Language: perl, 288 lines. AppleScript, 20 lines [folder actions].Difficulty: mediumExperience Gained: substantial
neat stuff:
use sigtrap qw(die normal-signals die error-signals);$SIG{__DIE__} = sub { print "$0: $_\n" for @_; `$CD msgbox --text "$0 Died" --style warning --informative-text "$_" --button1 "Abort"` for @_;};
$SIG{__DIE__} = sub { print "$0: $_\n" for @_; `$CD msgbox --text "$0 Died" --style warning --informative-text "$_" --button1 "Abort"` for @_;};
So any unchecked signal has $CD (Cocoa Dialog) pop a dialog so I can see it even when it is running as a folder action. I have this also setup for pseudo signal __WARN__.
Here is a regexp for matching status lines of rsync to get progress info out of them for a progress bar:
if(m/\((\d+),\s+(\d{1,3}\.\d)%\sof\s(\d+)\)$/){print $fh "$2 ($2"."%) $1 of $3 files transferred\n";}
― absolutego (ex machina), Monday, 4 April 2005 05:16 (twenty years ago)
LEVEL UP
― Gravel Puzzleworth (Gregory Henry), Monday, 4 April 2005 05:42 (twenty years ago)
― latebloomer: strawman knockdowner (latebloomer), Monday, 4 April 2005 05:43 (twenty years ago)
― Alex in LA (deangulberry), Monday, 4 April 2005 06:15 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 06:51 (twenty years ago)
― Andrew (enneff), Monday, 4 April 2005 07:07 (twenty years ago)
― g-kit (g-kit), Monday, 4 April 2005 07:08 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 07:11 (twenty years ago)
― g-kit (g-kit), Monday, 4 April 2005 07:14 (twenty years ago)
― g-kit (g-kit), Monday, 4 April 2005 07:15 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 07:16 (twenty years ago)
― g-kit (g-kit), Monday, 4 April 2005 07:18 (twenty years ago)
― carson dial (carson dial), Monday, 4 April 2005 07:21 (twenty years ago)
Help me subvert their evil plans!
― Colonel Poo (Colonel Poo), Monday, 4 April 2005 08:15 (twenty years ago)
― dog latin (dog latin), Monday, 4 April 2005 08:50 (twenty years ago)
I will post up a link to my crazy zombie text adventure game when it's finished. yall excited?
― Ste (Fuzzy), Monday, 4 April 2005 08:52 (twenty years ago)
i think you can use regedit to find the filename of the wallpaper in the registry then write a reg script that changes that value.
(mine's "My Computer / HKEY_CURRENT_USER / Control Panel / Desktop / Wallpaper" but then i'm on win2k so...)
.reg files:http://support.microsoft.com/kb/310516/
― koogs (koogs), Monday, 4 April 2005 09:15 (twenty years ago)
― Colonel Poo (Colonel Poo), Monday, 4 April 2005 09:22 (twenty years ago)
using System;using System.Runtime.InteropServices;class MainClass{ [DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern int SystemParametersInfo (int uAction , int uParam , string lpvParam , int fuWinIni) ; public static void Main(string[] args) { SystemParametersInfo(20, 0, args[0], 0x1 | 0x2); }}
― willdabeast, Monday, 4 April 2005 09:40 (twenty years ago)
― Mr Noodles (Mr Noodles), Monday, 4 April 2005 10:38 (twenty years ago)
― caitlin (caitlin), Monday, 4 April 2005 10:39 (twenty years ago)
― Mr Noodles (Mr Noodles), Monday, 4 April 2005 11:20 (twenty years ago)
― Colonel Poo (Colonel Poo), Monday, 4 April 2005 11:21 (twenty years ago)
#!/usr/bin/perlprint $ARGV[0],"\n";$file=$ARGV[0];open(F,"<$file") or die "can't read";@lines=<F>;close(F);srand (time ^ $$ ^ scalar @lines);die "no more urls" if(scalar @lines==0);$line = int rand(scalar @lines);$lines[$line] =~ s/\#.*$//; # strip anchor linkschomp $lines[$line];print `open '$lines[$line]'`;print STDERR "only ",(scalar @lines)-1," lines to go!\n";print "$lines[$line]","\n";undef $lines[$line];open(F,">$file") or die "can't write";foreach (@lines){ print F $_;}close(F);
$line = int rand(scalar @lines);$lines[$line] =~ s/\#.*$//; # strip anchor linkschomp $lines[$line];print `open '$lines[$line]'`;print STDERR "only ",(scalar @lines)-1," lines to go!\n";print "$lines[$line]","\n";undef $lines[$line];open(F,">$file") or die "can't write";foreach (@lines){ print F $_;}close(F);
― absolutego (ex machina), Monday, 4 April 2005 21:31 (twenty years ago)
― o. nate (onate), Monday, 4 April 2005 21:37 (twenty years ago)
― Hari A$hur$t (Toaster), Monday, 4 April 2005 21:40 (twenty years ago)
― o. nate (onate), Monday, 4 April 2005 21:44 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 21:48 (twenty years ago)
― o. nate (onate), Monday, 4 April 2005 21:53 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 22:32 (twenty years ago)
― Mr Noodles (Mr Noodles), Monday, 4 April 2005 22:48 (twenty years ago)
― Alex in LA (deangulberry), Monday, 4 April 2005 22:50 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 22:50 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 22:52 (twenty years ago)
― shieldforyoureyes, Monday, 4 April 2005 22:54 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 22:58 (twenty years ago)
I am!
― Jordan (Jordan), Monday, 4 April 2005 23:02 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 23:04 (twenty years ago)
― ken c (ken c), Monday, 4 April 2005 23:06 (twenty years ago)
― absolutego (ex machina), Monday, 4 April 2005 23:08 (twenty years ago)
― stephen morris (stephen morris), Monday, 4 April 2005 23:17 (twenty years ago)
― stephen morris (stephen morris), Monday, 4 April 2005 23:18 (twenty years ago)
That still doesn't make up for being here until 7:30 at night. :(
― Jordan (Jordan), Monday, 4 April 2005 23:24 (twenty years ago)
So I can be reminded how fun it was for him to break Alan's work after a rash of phpBB attacks? The last thing I need is after a day of dealing with bankers and brokers is to have a student use published attacks to pick on a volunteer’s code. No one picked at G's holes right after he ported from Greenspun so I don't see why he has the right to try and take a run at Alan's work.
― Mr Noodles (Mr Noodles), Monday, 4 April 2005 23:34 (twenty years ago)
I'm not sure how phpBB relates to ILX.
The last thing I need is after a day of dealing with bankers and brokers is to have a student use published attacks to pick on a volunteer’s code.
What "published attacks"? Are you talking out of your ass? To construe any annoying crap I have pulled on ILX as an 'attack' is moronic.
No one picked at G's holes right after he ported from Greenspun so I don't see why he has the right to try and take a run at Alan's work.
Yes and now they're fixed. Time to get one perspective, grudge bearer.
― absolutego (ex machina), Monday, 4 April 2005 23:56 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 00:24 (twenty years ago)
― Remy (x Jeremy), Tuesday, 5 April 2005 00:29 (twenty years ago)
― Mr Noodles (Mr Noodles), Tuesday, 5 April 2005 02:28 (twenty years ago)
― Ian John50n (orion), Tuesday, 5 April 2005 02:34 (twenty years ago)
― Mr Noodles (Mr Noodles), Tuesday, 5 April 2005 02:44 (twenty years ago)
― Ian John50n (orion), Tuesday, 5 April 2005 02:46 (twenty years ago)
― Remy (x Jeremy), Tuesday, 5 April 2005 02:48 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 02:52 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 02:53 (twenty years ago)
long RonsNumber (0);
int main (){//print initial number cout
― ronny longjohns (ronny longjohns), Tuesday, 5 April 2005 03:14 (twenty years ago)
― ronny longjohns (ronny longjohns), Tuesday, 5 April 2005 03:15 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 03:36 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 03:37 (twenty years ago)
#!/bin/shRS="nice -n 5 rsync -plrz --bwlimit=50 --delete-after --delete-excluded --delete --exclude=core.* --exclude=*~ --exclude=core -e ssh"STORE="$HOME/Homes"CD="/Applications/CocoaDialog.app/Contents/MacOS/CocoaDialog"LOG="$STORE/log.txt"rv=`$CD yesno-msgbox --no-cancel --text "Do you want to use rsync to backup remote home directories?" --informative-text "You can hit no and have it ask you later."`if [ "$rv" == "1" ]; then echo yay > /dev/nullelif [ "$rv" == "2" ]; then rv=`$CD yesno-msgbox --no-cancel --text "Do you wish to be reminded in an hour?"` if [ "$rv" == "1" ]; then sleep 3600 # one hour exec $0 elif [ "$rv" == "2" ]; then exit fifimv $LOG $STORE/log.old 1> /dev/null 2> /dev/null$RS --exclude=hash/ --exclude=first_cut/ xm@cif.my.edu:~/ $STORE/cif/ 2> /dev/stdout >> $LOG$RS obtuse@cycle2.csug.my.edu:~/ $STORE/csug/ 2> /dev/stdout >> $LOG$RS obtuse@heart.cs.my.edu:~/ $STORE/cs/ 2> /dev/stdout >> $LOGscp -rp obtuse@troi.cc.my.edu~/* $STORE/troi/ 2> /dev/stdout >> $LOGf=`$CD ok-msgbox --no-cancel --text "Rsync Backup Complete" \ --informative-text "Any logs will be in $LOG" \ --no-newline`
rv=`$CD yesno-msgbox --no-cancel --text "Do you want to use rsync to backup remote home directories?" --informative-text "You can hit no and have it ask you later."`if [ "$rv" == "1" ]; then echo yay > /dev/nullelif [ "$rv" == "2" ]; then rv=`$CD yesno-msgbox --no-cancel --text "Do you wish to be reminded in an hour?"` if [ "$rv" == "1" ]; then sleep 3600 # one hour exec $0 elif [ "$rv" == "2" ]; then exit fifi
mv $LOG $STORE/log.old 1> /dev/null 2> /dev/null
$RS --exclude=hash/ --exclude=first_cut/ xm@cif.my.edu:~/ $STORE/cif/ 2> /dev/stdout >> $LOG$RS obtuse@cycle2.csug.my.edu:~/ $STORE/csug/ 2> /dev/stdout >> $LOG$RS obtuse@heart.cs.my.edu:~/ $STORE/cs/ 2> /dev/stdout >> $LOGscp -rp obtuse@troi.cc.my.edu~/* $STORE/troi/ 2> /dev/stdout >> $LOG
f=`$CD ok-msgbox --no-cancel --text "Rsync Backup Complete" \ --informative-text "Any logs will be in $LOG" \ --no-newline`
― absolutego (ex machina), Tuesday, 5 April 2005 03:39 (twenty years ago)
and make sure i have a valid network address.....
― absolutego (ex machina), Tuesday, 5 April 2005 03:44 (twenty years ago)
― Casuistry (Chris P), Tuesday, 5 April 2005 04:42 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 04:50 (twenty years ago)
http://www.kingfishphoto.com/gallery/Music-Photography
― kingfish van pickles (Kingfish), Tuesday, 5 April 2005 04:54 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 04:59 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 05:02 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 05:06 (twenty years ago)
― Gravel Puzzleworth (Gregory Henry), Tuesday, 5 April 2005 06:24 (twenty years ago)
Even C is a better language for a beginner! Or Python! Or Java! Anything but Perl!
Even PHP, although web app are dumb to learn with.
― absolutego (ex machina), Tuesday, 5 April 2005 06:28 (twenty years ago)
Digital Research Logo (the one that came free with CP/M 3) had about 100, probably a bit more. I still have a manual for it somewhere.
I tried to write a Logo interpreter in Java myself, but at the time I didn't really get the idea that Logo is supposed to be a kind of simplified Lisp, with data handling based around list processing.
(I hadn't come across Lisp at all at the time)
Perl has a similar problem to Basic if you use it as a first language: it's easy to learn, but it's very easy to learn crap. PHP is probably worse, though.
(JW, if you want to learn how to do trivial data structure stuff in perl, real the 'perldsc' (Perl Data Structures Cookbook) manual page)
― caitlin (caitlin), Tuesday, 5 April 2005 06:36 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 06:39 (twenty years ago)
― Johnney B (Johnney B), Tuesday, 5 April 2005 06:43 (twenty years ago)
%hash = ( # Each hash element is a reference to an anon. array cake => [0, 1, 2], biscuit => [5, 6, 7],);foreach (keys %hash) { # Look, I don't have to put -> between the {} and the [] even though # I'm dereferencing an array ref print $hash{$_}[0], "\n";}
foreach (keys %hash) { # Look, I don't have to put -> between the {} and the [] even though # I'm dereferencing an array ref print $hash{$_}[0], "\n";}
― caitlin (caitlin), Tuesday, 5 April 2005 06:44 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 06:57 (twenty years ago)
On the subject of "regexps can be like strings sometimes", I did once use the '/.../ interpolates like "..."' rule to do *nasty* things involving computed search and replace:
$str =~ s/([\d\.]+)/${$tmp = $1*2;\$tmp}/g;
Which, if I've got that right, should take a string and double anything in it that looks like a number. It almost certainly won't work under 'use strict'.
― caitlin (caitlin), Tuesday, 5 April 2005 07:05 (twenty years ago)
― RickyT (RickyT), Tuesday, 5 April 2005 07:15 (twenty years ago)
Its just annoying to have to go through multiple levels of escaping for regexps and to have to use *gasp* functions to get at them.
― absolutego (ex machina), Tuesday, 5 April 2005 07:17 (twenty years ago)
My favorite was the time they were matching on the persmission of an "ls" and didn't take into account the possibility of suid/setgid bits. Ughhhh....
― absolutego (ex machina), Tuesday, 5 April 2005 07:19 (twenty years ago)
Perl's syntax exceptions do get annoying at times; and having to remember which way ambiguous constructs go is a nuisance.
I do like the comment in the docs on how arrays, hashes and variables have separate namespaces, and how $a and $a[0] are completely unrelated: "don't worry if this looks weird, because it *is* weird".
― caitlin (caitlin), Tuesday, 5 April 2005 07:53 (twenty years ago)
― Casuistry (Chris P), Tuesday, 5 April 2005 12:43 (twenty years ago)
― nathalie doing a soft foot shuffle (stevie nixed), Tuesday, 5 April 2005 13:00 (twenty years ago)
i want someone to help me build a site that would effectively be like the g-mail request thread but on a grander, more synchronised and more automated scale and scope. contact me if interested!
― Sven Basted (blueski), Tuesday, 5 April 2005 13:23 (twenty years ago)
― willdabeast, Tuesday, 5 April 2005 13:56 (twenty years ago)
date +"%y%m%d" -d yesterday
change format characters as required.
― koogs (koogs), Tuesday, 5 April 2005 14:03 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 14:14 (twenty years ago)
― Ste (Fuzzy), Tuesday, 5 April 2005 14:20 (twenty years ago)
― beanz (beanz), Tuesday, 5 April 2005 14:21 (twenty years ago)
― beanz (beanz), Tuesday, 5 April 2005 14:22 (twenty years ago)
― Sven Basted (blueski), Tuesday, 5 April 2005 14:27 (twenty years ago)
― beanz (beanz), Tuesday, 5 April 2005 14:30 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 14:32 (twenty years ago)
unfortunately i have a severe lack of knowledge of embdd progming at this current moment in time.
― Ste (Fuzzy), Tuesday, 5 April 2005 14:38 (twenty years ago)
depends who you want to work for. it's not as horribly low level as it used to be. which low level stuff can be fun, but it can be an easy way to ensure you turn into a dinosaur. of course, some folks like that. about the time they get tired of programming, they also happen to be come obsolete as a programmer... management HO!!!
but anyway... these days, embedded stuff can be done in higher level languages and therefore, your language skills can continue to develop etc.
i have buddies that do embedded stuff and enjoy it. non-computer computing devices are the future right?m.
― msp (mspa), Tuesday, 5 April 2005 14:47 (twenty years ago)
― Ste (Fuzzy), Tuesday, 5 April 2005 14:49 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 14:49 (twenty years ago)
my rewrite of Ant Attack for j2me devices (seen here running in Nokia emulator). only got as far as doing the fun bits and not the hard bits (ie the isometric projection, map editor, running, climbing, rotating, falling, but no ants, no one to rescue, no grenades)
― koogs (koogs), Tuesday, 5 April 2005 15:19 (twenty years ago)
A sony/ericsson t630 (i know this as i just bought it today). i figured it out.
"hello i'm nath, i'm a gadget freakazoid." heh
― nathalie doing a soft foot shuffle (stevie nixed), Tuesday, 5 April 2005 16:42 (twenty years ago)
that kind of thing can be quite common. hardware be cheap.
of course, there's always gonna be folks who can't go there. but even still, it's common to see C or C variants used to macro ASM quickly... then you can go in and tweak if needed. which, optimizations are usually well known, so it's easy to build your macros well. of course, even with hardware cheap, sometimes you have to go even cheaper and somebody might be coding ASM, but...
generalized solutions like java or c++ or c are greatly preferred. spending a lot of time and money developing a code base so chip dependent is unwise. the chip'll be out of date too quick and your code base will be useless.
that's what the theory and the whitepapers say anyway right? m.
― msp (mspa), Tuesday, 5 April 2005 16:49 (twenty years ago)
I'm in embedded programming and we use C mostly, though knowledge of assembly is very useful. Whoever said it turns you into a dinosaur is right for many applications, but probably not for phones, PDAs and such. It also limits locations where you can work because the companies that use it are not as widespread as web or database type companies.
― nickn (nickn), Tuesday, 5 April 2005 18:10 (twenty years ago)
script to build random desktop backgrounds. no images are repeated across pictures. supports arbitrary resolutions. set up for 1024x768 and 1280x1024. Dumps the images into resolution specific folders so that OS X random background can keep both displays refreshed. I need to take more pictures....
― absolutego (ex machina), Tuesday, 5 April 2005 18:23 (twenty years ago)
You need knowledge of C and ASM (IMHO) to be a good systems programmer. Especially for shared memory coding.
― absolutego (ex machina), Tuesday, 5 April 2005 18:25 (twenty years ago)
+ - * / = < > and arctan ascii bf bk bl buttonp bye catch changef char clean co copyon copyoff cos count cs ct cursor defaultd define dir dirpic dot dotc ed edall edf emptyp end er erall ern error fd fence first fput fs home ht glist go gprop if int item keyp label last lc list listp load loadpic local lput lt make memberp namep nodes noformat not notrace nowatch numberp op or paddle pal pause pd pe piece plist pprop po poall pons pops pots pps pr pu px quotient random rc recycle remainder remprop repeat rerandom rl round rq rt run save savepic se setbg setcursor setd seth setpal setpc setpos setscrunch setsplit setx sety sf sin show shuffle ss st stop text tf thing throw to towards trace ts type uc wait watch where window word wordp wrap
which is about 150, I think.
I should dig up the Java version I wrote years ago and see how much it could do. Not very much, as far as I remember.
― caitlin (caitlin), Tuesday, 5 April 2005 18:44 (twenty years ago)
― mark s (mark s), Tuesday, 5 April 2005 18:47 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 18:50 (twenty years ago)
http://jakarta.apache.org/bcel/
Its so easy!
nice mosiac thingy.
i pondered making something like that for my web rpg thingy. cause it takes individual tiles and either: composites a bigger image, or xmls a bunch of indexed urls... which is probably way slicker now that i type this out loud. much more condensed. yeah, so a stitcher i guess isn't what i need. still, a fun app to have around. are you using image magic to throw them together? thought about adjusting the color of each? you could make one of those yoda mosiac thingies made of 50x100 smaller yoda scenes... i wonder what people would pay for custom versions of those of their kids? $20 for a poster sized one? $40? m.
― msp (mspa), Tuesday, 5 April 2005 18:59 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 19:08 (twenty years ago)
― msp (mspa), Tuesday, 5 April 2005 19:21 (twenty years ago)
With the possible exception of games, embedded systems and a few niche areas, there is no good reason at all to ever consider writing assembler; certainly not systems programming, unless your system is MVS and you have a legacy of assembler programs written in the 1970s and you have a keen need to perpetuate the problem.
They were insisting this was the case at least 15 years ago in Computer Science; why, given 15 more years of Moore's law would there be a case for it now? Especially given that in the 1950s it was discovered that high-level programming languages afforded a five-fold increase in development speed; that the vast majority of inefficiencies in people's programs are in the algorithms used anyway and the fairly obvious problem that your program will be tied to the system you wrote it for. You'd have to be pretty keen to want to take on all of these disadvantages. I find it amazing anyone would want to consider this in 2005 outside the aforementioned areas. Even embedded systems are moving away from it, as has been mentioned before.
Fortran isn't used in any new applications I'm aware of, other than those that make use of the SIMD extensions in Fortran 90, for which there are little alternatives other than niche languages, such as Linda. In this problem space, it seems like a perfectly reasonable choice.
― KeefW (kmw), Tuesday, 5 April 2005 19:26 (twenty years ago)
Also, my professor contended that we are hitting Moore's law right now, which I doubt a bit, but seems OTM in some respects. He mentioned that Intel was scaling back its high end chips because they could not deal with the heat dissapation issues.
Isn't Linda a shared stored not a language?
― absolutego (ex machina), Tuesday, 5 April 2005 19:41 (twenty years ago)
Maybe we are hitting (presumably you mean the ceiling of) Moore's law now, maybe we're not. People have been saying we're hitting the ceiling for about 20 years if not more. I'm sure we'll hit it some time, but I think the odds are with it holding for some time to come. I read only a month ago about the hard drive storage ceiling being close to being hit and only today Hitachi have blown it away: http://news.bbc.co.uk/1/hi/technology/4411649.stm
I don't know about Intel, but my best guess is that they're scaling back on high end chips because no-one's buying any chips at all and why keep improving them until something, like Longhorn comes along to make use of them.
I know nothing about Linda other than what I read on my Parallel Computer Architecture course I did around 1993 at University. Parallel programs we wrote back then were in Fortran 90 for SIMD and Occam for MIMD. According to Wikipedia, Linda is a 'co-ordination language' whatever that means. How odd; I didn't think you needed to perform co-ordination for SIMD programs. Maybe my memory is failing me.
― KeefW (kmw), Tuesday, 5 April 2005 19:54 (twenty years ago)
http://en.wikipedia.org/wiki/David_Gelernter
― KeefW (kmw), Tuesday, 5 April 2005 20:01 (twenty years ago)
Yikes! For a good intro to -- Linda: S.Ahuja, N.Carreiro , and D.Gelernter, "Linda and Friends," Computer, Vol. 19, No. 8, Aug. 1986, pp. 26-34.
Funny, I'm taking a parallel systems course right now! My (guest) professor argued that most high peformance applications in the coming years are going to reply on parallelism and that allowing concurrent access to shared data structures through fine grained locking mechanisms was going to be important. We discussed the upcoming implementations of hardware-assisted transactional memory operations as well as lock-free queueing mechanisms etc.
― absolutego (ex machina), Tuesday, 5 April 2005 20:08 (twenty years ago)
Personally though, I would probably disagree that the MIMD style parallelism you describe will become popular, simply because it is just *way too hard* for the majority of developers. You said upthread that multi-threaded programming 'sucked'; well, this is basically the same problem. To take an example, EJB precludes spawning of threads from within an EJB, basically to make it simpler. Object pooling is used to maintain integrity and allow a high degree of parallelism. This approach has been in use since about 1968 (albeit without objects and EJBs).
That said, I guess it depends what you mean by 'high-performance applications', I'm not sure I understand how hardware can help with this either. If you're stuck in a queue awaiting access to some shared memory someone else is currently accessing, how will hardware help? It's surely more a function of the time spent in the critical section rather than the amount of time obtaining a lock.
Still, I'd be more than happy if someone comes up with something magic, but basically it still means programming concurrent systems, which is an order of magnitude harder than single-threaded systems (I don't mean 'thread' in the OS thread sense there).
SIMD parallel programming is hugely important (and also straightforward, since there's no co-ordination required in accessing data required) in applications where the interactions have no dependencies though, like raytracing.
Who was the guest professor?
― KeefW (kmw), Tuesday, 5 April 2005 20:21 (twenty years ago)
― msp (mspa), Tuesday, 5 April 2005 20:47 (twenty years ago)
Maybe there's been a big advance in the last 13 years I am unaware of.
― KeefW (kmw), Tuesday, 5 April 2005 20:52 (twenty years ago)
― Casuistry (Chris P), Tuesday, 5 April 2005 20:54 (twenty years ago)
― RickyT (RickyT), Tuesday, 5 April 2005 20:58 (twenty years ago)
― Casuistry (Chris P), Tuesday, 5 April 2005 21:00 (twenty years ago)
― RickyT (RickyT), Tuesday, 5 April 2005 21:02 (twenty years ago)
There's work being done to automate the process of taking a sequential data structure and automate the conversion of it to use fine grained locks throughout. Then you spend more time actually waiting on other processes' locks. Now, we all know kernel crossings for lock implemenatations are expensive and spinning on a lock is not good (priority inversion, etc). So the locks of the future will use a combination of atomic memory instructions like the test and set instructions combined with stuff like ethernet style exponential backoff. Additionally, hardware support for transactional memory (hold changes in cache till told to) will allow atomic updates to referential data structures like queues, heaps, etc. I can dig up material on this if you'd like.
Again, the automated system for parallelizing access (fine grained) to data structures are on the way.
SIMD parallel programming is hugely important (and also straightforward, since there's no co-ordination required in accessing data required) in applications where the interactions have no dependencies though, like raytracing.The fundamental limits iof the performance of a single SIMD unit. Even with stuff like hyperthreading using all of a core. I am not an electrical engineeer though!
Who was the guest professor?http://www.cs.rochester.edu/u/scott/
wait... i thought mimd was seamless?
MIMD is kind of generic term for multiple processing "units" right? MIMD is NOT transparent to the programmer. There is memory consistency models to worry about -- in addition to the simple problem of restricting access to shared data structures.
I think I am mostly right about all these points.
― absolutego (ex machina), Tuesday, 5 April 2005 21:07 (twenty years ago)
― absolutego (ex machina), Tuesday, 5 April 2005 21:19 (twenty years ago)
― shieldforyoureyes, Tuesday, 5 April 2005 22:10 (twenty years ago)
I still don't believe you
― absolutego (ex machina), Tuesday, 5 April 2005 22:13 (twenty years ago)
― shieldforyoureyes, Tuesday, 5 April 2005 22:35 (twenty years ago)
i feel like we had this conversation recently... i waxed about the maspar i used to get to play with. but my programs were written in C, without threads. but the api i talked to hit the maspar and all was divided over there. similar crap was done on a another machine i got to play with once... load leveller schedules out the rock from the conductor machine to the individual musicians. but this was all seamless from the programmer pov.
but i have no brain left and am probably confusing things.m.
― msp (mspa), Wednesday, 6 April 2005 05:26 (twenty years ago)
jw.
― absolutego (ex machina), Wednesday, 6 April 2005 05:28 (twenty years ago)
― absolutego (ex machina), Wednesday, 6 April 2005 05:29 (twenty years ago)
― absolutego (ex machina), Wednesday, 6 April 2005 05:30 (twenty years ago)
you ain't talkin to me are you?m.
― msp (mspa), Wednesday, 6 April 2005 06:07 (twenty years ago)
no one uses terms like SIMD and MIMD anymore.
― absolutego (ex machina), Wednesday, 6 April 2005 06:22 (twenty years ago)
fake rock critics are the art of pretend knowing. bullshitter revealed!m.
― msp (mspa), Wednesday, 6 April 2005 06:53 (twenty years ago)
― absolutego (ex machina), Wednesday, 6 April 2005 07:31 (twenty years ago)
― shieldforyoureyes, Wednesday, 6 April 2005 09:36 (twenty years ago)
― msp (mspa), Wednesday, 6 April 2005 12:41 (twenty years ago)
This isn't the case for most problems, which have dependencies inbuilt. To solve these efficiently you have to work harder and use a MIMD-style machine/approach. The problems you're trying to solve (more quickly by parallelizing constituent parts) are split into sub-problems (as ever), but unfortunately there are dependencies between these sub-problems, which means you need to co-ordinate effort if you're going to execute sub-problems in parallel. There are various topologies for letting MIMD processors talk to each other efficiently and some are described in this document: http://carbon.cudenver.edu/~galaghba/mimd.html
It doesn't look to have changed a lot since I did this stuff at uni, although it's not clear when this article was written.
― KeefW (kmw), Wednesday, 6 April 2005 16:43 (twenty years ago)
― shieldforyoureyes, Wednesday, 6 April 2005 19:50 (twenty years ago)
― Alex in TCBY (ex machina), Wednesday, 6 April 2005 20:46 (twenty years ago)
― shieldforyoureyes, Wednesday, 6 April 2005 21:46 (twenty years ago)
Oh sorry, fair enough. I've never heard of a CM5.
I'm not convinced this stuff is going anywhere though... It's been around for ages, with little impact on the mainstream (outside maybe graphics cards). That said, the grid thing's been around since Andrew Tanenbaum's Amoeba in around 1988 and it's hitting the headlines now, so you never know.
― KeefW (kmw), Wednesday, 6 April 2005 22:49 (twenty years ago)
― Alex in TCBY (ex machina), Thursday, 7 April 2005 01:57 (twenty years ago)
m.
― msp (mspa), Thursday, 7 April 2005 04:27 (twenty years ago)
Sun SunfireIBM Regatta Power4Linux TreadMarks / Cashmere 2-L clusters (some kind of memory channel interconnect)
Parallelism is now.
― Alex in TCBY (ex machina), Thursday, 7 April 2005 05:01 (twenty years ago)
for most businesses... a blade server is the closest thing to parallelism... that's what i see. shared memory = a pool of connections to a transactional database. the big problem with specialized hardware is the cost. and parts breaking and ruining an entire system board in the process. blade servers that are hot swappable alongside hotswappable disc arrays make better production sense. round robin the requests on the network. clusters.
my boss keeps talking grids. we've got weighty computations that just involve large amounts of rollups and sorting... it'd be great to have all the state's spare machines crunching. WAY cheaper than legacy mainframe time too. it's insane how expensive and lame those machines are. omg, like a small cluster of desktops could probably wallop that old school shit. not to mention getting away from fixed width text databases and stuff. ughness. it's shocking what our local, state, and federal gov uses to do ze computational tasks. old money contracts. it smells like $50 bottles of ketchup in defense spending.
anyway, sorry... this rant is entirely removed from programming feats.m.
― msp (mspa), Thursday, 7 April 2005 17:58 (twenty years ago)
MULTIPLE CORES ARE GOING TO BE THE DEFAULT IN LIKE 5 YEARS. WE HAVE MODERN OPERATING SYSTEMS THAT SUPPORT THIS.
― Alex in TCBY (ex machina), Thursday, 7 April 2005 20:22 (twenty years ago)
i'm just glad that there are people tending to these matters...
― ronny longjohns (ronny longjohns), Friday, 8 April 2005 00:24 (twenty years ago)
― Where is Erasto B. Mpemba? (ex machina), Friday, 8 April 2005 00:30 (twenty years ago)
werdness.m.
― msp (mspa), Friday, 8 April 2005 03:07 (twenty years ago)
― Where is Erasto B. Mpemba? (ex machina), Friday, 8 April 2005 03:55 (twenty years ago)
the windows is very guilty of this i'm thinking. (that might be why i've heard it cause i live in windows land too much.)
― msp (mspa), Friday, 8 April 2005 04:19 (twenty years ago)
― msp (mspa), Friday, 8 April 2005 04:32 (twenty years ago)
― caitlin (caitlin), Friday, 8 April 2005 06:34 (twenty years ago)
However, the SIMD/MIMD chat above is not the same thing.
Grid and parallel processing works fine seamlessly, i.e. requires no input from programmers when one OS process does not span more than one processor. Shared memory makes no difference, since the memory allocated to a given process is protected in the same way it is on your PC (other than the explicit 'shared memory' OS calls mentioned by Jonathan; these are a special case and typically used for IPC rather than collusion on parallel problems). In a nutshell, it works no differently to a single processor machine, except that something decides "why not run it on this processor instead of that one because it's not doing much right now".
SIMD and MIMD are when individual programs/processes collude to solve a problem using multiple processors with which to do that. You could do it by forking if you wanted; that would be basically the same thing; albeit, with less facilities to help you reach your goal. The equivalent would be that the OS said 'In this program, I've got a loop doing something 100 times; I've worked out there are no dependencies between iterations of the loop; therefore, I'll put each iteration on an individual processor so that it goes faster'
There are well-defined cases that live in a grey area; the one about data sources you make earlier fits here. All programs pull data sources from a single connection pool. This can work because it has been very well defined what the job of the connection pool is. However, each process using the connection pool will all execute fully on a single processor.
On another point: whilst it is true that a few PCs will beat an S/390 style mainframe in terms of processing; they won't come close to it in terms of I/O, which is typically what you need an in online transaction processing environment. That's not to say they're not overpriced; alternatives do exist. Lots of companies are pretty well locked in by assembler programs and older Cobol programs that cannot be ported easily to other systems. Looks like your problem is one of computation though, where parallel processors and grids are where you will score.
― KeefW (kmw), Friday, 8 April 2005 12:18 (twenty years ago)
― Where is Erasto B. Mpemba? (ex machina), Friday, 8 April 2005 13:39 (twenty years ago)
http://www.sharcnet.ca/past_workshops/excel_slides/IntroParallel_Waterloo.pdf
I think the point I failed to make above is related to this point:
'In this program, I've got a loop doing something 100 times; I've worked out there are no dependencies between iterations of the loop; therefore, I'll put each iteration on an individual processor so that it goes faster'
Is not possible to do in the general case automatically, i.e. you can't get the compiler to do it. It's theoretically possible, but I believe it's an NP-complete problem; that's to say, it's intractable.
Being an NP-complete problem means that programmers have to do the work themselves, using heuristics and intuition. This is why it is so hard and why it will not catch on in the mainstream. Compilers have been built that use heuristics themselves; maybe there is some mileage in this; your professor might know.
― KeefW (kmw), Friday, 8 April 2005 14:24 (twenty years ago)
― msp (mspa), Friday, 8 April 2005 15:21 (twenty years ago)
tons of pdfs there! (that is my class)
― Where is Erasto B. Mpemba? (ex machina), Friday, 8 April 2005 15:52 (twenty years ago)
― shieldforyoureyes, Friday, 8 April 2005 19:35 (twenty years ago)
those machines are cool. the people admining them in my case are just very disinterested in change.m.
― msp (mspa), Friday, 8 April 2005 20:21 (twenty years ago)
Agree about the reliability thing, although I think some of this is down to software as well as hardware, in that OS/390 is over 40 years old; CICS & IMS DB/DC are over 35 years old and DB2 20 years old. Given that the bulk of what these machines do is largely characterized by these four pieces of software, it's not too surprising that they're pretty stable.
IBM's top end Unix machines (P/690s) have, I believe largely the same reliable kind of hardware; they're just often running much younger and much less stable software.
msp... Tell me about it! It's not easy getting to data. How do you do it where you work?
― KeefW (kmw), Friday, 8 April 2005 20:23 (twenty years ago)
― Sterling Clover (s_clover), Saturday, 9 April 2005 03:10 (twenty years ago)
it is solved and we will be seeing this stuff soon. right now the tools to solve it require some "graduate student" coaxing though to work right.... according to my prof
i am durnk
― The Scottish Restauranteer (ex machina), Saturday, 9 April 2005 06:36 (twenty years ago)
- Avoidance of race conditions etc. by appropriately grained locking mechanisms; i.e. putting 'synchronized' in the right place to maximise throughput whilst ensuring there are no reentrancy-related defects
- Optimal load balancing of program components on multiple processors
The second is the hard problem to solve (not to trivialize the first); although executable code bound at runtime would seem to make the first an impossible problem to solve in that case too.
Sterling: I would agree with what you say in general. Not sure about recursion/iteration. There is I guess a case in functional languages like the aforementioned Haskell as well as Lisp/Scheme and ML etc, where recursion is the only option, that since in these languages side-effects are not possible in functions, that this makes them easier to make assumptions about and therefore parallelize.
Additionally Jonathan, I think you're being optimistic about seeing this stuff any time soon... Time will tell.
- OO: invented 1967, Norway, Simula-67. Hyped late '80s, enters widespread use mid '90s.
- GUI 'WIMP' interface: Douglas Engelbart 1968. Enters mainstream in 1983; Apple Lisa. Widespread in '90s.
- Grid computing: Amoeba development completed in 1983. Being hyped now. Yet to enter mainstream in any significant way; other than say SETI.
- Databases: it's a good bet the contents of your bank account are stored in a pre-relational database.
It never ceases to amaze me what a remarkably conservative industry computing really is!
― KeefW (kmw), Sunday, 10 April 2005 18:13 (twenty years ago)
― Open your eyes; you can fly! (ex machina), Thursday, 21 April 2005 21:54 (twenty years ago)
― Levinicus (nordicskilla), Thursday, 21 April 2005 21:57 (twenty years ago)
Anyway:
1) perl -MCPAN -e "install Mac::Glue" is insane. It does tons of text to speech during make test!!!
2) http://wizardishungry.com/mrtg/ ... I am adding MORE STATISTICS as we speak.
― Open your eyes; you can fly! (ex machina), Thursday, 21 April 2005 22:33 (twenty years ago)
― caitlin oh no (caitxa1), Thursday, 21 April 2005 23:10 (twenty years ago)
― WORF (ex machina), Thursday, 21 April 2005 23:31 (twenty years ago)
Do you work for a direct marketing company?
Not exactly, no.
i didn't think adam was a programmer! i thought he made films.
No Caitlin, this is how I get money to make films.
― Levinicus (nordicskilla), Friday, 22 April 2005 00:24 (twenty years ago)
nice graphics wih... also besides perldsc, perlLOL is useful. (for the lazy.)
this perl class i took in my sophomore year ruled... our book was the man pages.... i think i read that forwards and backwards. i convinced all my profs that semester to let me code my other projects in perl. crypto being the main class. we did a text based simulation of the enigma machine... extra credit that was required for the grad students was to CRACK THE FREAKIN THING. which, he attempted to explain how to crack it but i was baffled by his poor teaching skills. thank god i was a peon undergrad.
― msp (mspa), Friday, 22 April 2005 02:12 (twenty years ago)
set state to 0 -- This state means that we think that I am home because of Bluetooth.
trytell application "iSync"activatesynchronizedo shell script "sleep 45" -- for some reason there seem to be some races here... it should work fineif sync status is (not 1) thenset state to sync status -- This means I am not home. Try Emailingend ifquitend tellon errorset state to 1end try
if state is 1 then
-- email cellphone heretrytell application "Mail"
set theSender to "me@gmail.com"set theAddress to "me@fone"
set theSubject to "Wakeup Jon."set theBody to "There's probably something you need to do soon."
set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody, sender:theSender, address:theAddress}
tell newMessage
make new to recipient with properties {address:theAddress}
end tell
send newMessage
end tellon errorset state to 2end tryend if
if state is not 1 then -- Try to wake me with iTunestryset volume 100 -- systell application "iTunes"activateset sound volume to 100 -- itunesset this_playlist to (playlist named "WAKEUP STUPID")play this_playlistend tellon error -- play anything to wake me upset state to 3end tryend if
if state is 3 then -- uhhhhhhhtrytell application "iTunes"
set this_playlist to (playlist named "Library")play this_playlist
end tellon errorset state to 4end tryend if
if state is 4 then -- UGHHHHHtrysay "Good mornin', good mornin'!We've danced the whole night through,good mornin', good mornin' to you. Good mornin', good mornin'! It's great to stay up late, good mornin', good mornin' to you."beepbeepbeepbeepbeepbeepbeepbeep
end tryend if
― THE JAMES DEAN OF THE OLD TESTAMENT (ex machina), Monday, 27 June 2005 06:27 (twenty years ago)
I need some good tutorials on Python and wxPython. Anybody got any pointers, other than the usual ones?
― kingfish, Friday, 15 June 2007 22:16 (eighteen years ago)
SHOW THEM TO ME
― Alan, Friday, 15 June 2007 22:20 (eighteen years ago)
http://www.ibiblio.org/obp/thinkCSpy/
this is what I'm using to get spun up on editing and writing new cron jobs for analysis. unfortunately it would appear that anything worthwhile is also going to call for me to have to dig out Statistics for Dummies as well
― TOMBOT, Friday, 15 June 2007 22:26 (eighteen years ago)
I wrote a ruby script to allow LDAP queries/updates from instant messaging clients (xmpp) it uses a bot so you can do simple stuff easily.
― Jarlrmai, Friday, 15 June 2007 23:12 (eighteen years ago)
I wrote a Python tutorial as part of my Masters. http://pentangle.net/python/
I keep meaning to update it and maybe hawk it to some educational publishers. Too busy though.
Yesterday I successfully ported some code from column major IDL to row major Python. For a while all my galaxies were rotated 45˚, but I think I squashed all the array[x,y]s. I am still dealing with some horrible cancellation errors though. Mother fucking floating points.
― caek, Friday, 15 June 2007 23:39 (eighteen years ago)
a friend had a nice idea and wasn't too difficult to write a script for - myspace playlists - supply a list of names and get back an m3u file of all the tracks on the relevant pages. 50 lines of bash, half of them blank or comments.
― koogs, Tuesday, 10 July 2007 08:51 (eighteen years ago)
http://www.mullsports.com/frogger.rar
been working on 2d games lately, and started doing a frogger game. use keys Z,X,K,M to move. All you can do so far is jump on the logs and turtles and die in the water. I have traffic too but not put it in yet. soon.
― Ant Attack.. (Ste), Tuesday, 3 February 2009 23:29 (seventeen years ago)
I could tell you, but then you'd know too much.
― Mr. Snrub, Tuesday, 3 February 2009 23:37 (seventeen years ago)
Just spent two days trying to track down a problem with an Arduino project. Turns out the fault is a memory leak in the Strings library. m%^$%^$^ fu$%ing f$%^ (as my code was displaying on the LCD as leak milled RAM)
― second dullest ILXor since 1929 (snoball), Saturday, 14 July 2012 10:04 (thirteen years ago)