HN user

sizzla

37 karma
Posts0
Comments29
View on HN
No posts found.

If you want to be terse, you can just use typedefs but most of ISO C++03 libraries just assume your editor can autocomplete quickly. The culture is different and absolute clarity is preferred over terseness.

There's a lot of infrastructure behind MapReduce and I bet you any implementation is going to have a lot more code in it than what is in Data.List.

Once things are in RAM (say, less than 1 GB), quicksort is the fastest algorithm (Edit: or some other optimized in-place variation on the theme such as introsort). You can parallelize across cores all you want but all that is going to do is crap up your caches and cause bus contention, making your code more complex and slower. The bottleneck is your databus not the CPU, after all what is the cost of a compare in clock cycles? This is also why mergesort is slower and parallelizing is not going to fix it.

If you want to see things that are parallelizable check out vectorizing libraries such as Thrust that run on massively parallel GPGPUs that have the bus design and RAM to handle that kind of parallelization. They are written in C++ and both the implementation and the code to use them looks almost the same like the code I posted. The compiler technology of other languages is years behind and currently can't even target these kinds of architectures.

I've seen GPU massive parallelization in Haskell and all it did was to generate C code and then invoke the CUDA compiler. This was in a research paper. In the meantime you can fire up nvcc with Thrust and sort bazillion of keys with less than 10 lines of code in C++ using a well-tested library.

Edit: BTW, anyone (and I really don't know who would be doing this) who is even thinking of running a MapReduce Haskell cluster must have lots of free time and $$$ to burn on wasted CPU cycles.

BTW my recommendation is to take a look at a 21st century file not on the page first: 25C3: Everything about the C64 in 64 minutes: http://chaosradio.ccc.de/25c3_m4v_2874.html

OK, fixing the links by typing the basenames into Google. I better see some HN C64 intros.

Emulator FAQ - works: http://www.fairlight.to/docs/faq.html

Beginners guide to emulators - broken, get VICE or Frodo and be done with it

C64 Memory Map - http://www.pulia.nu/doc/c64/Docs/Misc/C64/Misc/c64-memorymap...

C64 I/O map - http://www.pulia.nu/doc/c64/Docs/Misc/C64/Misc/c64-io.html

C64 RAM map - http://www.pulia.nu/doc/c64/Docs/Misc/C64/Misc/c64-ram.html

C64 ROM map - http://www.pulia.nu/doc/c64/Docs/Misc/C64/Misc/c64-rom.html

C64 Kernal ROM version description - you dont need this yet

C64 ROM disassembly - http://www.ffd2.com/fridge/docs/c64-diss.html

All about your 64 - http://www.the-dreams.de/aay.html

REU Programming - http://codebase64.org/doku.php?id=base:reu_programming

REU Registers - http://codebase64.org/doku.php?id=base:reu_registers

1541 ROM dissassembly - http://www.ffd2.com/fridge/docs/1541dis.html

C64 User's Guide - http://project64.c64.org/hw/c64usg10.zip

C64 Programer's Reference Guide - http://project64.c64.org/hw/c64prg10.zip

Mapping the C64 - http://www.oocities.com/white-flame/files/c64/mapthe64.zip

VIC docs - works: http://www.fairlight.to/docs/text/vic.txt

Formats - works: http://www.fairlight.to/docs/text/formats.zip

Tools - all links work:

Manuals for Omikron Turbo Assembler, etc: links work: http://www.fairlight.to/docs/text/xass33.html

Elysium's code examples - works: ftp://ftp.elysium.pl/gnu-generation/

C64 ML Tutorials - ftp://ftp.padua.org/pub/c64/Docs/ml-tutorial.zip

The little tasks you assigned to yourself to try and tackle at least the low hanging fruit are in a way core to the Cognitive Behavioral Therapy. CBT is the most often used form of psychotherapy not in small part due to its reported effectiveness. It's great to hear your story, thanks.

I am ill and bed-ridden right now otherwise I wouldn't have time to comment so much on HN or read reddit.

I am not sure your "real-world" social skills will improve through reading reddit. It takes real time investment and accepting that you will fumble, fail and make a lot of mistakes. HN people often talk about how domain expertise rarely transfer easily into another domain and here's a perfect example.

Cool, understood. Just keep in mind that most psychologists will tell you that you are (or you can be) by and large in full control of your personality traits and that these things can change dramatically through your life, either through your conscious decision or through environmental influences.

So to make a determination over why you are the way you are based on how you perceive yourself in terms of a personality trait category that (Jung or not) is related to the Psychology of Types is doing a bit of that self-fulfilling prophecy.

There's nothing wrong with preferring to keep to yourself and socialize less frequently, but perhaps it would be wise to rule out other hypotheses (like, really really convince yourself that there's not something else bothering you in life). That's as far as I can speculate, because although I might claim you might not be consciously aware of the whole story, I am even less aware, it's just a pattern that I noticed with some friends and some of them, years later, refer to those periods as periods of depression, some of them even talked to a good psychologist about it.

