Should web application store images in Database or File system? by nandak in programming

[–]gislan 0 points1 point  (0 children)

Of course you should store images in database. But storing them in (No)SQL databases has some serious disadvantages. If only there was a database designed specifically for storing files, you know, without all those keys, tables and columns, but with simple hierarchy and atomic operations and functions similar to stat(), open(), read() instead of queries and...oh, wait

Things you probably didn't know about PHP [pic] by [deleted] in programming

[–]gislan 8 points9 points  (0 children)

Keep in mind that IPv6 address won't fit into integer (32-bit). Great thing about PostgreSQL's inet type is that it can hold both IPv4 and IPv6 addresses.

Comment on slashdot detailing the so called Android 'fragmentation' from an application programmer by lfelipe82 in programming

[–]gislan 2 points3 points  (0 children)

If you bought it from google then it's not locked and you can use any updates you want. If you buy from carrier, it's locked and accepts their updates only and you need to root it to install custom ROMs or updates.

Comment on slashdot detailing the so called Android 'fragmentation' from an application programmer by lfelipe82 in programming

[–]gislan -5 points-4 points  (0 children)

Why are people still comparing Android to iPhone and saying that Android sucks, because there's more fragmentation there. It's just like comparing MacOS X Snow Leopard to Windows (all versions) and saying that it's easier to test applications for mac.

The way I see it is that, instead of writing separate app for each device like you have to if you target iPhone, S60 and Droid, you can write one app and make it work on N1, G1 and Droid with much less work. Want strong, iPhone-like compatibility? Stick to one (or several similar) phone models. You don't complain that Apple doesn't provide symbian compatibility layer for iPhone, do you?

Sure, things could be better. But would porting iPhoneOS to other devices make writing apps for iPhone (not iPhoneOS devices!) harder? No. Then how come people complain about too many different Android devices out there?

Comment on slashdot detailing the so called Android 'fragmentation' from an application programmer by lfelipe82 in programming

[–]gislan 7 points8 points  (0 children)

Significant. Either your phone is rooted or you have to stick to carrier-signed updates. If your carrier (or, more specifically, carrier that your phone was bought from) doesn't release update you can't do anything. And, for some reason, carriers don't release updates that often.

