Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
heres the source nightmare image



(play where's waldo and try to find my avatar in it!)

one of my earlier experiments, i have a couple of them that came out much better and i'm sure ill revisit the technique sometime in the future

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

i just do some 6 finger touch typing bullshit that i homegrew by spending too much time in irc as a teen and now i can easily do 90-100 wpm and break 130 if im really goin at it

oh no blimp issue
Feb 23, 2011

its the funny eye looking thing in the top left

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Luigi Thirty posted:

how will I post in yospos from it with no DECnet

only DECnet failed to come up, I believe TCP/IP works

you could write an HTTP client and a forums HTML parser, and just hook that in as a back-end to the mail system so YOSPOS just shows up as another mailbox

hooking into the mail service was a common thing to do because in those days different sites used different systems

and then you could also easily port it to gnus too

Luigi Thirty
Apr 30, 2006

Emergency confection port.

No USER AIDS. I tried. :rip:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
I found the first > 10 loc program I ever wrote:




And now you can try it yourself.

code:
#!/bin/bash
## $1 is current command, $2 is current artist, $3 is current album, $4 is current song


##newlist()
## After md5sum check fails, parse a new list to be read for menu items
#{

parse ()
{
md51=`mpc -f "[zXz%artist%zXz%album%zXz%title%]" playlist|md5sum|cut -c -32`
md52=`tail -1 /tmp/.albumparse|cut -d ":" -f10`
if [ "$md51" != "$md52" ]
	then
INIT_TAB_AWK=""
mpc -f "[zXz%artist%zXz%album%zXz%title%]" playlist|sed -e 's/(//g' | sed -e 's/)//g' | sed -e 's/\#//g' | sed -e 's/\,//g'| sed -e 's/\&/&/g'| sed -e 's/\://g'|awk -F zXz '{printf ":%s:%s:%s:%d\n",$2,$3,$4,$1}'|


awk -F: '
{ $INIT_TAB_AWK }

{c++;r++}
{if ($2 != a) i++}
{if ($3 != b) p++ && r=1}
{if ($3 !=b && $2 != a) p = 1}
{printf ("%d:%d:%d:%s:%s:%s:%d\n",i,p,r,$2,$3,$4,c)}
{b = $3}
{a = $2}

' > /tmp/.albumparse
mpc -f "[zXz%artist%zXz%album%zXz%title%]" playlist|md5sum|cut -c -32|awk '{printf ":::::::::%s",$1}' >> /tmp/.albumparse
fi

}


getinfo()
{
# when parsing, total artists = $1, total albums = $2, total songs = $3, artist name = $4, album = $5, song 
# = $6


	if [ "$1" = getalbums ]
	then	
 	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
	echo "<openbox_pipe_menu>"
		
	n="$2"
	i=`awk -F: -v n=$n '$1 == n {print $2}' /tmp/.albumparse|uniq|wc -l`
	p=`awk -F: -v n=$n '$1 == n && $3 == 1 {print $2}' /tmp/.albumparse|head -1|tail -1`
	for ((m=1;m<=$i;m++))
	do
	
	albumname=`awk -F: -v z=$m -v n=$n '$1 == n && $2 == z && $3 == 1 {print $5}' /tmp/.albumparse`
	echo "<menu id=\"album$n$m\" label=\"$albumname\" execute=\"mpdmenu2.sh 'getsongs' '$n' '$m'\" />"
	##echo "<menu id=\"artist$m\" label=\"$artistname\" execute=\"mpdmenu2.sh 'getartist' $m\" />"

	#done

	echo

	done
	echo "</openbox_pipe_menu>"

	fi  
	
## make list of songs within an album. $1 is "Getsongs" command, $2 is artist #, $3 is song #
	if [ "$1" = getsongs ]
		then	
 		echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
		echo "<openbox_pipe_menu>"
	# define n as artist number, s as album number	
		s="$3"	
		n="$2"
	# i represents total number of songs on album, number of times to run loop
		i=`awk -F: -v n=$n -v s=$s '$1 == n && $2 == s {print $3}' /tmp/.albumparse|wc -l`
	
		songnumber=`awk -F: -v s=$s -v m=1 -v n=$n '$1 == n && $2 == s && $3 == m {print $7}' /tmp/.albumparse|head -1|tail -1`
			
		for ((m=1;m<=$i;m++))
		do
		songname=`awk -F: -v s=$s -v m=$m -v n=$n '$1 == n && $2 == s && $3 == m {print $6}' /tmp/.albumparse`
		
		echo "<item label=\"$songname\"> <action name=\"Execute\"><command>mpc play $songnumber</command></action></item>" 
		songnumber=$((songnumber+1))		
			
		done
   	echo "</openbox_pipe_menu>"	
fi

#echo "get info"



#echo "got info"
# passed from command line in script execution,
# for awk, $1 is songcount, $2 is startline, $3 is artist, $4 is album 
# will pass information from command line as
#  $1 operation to perform, $2 current artist, $3 current album 






}
makeartist ()
{


	totalartists=`tail -2 /tmp/.albumparse|head -1|cut -d ":" -f1` 
	i="$totalartists"
	echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
	echo "<openbox_pipe_menu>"
	for ((m=1;m<=$i;m++))
	do
	artistname=`awk -F: -v n=$m '$1 == n && $3 == 1 {print $4}' /tmp/.albumparse|head -1|tail -1`
	echo "<menu id=\"artist$m\" label=\"$artistname\" execute=\"mpdmenu2.sh 'getalbums' '$m'\" />"

	done

	echo "</openbox_pipe_menu>"

}
getalbums()
{
#  $1 is "getalbums" command, $2 is "$i", the artist number
getinfo "$1" "$2" "$3"


}
#getsongs "$1" "$2" "$3"
controlpanel()
{

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
echo "<openbox_pipe_menu>"
echo "  <item label=\"MPC Prev\">"
echo "    <action name=\"Execute\"><command>mpc prev</command></action>"
echo "  </item>"
echo "  <item label=\"MPC Play\">"
echo "    <action name=\"Execute\"><command>mpc play</command></action>"
echo "  </item>"
echo "  <item label=\"MPC Pause\">"
echo "    <action name=\"Execute\"><command>mpc pause</command></action>"
echo "  </item>"
echo "  <item label=\"MPC Stop\">"
echo "    <action name=\"Execute\"><command>mpc stop</command></action>"
echo "  </item>"
echo "  <item label=\"MPC Next\">"
echo "    <action name=\"Execute\"><command>mpc next</command></action>"
echo "  </item>"

echo "</openbox_pipe_menu>"
}



volume()
	{

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
echo "<openbox_pipe_menu>"
echo "  <item label=\"100%\">"
echo "    <action name=\"Execute\"><command>mpc volume 100</command></action>"
echo "  </item>"
echo "  <item label=\"90%\">"
echo "    <action name=\"Execute\"><command>mpc volume 90</command></action>"
echo "  </item>"
echo "  <item label=\"80%\">"
echo "    <action name=\"Execute\"><command>mpc volume 80</command></action>"
echo "  </item>"
echo "  <item label=\"70%\">"
echo "    <action name=\"Execute\"><command>mpc volume 70</command></action>"
echo "  </item>"
echo "  <item label=\"60%\">"
echo "    <action name=\"Execute\"><command>mpc volume 60</command></action>"
echo "  </item>"
echo "  <item label=\"50%\">"
echo "    <action name=\"Execute\"><command>mpc volume 50</command></action>"
echo "  </item>"
echo "  <item label=\"40%\">"
echo "    <action name=\"Execute\"><command>mpc volume 40</command></action>"
echo "  </item>"
echo "  <item label=\"30%\">"
echo "    <action name=\"Execute\"><command>mpc volume 30</command></action>"
echo "  </item>"
echo "  <item label=\"20%\">"
echo "    <action name=\"Execute\"><command>mpc volume 20</command></action>"
echo "  </item>"
echo "  <item label=\"10%\">"
echo "    <action name=\"Execute\"><command>mpc volume 10</command></action>"
echo " </item>"
echo "  <item label=\"Mute\">"
echo "    <action name=\"Execute\"><command>mpc volume 0</command></action>"
echo "  </item>"
echo "</openbox_pipe_menu>"
}


settings()
{
repeatstatus=`mpc | tail -1 | awk -F"   " '{print $2}'| sed 's/r/R/'|sed 's/o/O/'`
randomstatus=`mpc | tail -1 | awk -F"   " '{print $3}'| cut -d ":" -f2 |cut -c 2-| sed 's/o/O/'`

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
echo "<openbox_pipe_menu>"
echo "  <item label=\"MPC Prev\">"
echo "    <action name=\"Execute\"><command>mpc prev</command></action>"
echo "  </item>"
echo "  <item label=\"MPC Play\">"
echo "    <action name=\"Execute\"><command>mpc play</command></action>"
echo "  </item>"
echo "  <item label=\"MPC Pause\">"
echo "    <action name=\"Execute\"><command>mpc pause</command></action>"
echo "  </item>"
echo "  <item label=\"MPC Stop\">"
echo "    <action name=\"Execute\"><command>mpc stop</command></action>"
echo "  </item>"
echo "  <item label=\"MPC Next\">"
echo "    <action name=\"Execute\"><command>mpc next</command></action>"
echo "  </item>"
echo " <separator />"
echo "  <item label=\"$repeatstatus\">"
echo "    <action name=\"Execute\"><command>mpc repeat</command></action>"
echo "  </item>"
echo "  <item label=\"Random: $randomstatus\">"
echo "    <action name=\"Execute\"><command>mpc random</command></action>"
echo "  </item>"
echo "  <item label=\"Launch MPC\">"
echo "   <action name=\"Execute\"><command>urxvt -e \"ncmpcpp\"</command></action>"
echo "  </item>"
echo "<menu id=\"Volume\" label=\"Volume\" execute=\"mpdmenu2.sh 'volume'\" />"  
echo "</openbox_pipe_menu>"
}

playlists ()
{
playlistcount=`awk '{print $1}' "/tmp/.mpdplaylistsmenu"|wc -l`
playlistnames=`awk '{print $1}' "/tmp/.mpdplaylistsmenu"`
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
echo "<openbox_pipe_menu>"
for ((playlistcurrent=1; playlistcurrent <= $playlistcount; playlistcurrent ++))
do 
playlistname=`echo "$playlistnames"|head -$playlistcurrent|tail -1`
echo "<item label=\"$playlistname\"><action name=\"Execute\"><command>mpc clear</command></action><action name=\"Execute\"><command>mpc load '$playlistname'</command></action></item>"
done
echo "</openbox_pipe_menu>"
}

mainmenu ()
{
parse
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
echo "<openbox_pipe_menu>"
nowartist=`mpc current -f %artist% | sed -e 's/\&/&amp;/g'`
nowsong=`mpc current -f %title% | sed -e 's/\&/&amp;/g'`
nowalbum=`mpc current -f %album% | sed -e 's/\&/&amp;/g'`

nowstatus=`mpc -f f | awk '{print$1}'|head -n 2|tail -1 | sed 's/\]//' | sed 's/\[//'| sed 's/p/P/'`
nowtime=`mpc -f f | awk '{print$3}'|head -n 2|tail -1` 
echo " <separator label=\"$nowsong\" />"
echo " <separator label=\"$nowartist - $nowalbum\" />"
echo "<item label=\"$nowstatus - $nowtime\"><action name=\"Execute\"><command>mpc toggle</command></action></item>"
echo " <separator />"

echo " <menu id=\"playlistmenu\" label=\"Playlists\" execute=\"mpdmenu2.sh 'playlists'\" />"

echo " <menu id=\"artistmenu\" label=\"Artists\" execute=\"mpdmenu2.sh 'getartist'\" />"  
	
echo " <menu id=\"controlmainmenu\" label=\"Control Panel\" execute=\"mpdmenu2.sh 'settings'\" />"  


echo "</openbox_pipe_menu>"

#for ((currentartist=1; currentartist < $artistcount; currentartist++))
#do
#done

}
if [ -z "$1" ]
then
mainmenu
fi

if [ "$1" = getartist ]
then	
   makeartist "$1" "$2" "$3"
fi

	if [ "$1" = getalbums ]
	then
   	getalbums "$1" $2 "$3"
	fi
	
		if [ "$1" = getsongs ]
		then
		getinfo "$1" "$2" "$3"
		
		
		fi
	

		if [ "$1" = settings ]
		then
		settings
		
		
		fi
	
		if [ "$1" = playlists ]
		then
		playlists
		
		
		fi
	
Apparently I was so proud of this that I emailed it to my friend.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

to make up for the lack of USER AIDS I downloaded lispworks personal edition and made a button that pops up a dialog box containing goatse

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
i wrote a cool recursive algorithm that walked a horrific db and it ran super fast in linqpad

when I put it in the controller it takes like 5 minutes

hjalp

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
i suspect anonymous types, iis express, or my own personal failings

also recursion

Luigi Thirty
Apr 30, 2006

Emergency confection port.

you should be able to profile even IIS stuff if you have the Microsoft symbol pack

why an algorithm would be 50 times slower in VS than Linqpad I have no idea

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Luigi Thirty posted:

you should be able to profile even IIS stuff if you have the Microsoft symbol pack

why an algorithm would be 50 times slower in VS than Linqpad I have no idea

linqpad is really good and iis is very bad is my assumption. I was also running the query against a remote db rather than local but the time diff is still nuts when I ran against the remote db in linqpad (17s remote, 2s local, over 5 minutes in iis)

jony neuemonic
Nov 13, 2009

MALE SHOEGAZE posted:

I found the first > 10 loc program I ever wrote:



And now you can try it yourself.

Apparently I was so proud of this that I emailed it to my friend.

better than a lot of what i deal with professionally, tbh.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
I wish I could find a copy of the game I wrote in mirc script :(

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

uncurable mlady posted:

linqpad is really good and iis is very bad is my assumption. I was also running the query against a remote db rather than local but the time diff is still nuts when I ran against the remote db in linqpad (17s remote, 2s local, over 5 minutes in iis)

Is your local database on a SSD while the remote one is on spinning platters?

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer
I dug up the "text adventure" I wrote in TurboPascal in 10th grade. I didn't know anything about non-array data structures or about loading from/saving to files so the entire game map is encoded as several hundred methods. Each method does the following:
1)Print a description of where you're standing
2)Perform a random number generation to determine if you are attacked by a monster, initiate battle engine if so.
3)State which directions you can go in, prompt for input.

