Your Programming Feats!

Message Bookmarked
Bookmark Removed
Today I made an application that lets me beam photos from my bluetooth phone to my mac; categorizes them; inserts them in a db; puts them in html galleries; uploads them using rsync... all with pretty little cocoa dialogs.

Language: perl, 288 lines. AppleScript, 20 lines [folder actions].
Difficulty: medium
Experience 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 @_;
};

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)

Experience Gained: substantial

LEVEL UP

Gravel Puzzleworth (Gregory Henry), Monday, 4 April 2005 05:42 (twenty years ago)

but can he code for the human heart?

latebloomer: strawman knockdowner (latebloomer), Monday, 4 April 2005 05:43 (twenty years ago)

ROFFLEZ

Alex in LA (deangulberry), Monday, 4 April 2005 06:15 (twenty years ago)

it looks like this right now: http://wizardishungry.com/hash/

absolutego (ex machina), Monday, 4 April 2005 06:51 (twenty years ago)

JW I salute you.

Andrew (enneff), Monday, 4 April 2005 07:07 (twenty years ago)

10 PRINT "GREG KITTEN PWNS!!11"
20 GOTO 10

g-kit (g-kit), Monday, 4 April 2005 07:08 (twenty years ago)

Hey look I made a JUNE OF 44 ALBUM COVER

absolutego (ex machina), Monday, 4 April 2005 07:11 (twenty years ago)

i made a statement to the power of infinite. WHO WINS?

g-kit (g-kit), Monday, 4 April 2005 07:14 (twenty years ago)

i mean infinity, obv

g-kit (g-kit), Monday, 4 April 2005 07:15 (twenty years ago)

while(1) { fork(); print "YUO R ALL GAY\n"; }

absolutego (ex machina), Monday, 4 April 2005 07:16 (twenty years ago)

i remember in Neighbours when Todd hacked into the school's computer. genius.
10 PRINT "BREAK INTO SCHOOL'S COMPUTER"
RUN

g-kit (g-kit), Monday, 4 April 2005 07:18 (twenty years ago)

Downloading the plain text data from the IMDB, and writing a perl script that brute-forced the Kevin Bacon Game. Still the best use of my university education, I feel...

carson dial (carson dial), Monday, 4 April 2005 07:21 (twenty years ago)

Does anyone know how to change Windows XP desktop wallpaper from command line? My stupid parent company has forced us to have the crappy new company logo as our desktop, it loads up when we login and replaces whatever we had. I want to stick a batch file in Startup that replaces that with my own wallpaper, but I r dumbass.

Help me subvert their evil plans!

Colonel Poo (Colonel Poo), Monday, 4 April 2005 08:15 (twenty years ago)

When I was about 13 I programmed a whole text adventure in BBC Basic with musical interludes and stuff. Sadly every time you went back to a certain screen you had to wait for the music to stop before you could carry on with the game.

dog latin (dog latin), Monday, 4 April 2005 08:50 (twenty years ago)

>BREAK INTO WORLD BANK
Please enter password.
>OVERRIDE PASSWORD
Okay.

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)

> Does anyone know how to change Windows XP desktop wallpaper from command line?

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)

oh I already tried changing the registry. doesn't work, it doesn't actually change the wallpaper on the screen. I assume it would if I rebooted the PC, but then the evil login script will just change it back to 0n3.T3l again. Is there a command that will refresh the display from the registry values? Cos that would probably do it.

Colonel Poo (Colonel Poo), Monday, 4 April 2005 09:22 (twenty years ago)

compile the below and run with your picture as the argument

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)

Have you tried renaming the name of the graphic file you want to the one the company wants?

Mr Noodles (Mr Noodles), Monday, 4 April 2005 10:38 (twenty years ago)

If the sysadmins are at all sane, they'll have put it in a read-only file and folder.

caitlin (caitlin), Monday, 4 April 2005 10:39 (twenty years ago)

A more likely if is:
If the sysadm are lazy and don't care for the bosses vanity project, they would have done the minimal amount of work possible.

