Showing posts with label Tips For Programmer. Show all posts
Showing posts with label Tips For Programmer. Show all posts

Monday, June 11, 2012

Increasing the performance and usability of Facebook"s FQL


I try to get some insights from the pages I am administrator on Facebook.

SVN checkout the contents of a folder, not the folder itself


I'm fairly new to linux and svn. I'm trying to checkout the trunk folder of a project into my public_html directory using this command (while in public_html):

What is the purpose of a these #define within an enum?


I found this code in the linux headers, /usr/include/dirent.h:




enum
{
DT_UNKNOWN = 0,
# define DT_UNKNOWN DT_UNKNOWN
DT_FIFO = 1,
# define DT_FIFO DT_FIFO
DT_CHR = 2,
# define DT_CHR DT_CHR
DT_DIR = 4,
# define DT_DIR DT_DIR
DT_BLK = 6,
# define DT_BLK DT_BLK
DT_REG = 8,
# define DT_REG DT_REG
DT_LNK = 10,
# define DT_LNK DT_LNK
DT_SOCK = 12,
# define DT_SOCK DT_SOCK
DT_WHT = 14
# define DT_WHT DT_WHT
};

bash: defining a variable with or without export


What is export for? What is the difference between:




export name=value

generate a core dump in linux


I have a process in linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails?

What is the simplest way to SSH using Python?


What is the absolute simplest way to SSH to a remote server from a local Python (3.0) script, supply a login/password, execute a command and print the output to the Python console? I would rather not use any large external library and not install anything on the remote server.

jQuery Ajax calls and the Html.AntiForgeryToken()


I have implemented in my app the mitigation to CSRF attacks following the informations that I have read on some blog post around the internet. In particular these post have been the driver of my implementation

How can I convince IE to simply display application/json rather than offer to download it?


While debugging jQuery apps that use AJAX, I often have the need to see the json that is being returned by the service to the browser. So I'll drop the URL for the JSON data into the address bar.

How can you make a vote-up-down button like in Stackoverflow?


Problems



  1. how to make an Ajax buttons (upward and downward arrows) such that the number can increase or decrease

  2. how to save the action af an user to an variable NumberOfVotesOfQuestionID

Chrome: Disable same origin policy


Is there a way to disable the same origin policy on Google's Chrome browser? This is strictly for development, not production, use.

Do you know of a bleeding-edge HTML5 leveraging, legacy-ignoring JavaScript framework?


What's the best framework (sort of jquery, extjs, etc like) to use if I'd like to intensively use all the freshest technologies of the HTML5 stack provided by modern browsers (Firefox 7, Safari 5, Chrome 14) and have absolutely no need to support any legacy browsers (incl. no need in IE support at all and no need in Firefox or Chrome prior to the latest stable releases)? I'd like to get all the newest available goodness without having (even abstracted by a library layer) a line of code meant just fore legacy compatibility or keeping any legacy-induced things in mind.

How to sort a NSArray alphabetically?


How can I sort an array filled with [UIFont familyNames] into alphabetical order?

Convert UTF-8 encoded NSData to NSString


I have UTF-8 encoded nsdata from windows server. I want to convert it to nsstring for iphone. Since data contains characters(like degree symbol) which have different values on both platforms, how do I convert data to string.

Are you doing iPhone development? How do you learn?


I am looking for more iPhone developers who are actively posting to their blog and/or Twitter. I have been learning a lot from books but the online resources beyond Apple's developer site have been hard to find.

How do I draw a shadow under a UIView?


I'm trying to draw a shadow under the bottom edge of a UIView in Cocoa Touch. I understand that I should use CGContextSetShadow() to draw the shadow, but the Quartz 2D programming guide is a little vague:

Programmatically add custom event in the iPhone Calendar


Is there any way to add iCal event to the iPhone Calendar from the custom App?

iPhone or Android?


According to a recent article iPhone has gained a better appeal than Android among programmers. I'm quite a newbie to Java and a complete profane to ObjectiveC, in your opinion, in which one of the two could I have a try? which platform is good for me

How to implement Android Pull-to-Refresh


In Android applications such as Twitter (official app), when you encounter a ListView, you can pull it down (and it will bounce back when released) to refresh the content.

How do I make an http request using cookies on Android?


I'd like to make an http request to a remote server while properly handling cookies (eg. storing cookies sent by the server, and sending those cookies when I make subsequent requests). It'd be nice to preserve any and all cookies, but really the only one I care about is the session cookie.

Restful API service


I'm looking to make a service which I can use to make calls to a web based rest api. I've spent a couple of days looking through stackoverflow.com, reading books and looking at articles whilst playing about with some code and I can't get anything which I'm happy with.