Each method then simply called the method that represented the "cell" in the direction you wanted to go in. The map was close to 500x500 cells (I drew it in Excel to use as a reference while I coded). Also no validation of any input at any point. I spend close to 50 hours over thanksgiving weekend coding the stupid thing, and the file got so big that I exceeded the maximum line count TurboPascal for Windows could handle and had to switch to Borlean's shareware DOS pascal IDE (I hadn't learned about header files yet either).

Bloody
Mar 3, 2013

sounds like a text rpg thing I made in Java in high school it was bad

lord of the files
Sep 4, 2012

things I didn't expect to see in this decade: Perl 6 ✔

shall i dare ask for Half Life 3?

http://www.pigdog.org/auto/software_jihad/link/3138.html

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I think I found a use for lisp

using magit to simplify my stupid loving git workflow down from a shell, a program, and 3 shell scripts down to alt+shift+hyper+meta UPDATE MY REPOSITORY

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

MALE SHOEGAZE posted:

I found the first > 10 loc program I ever wrote:




And now you can try it yourself.

I'm surprised that you used functions

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Luigi Thirty posted:

I think I found a use for lisp

using magit to simplify my stupid loving git workflow down from a shell, a program, and 3 shell scripts down to alt+shift+hyper+meta UPDATE MY REPOSITORY

welcome to the best editor

gonadic io
Feb 16, 2011

>>=
God scalas type inference is just incredibly broken. Functions like compose and tupled just might as well not exist for all the good that they do

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Dessert Rose posted:

welcome to the best editor

now as soon as I figure out how to trap the error generated by magit-stash if there are no local changes so my awesome key command continues without stashing or unstashing I'll be in business :mad:

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today

Luigi Thirty posted:

now as soon as I figure out how to trap the error generated by magit-stash if there are no local changes so my awesome key command continues without stashing or unstashing I'll be in business :mad:
Maybe it would be easier to check if there are local changes and only then call magit-stash.

triple sulk
Sep 17, 2014



gonadic io posted:

God scalas type inference is just incredibly broken. Functions like compose and tupled just might as well not exist for all the good that they do

its a bad language, op

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Nitrocat posted:

things I didn't expect to see in this decade: Perl 6 ✔

http://www.pigdog.org/auto/software_jihad/link/3138.html

ugh all that metaprogramming poo poo. uuuuuuuuugh

Shaggar
Apr 26, 2006

gonadic io posted:

God scalas type inference is just incredibly broken. Functions like compose and tupled just might as well not exist for all the good that they do

why would you use scala when you could just use java?

Share Bear
Apr 27, 2004

Shaggar posted:

why would you use scala when you could just use groovy?

:3

cowboy beepboop
Feb 24, 2001

MALE SHOEGAZE posted:

ugh all that metaprogramming poo poo. uuuuuuuuugh

it's so gross. perl please die faster

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Ralith posted:

Maybe it would be easier to check if there are local changes and only then call magit-stash.

yes. yes it was. now i can press M-c c in an emacs window instead of punching a bunch of poo poo into a git console. turns out adding new commands to this thing is easy.

Elder Postsman
Aug 30, 2000


i used hot bot to search for "teens"


are you posting from inside my company

Bloody
Mar 3, 2013

I really like linq stuff for collections in c# but am currently doing a thing in python because numpy/scipy/etc. I wanna use python collections good and preferably in a way similar to linq. Is this a thing and how

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Bloody posted:

I really like linq stuff for collections in c# but am currently doing a thing in python because numpy/scipy/etc. I wanna use python collections good and preferably in a way similar to linq. Is this a thing and how

this? https://github.com/heynemann/pynq/wiki

quote:

Microsoft created Linq (Language Integrated Query) using Expression trees, which is a math concept on how to parse operations into trees in a way that you can analyze the operations independently from the result.

Pynq is an implementation in Python of the Expression Tree theory and some of the providers. There will be more providers gradually, but Pynq will strive to make it as easy as possible to write your own provider.