Thanks. Beatifully written and I love the print-shop analogy.

It's nice he is into the C&C Portland Wiki, there's golden nuggets of wisdom everywhere. I am reposting the link from his blog. http://c2.com/cgi/wiki?SufficientlySmartCompiler

Personally of the higher-level languages, I found SBCL to be crazy good at optimizing, of course given a few nudges with a compiler directive or two. By inspecting the dissasembly, I could validate it was doing the "right-thing" (TM), but then again, I do the same to check the C/C++ compiled code.

This is a great example of making something that is challenging for a novice, yet not so challenging they give up. The reward is much higher than watching some numbers show up in the correct order and you tend to cover more of the language (2D array or your own abstraction of such, I/O, control flow, etc.).

I would rather teach them:

1) how to write a program that guesses a number you thought of by doing binary search.

2) solve 2-queens

3) solve n-queens

4) solve knapsacking or some other combinatorial problem requiring memoization or DP. Of course, I wouldn't tell them any of those buzzwords that are meant to scare them away from just hacking on it.

Their mind will be blown regardless of the language they used and they'll get a feel for O() without even opening Cormen.

Any knowledge about your data set, how much of it varies, etc can vastly improve your performance over any canned standard library solution. Sorting ints? Radix-sort that mofo.

That sounds impressive.

A lot of really impressive C64 code is timing sensitive. The coder counts exact number of cycle a piece of code takes and attempts to, for example, synchronize it to the CRT rasterbeam, because the horizontal and vertical refresh frequency are known and because there is a VBL interrupt.

So for example you change the background color at just the right time as the rasterbeam renders the screen to get a rainbow. Similar stuff is done with quickly changing sprites so that you can get way above the, I don't know, 8 or so sprites that are supposed to be the max possible to do in hardware.

You would lose insight into this by converting the code to C.

I still prefer using Socratic Method, because of how deeply and thoroughly a student understands the matter once the inquiry is over with.

But yes, unfortunately, it drives people nuts, unless they have a penchant for this sort of thing.

Even if it drives them nuts, it works, albeit the student tends to lose focus if s/he gets upset or frustrated and so the whole thing can take a long time.

I wouldn't say introspection was harder for introverted and I definitely would have no reference for that.

It's just that introversion is a personality trait whose meaning was overloaded by pop-culture and pop-psychology. Stuff by Freud, Jung, Eyesenck, Myers-Briggs, etc. is useful to know as much as it is useful to know about the work done at Xerox in the 70s and 80s. Informative and a foundation for later work, but by no means current.

This http://en.wikipedia.org/wiki/Myers-Briggs_Type_Indicator#Rel...

will tell you about just how inaccurate it is to take a classic test like MBTI. While there is something to be said about personality traits and nature vs nurture, Psychological Types are so 1923.

There was a lot more concrete research done in the last 20 years on depression and related mood disorders as it is somewhat of a modern-day plague (OK plague is too harsh, can someone help me with a disease analogy here?).

Correct me if I am wrong but they are actually using mergesort (mergeAll) as it is significantly faster in Haskell than in-place quicksort (qsort).

That means there is a lot of overhead for doing something simple like an in-place qsort that should be much faster than a mergesort.

I am at a loss on why the provided code is any more elegant than: http://en.literateprograms.org/Merge_sort_%28C_Plus_Plus%29

or this (also taken from rosetta code)?

  #include <iterator>
  #include <algorithm> // for std::partition
  #include <functional> // for std::less
  
  template<typename RandomAccessIterator,
           typename Order>
  void quicksort(RandomAccessIterator first, RandomAccessIterator last, Order order)
  {
    if (last - first > 1)
    {
      RandomAccessIterator split = std::partition(first+1, last, std::bind2nd(order, *first));
      std::iter_swap(first, split-1);
      quicksort(first, split-1, order);
      quicksort(split, last, order);
    }
  }

  template<typename RandomAccessIterator>
 void quicksort(RandomAccessIterator first, RandomAccessIterator last)
  {
    quicksort(first, last, std::less<typename std::iterator_traits<RandomAccessIterator>::value_type>());
  }
The above code is more verbose?

Advancing compilers is hard. When people argue efficiency as a compiler implementation detail that is going to get worked out, they forget about many who have fallen before them.

You can argue some older languages were written in a way in which it was (reasonably) easy to write a compiler that generates code with little performance overhead when compared to assembly (at worst a factor of 2 to 4, back in the 80s). Some popular languages keep adding abstractions and constructs that the compiler can actually deal with without some new compiler research breakthrough.

The comfort of being alone and not interacting awkwardly currently outweighs your resolve to solve this problem.

It's hard to self-diagnose with introversion, you might just be seriously depressed and not willing to admit it to yourself, but I don't know you at all so all this is maybe BS.

I've met brilliant 30+ year olds who were still on the 8 year old level you describe.

You need to adjust your value system until you don't feel like you've been wasting time by working on yourself rather than your software project.

Be prepared for horrible failures in the same fashion that you expect segfaults the first few hundred times you code in assembly. Segfaults wouldn't shake your confidence, neither should a girl who is either not interested or openly annoyed by you.

Take a lot more risk and be prepared to fail hard and make a total moron out of yourself. You will still feel better than just cocooning yourself.

Listen. Don't judge the cool, preppy, jock, whatever guys, observe what they do and how they talk, dress, etc. You're not trying to be like them, but you're just learning like you are when you are reading source code or reference manuals.

Do not intellectually dominate. You will draw attention to yourself and lose all the opportunity to learn. Observe other people's sense of humor. Is yours too confined to stuff only the reddit crowd would laugh at?

Read bullshit magazines like Maxim. There is so much crap in there, but there's some truth too and they are very direct about it.

Ideally, try to get a good friend who is a girl and not a geek. Forget about ever hooking up with this girl, she is there just to give you feedback on how you look like when you say or do some things and how your appearance/dress affects others. If you have a sister/cousin, even better, ask for feedback.

This looks like yet another Haskell "variant." From what I can tell this sort does not occur in place and thus would not make a particularly good quicksort. Memory use, number of accesses per element, etc. This style of programming is more suitable for heapsort or maybe mergesort.

I think what the author is saying is that having done projects on your own helps your credibility.

I disagree that ML is something that can be picked up through just an OCW site and such. "Real" ML involves way too much mathematics and does not overlap much with programming. ..unless your idea of Software Engineering is writing stuff in MATLAB.

There are so many books and the path to knowledge can be daunting.

In the spirit of the blog-post's advice I was trying to gauge whether to take the author's advice seriously, but after some short searching I could not come up with publications in ML. I definitely found several moderately complex projects with an ML "flavor." And that's already way better than most people who try to get into this by themselves and shows Ravi picked up on a bunch of stuff.

Ravi mentioned 5 years ago that reading the literature felt like banging your head against the wall and I think most of people who attempt the self-taught route are going to feel the same.

You're looking at a year or two of full-time college-like preparation during which you will learn lots of math but little to no ML. Only then can you begin to really learn ML. The books by themselves are simply not enough to learn this stuff. One needs to literally go through as many lectures as possible in the relevant coursework online, and do the labs. Various CS departments that actually have some traction in ML spend a large chunk of time designing the course and labs are incredibly illuminating.

If you just want to learn how to apply an ML algorithm taught in an undergraduate-level course, disregard my post.

Truly understanding anything written by Bishop or even going through ESL completely is something that is going to take an enormous amount of time (on your own easily a year, if you have the background) and mathematical skills that are typically way outside of what a Software Engineer deals with in any of the projects. I mean Bishop introduces hyperpriors in Chapter 1 or 2 for chrissake.

I can see how getting into patricle-filtering based probabilistic robotics can be easier, but try some EKF-based methods and feel the pain, that is, feel the amount of math that you don't know yet.

Extra hint for HN readers: take a look at the CVs of hot-shots in ML. Lots of Math and Physics undergrads, and a PhD in Theoretical Physics or Mathematics is not a rare occurrence by any means.

I'd also take a risk and say that traditional mentor/student relationships in India are quite different from the less formal ones in the West. My experience with colleagues from India is that they are much more likely to observe the authority ladder. Just look up Anil K Bera's interview with C.R.Rao (of Rao-Blackwell theorem) especially w/regards to how things were going at ISI.

I agree, the SSN/fake birth cert is the riskiest most dangerous proposition .. I have interacted with people who have done this some 15 years ago and they are still around, they have a family, a US passport and a steady decent paying job. What I don't know is how many got busted and landed in deep stuff.

What the story might leave out is that Ashton's family is in a lot of trouble, Mom alcoholic, Dad MIA a long time ago. Mom's boyfriend is a physically abusive guy and thinking about that prick gave him strength to do just one more rep on his 200 lb bench-press routine. He could never quite fit in with the rich "middle class" kids from the big cities, preferring to drink Pabst Blue Ribbon with his high-school buddies, get stoned and listen to 80s hard-rock. On one or two occasions, he read Hacker News but thought ... well, the readers here might get angry but our farm boy thought all of them were sheltered dweebs who did not know a damn thing about how real life is like.

On one of those occasions where their crowd was full of freshman girls who were really looking forward to getting wasted and laid that night, in drunken stupor Ashton heard Wayne calling out to him. He hasn't seen Wayne since he joined the Army 2 years ago. Man it was good to see him again, he's the kind of buddy who'd get in a fight for you without asking a single question. Wayne knows what's up, Ashton thought to himself as they talked about Wikileaks and f__king sh__ up. Giggly girls just kept interrupting his conversation and, irritated, he asked one of them if she would give away a government secret if all it was doing was covering someone's ass for raping some 9 year old dancing boys in Afghanistan. Janice just clammed up and some of her ditsiness immediately disappeared. Not having much to say, feeling put on the spot, a bit shamed and a bit embarassed, she remembered him well that night, but that's another story.

Wayne and Ashton went to Bobbie's Diner to sober up with some greasy burgers and shoot the sh_t. Soon enough they weren't talking about tits, even though Janice had a really nice pair... Wayne kept telling him how much of cool stuff the military really does and how he could hook him up. Man, Wayne knows what's up, he thought to himself. Besides, if it came to working with guys like Wayne or the dweebs in San Francisco, it was a no brainer....

That's at least how Ashton thought about things back then... but then again, he was only 20. Nowadays he spends his time working for DISA on new worms. Everyone needs a botnet nowadays, even the government. It's really cool work, he learned a lot. But he knows damn well that's something he's never going to be able to talk about. At least Wayne gets to post bullshit on Twitter as th3j3st3r, he thinks to himself. His $80k salary is pretty damn good, and even his Mom is better, she dumped that dickwad. Though she is really getting old, all that alcohol just turned har brain to mush and she sometimes doesn't make sense. Maybe it'd be better he went to Silicon Valley, but then, just glancing over at the picture of him, Janice and their adorable 3 year old made him say "fuck no!" loud enough that his officemate looked up at him with that "dude, are you allright?" look.. He would've never met Jen and would probably still be chasing money like a wannabe pornstar in Los Angeles...

Something like DREAM will get passed eventually for the new wave of illegals, just look at this:

1. Immigration and Reform Control Act (IRCA), 1986: A blanket amnesty for over 2.7 million illegal aliens

2. Section 245(i) Amnesty, 1994: A temporary rolling amnesty for 578,000 illegal aliens

3. Section 245(i) Extension Amnesty, 1997: An extension of the rolling amnesty created in 1994

4. Nicaraguan Adjustment and Central American Relief Act (NACARA) Amnesty, 1997: An amnesty for close to one million illegal aliens from Central America

5. Haitian Refugee Immigration Fairness Act Amnesty (HRIFA), 1998: An amnesty for 125,000 illegal aliens from Haiti

6. Late Amnesty, 2000: An amnesty for some illegal aliens who claim they should have been amnestied under the 1986 IRCA amnesty, an estimated 400,000 illegal aliens

7. LIFE Act Amnesty, 2000: A reinstatement of the rolling Section 245(i) amnesty, an estimated 900,000 illegal aliens

Source: http://www.endillegalimmigration.com/History_of_Illegal_Immi...

Exactly, ICE won't deport you unless you get in the news or f__k up big time and get booked (such as, for example, driving over X mph in certain states) and on top of that if someone in the po-lice really hates you (they'll play dumb otherwise). I have my own opinion on why this is, something to do with actually needing illegals, but don't want to start a flamewar.

I read your post thoroughly and all the replies so far.

Advice: 1) There are plenty of merit-based scholarships. Forget about Florida and think about out-of-state universities. Don't aim very high and get into a Tier 2 University where you will be their super-fab superstar.

2) Don't plan on leaving the country or even leaving to do work any time soon. There are full-ride merit-based scholarships and your family just needs to provide you the money for some clothes, some books and an occasional ticket home.

You didn't mention options that are breaking the law, but that are likely to have little repercussions for you if you get caught (second hand experiences):

1) Do not on any forms circle anything that would indicate you are a non-US citizen.

2) If there is a form asking if you are a U.S. resident, circle yes. If this ever becomes an issue you can lie that you thought it was for tax purposes (for which you are a resident).

3) Imagine your parents never told you your real story. What are the real world situations in which someone will ask for your birth certificate? There are just a few and one of them is for getting an SSN.

4) Play dumb. With a merit-based scholarship you'll buy yourself years more of time. U.S. degrees in Comp. Sci are highly valued overseas and require little to no paperwork to convert into whatever country's accreditation system.

5) Talk to immigration lawyers, they usually have good ideas.

6) Try to gather information from other illegals. With all the security paranoia it might be harder nowadays, but I bet there is still a somewhat accessible underground that will, for around $15000, be able to procure you an SSN with your name on it. That is all you need, once you have an SSN, you are gold my friend and no one ever needs to know. Don't go for it, but find out if such networks still exist or if everything got so computerized that an SSN is impossible to obtain.

7) Talk to more lawyers.

8) If there is ever a deportation procedure against you, this can be stalled for a loooong time I think with a case like yours. Be prepared to write lots of correspondence with powers that be. Lawyers are good.

9) Accept only under-the-table cash in hands for occasional contracting/coding work. Accept a car or some other good. Sell it later. For cash. You can make enough like this to support yourself while in college.

10) Wait until some legislation gets passed admitting the X million of illegals into the country. Number X will grow over years and eventually a generation will be quietly legalized. This will happen sooner or later. A big one happened in the early 1990s. You might spend the next 20 years waiting for this, but if anything like the DREAM act eventually passes, you're gold and welcome to America.

Oh and yes, if things are getting desperate, consider forging a Florida birth certificate if your in-state scholarship documentation requires it. My guess is they have nowhere near enough resources to verify these. If the scholarship requires an SSN, you are fux0red.

If there are people upset about me posting this stuff, I'd just like to remind that I hope this still adds signal and that the name of this website is Hacker News.