tips-and-tricks

Disadvantage of Python eggs?

Are there any disadvantages about using eggs through easy-install compared to the "traditional" packages/modules/libs? ...

Catch access to undefined property in JavaScript

The Spider-Monkey JavaScript engine implements the noSuchMethod callback function for JavaScript Objects. This function is called whenever JavaScript tries to execute an undefined method of an Object. I would like to set a callback function to an Object that will be called whenever an undefined property in the Object is accessed or ass...

Tips and Tricks to avoid iphone app crash

Is there any tips to avoid crashing of iPhone applications. Sometime it is very difficult to understand where the problem is. What are the possible reasons of iPhone app crashes ? ...

Cross Join 'n' times a table

It is possible to write a generic function/procedure/select/somethingElse to cross-join a table against himself 'n' times? (yes, 'n' is a given parameter : ) How would you do it? Example Having this table: Value ------- 1 2 3 cross join it 2 times, would return: Value | Value ------------------ 1 1 1 ...

Taming the malloc/free beast -- tips & tricks

I've been using C on some projects for a master's degree but have never built production software with it. (.NET & Javascript are my bread and butter.) Obviously, the need to free() memory that you malloc() is critical in C. This is fine, well and good if you can do both in one routine. But as programs grow, and structs deepen, keeping...

Fast dot product for a very special case

Given a vector X of size L, where every scalar element of X is from a binary set {0,1}, it is to find a dot product z=dot(X,Y) if vector Y of size L consists of the integer-valued elements. I suggest, there must exist a very fast way to do it. Let's say we have L=4; X[L]={1, 0, 0, 1}; Y[L]={-4, 2, 1, 0} and we have to find z=X[0]*Y[0] +...

A Book about Productivity for programmers

I just find this video about productivity for programmers by peepcode and I'm thinking to download and see it. Besides that, I have to tell you that I prefer to read a book and take notices about it, rather than seeing a video. So, my question is: can you recommend me a good book about productivity for programmers with tips, advices, b...

EF4 performance tips and tricks

I've gotten to that point in one of my projects, and haven't found much information out there. So if you've got some pointers for improving performance in the new Entity Framework 4, please let us know! ...

What are some typing patterns using a standard QWERTY keyboard that work well for you as a programmer?

After hunting and pecking for about 35 years, I have decided to learn to type. I am learning QWERTY and have learned about 2/3 of the letters so far. While learning, I have noticed how asymmeterical the keyboard is, which really bothers me. (I will probably switch to a symmetrical keyboard eventually, but for now am trying to do everythi...

How to send mail from any mail id through java?

How to send mail from any mail id through java? i meant how can we set from : address in mail any that we want. ...

How do you use kate? Tips/Tricks/Workflow

We all seen a bunch of these? Mostly for IDE's but also for vim and emacs. Kate is (only) a text editor (an awesome one) but it has a ton of options plus a number of plugins, so its hard to know all of it well. How do use the Kate text editor? Please share your workflow and help me and others learn some of the cool tricks you use. I'll...

Tips for Using Multiple Development Systems

When I travel, I don't pack up the desktop I use in the office and take it with me. Maybe I should, but I don't. However, since I'm a contract programmer I like to be able to work wherever I am: I'm mostly thinking of web development here. Version Control goes a long way in keeping sane and working on multiple projects on multiple sys...

Effective Android Programming Techniques

Please Help me compile a list of Effective Android Programming techniques Don't forget to free resources after use. Lot of resources like Cursors are overlooked. Free them too. Don't Use magic Numbers. values[0] is meaningless. The framework provides very useful accessors like values[SensorManager.DATA_X] "Make use of onPause()/o...

Javascript protocol and events

What does the following code mean - <a href="javacsript:;" onClick="addItem(160)">some link</a> My basic doubt is which script is run when we click on the link ...

Cross Platform Tips, Tricks & Gotchas

If you've worked on a cross platform development project what advice do you have for someone (like myself) considering starting one? Examples: What worked? What didn't? What problems did you run into and how did you solve them? Did you aim for consistent appearance and functionality across all platforms or try to take advantage of each...

What are some tips for a beginner PHP developer?

Hey all, what are some tips or tricks that new PHP developer's should follow. Good tutorials, best practices etc? Sam ...

Python tips for memory optimization

Hi all, I need to optimize the RAM usage of my application. PLEASE spare me the lectures telling me I shouldn't care about memory when coding Python. I have a memory problem because I use very large default-dictionaries (yes, I also want to be fast). My current memory consumption is 350MB and growing. I already cannot use shared hosting...

Looking for good Lisp code to read

I'm currently trying to get proficient in Common Lisp and to learn some of the tricks for writing compact, clear and beautiful code in it. So, I want to know if you have any sources of good Common Lisp, preferably free and online but books are also OK. ...

Mysql ninja tricks

Possible Duplicate: Hidden Features of MySQL Hi, what are your mysql ninja tricks? What features are extra special? I'm starting with ORDER BY FIELD which enables you to sort in a particular order, like this: SELECT url FROM customer ORDER BY FIELD(customer.priority, 1, 2, 3, 0) Features like this is hard to find in the m...

Tricky Python Questions

What are the most 'tricky questions' you came across concerning python (ie during job interview) ? You can also give a sample solution of the problem. Mine : How in one line add to arguments of workers names list their positional numbers ( list=[jon,michael,rob,bill] ). ...