HNHacker News
TopNewBestAskShowJobs

technoguyrob

28 karma · joined February 24, 2008

http://therobert.org

technoguyrob @ [letter before h]mail (math\.uic\.edu)\/~(robertk) -> $2 @ $1

submissionscomments
technoguyrob··on NOLOH (not one line of html) Beta Program
If the framework does all you promise and starts getting adopted, you could make the language translation an open source project, maybe. That way it will both be quicker to completion and less error-prone (since you're not locking yourself in). In any case, it doesn't seem like turning this into Ruby or Python should be too much of an issue, since they're all OOP languages anyway.
technoguyrob··on NOLOH (not one line of html) Beta Program
This is really awesome.

Constructive comment: I can't middle click links to open them in new tabs.

P.S. You're not getting too much enthusiasm for it here because of the choice of PHP. I can assure you, though, if this takes off, a lot of those "can someone build me a Joomla or Drupal site?" on eLance will rapidly turn into "can someone build me a Noloh app?"

technoguyrob··on Ask YC: Notable People On YC
Is that really Steve Pavlina?
technoguyrob··on Ask YC: Notable People On YC
Eliezer Yudkowsky.

http://news.ycombinator.com/threads?id=eyudkowsky

technoguyrob··on Ask YC: Fewer lines of clever code or more lines of clearer code?
Clearly clever...
technoguyrob··on Ask YC: Fewer lines of clever code or more lines of clearer code?
Exactly! And yes, all those "magic numbers" are derived. For example...

		this.hSpacing = Array.prototype.slice.call(this.parent.blocks.filter(
				function(n){ return n < _this.parent.cols; })
				.map(function(n,o){ return o.offsetLeft; })
		);
Your function names and decomposition are indeed much easier to read. Thanks again, Neal!
technoguyrob··on Ask YC: Fewer lines of clever code or more lines of clearer code?
Yeah, I did all this. :) For part 2, I still need a helper function like this because the timestamp changes (when the user resizes, moves, etc.). Does that make more sense? I have a grid of DIVs, on which I position events on top of.

EDIT: I see what you mean. For part 3, for example, I want "12:05", not "12:04:27". Yeah, I was getting to that.

technoguyrob··on Ask YC: Fewer lines of clever code or more lines of clearer code?
This is the dirtiest component of going between DOM and the event abstraction (start and end times). When someone resizes the event or moves it, it's going to take some kind of pixel calculations at one point or another, even if they're very generalized, since they used their mouse to do that. This is the point at which I decided to deal with that. Otherwise the events are all handled abstractly. The data isn't necessarily coupled with the presentation, but for example the way they move the event around on the DOM when they're dragging and dropping (presentation) has to be translated into data at one point or another (and so the function is called dom2time--translating presentation to data :).
technoguyrob··on Ask YC: Fewer lines of clever code or more lines of clearer code?
Sorry for not being clear about that. The purpose of this helper method (hence the underline before that name) is to take an event positioned in the DOM and convert its position into a timestamp for that event. Probably the only place this will be called is when some change is made to the DOM of the event. For example, when it is resized, it'll have a different height as well as "top" offset, so that'll have to be translated into a timestamp. I don't know any other way to do this that would be fundamentally different, since at some point the pixel-based resizing is going to have to become a timestamp. Nothing in this function will be used anywhere else, hence I didn't make any more helper functions for my helper function. Thanks!

EDIT: And yes, I agree, if I ever decide to make events more fancy than just dropping in a DIV on the timetable, I'll probably have to do a bit more. But of course, only a couple things will change then, and I can just write those as helper functions for this function.

technoguyrob··on Ask YC: Fewer lines of clever code or more lines of clearer code?
The pixel computations are done because of the way this is used in the calendar. When a user resizes the event, some kind of pixel computation is going to happen at some point, since mouse coordinates have to be transferred in some way to "left" and "top" offsets (perhaps by first translating to the start time and end time abstractions). This was probably the dirtiest part in that respect, as it is the point at which I chose to translate between pixels into usable data. It's a helper function, so to speak, so I don't have to deal with any of this in my more general abstract code (which does indeed follow the much more "clean" approach). Hence the underline before the method's name. :) (this is part of an object)

1. I agree, but they're tiny inline functions so that's why I did that. I'll refrain from doing that from now on as this seems to be a general consensus.

2&3. Aah, good point. I just went back and looked at an old JS project and noticed I was doing both of these properly with parseInt. I've forgotten though as I haven't done too much heavy Javascript for a while before this. Thanks so much!

4. I've used call before like that but for some reason I forgot about it and switched to apply. Thanks!

5. Ok, that's what I wondered. The comments so far seem to agree this would be better for readability. I don't plan on anyone else even touching this code, so indeed like someone else suggested that could be an important factor, as indeed if this wasn't a personal project I would've used a more orthodox (i.e., less compressed) approach.

That's exactly what I was looking for. Thanks!