Bloody
Mar 3, 2013

Oh

http://mark-dot-net.blogspot.com/2014/03/python-equivalents-of-linq-methods.html

Ugh

This is so much shittier

Maybe I should just port numpy to c# instead

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Luigi Thirty posted:

No USER AIDS. I tried. :rip:



I'll dig through my working copy and see what I had to tweak, I'm sure there was something straightforward

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Shaggar posted:

why would you use scala when you could just use java?

when u can't use Java 8

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Luigi Thirty posted:

yes. yes it was. now i can press M-c c in an emacs window instead of punching a bunch of poo poo into a git console. turns out adding new commands to this thing is easy.

you should see how commands worked in the Symbolics Dynamic Listener and CLIM

commands along with descriptions of the types of their arguments are described independently from how they're invoked so they can be represented by menu items, or by automatic completion on the command line, or by picking from a pop-up window or other UI widget, or just supplied by clicking on any other things of the right type on-screen

way more awesome than emacs

Corla Plankun
May 8, 2007

improve the lives of everyone

Bloody posted:

Oh

http://mark-dot-net.blogspot.com/2014/03/python-equivalents-of-linq-methods.html

Ugh

This is so much shittier

Maybe I should just port numpy to c# instead

what are you trying to do exactly? because most of that looks less convenient in c# if you skip the parts about itertools

which you should, because the itertools module's only valid use case is making stack overflow answers long enough to submit

also that writer is really bad at python and misses a lot of easy similarities

Luigi Thirty
Apr 30, 2006

Emergency confection port.

eschaton posted:

you should see how commands worked in the Symbolics Dynamic Listener and CLIM

commands along with descriptions of the types of their arguments are described independently from how they're invoked so they can be represented by menu items, or by automatic completion on the command line, or by picking from a pop-up window or other UI widget, or just supplied by clicking on any other things of the right type on-screen

way more awesome than emacs

:eyepop:

eschaton posted:

I'll dig through my working copy and see what I had to tweak, I'm sure there was something straightforward

for some reason the arch was set to pentium3. I had to set it to x86-64 to get it to compile. I get to a diagnostic screen but when it tries to boot from the disk i just get a black screen.

I am only on the surface of Richard Stallman's monument to autism but I like how extensible it is

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
Doesn't CLIM still sort of work on modern Common Lisp implementations?

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

Corla Plankun posted:

what are you trying to do exactly? because most of that looks less convenient in c# if you skip the parts about itertools

which you should, because the itertools module's only valid use case is making stack overflow answers long enough to submit

also that writer is really bad at python and misses a lot of easy similarities

it probably isn't hard in python but I do not know how to do things

I have a collection of tuples. I want to take the subset of tuples where item 1 is equal to 2 and then apply a function to item 2, yielding a new set
in c# I'd do something like
var result = collection.where(e => e[0] == 2).select(e => function(e[1])

how do I do that in python in a way that isn't gross I know it has map and filter and fold and whatever but like how do I use them good

  • Locked thread