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
Sapozhnik
Jan 2, 2005

Nap Ghost
i'll be honest if python's standard library wasn't such a loving disorganised mess I'd probably use python more

yes let's mix every identifier capitalisation style ever. also let's have "pickle" and "cpickle" and the only difference between the two is that the second has a faster(?) underlying implementation. ok chief.

also the GIL is frankly shameful.

basically what i'm saying is that i'm a mong

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost

quote:

UML

:stare:

quote:

Haskell

Ah yes, functional programming.

I think I'll bake a cake. How do you think I formulate this problem in my head:

1. Grab bowl and ingredients, start the oven heating up in the background
2. Add flour, sugar, eggs, etc to bowl
3. Stir until consistent
4. Wait for oven to get hot if it isn't already
5. Insert dough into oven, wait X minutes

or:

Let F(tau, xi, aleph, B, W, w1, w2, n) be a regular functional of the third kind from the domain of all functions on the finite Abelian field blah blah blah blah blah p.s. monads

yeah no

Sapozhnik
Jan 2, 2005

Nap Ghost
um doesn't setting a condition variable require a syscall? :confused:

0MQ looks kinda kewl tho

Sapozhnik
Jan 2, 2005

Nap Ghost
oh wow Python 3 is actually quite nice.

Sapozhnik
Jan 2, 2005

Nap Ghost
I was gonna write some code, but then I got high
I was gonna wait for Eclipse to load, but then I got high
My test cases are broken, and I know why
Because I got high, because I got high, because I got high

Sapozhnik
Jan 2, 2005

Nap Ghost
uh but the one thing I don't like is how they deprecated formatting using the % operator

"string literal".format(blah, blah) just looks hella gross.

It's like how Ruby lets you do stuff like 1234.butt() and then acts like that's a good thing.

Sapozhnik
Jan 2, 2005

Nap Ghost

Fren posted:

how is it any different from "butts".upper()

it isn't, both are terrible.

Sapozhnik
Jan 2, 2005

Nap Ghost
bitch you best step off i'mma loving cut you

Sapozhnik
Jan 2, 2005

Nap Ghost
Hey AV go read the following poo poo on Wikipedia

Data structures:
- Dynamic arrays
- Linked lists
- Hash tables
- Heaps (n.b. not 'the dynamic memory pool', the data structure)
- Binary trees (and the main ways to make them not suck: AVL Trees and Red-Black trees. Do not attempt to implement the latter, it is painful).