EDIT: Also, if I used "day" and "halfHour" attributes they would be hardcoded. Maybe someday I'd like to change to hour blocks, or have a view in four-hour blocks instead of half-hour. I am using this object as an abstract class that handles a calendar view, which will be passed specifics for the view. For example, the day view will be initialized like this:

			 arguments.callee.$.__init.call(this,
				{timeblock:1800, rows:48, cols:1, timedir:0,
				startTime:startTime,
				timename:'day', container:'daycontainer'}
			);
Where the "arguments.callee" stuff is just calling the (inherited) superclass initialization function. This way, if a New World Order appears and ever decides to make 5-day instead of 7-day weeks, all I have to do is change one line of code. ;) (while that's true, the real reason for me doing this is so I don't have to write code 3 times for a day, week, and month view)

That's (partially) why I didn't do something like hardcode "day" or "halfHour" attributes (although I do store all this information in the object--the method I showed above is a computational helper function).

technoguyrob··on Ask YC: Fewer lines of clever code or more lines of clearer code?
Yes, I skipped over a few of the specifics. The "Saturday/Sunday" at the end of the week versus "Sunday at the beginning" is taken care of, I was just using that as an example to explain; internationalization works fine. The time property is already attached to the DIV; however, this will be recomputed based on some DOM-change to the event. It makes it simpler, since (for example) when the user resizes the event, I can just deal with the physical resizing of the DOM object, and once they're done, translate it to the timestamp. I'm a presentation/data separation freak to the point of having no Python code include any HTML, and no HTML include any JS (except the <script> tag). However, this is a case where presentation and data are very intimately attached. Maybe I should have explained that I don't use this to get the time of the event. However, when the user resizes the event, at some point that connection between data and presentation has to be made, since their resizing is ultimately caused by pixel-based mouse coordinates. Also, the varying column width is taken care of, as none of this is hardcoded. The vertical and horizontal spacings are computed by looking at offets, and recomputed during window resizing.

Does that make my approach any better? I think that addresses every issue. I agree, though, there are better ways to do this, but this isn't a priority project for me so I haven't put as much thought into it as I'd like. Thanks, Neal.

technoguyrob··on Inventions they said would never work
Many things make Einstein more human. You should hear the story about his first wife, Mileva Maric. Quite a sad ordeal.
technoguyrob··on Inventions they said would never work
Television won't be able to hold on to any market it captures after the first six months. People will soon get tired of staring at a plywood box every night.

- Darryl F. Zanuck, Head of 20th Century-Fox, 1946.

How I wish you were right, my dear Darryl.

technoguyrob··on Code Golf - Perl, PHP, Python, Ruby
Also see Project Euler:

http://projecteuler.net/

technoguyrob··on LinkedIn is Evil
I like the "Paypal plugin". You can generate both temporary long-term and temporary one-time use cards. Very handy, and you have the extra protection of having it linked to your Paypal account, so if you choose to limit your Paypal balance to $100 you don't have to pull any tricks like you would with a bank account.
technoguyrob··on Where on the Internet to chat with geeks?
Joanna...fire.
technoguyrob··on Spoken language affects thought as programming languages affect algorithms?
But I feel like all mainstream programming languages aren't truly "languages", they're mostly dialects of X, where "X" is a fusion of Lisp and C, i.e. same old ideas repackaged in different syntactic packaging.

How are "normal" languages not the same old ideas repackaged in different syntactic packaging? I'd say "dog" and "hond" aren't different ideas even though one is in English and the other in Dutch. They're just the same old ideas repackaged in different syntactic packages. Isn't that practically the definition of a language? Some things that take me a sentence to say in English can are only a few phonemes in Japanese, but does that mean Japanese isn't a real language because it's the same idea in a different syntax? I'd say syntactic difference is possibly the defining characteristic of a language.

Perhaps this is simply indicative that the term "language" is innapropriate to apply to a programming grammar.

technoguyrob··on Why You Should Download Firefox 3 Right Now
I don't like FF3's "Awesome Bar" so I disabled it. I tried using it for a while, but noticed I mostly type in things like "n", "r", or "t" to get to news.ycombinator.com, reddit.com, or my own domain, respectively, and with the "Awesome Bar" this is removed and it actually takes me LONGER to browse, as I generally type in a letter or two of the URL and go to it directly.
technoguyrob··on The argument against "downvote". A slight violation of the First Amendment
I miss PG. The mods need to get back so they mark deads.
technoguyrob··on Ask YC: Voting and Karma (Call to action)
Keep in mind some people might also simply click downvote without paying much attention to their action. I've seen this time and time again on Reddit and here that when someone replies "Why are people downvoting me? Could you please explain?" to their own downvoted comment, everyone wakes up and realizes the comment isn't that bad, or possibly even quite insightful.
technoguyrob··on Ask YC: Voting and Karma (Call to action)
I talked about this more in detail:

http://news.ycombinator.com/item?id=208748

To quote:

It is not ridiculous, since people aren't downmodding to express a difference of opinion about what the person said. They are downmodding to assert they do not want to hear any political opinion on Hacker News, because--as has been said--there are countless other venues for hackers to express and debate political opinion; Hacker News is not one of them.

Notice therefore we see something interesting regarding the HN system. In essence, this is exactly what pg had in mind. Karma is taken away for comments and not just submissions, so that users will adapt to the Hacker News atmosphere. As we have seen from this thread, politics (even "news" like the first ever black general election presidential candidate) is simply not something people are interested in seeing on HN, and if people keep discussing it, they will be downmodded into oblivion, effectively maintaining the current HN mindset (since, presumably, people with negative, or quickly decreasing karma, will not want to continue posting on HN).

The only thing that could break such a system is a vast shift in the mentality of the community (which is not a bad thing since it would still keep the community happy, although it's very unlikely to happen), or a massive influx of new people into the community (which is why pg wants to keep the number of new signups per day low).

technoguyrob··on Ask YC: Voting and Karma (Call to action)
I disagree with your second sentence, but I upvoted you for it.
technoguyrob··on Why are we still 'releasing' software?
I knew about Web Developer's Ctrl+Shift+S (disable all styles), but I had no idea about that built-in style disabling. I just tried it on Gmail and it was quite...interesting...
technoguyrob··on How can a teenager get a programming job over the summer?
You mentioned Rent A Coder.

I used Rent A Coder for a bit, but their system is terrible. I now use eLance to freelance and it's MUCH better. I've already made $10k on the side with this, with a cumulative coding time of less than 100 hours. However, the searching might've taken 10 hours, as it's hard to find projects that are worth it (but once you hit one, it's jackpot).

Not to mention, I always do projects which involve some new framework/language I've never used or some task I've never tried, so I can learn as well as make money! It's so great. Some might call it irresponsible, but I do my homework before even starting the project, and we all know it doesn't matter what tools a great programmer is given.

P.S. I'm 17, but no one has to know that. ;-)

technoguyrob··on My New Instant Karma Plan
Fixed to avoid wrath from Dijkstra and the raptors:

   while (true) 
      1. Find a new submission with no upvotes or comments that is interesting to you
      2. Make an interesting comment for that submission
      3. Upvote the submission - if it's new enough it should get bumped to the front page, and if it's interesting enough it should start getting upvoted, as well as your comment
technoguyrob··on When Do Post-Humans Show Up?
That's a good point, but I think the idea of "Singulitarians" (for lack of a better term) is that your iPhone or other new gadget won't be invented in years, months or weeks, but hours or minutes. A human brain simply can't keep up.

Of course, if the "Singularity" happens to mean we'll just be much faster thinking version of ourselves, then perhaps you're right, it will be banal, as presumably our perception of time will be perverted as well.

technoguyrob··on When Do Post-Humans Show Up?
Well, I don't think anyone can argue that if we create an AI smarter in nearly every way than any given human, several or a large amount of those AIs could create an even smarter AI, and so forth recursively. The only question is if we indeed will, and if so when (even 100-150 years isn't that far off if you think about it). Given the huge impact it would have on society (for better or worse), it's perfectly reasonable to be a matter of public debate.
technoguyrob··on The customer doesn't care who's fault it is
This is a somewhat obstinate and perhaps nonconsequential point, but as a public service announcement, could anyone who reads this please do their best to assure the title of their story is grammatical and spell-checked? If the 37signals article has the title right, then it's not hard to do a quick check or just copy and paste the title. It would help prevent the Digg/reddit sort of "degeneration," as while proper spelling and grammar may seem like a somewhat arbitrary and objectively unimportant matter, it does indicate if not intelligence, at least greater care for one's communications. When you post on Hacker News, it's like talking to hundreds of people at once. Perhaps it is a moot analogy, but would you give a speech to several hundred people without checking the pronunciation of new words? It's embarrassing for both you and the community.

Kind thanks!

EDIT: I now see the URL of the 37signals post betrays the fact the original title did in fact contain "who's". Of course it is not your fault then, but as I said, it would still show greater care if one checked something like that before posting.

technoguyrob··on Obama: I will be the Democratic nominee
I disagree. Read my post again, I added two paragraphs. It's very useful behavior, in fact (imho). It preserves the nature of the community quite effectively (albeit at the expensive of causing temporary upset).
technoguyrob··on Obama: I will be the Democratic nominee
It is not ridiculous, since people aren't downmodding to express a difference of opinion about what the person said. They are downmodding to assert they do not want to hear any political opinion on Hacker News, because--as has been said--there are countless other venues for hackers to express and debate political opinion; Hacker News is not one of them.

Notice therefore we see something interesting regarding the HN system. In essence, this is exactly what pg had in mind. Karma is taken away for comments and not just submissions, so that users will adapt to the Hacker News atmosphere. As we have seen from this thread, politics (even "news" like the first ever black general election presidential candidate) is simply not something people are interested in seeing on HN, and if people keep discussing it, they will be downmodded into oblivion, effectively maintaining the current HN mindset (since, presumably, people with negative, or quickly decreasing karma, will not want to continue posting on HN).

The only thing that could break such a system is a vast shift in the mentality of the community (which is not a bad thing since it would still keep the community happy, although it's very unlikely to happen), or a massive influx of new people into the community (which is why pg wants to keep the number of new signups per day low).

← PreviousPage 3 of 8Next →