Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  php://input in PHP

When using xml-rpc, server side will get the data from client with php://input method instead of $_POST. Hence today we will discuss php://input.PHP official manual has below explanation to php://input:“php://input allows you to read raw POST data. It is a less memory intensive alternative to $HTTP_RAW_POST_DATA and does not need any special php.ini directives. php://input is not available with enctype=”multipart/form-data”.Here we understand the above statement from 3 aspects:Read POST dataCannot use multipart/form-data typephp://input...

34,998 0       PHP://INPUT IO INPUT


  Permutation algorithm with JavaScript

In secondary school, we have learned permutation. Basically, for n numbers, the number of permutations for these n numbers can be calculated to n! which is called 'n factorial'. But to display all the permutations on the screen, we need to use a recursive function. The problem is how to write this function. Next I write a program to display the permutations for n numbers with JavaScript. First, we need to understand that from these n numbers, we can first take any one number from it, and the (n-1) numbers remaining has the similar property as the n numbers, we need to find the permutation...

34,941 0       JAVASCRIPT ALGORITHM PERMUTATION IMPLEME


  C vs Java Complete Comparison

Similarities:Java and C have same syntax operators.Difference—thinkingTwo paradigms:Java: Object oriented languageC: Structured languageDifferences: --SyntaxNo preprocessorJava does not include a preprocessor and does not define any analogs of the #define, #include, and #ifdef directives. Constant definitions are replaced with static final fields in Java. (See the java.lang.Math.PI field for an example.) Macro definitions are not available in Java, but advanced compiler technology and inlining has made them less useful. Java does not require an&nbs...

34,738 7       JAVA COMPARISON C DIFFERENCE SIMILARITIE


  About short URL and its implementation

IntroductionURL shortening is a kind of technique to convert a long URL to a short URL. There are many companies now providing this kind of service, we now take Google's URL shortener service http://goo.gl/ as an example.First we navigate to http://goo.gl/, then we enter a random URL into the text field, here we use http://www.url-to-be-shortened.com as the input, it will return us an shortened URL : http://goo.gl/ZSVMM. URL ParsingWhen we type http://goo.gl/ZSVMM in browser address bar, the DNS server will first parse the IP address of http://goo.gl/. After the DNS server gets the IP address ...

34,545 2   


  How to check whether a web page can be loaded in iframe

Sometimes you may want to load other website's page in your own website's iframe, but due to some security concerns, other website may have security configurations which prevent you from loading their pages into your iframe. In this case, if you try to load them, you would see a blank page or a text message telling that it's prohibited. Fortunately, you can detect this before you actually decide to load it.To prevent a page from being loaded by an iframe from other site, the response header sent to the browser will contain some options which denies the load. These response header opt...

34,154 2       IFRAME SECURITY X-FRAME-OPTIONS CONTENT-SECURITY-POLICY HTML HTTP


  TIOBE : Where is that next big programming language?

TIOBE has released the Programming Community Index for May 2012 a bit late. The top 3 languages do not change compared to last Month TIOBE : C overtakes Java as the No.1 programming language, they are still C,Java and C++. However, the share of Java is continuing dropping, Objective-C is steadily rising  Other languages which have rising trend are Visual Basic.NET,PL/SQL and Logo.The last 8 years not much has changed in the top 10 of the TIOBE index except for Objective-C (in) and Delphi (out). Apart from iPhone language Objective-C, new language adoption appears to be much harder th...

34,067 2       TIOBE 2012 MAY KING


  Eight C++ programming mistakes the compiler won’t catch

C++ is a complex language, full of subtle traps for the unwary. There is an almost infinite number of ways to screw things up. Fortunately, modern compilers are pretty good at detecting a large number of these cases and notifying the programmer via compile errors or warnings. Ultimately, any error that is compiler-detectable becomes a non-issue if properly handled, as it will be caught and fixed before the program leaves development. At worst, a compiler-detectable error results in lost time while the programmer searches for a solution or workaround.The dangerous errors are the ones that co...

33,873 3       C++ COMPILER ERROR DETECTION


  Create temp file in Bash using mktemp and trap

When working on Linux Bash, sometimes there is need to create temporary file. A common way of creating temp file on Linux is creating some file in /tmp directory. However there is security risk when creating temp file in /tmp directory. This post will show how to securely create temp file in Linux Bash.When creating file in /tmp directory, there are some security risks. This directory can be accessed by any user on the system, any user can write data into this directory as well. The files created in this directory can also be read by other users. pike@DESKTOP-G352RBR:/tmp$ touch /tmp/info...

33,815 2       TEMP FILE MKTEMP TRAP LINUX