...implies that which actually does something as opposed to that which has placeholder methods for something that inheirts it to override. Concrete means "not interface" per a coworker. A class which does not contain any undefined method is a concrete class.
Friday, February 28, 2014
TimTowTdi
I ran into this Perl term for "there is more than one way to do it" just now when Googling for a less awful way to say: There is more than one way to skin a cat.
Thursday, February 27, 2014
for swizzle
grab the value of a parameter off of an HTML element in plain Jane JavaScript
if (element.getAttribute("data-dojo-attach-point").indexOf("whatever") != -1) {
Wednesday, February 26, 2014
Add a new closing form tag and then open a new form tag to make an ASP.NET web form post to someplace other than itself.
my old notes on integrating with a merchant account
This is a blast from the past. I think this goes back to 2007. I haven't done this sort of thing in a long, long time. I never hear anything about anyone rolling their own shopping cart anymore for a simple web presence. It seems like most people will use a canned package these days.
subselect in SQL
SELECT * FROM Whatever WHERE myKey IN (SELECT myKeyReference FROM SomethingElse WHERE YetAnotherThing = 42)
Filtering arrays in JavaScript without Underscore.js!
What keeps the Firefox burning?
How can Firefox compete as a browser when it does not have a huge company behind it like IE (Mircosoft) or Chrome (Google)? How has it kept apace for years? A coworker explained that Mozilla is a non-profit which is kept alive by donations. Google gives heavily as Firefox defaults to google.com for its home page. There may eventually be ads in Firefox too. I pulled away from it myself in 2013 when I realized I could do everything I used to do in Firebug (and more) in Google Chrome's Developer Tools. JavaScript, developed by Brendan Eich at Sun Microsystems is being formally versioned and kept by Mozilla. The JavaScript that exists outside of Firefox and Mozilla in other browsers is technically just ECMAScript, a scripting language standard (Ecma International's ECMA-262 spec), of which what Mozilla calls its version is JavaScript and of which what Microsoft calls its version is JScript. (You've seen that silliness in Visual Studio, correct?) Adobe's ActionScript for Flash is of this specification too.
Is this burning an eternal flame?
text-overflow: ellipsis;
...as a CSS style will put three dots (...) at the end of truncated text. See: this
display: inline-block;
...is awesome. If you decorate a series of divs WITH FIXED WIDTHS with this CSS style too they will end up sitting side by side on a horizontal row as if they all had...
float: left;
...on them, but they are not floating. They push other content down.
gradients in CSS
This markup:
<div style="
width: 100px;
height: 100px;
background-image: -webkit-gradient(linear, 0% 0, 0% 100%, from(#decaff),
color-stop(0.33, #decaff), to(#c0ffee));
background-image: linear-gradient(to bottom, #decaff 0%, #decaff 33%,
#c0ffee 100%);">
</div>
Makes this:
Links that helped me with this:
Tuesday, February 25, 2014
Wipe Out Workspace
...is an option in Jenkins beneath the Workspace option at the upper left. This gets rid of some sort of cache and thus may unburden you of some nastiness. I don't really understand it yet but this has some more details on this clean up trick.
Monday, February 24, 2014
C:\Fluffy Nothing\src\FluffyNothing.UserInterface\home\index
...is an example of what an ASP.NET MVC route at /home/index/ looks like when it it summoned from C# with:
System.IO.Path.GetFileName(Request.ServerVariables["SCRIPT_NAME"])
With 'dojo/dom-class' one may "remove" a class decorating an element without any sanity checking to ensure the class actually decorates the element.
If the class is not there, the call to remove will throw no errors. This minimizes if/then logic obviously. In the example below domClass is a variable mapped to 'dojo/dom-class' at the AMD signature and countLineList is a data-dojo-attach-point designation in a dojox view.
var fourColumns = "cascading-effect-for-four-columns";
var fiveColumns = "cascading-effect-for-five-columns";
var fourColumnsOrFive = fourColumns;
if (this.mdoElt.ahType != i18n.typeUnplanned) {
if (app.appSettings.AHS_ShowSystemQtyInCount) {
fourColumnsOrFive = fiveColumns;
}
}
domClass.remove(this.countLineList, fourColumns);
domClass.remove(this.countLineList, fiveColumns);
domClass.add(this.countLineList, fourColumnsOrFive);
Add current location to Favorites
can't find grunt.cmd even though Grunt is installed?
Try running this command line command: path=%PATH%;%APPDATA%\npm
This command will let you know if you're successful: where grunt
Friday, February 21, 2014
There is no if/then logic in dojox templates.
All you can really do is cough something up from a variable like this:
<div>${Whatever.Foo}</div>
All manipulations need to come from the controller side. If you want to conditionally hide something you could latch onto an attach point and conditionally swap out a CSS style.
Uncheck the checkbox for: "Straight quotes" with "smart quotes" ...under the "Replace as you type" heading in Microsoft Word 2013 to get rid of slanted quotes.
Dart!
Lars Bak who developed the V8 JavaScript engine for Chrome and has done extensive work in the name of optimizing performance for virtual machines, lead in a talk by a John Talley on Lars' new scripting language, Dart, in a prerecorded video displayed on a wall at Spanning Thursday night. He said that one could learn Dart in just one hour and supposedly there is a tutorial online as a part of something called Dart Flight School which shows you how to do just that, but the one hour timebox became clearly comedic once John started showing off code from an entirely new scripting language and descended into how out to override operators. The examples given during a fire hose or syntax-heavy geek out were really too much for me to memorize and I just sort of took it in numbly. To me Dart looks just as complicated a C#. Dart is Google's C#, by which I mean it is to be its premiere scripting language that it pushes, and I'd take it seriously as I'd take Google seriously if I were you. Some things about Dart are that it has been in version 1.0 since November, it is dynamic, and compiles to JavaScript. dart2js is the name of the compiler. There was much talk of Dart one day just running uncompiled, as is, in Chrome (and then, hopefully, other browsers) but presently the only way you may run it uncompiled is through Dartium (built in Chromium which is the open source project from which Google crafts its Chrome browser and also the Canary browser which is like the latest version of Chrome that is not yet well tested) which is the preview browser of sorts within the Dart IDE which is called "The Dart Editor" which is in fact a doctored up Eclipse. Just as you might preview an ASP.NET MVC project in Cassini, you might preview a Dart project in Dartium. Dart is for both the front end and the back end. You may use it with AngularJS or Polymer (a comparable framework to AngularJS) in much the same way you might use C# with Razor in an MVC app, and you may also use Dart to touch a database or write to flat files thus allowing you to work front-to-back in JavaScriptland without having to use Node.js for the backend stuff! You'd use the familiar moustache notation of AngularJS in your HTML. Dart itself has interfaces, and mixins, and garbage, collection, and lots of other things you can't hope to understand in an hour's time. Every Dart app gets a pubspec.yaml file for package management, which allows Dart to know what it needs to bake in when it compiles. Unused code is dropped from the compiled code. It is shaken out in "tree shaking." Dart supports the asynchronous qualities of JavaScript but not truthiness vagueness. Let's see, what else do I want to say? I think it jives with Firebase which is an API for storing JSON objects "in the cloud." Hmmm... A Mr. Charles d'Harcourt spoke after John and showed off a simple app that he made.
add a property to a JavaScript object based on dynamic content
var foo = {};
var bar = "baz";
foo[bar] = "qux";
If one calls foo.baz after the lines of code above, "qux" will be returned. The "baz" magic string may not be "dynamic" really, but you get the idea, right?
a return inside a forEach loop in JavaScript seems to sabotage the forEach loop
call: function(app, key) {
if(app._appSettings === undefined) {
return null;
} else {
app._appSettings.forEach(function(setting) {
if (setting.ahCode == key) {
if (setting.ahValue) {
return setting.ahValue;
} else {
return setting.ahBooleanValue;
}
}
});
}
}
What is above ALWAYS returned null no matter the circumstance because a return inside a forEach loop in JavaScript seems to sabotage the forEach loop. I had to change it to:
call: function(app, key) {
if(app._appSettings === undefined) {
return null;
} else {
var returnMe = "null";
app._appSettings.forEach(function(setting) {
if (setting.ahCode == key) {
if (setting.ahValue) {
returnMe = setting.ahValue;
} else {
if (setting.ahBooleanValue == null) {
//return null
} else {
if (setting.ahBooleanValue) {
returnMe = "true";
} else {
returnMe = "false";
}
}
}
}
});
if (returnMe == "null") {
return null;
}
if (returnMe == "true") {
return true;
}
if (returnMe == "false") {
return false;
}
return returnMe;
}
}
Thursday, February 20, 2014
Cryptography Basics
I saw Bankim Tejani of ServiceMesh speak on cryptography at a Wednesday meeting of IEEE (Institute of Electrical and Electronics Engineers). The talk gave a great 10,000 foot view of cryptography in general. Did you know?
- A cipher is that which takes readable text and turns it into ciphertext which is either encoded or encrypted. Encoded text may be cast back to readable text by reversing the cipher so to speak. Caesarian-8 is an example of a cipher in which every letter is replaced by the letter 8 places forward again in the alphabet also that "Cat" becomes "Kib" as the T wraps around past the Z two positions back to the B. You can probably see how one decodes Kib back to Cat, but Kib only makes sense if you know what the cipher is!
- A hash is a cipher process in which text is encrypted not encoded. You cannot cast the encrypted back to readable text. Hashes are used for keeping passwords. To see if a password matches a hashed password, you do not unhash the hashed, but instead you hash the unhashed and see if it matches the otherwise unreadable string you keep for a password.
- A salt is an additional piece of data that goes into a function for creating a hash to make the algorithm harder for an outsider to decode. Every user account which has a salt for a password should get an independent random salt. The salt doesn't help (much) if it doesn't vary. A code-side object for a user could thus be improved from this:
User record {
userid
pwhash
attributes
}
...by adding a field for a salt as seen below. A salt is an example of entropy which could be defined as something which randomizes a cipher. If one is not ciphering one letter at a time, but instead chunks of 512 bytes, one could write a cipher that takes the first chunk "regularly" and then adds entropy to each chunk in the subsequent stream based upon the prior chunk. But, not to digress...
User record {
userid
pwhash
salt
attributes
}
...but while we are on this subject, note that this is even better yet!
User record {
userid
pwhash
salt
algorithm
attributes
}
Why not keep in a field a note of what algorithm was used the last time the password was reset? This allows for a maintainable system wherein the algorithm used may be swapped out with another one day. Why would you want to upgrade the algorithm used? Because every algorithm will eventually become antiquated. MD5 and SHA1 are types of algorithms for hashing which are no longer considered safe by way of just not being complicated enough. Modern day hackers can break these. Every possible value for a six to twelve alphanumeric string (for example) may be put in a list and used to eventually match a password in an "endless" (not really infinite) series of tries for each item on the list. There is too much complexity in SHA512 today to use this trick to break SHA512 which is encouraged as of this writing, but that won't last forever. Also, breaking the passwords out to their own collection offers a way to keep a history of passwords and force users to not reuse the last few passwords they used.
User record {
userid
attributes
}
Passwords {
userid
pwhash
salt
algorithm
status (active or expired)
lastUsedTime
}
The Zimmerman Telegraph is an example of a cipher fail. During World War I, Germany sent it to Mexico in an attempt to bait Mexico into attacking America. America intercepted the communication and was able to break the code inside. America would end up fighting Germany and not Mexico as things turned out. PGP (Pretty Good Privacy) uses public and private keys to send messages between parties. Any one individual has a both a public (advertised) and a private (secret) key. If Mr. Smith wants to send an encoded message to Mr. Jones then he would use Jones' public key and his own private key in the algorithm. Jones would use Smith's public key and his own public key to decode the message. This is not a typo on my part. Jones never gets handed the private key of Smith. So how could Jones possibly decode Smith's message? I asked about this at the talk and was told that it's just "magic." Somewhere deep inside the mathematics of PGP lives a trick for this. How to manage keys that need to be shared is the great unsolved problem of cryptography. Bankim mentioned that the key for decoding Blu-ray was accidentally published on Intel's web site. Beyond big mistakes like this, one has to assume that such a key would eventually slip out into the public domain anyways. As long as the key for decoding needs to be shared between multiple parties, the key will eventually leak out. Other things I should mention include:
- Homomorphic is a concept in which both a blob of text and blob of corresponding ciphertext may be queried for key pieces of information with the SAME means. This is something cryptographers are trying to figure out presently.
- AES stands for Advanced Encryption Standard and it is... a standard.
- Many in cryptography are paranoid the American government has placed "backdoors" in ciphers in the name of spying on companies and individuals.
- Slow algorithms rerun an algorithm over and over again to cipher. To break one of these you'd have to know the increment of reruns.
- Export Control Classification Number (ECCN) is a code for categorizing American exports.
- American laws are lax in the cryptography space. Anyone may use any encryption or no encryption unless they are: giving to parties in another nation, keeping financial data, doing a few key industry-specific things (there are regulations governing Healthcare for example)
- Woodrow Wilson didn't like the Zimmerman Telegraph.
Wednesday, February 19, 2014
Glyphicons!
glyphicons.com is a neat resource for using icons in the form of a font in lieu of images. Using the cheatsheet at the base of this blog posting to find an encoding for a bomb, one may make a class that will put a bomb icon before copy like so:
.bomb:before {
font: 24px/1em 'Glyphicons Regular';
-webkit-font-smoothing: antialiased;
line-height: 29px;
vertical-align: middle;
content: "\1F4A3";
}
In Team Explorer, right-click on your "DefaultCollection" (or whatever the directory is named) and select "New Team Project..." to make a new project in TFS.
This touches on some Team Foundation Server basics including how to make a new repository outright which is new to me.
If it takes forever to copy files from one folder to another in Windowsland...
Add a question mark followed by a string of random characters to the end of a URL in Google Chrome to force it to refresh the HTML it gets for a site it has cached.
This trick for disabling the cache in Google Chrome Developer Tools will not reach into files that do not show up under the "Sources" tab (in Google Chrome Developer Tools) which may include HTML files in views which are slurped into a Dojox application which are specified in config.json.
Tuesday, February 18, 2014
a better way to destroy a cookie
HttpCookie cookie = Request.Cookies[MagicStrings.IdentityName];
if (cookie != null)
{
cookie.Value = "";
cookie.Expires = clock.GiveTime().AddDays(-1);
Response.Cookies.Add(cookie);
}
What is above should really replace what is below in this. What is below isn't so wonderful.
HttpCookie cookie = new HttpCookie(MagicStrings.IdentityName, "");
cookie.Expires = clock.GiveTime();
Response.Cookies.Add(cookie);
make a text type input in HTML read only by decorating it with "readonly"
<input type="text" name="whatever" readonly />
Make a number type input field accommodate decimals.
<input type="number" name="whatever" step="0.01" />
...is a "paraphrased" example given here which shows off the step parameter which is the key to the trick.
Monday, February 17, 2014
cookies and session variables in modern ASP.NET MVC
Here is how to set cookies and session variables in modern ASP.NET MVC. This is a method from a controller:
private void SetIdentity(string id)
{
IClock clock = ObjectFactory.GetInstance<IClock>();
string carat = "^";
if (id != null && id.Contains(carat))
{
string[] instructionAndIdentity = id.Replace("^^", ".").Replace("||",
"+").Split(carat.ToCharArray());
string pipeSymbol = "|";
if (instructionAndIdentity[1].Contains(pipeSymbol))
{
if (instructionAndIdentity[0] == MagicStrings.MakeCookieOnMatch)
{
HttpCookie cookie = new HttpCookie(MagicStrings.IdentityName,
instructionAndIdentity[1]);
cookie.Expires = clock.GiveTime().AddDays(30);
Response.Cookies.Add(cookie);
} else {
HttpCookie cookie = new HttpCookie(MagicStrings.IdentityName, "");
cookie.Expires = clock.GiveTime();
Response.Cookies.Add(cookie);
}
HttpContext.Session[MagicStrings.IdentityName] = instructionAndIdentity[1];
}
}
}
There is plenty of noise here, but I think you can see what you need beyond what I wrote for myself for a project I am tinkering with. Note how a cookie is destroyed by being set to nothing. You may comparably kill a session variable by setting it to null or an empty string. Here is how to fish for the settings once they are set. Again, forgive the noise. Again, this is a method in a controller.
protected Person GetIdentity()
{
IPersonRepository personRepository =
ObjectFactory.GetInstance<IPersonRepository>();
HttpCookie cookie = Request.Cookies[MagicStrings.IdentityName];
if (cookie != null)
{
string emailAndPassword = cookie.Value;
if (emailAndPassword.Contains("|"))
{
return PersonFinder.FindPersonByEncryptedPassword(emailAndPassword,
personRepository);
}
}
if (HttpContext.Session[MagicStrings.IdentityName] != null)
{
string emailAndPassword = HttpContext.Session[MagicStrings.IdentityName] as
string;
if (emailAndPassword != null && emailAndPassword.Contains("|"))
{
return PersonFinder.FindPersonByEncryptedPassword(emailAndPassword,
personRepository);
}
}
return null;
}
Addendum 2/18/2014: The way I am destroying cookies above is bad as it turns out. Please see this instead.
Trim away trailing whitespace in Sublime Text 3.
JSHint is behaving differently for our team between Sumblime Text 2 and Sublime Text 3 (in spite of identical settings) on our team. Trailing whitespace in .js files is not highlighted in the later version for some reason. There is some good news however in that this explains how you may make Sublime Text 3 always trim away the trailing whitespace from a file upon a saving, and that addresses our problem in a roundabout way. A trim_trailing_white_space_on_save setting needs to end up in the file one exposes by picking the "Settings - User" option under the "Preferences" menu. My own settings file looks like so:
{
"color_scheme": "Packages/User/Monokai (SL).tmTheme",
"font_size": 11,
"ignored_packages":
[
"Vintage",
"SublimeLinter-jshint"
],
"trim_trailing_white_space_on_save": true
}
While I am running my mouth, Trailing Spaces is a plugin for Sublime that I tried to install today to solve the same problem. This and this touch on installing plugins and this is a place to find plugins online which may be installed at the console while there is also a way to manually install a plugin and this is where you'd get the particular file to put at what is on my computer at:
C:\Users\tjaeschke\AppData\Roaming\Sublime Text 3\Installed Packages
...to install Trailing Spaces. And installed plugins will, I think, end up at what is on my laptop at:
C:\Users\tjaeschke\AppData\Roaming\Sublime Text 3\Packages
...which is a folder exposed by going to "Browse Packages..." under the "Preferences" menu. Going to "Show Console" under the "View" menu will alternatively expose the console. I tried an install at the console and a manual install and I couldn't get it to work however. Whatever.
Saturday, February 15, 2014
generate a random password
Challenge: You want to make a random password for a password reset feature in C#. You can make a new Guid and just strip out the hyphens, but you've noticed that you cannot just build a string by returning (several times over) a character based upon a random number. The random numbers in C# are based on the ticks and if you call something that generates a random number ten times in a row back to back you will get the same random number ten times over. Another approach:
- Make a Random number using a big range of possible values such as one billion.
- Cast the number to a string.
- Encrypt the string.
Friday, February 14, 2014
Ctrl-Shift-F in Sublime Text 3 seems to unlock the Find and Replace feature.
Redgate .NET Demon
...will constantly recompile your work in the background as you use Visual Studio (2010 or better). The .NET Demon will expose compilation errors in realtime and let you thus know if there is drama in associations between solutions and projects.
debug minimized .js?
Click on the {} at the lowerleft of the debugger in Google Chrome Developer Tools to turn on "Pretty print" which should allow you to set breakpoints in "lines" of code which have been snugged up into one big line of code together. (think minimized .js)
Automatically generated documentation for C#?
GhostDoc makes documentation for C# methods. It will try to parse a method's name and make sense of it in the name of crafting a descriptive sentence. It is a Visual Studio plugin.
Thursday, February 13, 2014
I learned today that one may quickly preview a selected web site or virtual folder in Internet Information Services (IIS) Manager.
Web.config hacks around ASP.NET Forms Authentication pain points!
This and this touch on how to open up permissions in a folder full of stylesheets and/or images (or even .js files) so that a user may see the images and the effects of the stylesheets without being logged in. The trick is to put a Web.config file inside of the folder full of content you wish to expose to everyone in all circumstances which has this in it:
<configuration>
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</configuration>
This tells us the following is required just to get an application with forms authentication to run in IIS.
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
Press the right or left arrow key in tandem with the Windows key in Windows 8 to make a window snap to and fill one half of the screen.
Create a local branch in TortoiseHg
You may have noticed the "Phase" column in TortoiseHg. A value of "draft" suggests a local commit while a value of "public" suggests a commit that exists in greater source control beyond mere local scope.
If you right-click on the "draft" designation for a detached head (and pick "Change Phase to" from the menu which appears) and set it to "secret" instead...
...you will create a local branch.
Don't update to the detached head or pull down from source control into it. If you do not, the detached head will otherwise be ignored and TortoiseHg will not complain when you try to make future commits with the detached head in existence. Turn "secret" back into "draft" to merge the local branch back in later.
Tuesday, February 11, 2014
Sass!
C:\Program Files (x86)\Cisco Systems\VPN Client\Profiles\ ...is where your .pcf lives.
an example of authenticating when sending email from C# via System.Net.Mail
public void Send(string to, string message)
{
MailMessage alert = new MailMessage("something@example.com", to);
alert.Subject = "Communication!";
alert.Body = message;
NetworkCredential credentials = new NetworkCredential("something@example.com",
"letmein");
SmtpClient emailSender = new SmtpClient();
emailSender.Host = "smtp.example.com";
emailSender.UseDefaultCredentials = false;
emailSender.Credentials = credentials;
emailSender.Send(alert);
}
Monday, February 10, 2014
When JavaScript integers are put into string fields at Web SQL databases they seem to end up with a one place decimal precision.
Using dojo/on to react to a change in a dropdown list in dojo.
A coworker suggested that a better, modern (dojo 1.9.2) way to do this is:
define([
"dojo/dom",
"dojo/on"
], function (dom, on) {
return {
init: function(current, data) {
var self = this;
dojo.addOnLoad( function() {
on(dom.byId('locale'), "change", function(evt) {
alert(self.locale.value);
dojo.stopEvent(evt);
});
});
},
Sunday, February 9, 2014
Mutex
CSS trick to make text align to the bottom of a div!
#mydiv {
width: 200px;
height: 300px;
display: table-cell;
vertical-align: bottom;
}
Saturday, February 8, 2014
how the sun looked to the original iPhone
A tweet of mine from Friday, October 16, 2009:
- When I photo the sun with my iPhone there is ALWAYS a little white dot to one side of it http://yfrog.com/0b1jpwj
I am just as hypnotized and entranced with this as Bjarne Stroustrup is with his projector.
Ha. And, we think we are tech people. Yet, we are so easily distracted. I'd better avoid this Kool-Aid:
Friday, February 7, 2014
React to a change in a dropdown list in dojox!
init: function(current, data) {
var self = this;
dojo.addOnLoad( function() {
dojo.connect(dom.byId('locale'), "onchange", function(evt) {
alert(self.locale.value);
dojo.stopEvent(evt);
});
});
},
In order for the above to work in a dojox controller...
- One must have dojo/dom in the define signature of the AMD module.
- One must have "locale" as the value for both the id and the data-dojo-attach-point settings on a select tag like so:
<select data-dojo-attach-point="locale" id="locale">
Thursday, February 6, 2014
list-style: none;
putting quotes inside of quotes inside of quotes in HTML
Wednesday, February 5, 2014
a modern HTML head tag for a mobile app
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=480,initial-scale=1,maximum-
scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>AntMill</title>
</head>
Fatal error: Unable to find local grunt.
This grunt error when unexpected and run from a command line at a folder where it should work...
...means you need to run this command again to reinstall:
npm install
Tuesday, February 4, 2014
'onClick' of object [object Object] is not a function
Getting this error when using dojox.mobile.ListItem likely means you need to change something like this:
<li data-dojo-type="dojox.mobile.ListItem"
data-dojo-props="clickable:true, onClick:this.app.openView(null,{target:'Something'})"
>Whatever</li>
...to something like this:
<li data-dojo-type="dojox.mobile.ListItem"
data-dojo-props="clickable:true, app: this.app, onClick:function()
{this.app.openView(null,{target:'Something'})}"
>Whatever</li>
top level domains
http://data.iana.org/TLD/tlds-alpha-by-domain.txt today has the following list of top level domains which is always growing:
- AC
- ACADEMY
- AD
- AE
- AERO
- AF
- AG
- AGENCY
- AI
- AL
- AM
- AN
- AO
- AQ
- AR
- ARPA
- AS
- ASIA
- AT
- AU
- AW
- AX
- AZ
- BA
- BARGAINS
- BB
- BD
- BE
- BERLIN
- BF
- BG
- BH
- BI
- BIKE
- BIZ
- BJ
- BM
- BN
- BO
- BOUTIQUE
- BR
- BS
- BT
- BUILD
- BUILDERS
- BUZZ
- BV
- BW
- BY
- BZ
- CA
- CAB
- CAMERA
- CAMP
- CAREERS
- CAT
- CC
- CD
- CENTER
- CEO
- CF
- CG
- CH
- CHEAP
- CI
- CK
- CL
- CLOTHING
- CLUB
- CM
- CN
- CO
- CODES
- COFFEE
- COM
- COMMUNITY
- COMPANY
- COMPUTER
- CONSTRUCTION
- CONTRACTORS
- COOL
- COOP
- CR
- CU
- CV
- CW
- CX
- CY
- CZ
- DANCE
- DATING
- DE
- DEMOCRAT
- DIAMONDS
- DIRECTORY
- DJ
- DK
- DM
- DO
- DOMAINS
- DZ
- EC
- EDU
- EDUCATION
- EE
- EG
- ENTERPRISES
- EQUIPMENT
- ER
- ES
- ESTATE
- ET
- EU
- EXPERT
- FARM
- FI
- FJ
- FK
- FLORIST
- FM
- FO
- FR
- GA
- GALLERY
- GB
- GD
- GE
- GF
- GG
- GH
- GI
- GIFT
- GL
- GLASS
- GM
- GN
- GOV
- GP
- GQ
- GR
- GRAPHICS
- GS
- GT
- GU
- GUITARS
- GURU
- GW
- GY
- HK
- HM
- HN
- HOLDINGS
- HOLIDAY
- HOUSE
- HR
- HT
- HU
- ID
- IE
- IL
- IM
- IMMOBILIEN
- IN
- INFO
- INSTITUTE
- INT
- INTERNATIONAL
- IO
- IQ
- IR
- IS
- IT
- JE
- JM
- JO
- JOBS
- JP
- KAUFEN
- KE
- KG
- KH
- KI
- KIM
- KITCHEN
- KIWI
- KM
- KN
- KP
- KR
- KW
- KY
- KZ
- LA
- LAND
- LB
- LC
- LI
- LIGHTING
- LIMO
- LINK
- LK
- LR
- LS
- LT
- LU
- LUXURY
- LV
- LY
- MA
- MANAGEMENT
- MARKETING
- MC
- MD
- ME
- MENU
- MG
- MH
- MIL
- MK
- ML
- MM
- MN
- MO
- MOBI
- MODA
- MONASH
- MP
- MQ
- MR
- MS
- MT
- MU
- MUSEUM
- MV
- MW
- MX
- MY
- MZ
- NA
- NAGOYA
- NAME
- NC
- NE
- NET
- NF
- NG
- NI
- NINJA
- NL
- NO
- NP
- NR
- NU
- NZ
- OM
- ONL
- ORG
- PA
- PE
- PF
- PG
- PH
- PHOTO
- PHOTOGRAPHY
- PHOTOS
- PICS
- PINK
- PK
- PL
- PLUMBING
- PM
- PN
- POST
- PR
- PRO
- PS
- PT
- PW
- PY
- QA
- RE
- RECIPES
- RED
- REPAIR
- RICH
- RO
- RS
- RU
- RUHR
- RW
- SA
- SB
- SC
- SD
- SE
- SEXY
- SG
- SH
- SHIKSHA
- SHOES
- SI
- SINGLES
- SJ
- SK
- SL
- SM
- SN
- SO
- SOCIAL
- SOLAR
- SOLUTIONS
- SR
- ST
- SU
- SUPPORT
- SV
- SX
- SY
- SYSTEMS
- SZ
- TATTOO
- TC
- TD
- TECHNOLOGY
- TEL
- TF
- TG
- TH
- TIENDA
- TIPS
- TJ
- TK
- TL
- TM
- TN
- TO
- TODAY
- TOKYO
- TOOLS
- TP
- TR
- TRAINING
- TRAVEL
- TT
- TV
- TW
- TZ
- UA
- UG
- UK
- UNO
- US
- UY
- UZ
- VA
- VC
- VE
- VENTURES
- VG
- VI
- VIAJES
- VN
- VOTING
- VOYAGE
- VU
- WANG
- WATCH
- WED
- WF
- WIEN
- WORKS
- WS
- XN--3BST00M
- XN--3DS443G
- XN--3E0B707E
- XN--45BRJ9C
- XN--55QW42G
- XN--55QX5D
- XN--6QQ986B3XL
- XN--80AO21A
- XN--80ASEHDB
- XN--80ASWG
- XN--90A3AC
- XN--CLCHC0EA0B2G2A9GCD
- XN--FIQ228C5HS
- XN--FIQ64B
- XN--FIQS8S
- XN--FIQZ9S
- XN--FPCRJ9C3D
- XN--FZC2C9E2C
- XN--GECRJ9C
- XN--H2BRJ9C
- XN--IO0A7I
- XN--J1AMH
- XN--J6W193G
- XN--KPRW13D
- XN--KPRY57D
- XN--L1ACC
- XN--LGBBAT1AD8J
- XN--MGB9AWBF
- XN--MGBA3A4F16A
- XN--MGBAAM7A8H
- XN--MGBAYH7GPA
- XN--MGBBH1A71E
- XN--MGBC0A9AZCG
- XN--MGBERP4A5D4AR
- XN--MGBX4CD0AB
- XN--NGBC5AZD
- XN--O3CW4H
- XN--OGBPF8FL
- XN--P1AI
- XN--PGBS0DH
- XN--Q9JYB4C
- XN--S9BRJ9C
- XN--UNUP4Y
- XN--WGBH1C
- XN--WGBL6A
- XN--XKC2AL3HYE2A
- XN--XKC2DL3A5EE0H
- XN--YFRO4I67O
- XN--YGBI2AMMX
- XN--ZFR164B
- XXX
- YE
- YT
- ZA
- ZM
- ZONE
- ZW
Monday, February 3, 2014
.attr('style'); will behave badly in Internet Explorer!
var bar = $("#Foo").attr('style');
if (bar == 'display:block;') {
Per this the above will not work in IE and I can attest that as much is true. The better jQuery to use is:
if ($("#Foo").css('display') == 'block') {
Sunday, February 2, 2014
I'm playing with Inkscape for the first time this morning.
- Ctrl-Shift-C seems to convert to text into what would be called "curves" (paths) in Adobe Illustrator.
- Cario doesn't support CMYK and as Cario is used by Inkscape for rending... there are no CMYK features. :(
- Ctrl-Shift-D followed by a navigation to the "Color Management" tab of the dialog box which appears takes one to a place for managing color swatches, but who cares? There are no Pantone colors.
Saturday, February 1, 2014
JavaScript "code behinds" in ASP.NET MVC applications.
At an ASP.NET MVC application, let's say you have a .cshtml view at /Views/Aardvark/AardvarkCountingWidget.cshtml. Let's also suppose that AardvarkCountingWidget.cshtml has a bunch of jQuery in it inside a script tag and you eventually wish to pull it out to a .js file. Well, I suppose that .js file could go at /Scripts/AardvarkCountingWidget.js, but what if it instead accompanied /Views/Aardvark/AardvarkCountingWidget.cshtml by living at /Views/Aardvark/AardvarkCountingWidget.js? In this convention a .cshtml file will have, if applicable, a .js "code behind" of the same name in the same folder. This is sort of like the code behinds of web forms... Mmmmm, maybe that's a stretch. Anyhow, this idea came from Joel Holder and it was going on at the AMD application I was a part of. That was an MVC3 project. /Views/Web.config prevents you from touching content inside of the Views folder in later versions of MVC save for using .cshtml views in the very different than usual way in Razor. So how do you allow access to .js files in the Views folder? Great question. I did it by removing everything between <httpHandlers> and </httpHandlers> and also between <handlers> and </handlers> at /Views/Web.config!