Mr Noodles (Mr Noodles), Monday, 4 April 2005 11:20 (twenty years ago)

Hah if I overwrite the logo file with my own desktop, everyone else in the company will also get my wallpaper! Way to get fired...

Colonel Poo (Colonel Poo), Monday, 4 April 2005 11:21 (twenty years ago)

I use this script to read a flat file of my mozilla bookmarks (generated using lynx -dump and vi) one at a time for del.icio.us filing at my own pace. "Only 474 lines to go!"


#!/usr/bin/perl
print $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 links
chomp $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)

http://www.techprep.ab.ca/abtp/saw/images/law_img2.jpg

o. nate (onate), Monday, 4 April 2005 21:37 (twenty years ago)

every single thing in here makes 0% sense to me. But i would like to learn.

Hari A$hur$t (Toaster), Monday, 4 April 2005 21:40 (twenty years ago)

My real answer: at my old job we had a firewall where connections could not be made from outside the firewall to inside the firewall, but you could make connections in the opposite direction. I had some mp3s I wanted to share with a friend, but IM'ing files didn't work with the firewall. So I wrote two little programs: one that started up on his machine and listened on a certain port, then I started the program on my machine that connected to his machine. Once the connection was established that way he could browse my files and double-click on them to download them.

o. nate (onate), Monday, 4 April 2005 21:44 (twenty years ago)

that's cute!

absolutego (ex machina), Monday, 4 April 2005 21:48 (twenty years ago)

Yeah, it worked pretty well. It was pretty easy to do in Java, and I learned a bit about Swing GUIs.

o. nate (onate), Monday, 4 April 2005 21:53 (twenty years ago)

multithreaded gui programming in java sucks

absolutego (ex machina), Monday, 4 April 2005 22:32 (twenty years ago)

no, it does not.

Mr Noodles (Mr Noodles), Monday, 4 April 2005 22:48 (twenty years ago)

If there should be one thread where the two of you can get along, it should be the programmer nerd one...

Alex in LA (deangulberry), Monday, 4 April 2005 22:50 (twenty years ago)

It does if you need to add a second thread to your program at the last minute and have never done any synchronization in java.

absolutego (ex machina), Monday, 4 April 2005 22:50 (twenty years ago)

I'm really amazed Noodles has a such a hateful heart.

absolutego (ex machina), Monday, 4 April 2005 22:52 (twenty years ago)

Doing distributed processing of postscript for animation - the shell script
that splits the whole animation into smaller jobs for the network batch
queue makes the jobs smaller as it approaches the end, so I don't end
up waiting too long on my slowest processor.

shieldforyoureyes, Monday, 4 April 2005 22:54 (twenty years ago)

Dave, I just attended a lecture on software transactional memory and lock free queues... It was pretty neat. Sun+Intel are adding support for building memory transactions in cache. Seems interesting!

absolutego (ex machina), Monday, 4 April 2005 22:58 (twenty years ago)

I will post up a link to my crazy zombie text adventure game when it's finished. yall excited?

I am!

Jordan (Jordan), Monday, 4 April 2005 23:02 (twenty years ago)

http://www.straightdope.com/mailbag/mzombiepower.html

absolutego (ex machina), Monday, 4 April 2005 23:04 (twenty years ago)

i turned that "nibbles" game on Qbasic on DOS to 4 player, once, when i was young.

ken c (ken c), Monday, 4 April 2005 23:06 (twenty years ago)

that's pretty cool!

absolutego (ex machina), Monday, 4 April 2005 23:08 (twenty years ago)

When I was 12 I used one of those "Learn PERL In 24 Hours" books so that I could join the programming staff on an online wrestling sim I played.

stephen morris (stephen morris), Monday, 4 April 2005 23:17 (twenty years ago)

I haven't done any programming since puberty, tho.

stephen morris (stephen morris), Monday, 4 April 2005 23:18 (twenty years ago)

I don't code, but I test. I just found a really cool bug too.

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)

If there should be one thread where the two of you can get along, it should be the programmer nerd one...

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)

So I can be reminded how fun it was for him to break Alan's work after a rash of phpBB attacks?

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)

That's right, bitch! WHERE ARE YOU NOW?

absolutego (ex machina), Tuesday, 5 April 2005 00:24 (twenty years ago)

http://www.diamonddollies.com/Flower%20Pot%20Man.jpg

Remy (x Jeremy), Tuesday, 5 April 2005 00:29 (twenty years ago)

Blow me kid, I was eating dinner.

Mr Noodles (Mr Noodles), Tuesday, 5 April 2005 02:28 (twenty years ago)

WHY WERE YOU USING PUBLISHED ATTACKS ON YOUR FOOD LIKE THAT

Ian John50n (orion), Tuesday, 5 April 2005 02:34 (twenty years ago)

Cause we are all noize roffle roffle.

Mr Noodles (Mr Noodles), Tuesday, 5 April 2005 02:44 (twenty years ago)

ooh, that put ME in my place.

Ian John50n (orion), Tuesday, 5 April 2005 02:46 (twenty years ago)

I'm not noise, but most of my friends are!

Remy (x Jeremy), Tuesday, 5 April 2005 02:48 (twenty years ago)

I'm twee and emo! Hugs LOL

Remy (x Jeremy), Tuesday, 5 April 2005 02:48 (twenty years ago)

So you're wrong, is what you're saying?

absolutego (ex machina), Tuesday, 5 April 2005 02:52 (twenty years ago)

How much did you eat?

absolutego (ex machina), Tuesday, 5 April 2005 02:53 (twenty years ago)

#include

long RonsNumber (0);

int main ()
{
//print initial number
cout

ronny longjohns (ronny longjohns), Tuesday, 5 April 2005 03:14 (twenty years ago)

hey it ate the rest of my brilliant program

ronny longjohns (ronny longjohns), Tuesday, 5 April 2005 03:15 (twenty years ago)

make sure you convert &;lt to &lt; and > &gt; else it thinks it is HTML!

absolutego (ex machina), Tuesday, 5 April 2005 03:36 (twenty years ago)

err
"< to &lt; and > to &gt;"

absolutego (ex machina), Tuesday, 5 April 2005 03:37 (twenty years ago)

#!/bin/sh
RS="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/null
elif [ "$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
fi
fi

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 >> $LOG
scp -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)

I have it set to run every day using cron. The only thing I wish I could do was make the initial dialog timeout and default to yes after 30 seconds....

and make sure i have a valid network address.....

absolutego (ex machina), Tuesday, 5 April 2005 03:44 (twenty years ago)

The geekiest programming thing I ever did was to make a Logo interpreter in Javascript.

Casuistry (Chris P), Tuesday, 5 April 2005 04:42 (twenty years ago)

how many functions does a logo implementation have? it doesn't have dynamic memory, right?

absolutego (ex machina), Tuesday, 5 April 2005 04:50 (twenty years ago)

i fucked with the PHP of my Gallery install to incorporate Google adsense:

http://www.kingfishphoto.com/gallery/Music-Photography

kingfish van pickles (Kingfish), Tuesday, 5 April 2005 04:54 (twenty years ago)

I wonder if I used a CSS hack to disable adsense...

absolutego (ex machina), Tuesday, 5 April 2005 04:59 (twenty years ago)

PS - I am the best programmer on ILX. I DATE ANYONE TO BE L33T3R.

absolutego (ex machina), Tuesday, 5 April 2005 05:02 (twenty years ago)

I do make a lot of typos though.

absolutego (ex machina), Tuesday, 5 April 2005 05:06 (twenty years ago)

Hari, you could look at this package for installing perl, and this friendly guide, for learning, if you wanted?

Gravel Puzzleworth (Gregory Henry), Tuesday, 5 April 2005 06:24 (twenty years ago)

Don't let the man start with perl. Look at how crap my code is up there. I don't even understand how scoping works with use strict. I don't know how to do a lot of trivial data structures stuff.

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)

how many functions does a logo implementation have?

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)

ah, thanks. I don't know how to like make hashtables with arrays as the value and such

absolutego (ex machina), Tuesday, 5 April 2005 06:39 (twenty years ago)

Join the Dark Side and learn VBA.

Johnney B (Johnney B), Tuesday, 5 April 2005 06:43 (twenty years ago)

The secret is to use references, because hashes and arrays can only hold scalars. When you do that, the syntax lets you miss out the arrow operator in a lot of cases.


%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";
}


caitlin (caitlin), Tuesday, 5 April 2005 06:44 (twenty years ago)

perl sucks but i like that regexps aren't in strings

absolutego (ex machina), Tuesday, 5 April 2005 06:57 (twenty years ago)

... apart from when they are, of course!

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)

As a scripting language, perl is nice once you get used to some of its quirks. For writing big programs, I'd rather use something allows me to use complex data structures without making me want to tear my hair out. The syntactic sugar (and this *includes* the arrow operator) actually makes it worse, because it doesn't work all the time, and the exceptions are non-intuitive.

RickyT (RickyT), Tuesday, 5 April 2005 07:15 (twenty years ago)

I've done stuff like that...

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)

I speak of PHP land. If only I could show you the horrors of BAD regexp use perpetuated by undergraduate university web programmers I have fixed.

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)

Ew indeed.

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)

I doubt I dealt with any sort of dynamic memory issues, and I implented all (or almost all?) the functions I found on some website that went over what the basic functions of Logo are. I did allow you to create your own functions, though. I'm not suggesting it was mind-bendingly clever, but it was pretty good for a dabbler.

Casuistry (Chris P), Tuesday, 5 April 2005 12:43 (twenty years ago)

i'll be happy if i can transfer my pics from my new cellphone to my mac with bluetooth. (that said, i managed to install wordpress and coppermine with fuxoring it all up.)

nathalie doing a soft foot shuffle (stevie nixed), Tuesday, 5 April 2005 13:00 (twenty years ago)

what i meant to ask: how do you start learning all this?

nathalie doing a soft foot shuffle (stevie nixed), Tuesday, 5 April 2005 13:00 (twenty years ago)

my recent programming feats amount to merely getting my client's sites web-compliant.

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)

Does anyone know how to return yesterdays date in unix?
Thanks for any help
Will

willdabeast, Tuesday, 5 April 2005 13:56 (twenty years ago)

man date!

date +"%y%m%d" -d yesterday

change format characters as required.

koogs (koogs), Tuesday, 5 April 2005 14:03 (twenty years ago)

nathalie: what kidn of cell phone do you have. on mine i just select pictures and "transfer..bluetooth"

absolutego (ex machina), Tuesday, 5 April 2005 14:14 (twenty years ago)

would I be a horrible nerd if I downloaded the bash theming engine?

absolutego (ex machina), Tuesday, 5 April 2005 14:14 (twenty years ago)

Is it worth my while, career wise, to get into embedded programming?

Ste (Fuzzy), Tuesday, 5 April 2005 14:20 (twenty years ago)

Jon it's a bit late to worry about that
xpost

beanz (beanz), Tuesday, 5 April 2005 14:21 (twenty years ago)

(minus 'horrible', obv.)

beanz (beanz), Tuesday, 5 April 2005 14:22 (twenty years ago)

i dunno, he called me a HOMOSEXUAL once. i cried for days.

Sven Basted (blueski), Tuesday, 5 April 2005 14:27 (twenty years ago)

i'm over it now though.

Sven Basted (blueski), Tuesday, 5 April 2005 14:27 (twenty years ago)

I wouldn't have taken that lying down.
< /jim davidson>

beanz (beanz), Tuesday, 5 April 2005 14:30 (twenty years ago)

How old are you Ste? What's your academic background?

absolutego (ex machina), Tuesday, 5 April 2005 14:32 (twenty years ago)