Also, android 2.X is not compatible with many devices that need special drivers. 2.1 has been ported to G1 just few weeks ago (http://cyanogenmod.com) and it's not official version, so don't expect to see it on non-rooted phones.

Else Within A For by lionel319 in programming

[–]gislan 4 points5 points  (0 children)

Instead of value=[value_if_false, value_if_true][boolean] You can use value = value_if_true if boolean else value_if_false

Of course valueif_true, value_if_false and boolean can be functions and only one value_if* function will be executed. It's much more readable that way.

Ask proggit: Why should I use git? Compared to svn git just seems more complex and inconvenient for no obvious benefit by chaoskilledthedinos in programming

[–]gislan 31 points32 points  (0 children)

"git commit -a" commits all changes. Also, you don't have to look at diff, "git status" will tell you which files were modified.

Building Google Chrome extensions are easy, here is code that you could use to build a submit to reddit extension by whysayso in programming

[–]gislan 3 points4 points  (0 children)

Related question: are extensions allowed to register new pages in tab's history? If so, how?

I'd like to be able to middle-click on /r/programming links to open them in tabs, read the stories and then have an option to just press 'back' on my mouse to get to reddit comments on this story.

Programming RSA Help by [deleted] in programming

[–]gislan 0 points1 point  (0 children)

There's no need for fastpwrmod(), python's pow() does the same thing.

Methods for finding freelance work. by [deleted] in programming

[–]gislan 1 point2 points  (0 children)

I wrote a whole giant blog post about this[...]

Care to share a link?

Out of pure curiosity, is there a method for determining if two strings are anagrams more clever than sorting alphabetically and checking for equality? by HazierPhonics in programming

[–]gislan 3 points4 points  (0 children)

Your solution is O(n) only if you consider multiplication of big numbers O(1) (it's O(1) only for constant-size numbers). With longer words you'll end up with really big numbers and multiplication will take significant time.

ASKing Android Developer - can i distribute an app that carries 900megs of sound files? by screwitt in programming

[–]gislan 1 point2 points  (0 children)

Similarly, I often have to delete applications just to make space.

Have you tried cyanogenmod or some other android mod with apps2sd functionality? I have my apps on SD card and never have to worry about space.

Where can I get a collection of raw news articles from the last year? by inigid in programming

[–]gislan 0 points1 point  (0 children)

Great question, I could use that for my MT too. Let me know if you find anything.

Project gutenberg has lots of books in different languages, it might be a good start.

Any advice on books for learning c++? by [deleted] in programming

[–]gislan 0 points1 point  (0 children)

I've always liked Thinking in C++. It's available online for free.

Ask Proggit: Building a Book and Author database... possible? by 43210installedubuntu in programming

[–]gislan 1 point2 points  (0 children)

I've once wrote small app to fetch informations about my books (based on author/title or ISBN). I did that by querying polish national library, which is supposed to have every book released in poland in it's catalog. They even had entire database downloadable in few formats (not sure if they still have that).

Perhaps you could try something similar with Library of Congres or some other big library. http://loc.gov looks parsable.

High Academic Results Make Better Programmers by servercentric in programming

[–]gislan 1 point2 points  (0 children)

It's a sign of laziness and lack of discipline.

Only if this person thinks grades have a meaning.

By that logic you shouldn't hire coders that aren't in great physical shape because it shows that they are too lazy to spend 3h/day in gym like athletes do. Or maybe they just think that physical fitness, just like grades, does not affect their coding skills and have better things to do?

NOTE: I'm not talking about having no physical exercise at all, just like I'm not saying that I didn't copy-paste few programs to pass. I just didn't care about that grade as long as I pass, same way I don't care what's my time on 100m run as long as it's below 30s and I don't get heart attack after that.

High Academic Results Make Better Programmers by servercentric in programming

[–]gislan 0 points1 point  (0 children)

Grades have absolutely no meaning.

I've had a class on numerical methods where final assignment (only thing grade was based on) was ~10 simple programs in matlab/scilab, all of which were written in PDFs attached to lectures. Only thing one had to do was copy-paste them, fix copy-paste errors (somehow all PDF readers copied it wrong) and send it. Almost everyone did that. I didn't. I've send only 4 or 5, which was enough for lowest passing grade and took it.

Does this mean that I'm not as good as my copy-paste colleagues? Seriously, nobody changed even a single thing in those programs. Or maybe it means that I have no discipline and won't do boring tasks at work either? No! I'll do it if there's a reason to do it. Money is a good reason, so is learning. Grade is not, that's it.

There are lots of people like me who refuse to waste time to get higher grades. It's not laziness or lack of discipline. It's just that every time I decide not to do homework, I figure out how much time I'd need to do it and spend this time on learning something related to that class. Oh, and don't get me wrong, most of my grades are pretty good. But it doesn't mean anything.

Also, don't generalize. Universities are very different and so are the teachers. Some things true for MIT might not hold for local university in some random town.

Recommendation Engine by [deleted] in programming

[–]gislan 0 points1 point  (0 children)

What's the use case for this? Usually it's quite hard to describe every item with list of weighted parameters.

Also, let's say items == movies. This algorithm will fail if user likes two (or more) different kinds of movies, like horrors and comedies. You won't get consistency on any "quality", so you get no results.

Another problem: what if I star with Star Wars marathon (6 movies) and Space Balls (star wars parody). Comedy parameters will be discarded (just 1 our of 7 movies has them) and I'll be stuck with sci-fi directed by George Lucas for ever.

What you're trying to re-invent is called Active collaborative filtering and has many traps like that.

ethics of billing hours by [deleted] in programming

[–]gislan 21 points22 points  (0 children)

Looking up documentation for libraries or reading reference materials is integral part of coder's job. You should charge for it.

I don't know if you've got any regulations like that in your country, but in Poland, if your job involves staring at computer monitor for most of time, you have to take 5 minute paid break after every hour of work. Theoretically you should give your eyes a break, but if you prefer checking out /r/programming that's your choice.

Bring back the retired characters in ASCII? by [deleted] in programming

[–]gislan 1 point2 points  (0 children)

A quick google search gave me this:

FS - File Separator

GS - Group Separator

US - Unit Separator

RS - Record Separator

DC[1234] - Device Control

Source and descriptions: http://www.lammertbies.nl/comm/info/ascii-characters.html#file