Algorithms:
- Binary search
- Heapsort (you know about heaps now so this is ez)
- Quicksort
- Insertion sort (token 'suboptimal' example that's fast on 'small' lists)

Concurrent programming:
- Threads
- Mutexes
- Condition variables

Maybe optionally learn how malloc()/free() actually work as well and maybe what a cache line is.

Congratulations, that probably took you a week or two and this is like 99% of the actual theory that you need to know for professional programming, not including writing more than a few thousand LOC without it turning into an incomprehensible soup, and that's craft and not science so it simply takes practice. Also everyone disagrees on how best to do it and everyone thinks everyone else sucks at it anyway.

Oh yeah Wikipedia goes out of its way to explain things in the worst way imaginable so maybe read this poo poo somewhere else idk.

Sapozhnik
Jan 2, 2005

Nap Ghost

ppp posted:

it just works. but i have no clue how *le random flash 0day exploit, steals my le ramz* - failcat

reddit raus

Sapozhnik
Jan 2, 2005

Nap Ghost
kill everybody

Sapozhnik
Jan 2, 2005

Nap Ghost
So I just learned that Python iterators throw an exception to indicate end of sequence

what the gently caress kind of amateur hour horse poo poo is this

Sapozhnik
Jan 2, 2005

Nap Ghost
It wouldn't have been hard to retrofit a non-retarded behaviour in Python 3, either, just add a has_next or __has_next__ or whatever method to the iterator protocol and then keep the existing StopIteration behaviour as a genuine "you did something you weren't supposed to do, bonehead" exception, albeit a poorly named one. Even a __boolean__ coercion, while kinda terrible, would have been better than just leaving that wtf in its current form.

Sapozhnik
Jan 2, 2005

Nap Ghost

Shaggar posted:

java is the only language i've used that does exceptions correctly.

I know I'm probably being trolled but this is actually true

Checked exceptions are an excellent thing when they're (a) optional and (b) structured correctly (read: have a common base class if methods tend to throw three or four of them).

Java has a useful level of covariance and contravariance as well, which is nice.

I just don't like duck typing in general. I mean, strong typing turns a big class of runtime errors into compile errors for not too much hassle, those types give you hyperlinks around the codebase for free, and it's just easier to see what's going on and what the collaborators are in general.

I'm trying to fix some stupid loving Python library at the moment and having types in the signatures would be really loving useful, since I can look at a line of code like butt.poke() and have a reasonable chance of actually finding where the implementation of poke() is located.

Basically Python is cute but I'm not convinced it scales. Sometimes repetition is a necessary price for clarity, as long as the compiler enforces the correctness of that repetition I don't see what's wrong with it.

Sapozhnik
Jan 2, 2005

Nap Ghost
there is no way in hell i would use c++ for anything willingly. ever

c is an altogether different story

optional as in some exceptions can be checked and some exceptions can be unchecked because they represent different categories of exceptional condition

and in either case exceptions should be exceptional. i.e. it should be possible to use a program in every possible intended way without exceptions being thrown inside it, anything else is just incredibly lazy poo poo design.

also not all large software is middleware and separation of concerns is a thing so i'd rather not learn how an entire gigantic codebase works if i just want to alter some small piece of it

(cute is probably an overly negative and dismissive adjective to use to describe a programming language. pretend I said "elegant")

Sapozhnik
Jan 2, 2005

Nap Ghost
if you are iterating over something that's simultaneously changing while you're iterating over it then an iterator is probably not exactly the tool you want. no commonly used I/O system lets you send something to someone and then subsequently change your mind and un-send it. also if you really wanted to abuse iterators for I/O (let's make these completely different things look exactly the same) then you'd probably make next() block or something and only make has_next() return false on EOF.

if it isn't changing while you're iterating over it then constant data can't very well have a race condition can it (please don't bring up concurrent splay trees or something stupid like that)

C++ (ew) makes iterators pointer-shaped. Java's iterator interface uses hasNext() and next(). Literally every other imperative language with iterators manages to do this just fine without needing to use nonlocal jumps. Stop making up ridiculous contrived what-if cases to justify this design decision please.

Sapozhnik
Jan 2, 2005

Nap Ghost
tef is like the ultimate YOSPOS hipster

yeah i'm into some p obscure software engineering philosophies you've probably never heard of them

i'll leave you with this: the same people who propose new langauges/operating systems to solve all the ills of the programming world are the same ones who propose forming new political parties to solve the ills of the physical one

people's front of judea etc

Sapozhnik
Jan 2, 2005

Nap Ghost
I think Cincinnatus was the most well-known example, though that wasn't so much a case of "Yo you guys suck and i'mma fix your poo poo" as "omg we suck plz fix our poo poo". twice.

but yeah SOPA thread is thataway

Sapozhnik
Jan 2, 2005

Nap Ghost
embedded programming is really fun and everyone should try it sometime

provided that you get to use nice hardware anyway. which is approximately never. so ok, stay out it's terrible (i'm lucky, i get to use nice hardware)

Sapozhnik
Jan 2, 2005

Nap Ghost
univ. of edinburgh has the computer science ("informatics") building in the liberal arts campus and all the other engineering stuff way outside town in the science campus

i think they have the right idea

Sapozhnik
Jan 2, 2005

Nap Ghost
If you develop Win32 software using anything whatsoever other than the WDK then you're doing it wrong

visual studio was good back in the Visual C++ 6.0 days and then it got overrun by stupid training wheels for baby languages

Sapozhnik fucked around with this message at 14:23 on May 27, 2012

Sapozhnik
Jan 2, 2005

Nap Ghost
perl is awful, never write anything new in perl that doesn't fit on your screen

Sapozhnik
Jan 2, 2005

Nap Ghost
Scheme looks really neat, i like simple and elegant things so i think i might like Scheme.

YOSPOS plz tell me why Scheme sucks because I don't want to waste a year of my life learning it only to inevitably come to the conclusion that it sucks when i could spend that time eating lard and watching anime instead

Sapozhnik
Jan 2, 2005

Nap Ghost
GNU make owns. The whole "ASCII TABs serve a distinct and crucial purpose in the grammar of this language and ok that was kind of a bad idea in hindsight but I've already got ten users now so welp" thing is unfortunate, but basically anyone who attempts to make an alternative to make because "make sucks" usually doesn't actually understand make and just creates something far less flexible and not that much easier to use.

Write a small set of macros to drive the whole process in a master GNUmakefile and then make some Module.mk files or whatever in your source tree that look like

code:
libraries      += peepee doodoo
programs       += badposter

fart_SRC       := fart.c butt.c

doodoo_SRC     := android.c

badposter_LIBS := -lpeepee -ldoodoo
badposter_SRC  := getout.c
and dependencies are handled automatically and you can tweak the actual build process to you're hearts content.

Sapozhnik
Jan 2, 2005

Nap Ghost
also is there a word for when someone uses an imperative language to do declarative things (e.g. Scons, writing key-value configuration files in Lua) because holy poo poo i hate that. HTML templating languages are acceptable but every other such usage needs to die.

Sapozhnik
Jan 2, 2005

Nap Ghost

Internaut! posted:

I know there's all sorts of object relational frameworks and approaches out there, what's considered today's best of breed in c++/java land?

I used toplink in a project once years ago and it was great for the developers but the dba shook his head at the plans

none, they're all horrible. ORMs are like C++ in the sense that it looks great when your project is still in its nascent state, but by the time you realise how truly hosed you are it's impossible to get rid of.

personally i did a thing in Java where I can just define Java interfaces with some light annotations and then there's this thing that takes the Class of that interface and gives you back a proxy object. Method calls on that proxy object get transparently turned into stored proc calls and result sets get turned into Java scalars or Lists of beans or w/e. imho this mini-framework seriously fucen owns for my particular application (a butt store) but it certainly isn't a one-size-fits all kind of deal.



The best part of it is that there is no code generation involved. C# has no equivalent functionality, which is a bit of a pity.

Sapozhnik fucked around with this message at 17:30 on Jul 15, 2012

Sapozhnik
Jan 2, 2005

Nap Ghost
Sounds like a wordier version of my solution tbh. This doesn't need mapping files, there's these things called annotations that have been around for almost ten years now that do the job just fine.

I kinda sidestep the transaction thing by just running each SP in its own transaction but this could be integrated fairly easily into JTA i suppose.

Spring has seriously gone off the deep end lately, though. I mean first you have this AOP insanity which means that changing the name a method can change its semantics in a manner that's defined in some file on the other side of the planet code base, god drat is that an insanely bad idea.

Then they decided that autowiring is awesome because a bloo bloo bloo typing is hard. Except now you have objects of class X connected to objects of class Y and you have absolutely no idea how it got that way short of searching for all implementations of an interface within your codebase or something.

I have no idea why they'd do either of these things, it's like they're actually trying to make your codebase incomprehensible so that when everything finally goes completely pete tong you have to hire their consultants to help you... oh.

Basically writing my own YAML-based IoC thing to replace Spring in my project is now sitting on my to-do list.

Sapozhnik
Jan 2, 2005

Nap Ghost
Oh yes I forgot this is Java where you need a framework to abstract out what framework framework you are using.

I have a front servlet that has a hard dependency on Free marker and a bidirectional URL mapping scheme that I wrote, I bet it gives people like that conniption fits


Also stop saying "c/c++" please they are not the same thing. "As a man of wealth and taste I enjoy drinking fine scotch/my own urine"

Sapozhnik
Jan 2, 2005

Nap Ghost
ESC? oh, you mean Ctrl-[ :smug:

(Ctrl-P triggers VIM's built-in fake intellisense thing though and it is tres annoying)

Sapozhnik
Jan 2, 2005

Nap Ghost
i like how everyone itt likes to periodically jizz over the D Language Forum's performance, and my Java web thing is pretty much that fast and i don't even do anything terribly clever with it (there's a bunch of memcached hooks in the code but i haven't actually got around to writing a Cache impl that actually remembers anything. i prob never will because tef says cache invalidation is Hard and tef is always right)

postgres and the jvm ft loving w

Sapozhnik
Jan 2, 2005

Nap Ghost
I keep thinking that one of these days there'll be an OOP anti-fad and we can all get that nonsense behind us but nope, 30 years in and here we are.

Still, we are at least kinda sorta coming around to the idea that C++ is a Bad Programming Language, so there may be some hope yet.

Sapozhnik
Jan 2, 2005

Nap Ghost
How to do Java web deployment (for babbys)

1. mvn package
2. Copy target/butt-store.war to ur live Tomcat instance's webapps directory

I mean I'm not sure how that could possibly be any more straightforward, it really is p sweet. You can't SCP it straight to the webapps directory, you have to SCP it somewhere else and move it first (otherwise it'll try to deploy a partially-transferred WAR and that way lies 503 errors and lots of frantic scrambling). But apart from that it's p sweet. You might be thinking of that old shambling EJB poo poo but lmao if you think anyone uses that anymore. I don't even see the point in using JSP these days, because even with the JSTL it's wordy as fuc and Freemarker is just better.




Java owns, Postgres owns. Kill all MySQLs ever, it is an embarassment.

Sapozhnik
Jan 2, 2005

Nap Ghost

homercles posted:

$ mvn package
> DOWNLOADING THE INTERNET
> COMPILING SOME STUFF
> DOWNLOADING MORE INTERNET
^C^C^C^C^C
> CANT LET YOU DO THAT DAVE
> COMPILING STUFF I DONT EVEN NEED EAT A HOT BOWL OF DICKS DAVE
> DOWNLOADING TUCOWS LOL


welp guess i suck at maven

apparently so because it does that once ever and then it caches it all in your ~/.m2 directory?

Sapozhnik
Jan 2, 2005

Nap Ghost
I can't get the tomcat admin app to work on my live server lol. and i don't particularly want to risk extended downtime by loving around with it right now. it's some class path poo poo (needs a special class loader to gain super admin powers and the option that says it enables that doesn't actually seem to enable it)

so I just push things using SCP/mv like a big god drat idiot

deployment over HTTPS to an admin web service would be p sw8 tho.

Sapozhnik
Jan 2, 2005

Nap Ghost
Currently looking at maybe throwing ZeroMQ into the mix so that I can have a middle tier (i have two HTTP things, wanna add a middle tier to do caching and pub/sub between them).

ZeroMQ looks really nice but the ~hilariously zany~ documentation is kind of annoying. "hello sir can i interest you in building your business on top of a middleware package that was written by a gigantic man child?"

does anyone have any experience with it?

Sapozhnik
Jan 2, 2005

Nap Ghost
pub-sub doesn't really map well to rest

Sapozhnik
Jan 2, 2005

Nap Ghost

tinselt0wn posted:

why would you waste time compiling code when scripting has surpassed all compiled code except for a few edge cases that require speed

compiled code tends to be statically typed, static typing catches typos

Sapozhnik
Jan 2, 2005

Nap Ghost
i should write a high frequency trading sniping algo

in prolog

Sapozhnik
Jan 2, 2005

Nap Ghost

tef posted:

this is where the tight coupling happens - without a common message format, it is hard to build reusable middleware. without self descriptive messages, it is hard to build loosely coupled components.

Neither ZMQ nor HTTP has a defined payload format, what makes them different?

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
don't learn to program in java

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