I'm 31, but already have a fair knowledge of assembly (various systems) and c++. I was reading an article today in an IT rag, I'd never even really thought about embedded programming but it somehow sounds more up my street programming with hardware on a lower level as such. and with mobile technology advancing as it is it sounds like a promising move forward.

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)

"Is it worth my while, career wise, to get into embedded programming?"

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)

cheers, I've been learning all sorts of languages adhoc in my spare time but never really found a niche to associate them with a career. I think we maybe onto something with this now though. thanks again.

Ste (Fuzzy), Tuesday, 5 April 2005 14:49 (twenty years ago)

I don't know much about real world embedded programming outside of like "embedded linux" and "embedded java" on mobile phones and such. This stuff is kind of the high end for small systems.... most have java implementations and/or c++ toolkits. using ASM seems like a waste for platforms that provide an OS or API that is common to several architectures....

absolutego (ex machina), Tuesday, 5 April 2005 14:49 (twenty years ago)

http://home.clara.net/koogy/antchester.png

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)

nathalie: what kidn of cell phone do you have. on mine i just select pictures and "transfer..bluetooth"

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)

"I don't know much about real world embedded programming outside of like "embedded linux" and "embedded java" on mobile phones and such. This stuff is kind of the high end for small systems.... most have java implementations and/or c++ toolkits. using ASM seems like a waste for platforms that provide an OS or API that is common to several architectures.... "

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)

FORTRAN ROX - U R ALL GAY!!!

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)

http://wizardishungry.com/hash/Backgrounds/6x6/1.jpg

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)

fortran is TOTALLY GAY guys. Fuck column major order.

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)

Commands in Digital Research Logo (the version shipped with CP/M 3 for the Amstrad CPC):

+ - * / = < > 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)

jon yr head is the same shape as yr nose only upside down

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)

If anyone is interested in writing really easy compilers and learning about how call stacks, etc. work:

http://jakarta.apache.org/bcel/

Its so easy!

absolutego (ex machina), Tuesday, 5 April 2005 18:50 (twenty years ago)

yeah, i could imagine that C is a must especially in *nix systems land. even just as an admin, i can't imagine not knowing it at least a little. makefiles don't always work first try without a little edit. you must be pals with gcc or it will show you the door.

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)

Yea, that's image magick "montage". I think there are tools to generate those mosaic things... look on freshmeat.

absolutego (ex machina), Tuesday, 5 April 2005 19:08 (twenty years ago)

shit, there goes my early retirement scam.
m.

msp (mspa), Tuesday, 5 April 2005 19:21 (twenty years ago)

What on earth do you need to know about assembler to be a good system programmer? C yes, in Unix anyway, but assembler? Why? What can you achieve that you can't achieve in C?

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)

KeefW, you really do need some grasp of asm to understand computer architecture.

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)

Jonathan, understanding assembler does help you to understand computer architecure, what with the two being inextricably linked, but this doesn't preclude you from becoming a sysprog, for which I would argue it's less important to know about computer architecture; this is, after all the main function of operating systems, to abstract from the computer's underlying architecture. However, it's always pleasing in this industry when people are keen to learn more.

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)

Quite frightening history of the guy who invented Linda here:

http://en.wikipedia.org/wiki/David_Gelernter

KeefW (kmw), Tuesday, 5 April 2005 20:01 (twenty years ago)

First: here's a cool hack: http://www.komar.org/xmas/hoax/


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)

What's actually just freaked me out is that following through the Google links, not only do I find the woman who taught me all stuff this back then, but that she has some papers published with a guy I currently work with! Yikes indeed!

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)

wait... i thought mimd was seamless?
m.

msp (mspa), Tuesday, 5 April 2005 20:47 (twenty years ago)

Well, not that I remember. I wrote an Occam program for a MIMD machine once and it was all co-ordination. It wasn't funny writing it at all!

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)

If I learn Scheme, will it make me a better person?

Casuistry (Chris P), Tuesday, 5 April 2005 20:54 (twenty years ago)

Yes. But if you learn Haskell you will become morally superior to everyone else on the planet. Just look at me.

RickyT (RickyT), Tuesday, 5 April 2005 20:58 (twenty years ago)

I don't even know of this Haskell. It sounds like a relative of Befunge.

Casuistry (Chris P), Tuesday, 5 April 2005 21:00 (twenty years ago)

http://www.haskell.org/

RickyT (RickyT), Tuesday, 5 April 2005 21:02 (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.
Right, there will always be a need for straight sequential code.

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.

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.

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).

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)

I glossed over a lot of implementation details.

absolutego (ex machina), Tuesday, 5 April 2005 21:19 (twenty years ago)

ASM is not sufficient for learning computer architecture. You must program
in machine language, using toggle switches.
Which brings us to another Programming Feat (tm) - I wrote a little graphics
demo thingy (basicly etch-a-sketch) using only toggle switches, in LINC
machine language, on a PDP-12. Input from two pots hooked up to analog
input lines, output to a scope.

shieldforyoureyes, Tuesday, 5 April 2005 22:10 (twenty years ago)

dave, remember when you said that you could use flangers to build a turing machine


I still don't believe you

absolutego (ex machina), Tuesday, 5 April 2005 22:13 (twenty years ago)

a. MIMD = "Multiple Instruction, Multiple Data" ie: CM5 - a fuckload of
SPARCs running in parellel.
SIMD = "Single Instruction, Multiple Data" ie: CM2 - 64K processors
working in lockstep - the entire machine executes one instruction, but
on 64K seperate sets of registers.
b. Don't remember that, but it sounds like something I'd say. You could
rip the transistors out and make NAND gates, but I was probably arguing
that you could use it as a black box... dunno. I wouldn't want to have
to argue that position, though I suspect someone could figure out how
to do it.

shieldforyoureyes, Tuesday, 5 April 2005 22:35 (twenty years ago)

i guess my point with the seamless mimd programming was... isn't something like p2p or grid computing mimd essentially? or is that semantics? like, the singular control mechanism controlling the group of machines still acts as one singular entity and keeps things all separated and clean... and so despite the technical "multiple" it's really "single". the virtual machine spans multiple procs and datas yet all is really very much under control at the top.

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)

uhhh... stick to being an EE dude!

jw.

absolutego (ex machina), Wednesday, 6 April 2005 05:28 (twenty years ago)

Dave, I"m sure you'd be able to think of some cool applications of a transactional cache.

absolutego (ex machina), Wednesday, 6 April 2005 05:29 (twenty years ago)

I just hit ":w" in my fucking workprocessor. Does anyone know of a vi mode for word?

absolutego (ex machina), Wednesday, 6 April 2005 05:30 (twenty years ago)

"uhhh... stick to being an EE dude!"

you ain't talkin to me are you?
m.

msp (mspa), Wednesday, 6 April 2005 06:07 (twenty years ago)

I am.

no one uses terms like SIMD and MIMD anymore.

absolutego (ex machina), Wednesday, 6 April 2005 06:22 (twenty years ago)

well, i was using them conversationally i guess.

fake rock critics are the art of pretend knowing. bullshitter revealed!
m.

msp (mspa), Wednesday, 6 April 2005 06:53 (twenty years ago)

Anyway, in multiprocessor environments (NOT in multiple chips on core usually - they tend to share a cache... but not always) the architecture has a defined set of properties on how the actual ordering of memory operations corresponds to the order that they are visible to various nodes. this is refered to as a memory consistency model. once you move past bus based smp, relaxing consistency models improves memory throughput and latency since not all memory operations have to have the same total order across nodes

absolutego (ex machina), Wednesday, 6 April 2005 07:31 (twenty years ago)

As long as it doesn't fuck load/store purity. I am highly suspicious
of any such hacks.

shieldforyoureyes, Wednesday, 6 April 2005 09:36 (twenty years ago)

sort of similarly... i'm highly suspicious of automerging in cvs and other source control software.
m.

msp (mspa), Wednesday, 6 April 2005 12:41 (twenty years ago)

