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.
 
  • Post
  • Reply
coaxmetal
Oct 21, 2010

I flamed me own dad
ok how about expresso

Adbot
ADBOT LOVES YOU

coaxmetal
Oct 21, 2010

I flamed me own dad

tinselt0wn posted:

im "learning" j again

quicksort=: (($:@(<#[) , (=#[) , $:@(>#[)) ({~ ?@#)) ^: (1<#)

suck it legibility havers

I don't like this. :mad:


Same with poo poo like fancy perl oneliners. If its hard to tell what the code actually does then its lovely code imo.

coaxmetal
Oct 21, 2010

I flamed me own dad
clrs was the textbook for my algorithms class.



Its probably the textbook for a lot of algorithms classes.

coaxmetal
Oct 21, 2010

I flamed me own dad
clrs is also available for free if you know where to look. I rarely pay for textbooks.

coaxmetal
Oct 21, 2010

I flamed me own dad

MononcQc posted:

While we're in algorithm talk, I'd like to ask if anyone has a few tips here.

I'm working on doing some advertisement targeting at the moment and I've been working on implementing Interval IDs to evaluate Boolean Expression Trees (PDF) to allow me to do some nifty efficient arbitrary matches, getting close (~3x) to compiled-code speed when interpreted on a few reasonable queries.

The problem I foresee is that it's still gonna be lovely expensive to run this stuff over hundreds of thousands of candidates. I was wondering if anyone working in different areas had similar problems of doing complex matching (hard to index) over medium-sized to large data-sets with ideally sublinear complexity, and if so, if you'd have any pointers :3:.

It seems to me pub/sub problems are somewhat similar, as well as match-making for dating sites or online games and whatnot. I'm sadly under low-latency constraints (under 20-30ms if possible), but any source of inspiration is welcome.

have you tried mongo db? It's web scale you know.

coaxmetal
Oct 21, 2010

I flamed me own dad
I can see the reasoning behind 0 being true, but having it false is still super convenient.

coaxmetal
Oct 21, 2010

I flamed me own dad

ahhh spiders posted:

in what context

doing something if something is or isn't 0, or looping while something isn't 0, or checking if something returns 0, is really common.

coaxmetal
Oct 21, 2010

I flamed me own dad

ahhh spiders posted:

not in lua, because you wouldn't do those retarded C things in lua

you don't work with numbers? weird.

coaxmetal
Oct 21, 2010

I flamed me own dad
this thread sucks now

coaxmetal
Oct 21, 2010

I flamed me own dad
last bunch of pages have all been "my language is better because *faaaaart" and I hear that all the time so if everyone could either shut up, start posting constructively or at least entertainingly (lol like that's gonna happen) or if we could get this shitheap closed, that would be cool.



just stop flinging poo poo and nothing else yall, if you are going to fling poo poo at least fling something interesting too. Are we out of interesting things to fling? (I sure am)

coaxmetal
Oct 21, 2010

I flamed me own dad

rotor posted:

how about you shut the gently caress up

sorry, that was a drunkpost.



carry on thread, i'll quit bitching.

coaxmetal
Oct 21, 2010

I flamed me own dad
shaggar and tbc are way more entertaining than sulk

coaxmetal
Oct 21, 2010

I flamed me own dad
remember that one time when tbc talked about security and it was really funny.

shaggar was probably funny once too.

coaxmetal
Oct 21, 2010

I flamed me own dad

Sweevo posted:

shaggar, like a stopped clock is right twice a day

tbc has a php script which moves the hands whenever the clock gets too close to being correct

sometimes it doesn't work because its php, but when that happens the whole hting just fails and doesn't inform the user so just vomits up random posts.

coaxmetal
Oct 21, 2010

I flamed me own dad
someone give me an idea for a cool (and maybe useful???) thing to do wiht haskell so I have a reason to mess around with haskell again tia

coaxmetal
Oct 21, 2010

I flamed me own dad

tef posted:

buttbot is yet to be ported to haskell :eng101:

that actually sounds like a thing that might be fun to do, a relearn me some haskell project.

coaxmetal
Oct 21, 2010

I flamed me own dad

JawnV6 posted:

yeah string-heavy programthat relies on a perl library SOUND LIKE FUN HASKELLIN

yea but there are butts

coaxmetal
Oct 21, 2010

I flamed me own dad

Markov Chain Chomp posted:

bytes are not integers and i will fight anyone who says otherwise

well duh, iirc ANSI C doesn't specify a byte type, the 8 bit numeric (integer) type is char

coaxmetal
Oct 21, 2010

I flamed me own dad
python uses exceptions for control-flow sometimes. It works. Takes a bit of getting used to if you are used to thinking of exceptions as always bad instead of just another tool.

coaxmetal
Oct 21, 2010

I flamed me own dad

Werthog posted:

this is getting pretty old, this isn't even shaggaring anymore. put some effort into it

coaxmetal
Oct 21, 2010

I flamed me own dad

tef posted:




ahahahahahaha

coaxmetal
Oct 21, 2010

I flamed me own dad

Shaggar posted:

lol thats awful

can you elaborate on exactly why it is awful? tia

coaxmetal
Oct 21, 2010

I flamed me own dad

Shaggar posted:

because 1 its ordering on the natural order of butt which isnt the same as a comparator. 2 if you're using a comparator in a bunch of different locations and need to update the logic you do it inside the comparator and you're done. in your shitlanguages you'd have to search and replace for all your compares. 3 the java is far more readable than gross rear end shitlanguages

1 is a valid point since you might not always want to sort on the natural order (usually us), but at least the python sort implemention can take an optional cmp argument that specifies a comparator function. That also solves 2, or you can just put the sort in its own function. 3... is debatable. I think key=[function] and cmp=[function] is perfectly understandable unless you are really dumb.

The java way works but the ability to easily sort any list by an arbitrary key is pretty cool since usually that's the kind of sorting you do anyway.

coaxmetal
Oct 21, 2010

I flamed me own dad

BonzoESC posted:

does python have both comparator sort and a schwartzian transform sort-by method

the same sort method (either sorted(list) or list.sort(), they do the same thing) can take a key function, which will sort by that key, or a cmp funtion, which specifies a comparator. In general a key is prefered because it's faster. You can also tell it to give the reverse if you want.

coaxmetal
Oct 21, 2010

I flamed me own dad

BonzoESC posted:

"In Python 2.4 and above, both the sorted() function and the in-place list.sort() method take a key= parameter that allows the user to provide a "key function" (like foo in the examples above). In Python 3 and above, use of the key function is the only way to specify a custom sort order (the previously-supported comparator argument was removed)."

i guess that's "the new way" or maybe "the only way" now

well the only way in python 3 I guess. I didn't know they removed it, neither did anyone else I guess, nobody uses python 3 :frogbon:

coaxmetal
Oct 21, 2010

I flamed me own dad

Shaggar posted:

function pointers make me want to vomit

oh yea that reminds me that functions and methods not being first-level objects in java is dumb

coaxmetal
Oct 21, 2010

I flamed me own dad

Lysidas posted:

shaggar how do you feel about other callables that aren't technically functions :allears:

code:
In [1]: class Adder:
   ...:     def __init__(self, value):
   ...:         self.value = value
   ...:     def __call__(self, other):
   ...:         return self.value + other
   ...:     

In [2]: four = Adder(4)

In [3]: four(5)
Out[3]: 9

ducktyping is cool

coaxmetal
Oct 21, 2010

I flamed me own dad
shagger doesn't like it but he doesn't actually have a good reason not to like it because functions and callables as first-level objects is actually really handy and hes just shaggering

coaxmetal
Oct 21, 2010

I flamed me own dad

ahhh spiders posted:

wahts that have to do with duck typing

it's a callable because it has the __call__ attribute

coaxmetal
Oct 21, 2010

I flamed me own dad
if you understand how objects work it actually makes perfect sense!

coaxmetal
Oct 21, 2010

I flamed me own dad

ahhh spiders posted:

wouldn't that just be operator overloading

what? idk how operators come into the picture here.

functions are equivalent to objects with a __call__ attribute as far as python is concerned, it's not overloading the () operator. Function/methods are just one type of callable. so are ducks. It's p simple. Quack. You could make a duck that was callable and iterable!

coaxmetal
Oct 21, 2010

I flamed me own dad

ahhh spiders posted:

the function call operator. calling a function is an operation on the function

I know I addressed that, jeez.


Rufo what's CSP?

coaxmetal
Oct 21, 2010

I flamed me own dad

Wheany posted:

Oh no, the threads are no longer normalized....

coaxmetal
Oct 21, 2010

I flamed me own dad
that's stuff wasn't required for cs at all at my uni but I started as a physics major as well so I took through diff eq anyway.


I don't remember a lot of how to do diff eq, but I did calc for long enough (learned it in HS first) that I still remember it.

coaxmetal
Oct 21, 2010

I flamed me own dad
I deffo don't remember ANYTHING about solving pde's.

coaxmetal
Oct 21, 2010

I flamed me own dad

Ridgely_Fan posted:

i remember the pde stuff that was basically breaking stuff down to fourier components after separation of variables, but i would have a hard time solving an ode by hand

irl if i got asked to analyze a system of differential equations i would immediately go to graphical methods

yea I remember being taught a bunch of techniques to analytically solve certain classes of ODEs by hand and I don't remember any of them and probably wouldn't have used them much anyway. THat class was neat though, also taught numerical analysis and ~computer~ methods.


oh yea also since you mentioned fourier there is the laplace transform I might be able to remember that if I looked some stuff up about it.

I do remember what the fourier transform is, if not how to do it analytically, because it's super useful.

coaxmetal
Oct 21, 2010

I flamed me own dad

Rufo posted:

calculus is terrible but you need to earn the right to say so

I kind of actually think calculus is pretty rad and useful even though I don't use it in what I do anymore :frogbon:

coaxmetal
Oct 21, 2010

I flamed me own dad

bob arctor posted:

i hated calculus it was the only subject that got in the way of my drinking.

a mathematician walks into a bar, he orders a beer. Another mathematician walks in, he orders half a beer. Another one walks in, orders a quarter beer. Another one, and Eighth of a beer. The bartender says gently caress you and pours 2 beers.


the moral of the story is that mathematician jokes aren't funny + if infinity mathematicians come into your bar and order 2 drinks total they are assholes and also you probably exceeded the occupancy limit of the bar and the fire dept will get pissed.

Also they probably drink a lot more than that.

coaxmetal
Oct 21, 2010

I flamed me own dad
unless they tip well, like if you get a dollar per drink, regardless of drink size, that's infinity dollers, and only the federal reserve has that much.

Adbot
ADBOT LOVES YOU

coaxmetal
Oct 21, 2010

I flamed me own dad

Jonny 290 posted:

[ASK] me about this really depressing theory I have that humans are literally nothing more than bags of water and lookup tables that spend most of their time and resources and life building up one database of i/o but actually only take action when they receive input from another, much smaller and more critical set of inputs



are we talking just key/value pairs or a proper relational db? Really what im saying is are humans webscale?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply