Home »
Tag: Programming languages Tag: Programming languagesParents:
Children:
- C#,
- C++,
- C#,
- COBOL,
- Erlang,
- Forth,
- Haskell,
- Java,
- Javascript,
- K,
- Lisp,
- Lua,
- Matlab,
- OCaml,
- Perl,
- PHP,
- Python,
- REBOL,
- Rexx,
- Scheme,
- Smalltalk
-
John Resig - Processing.js (via):
I've ported the Processing visualization language to JavaScript, using the Canvas element.
Impressive, to say the least.
¶ (0)
Tags: [Javascript]
-
Generator Tricks for Systems Programmers (via). Presentation on Python's generators.
¶ (0)
Tags: [Python]
-
JavaScript: The Good Parts, by Douglas Crockford (via).
¶ (0)
Tags: [Books, Javascript]
-
Reading binary files using Ajax « nagoon97’s Weblog (via).
¶ (0)
Tags: [Ajax]
-
Javascript getElementsByClass function. I know there's one built into prototype, but I didn't want to include the whole library since I wasn't already using it. This seems to work.
¶
Tags: [Javascript]
-
JSLint, The JavaScript Verifier (via).
¶ (0)
Tags: [Javascript]
-
JavaScript Kit- DOM Table Object Methods.
¶ (0)
Tags: [Javascript, Web Development]
C# is ugly as heck:
private static string JoinNvcToQs(System.Collections.Specialized.NameValueCollection qs){
return string.Join("&", Array.ConvertAll<string, string>(qs.AllKeys, delegate(string key){
return string.Format("{0}={1}", HttpUtility.UrlEncode(key), HttpUtility.UrlEncode(qs[key]));
}));
}
In Ruby, this would be (essentially):
e = URI.escape
qs.collect{ |k,v| e(k)+"="+e(v) }.join("&")
-
Faster JavaScript Trim.
¶ (0)
Tags: [Javascript]
-
ASP.NET AJAX Control Toolkit.
¶
Tags: [ASP.NET, Javascript]
-
AppJet: Instant Web Programming (via).
¶ (0)
Tags: [Javascript, Web Development]
-
Jash: JavaScript Shell (via, via).
¶ (0)
Tags: [Javascript]
-
7 reasons I switched back to PHP after 2 years on Rails - O'Reilly Ruby (via). The main reason I'd hope to switch to Rails is not for Rails itself, but to be able to use Ruby. If only PHP used Ruby 
¶ (0)
Tags: [PHP, Ruby, Ruby on Rails]
-
Minimal FORTH compiler and tutorial | Lambda the Ultimate.
¶ (0)
Tags: [Forth]
-
ONLamp.com -- An Introduction to Erlang (via). To read.
¶ (0)
Tags: [Erlang]
Re: translate Perl diamond operator to Ruby.
Perl:
while(<>){
...
}
Ruby:
ARGF.each do |$_|
...
end
At this point I question whether I'd ever use Perl for anything again. Until now, Perl filled a niche where if the code I wanted to write would fit in 10 lines or so, and did a lot of string manipulation, I'd turn to Perl. Otherwise Python. Now I think I'll just use Ruby for everything 
-
RussellBeattie.com - Java needs an overhaul (via):
There's something about the Java culture which just seems to encourage obtuse solutions over simplicity.
I was bemused when Sun changed their ticker to JAVA the other day; it's a name they won't want to be associated with in a few years. Kinda surprised they want to be associated with it now tbh... this isn't 1999.
¶ (0)
Tags: [Java]
-
Simon Willison: jQuery for JavaScript programmers. Maybe I'll use jQuery instead of Prototype for future development.
¶ (0)
Tags: [Javascript, Web Development]
-
Emprise JavaScript Charts :: 100% Pure JavaScript Charts.
¶
Tags: [Javascript]
-
SproutCore (via):
Sprout Core is a application framework written in Java Script. It’s designed for creating full applications that run inside the web browser.
MIT license.
¶ (0)
Tags: [Javascript]
-
Kathy Kam : .NET Format String 101.
¶ (0)
Tags: [C#]
Some more handy Javascript (depends on Prototype):
function toggleByClass(id, className, callback){
// shows the element with id 'id'
// and hides all other elements with class 'className'
$A($$('.'+className)).each(function(element){
$(element).style.display = "none";
})
if(id) // call it with a false id to hide all
$(id).style.display = "block";
if(callback)
callback(id, className);
}
function toggleById(id1, id2){
var a = $(id1).style;
var b = $(id2).style;
if(a.display == 'none' || a.display == ''){
a.display = 'block';
b.display = 'none';
}else{
a.display = 'none';
b.display = 'block';
}
}
List<Type> temp = list.ConvertAll<Type>(delegate(Type a){return a;});
You'd think a generic type like List would have a useful clone or copy method, but noo. (Type is just a placeholder... insert your type here)
-
Matt Raible relays comments from Don Box:
Richard Monson-Haefel asks "Is there a place for AOP in .NET or is it too sophisticated for your developers." Don's take is "My development platform should allow me to write code w/ a couple of beers in me." He ragged a bit on Java developers and said their main problem is they think they're smarter than they are. He also said that if he could change on thing at MSFT, it would be that Ruby becomes the language of choice.
¶ (0)
Tags: [Java, Microsoft, Ruby]
I always wind up needing functions to dynamically populate the options on a <select> list, or select a given item in an existing <select>. So I've finally written them out in a reusable form:
<select id="foo" onchange="alert(this.value)"/>
<script language="javascript" type="text/javascript">
function loadSelectOptions(selectId, keys, values, selectedOption){
var list = document.getElementById(selectId)
if(!list)
return;
var selectedIndex = 0;
list.length = 0;
var found = false;
for(var i=0,n=keys.length; i<n; i++){
list.options[i] = new Option(values[i], keys[i]);
if(selectedOption == keys[i]){
list.selectedIndex = i;
found = true;
}
}
return found;
}
function selectSelectOption(selectId, value, runEvent){
var list = document.getElementById(selectId)
if(!list)
return;
var options = list.options;
for(var i=0,n=options.length; i<n; i++){
if(options[i].value == value){
list.selectedIndex = i;
if(runEvent)
list.onchange();
return true;
}
}
return false;
}
loadSelectOptions("foo",['foo','bar','baz'], ['FOO','BAR','BAZ'],'baz')
var list = document.getElementById("foo")
list.remove(1)
selectSelectOption("foo","baz")
</script>
-
Because I'm sure it'll come in handy later, here's a javascript object clone function:
function clone(obj){
if(obj == null || typeof(obj) != 'object')
return obj;
var temp = {};
for(var key in obj)
temp[key] = clone(obj[key]);
return temp;
}
Update: From feedback in the comments, a better version is:
function clone(obj){
if(obj == null || typeof(obj) != 'object')
return obj;
var temp = new obj.constructor(); // changed (twice)
for(var key in obj)
temp[key] = clone(obj[key]);
return temp;
}
¶
Tags: [Code, Javascript]
For some reason C#, by default, formats negative currency as "($12,345,678.90)" instead of "-$12,345...". Here's code that lets you change that (wordwrapped for her pleasure):
// set currency format
string curCulture =
System.Threading.Thread.CurrentThread.CurrentCulture.ToString();
System.Globalization.NumberFormatInfo currencyFormat =
new System.Globalization.CultureInfo(curCulture).NumberFormat;
currencyFormat.CurrencyNegativePattern = 1;
number.ToString("c", currencyFormat);
// or string.Format(currencyFormat, "{0:c}", number);
C# is retarded.
-
Labnotes » Buildr, or when Ruby is faster than Java:
Somewhere in my ever expanding list of drafts I’ll never get to finish is another post about the economics of Ruby, and how raw performance is less of a problem when you’re bound by the database, spend less on development, and can optimize in the large. Basically, regurgitating the same justifications I used to explain Java a decade ago.
But this is not that post.
Today, I’m going to talk about something else, and share with you an interesting discovery from working on Buildr. There will be no language theologies or abstractions of performance, just the facts.
Off the bat, we downsized 5,443 lines of XML abuse spread over 52 files, into a single build script weighting a measly 485 lines. It’s amazing what a real language, with proper variables and (gasp!) functions and objects, can do.
Of course, we’re not measuring raw Ruby against pure Java. We’re comparing one implementation against another, where they both do the same thing. Black box equivalent. That’s a real life benchmark.
We know the Ruby-based solution performs significantly faster, is much more reliable, requires less work to use and maintain, and took all of 3 months from concept to working release.
Ruby might be slow, but what you build with it can be devilish fast.
¶ (0)
Tags: [Java, Ruby]
-
Destroydrop » Javascripts » Tree. dTree has worked great for me so far.
¶
Tags: [Javascript, Web Development]
C# Frequently Asked Questions : Why can't I use the same variable as an inner loop does?. Language designers, please don't try to protect me from something like this. It's annoying.
But for fun, check out the possibly contradictory compile errors in code like:
public static void Main(string[] args){
for(int y=0; y<100; y++){}
Console.Write(y);
int y = 0;
}
y doesn't exist but yet can't be created.
|
Generated in about 0.216s. (Used 12 db queries) |
"IMDB for music"
IMDB for Music? It looks to be acouple of years old...http://MusicTell.co...
Ken Empie: May 14, 9:57pm