MIMD is not the same as a load of SPARCs. MIMD is a collection of processors collaborating on a single problem that uses shared data. Something like the SETI project shares similarities to a SIMD machine, i.e. lots of different processors are executing independently of each other to process a dataset unique to the processor. No one processor's results are dependent on the results of another, so the machines running SETI code against your allocated lump of data do not need to communicate with each other. The speed at which the problem can be solved is directly proportional to the number of processors allocated to the task.

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)

I said the CM5 (Connections Machine 5 supercomputer) was a classic example
of MIMD. It happens to use SPARC processors.
On the other hand, my home computer is an 8-processor Sun, but I would *never*
refer to it as a MIMD machine.

shieldforyoureyes, Wednesday, 6 April 2005 19:50 (twenty years ago)

this "MIMD" concept seems kind of nebulous.

Alex in TCBY (ex machina), Wednesday, 6 April 2005 20:46 (twenty years ago)

Traditionally, the terms (SIMD/MIMD) are *only* used in discussing
different types of massively parellel supercomputers.

shieldforyoureyes, Wednesday, 6 April 2005 21:46 (twenty years ago)

I said the CM5 (Connections Machine 5 supercomputer) was a classic example of MIMD

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)

Andrew T's grad program looks tasty... :/

Alex in TCBY (ex machina), Thursday, 7 April 2005 01:57 (twenty years ago)

well, a lot of the ideas get rehashed... various boundaries move is all... and so on. and then just "Perfect Storm" conditions form for certain things. i mean... 1988? what was happening with the internet at that point? the time wasn't ripe. even since 1995, since my first job, i've seen a gajillion architectures come and go that were gonna let everything talk to everything and you'd have all this super duper parallel lunacy goin on...

m.

msp (mspa), Thursday, 7 April 2005 04:27 (twenty years ago)

I have access to through school + work:

Sun Sunfire
IBM Regatta Power4
Linux 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)

but 5-10 years ago i had access to maspar and ibm sp action... it's ongoing. slowly as more gpu's and ppu's appear on chips in our home machines, maybe parallelism will reach beyond the acdemic.

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)

maybe parallelism will reach beyond the acdemic.

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 love reading this even though it makes no sense to me whatsoever!

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)

of course, you do realize that parallelism made jar jar binks possible

Where is Erasto B. Mpemba? (ex machina), Friday, 8 April 2005 00:30 (twenty years ago)

it's funny tho cause despite having multiple procs onboard, a lot of software and OSes make little use of it. or other limitations to the architecture totally limited everything. man, i remember being so insanely impressed by the BeOS demo we had in ACM... the guy could turn on and off the processors... you had total control. very rad. and you knew the processors were actually being used.

werdness.
m.

msp (mspa), Friday, 8 April 2005 03:07 (twenty years ago)

dude, any apps with pthreads can use multiple procs.

Where is Erasto B. Mpemba? (ex machina), Friday, 8 April 2005 03:55 (twenty years ago)

true, but still, much software ignores that. it's a common addage that, "your dual pentium goes to waste."

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.)

m.

msp (mspa), Friday, 8 April 2005 04:19 (twenty years ago)

you're right tho... dual cores are gonna start going towards the desktop (this year in fact evidentally...)... so maybe with the desktop home market kicking it, more apps will be written with threading in mind. etc etc.

m.

msp (mspa), Friday, 8 April 2005 04:32 (twenty years ago)

Any machine running multiple apps at once makes use of multiple cores too.

caitlin (caitlin), Friday, 8 April 2005 06:34 (twenty years ago)

The point you make here is correct. Parallelism in this sense is here and now and has been for years/decades. Everything we run in production at work runs on parallel processors.

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)

oh i think i understand mimd now

Where is Erasto B. Mpemba? (ex machina), Friday, 8 April 2005 13:39 (twenty years ago)

This gives a good overview of a lot of the stuff discussed here.

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)

thanks for posting that pdf. very useful introduction to concepts i've glossed over the nuances of.
m.

msp (mspa), Friday, 8 April 2005 15:21 (twenty years ago)

http://www.cs.rochester.edu/users/faculty/sandhya/csc258/

tons of pdfs there! (that is my class)

Where is Erasto B. Mpemba? (ex machina), Friday, 8 April 2005 15:52 (twenty years ago)

As KeefW points out, the difference between a mainframe and a PC is mostly
IO (also subtleties like reliability and accurate diagnostics, etc.).
Likewise, the difference between a supercomputer and a PC is memory
bandwidth. A Cray from the mid 90s can transfer 900 gigabytes per second
between its processors & main memory.

shieldforyoureyes, Friday, 8 April 2005 19:35 (twenty years ago)

yeah... my grid vs. mainframe comment was mostly in frustration with the software+people interfaces we have to go through to get to data that lives there. not to mention the cost.

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)

x-post

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)

re: np completeness. my gut tells me there are lots of special cases that can be automatically picked out + head vs. tail recursion vs. iteration wld probably play a role + how much "hint" is given in language design + the giant advantage of bytecode in this regard, at least potentially.

Sterling Clover (s_clover), Saturday, 9 April 2005 03:10 (twenty years ago)

the stuff that automates making datastructures be accessable in parallel with software transactional memory is a subset of this type of problem

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)

There are two separate problems as I see it:

- 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)

Thanks for perldsc!!!

Open your eyes; you can fly! (ex machina), Thursday, 21 April 2005 21:54 (twenty years ago)

SELECT Distinct ( count (pv.idnumber) )
FROM prospect_view pv, subscription s
WHERE pv.idnumber = s.idnumber
AND s.journalcode = 'STB'
AND pv.state = 'AZ';

Levinicus (nordicskilla), Thursday, 21 April 2005 21:57 (twenty years ago)

that is what I do all day, pretty much.

Levinicus (nordicskilla), Thursday, 21 April 2005 21:57 (twenty years ago)

Do you work for a direct marketing company?

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)

i didn't think adam was a programmer! i thought he made films.

caitlin oh no (caitxa1), Thursday, 21 April 2005 23:10 (twenty years ago)

I could show you SQL that would send cold chills down your spine, and wake you up in the middle of the night. No, it is better you do not know.

WORF (ex machina), Thursday, 21 April 2005 23:31 (twenty years ago)

I really am not good at SQL, but I get by.

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)

sql... i know enough to get basic jobs done... but yeah, i bet WORF could make me cry cause i've seen some doosey ass recursive stored procedures and stuff... i can make sense of it, but i probably would have never been able to write it.

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.

m.

msp (mspa), Friday, 22 April 2005 02:12 (twenty years ago)

two months pass...
AppleScript:

set state to 0 -- This state means that we think that I am home because of Bluetooth.


try
tell application "iSync"
activate
synchronize
do shell script "sleep 45" -- for some reason there seem to be some races here... it should work fine
if sync status is (not 1) then
set state to sync status -- This means I am not home. Try Emailing
end if
quit
end tell
on error
set state to 1
end try

if state is 1 then

-- email cellphone here
try
tell 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 tell
on error
set state to 2
end try
end if


if state is not 1 then -- Try to wake me with iTunes
try
set volume 100 -- sys
tell application "iTunes"
activate
set sound volume to 100 -- itunes
set this_playlist to (playlist named "WAKEUP STUPID")
play this_playlist
end tell
on error -- play anything to wake me up
set state to 3
end try
end if


if state is 3 then -- uhhhhhhh
try
tell application "iTunes"

set this_playlist to (playlist named "Library")
play this_playlist

end tell
on error
set state to 4
end try
end if

if state is 4 then -- UGHHHHH
try
say "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."
beep
beep
beep
beep
beep
beep
beep
beep

end try
end if

THE JAMES DEAN OF THE OLD TESTAMENT (ex machina), Monday, 27 June 2005 06:27 (twenty years ago)

one year passes...

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)

three weeks pass...

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)

one year passes...

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)

three years pass...

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)


You must be logged in to post. Please either login here, or if you are not registered, you may register here.