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

 ALL


  Execute PHP from a .html File

How can I execute PHP code on my existing myfile.html page?:When a web page is accessed, the server checks the extension to know how to handle the page. Generally speaking if it sees a .htm or .html file, it sends it right to the browser because it doesn't have anything to process on the server. If it sees a .php extension (or .shtml, or .asp, etc), it knows that it needs to execute the appropriate code before passing it along to the browser. Here is the problem: You find the perfect script, and you want to run it on your site, but you need to included PHP on your page for it to work. You ...

6,845 0       PHP HTML PHP IN HTML ADDTYPE


  How to Ace a Google Interview

Imagine a man named Jim. He's applying for a job at Google. Jim knows that the odds are stacked against him. Google receives a million job applications a year. It's estimated that only about 1 in 130 applications results in a job. By comparison, about 1 in 14 high-school students applying to Harvard gets accepted.Jim's first interviewer is late and sweaty: He's biked to work. He starts with some polite questions about Jim's work history. Jim eagerly explains his short career. The interviewer doesn't look at him. He's tapping away at his laptop, taking notes. "The next question I'm going to ask...

2,322 0       GOOGLE INTERVIEW JOB QUESTIONS AND ANSWERS


  On being happy

For the whole past night I lay awake without sleeping a minute, mostly because I am still fully jet-lagged from the move to Europe yesterday. For some reason, the one thought that entered my mind was one about what it means to be happy.Yes, of course, being on an exciting startup journey, there are other goals which are more in the foreground. There is creating a product users love, getting funding or earning enough money to sustain yourself.Whilst I greatly enjoy this product and user focus, it is fantastic to take a step back during these more quiet days and reflect on life more widely.Perso...

2,123 0       STEVE JOBS HAPPINESS ATTITUDE


  In 2012, let’s stop talking web design and start talking product design

“My hope for 2012 is that some of the old guard of well-respected web gurus stop talking HTML and CSS and start talking serious development. I love the way many of the old guard write and evangelize, but I’m tired of discussing basically the same stuff we were in 2006.”I wasn’t specifically referring to Jeffrey Zeldman, but he (somewhat arrogantly) assumed I was, and responded with a sarcastic, “And a merry Christmas to you, sir.” And while I wasn’t thinking of Zeldman and his books, conferences, and magazi...

2,490 0       WEB DESIGN MODEL 2012 MODULE FOCUS


  A Perl Regular Expression That Matches Prime Numbers

perl -lne '(1x$_) =~ /^1?$|^(11+?)\1+$/ || print "$_ is prime"'Can you figure out how it works? I give an explanation below, but try to figure it out yourself. Here is what happens when you run it:$ perl -lne '(1x$_) =~ /^1?$|^(11+?)\1+$/ || print "$_ is prime"'122 is prime33 is prime455 is prime677 is prime89101111 is primeHere is how it works.First, the number is converted in its unary representation by (1x$_). For example, the number 5 gets converted into 1x5, which is 11111 (1 repeated 5 times.)Next, the unary string gets tested against the regular expression. If it matches, the number is ...

5,337 0       REGULAR EXPRESSION PERL REGEX PRIME NUMBER ONE LINE


  The ugliest C feature:

<tgmath.h> is a header provided by the standard C library,introduced in C99 to allow easier porting of Fortran numerical software to C.Fortran, unlike C, provides “intrinsic functions”, which are a part of the language and behave more likeoperators. While ordinary (“external”) functions behave similarly to C functions with respect to types(the types of arguments and parameters must match and the restult type is fixed), intrinsic functions accept arguments of several types and their return type may depend on the type of their arguments.For example Fortran 77 provid...

45,757 0       C FORTRAN INTRINSIC FUNCTIONS C99 UGLY


  10 habits of 10x developers

Last week, I discovered The Rise of Developeronomics via Brad Feld. As long as I’ve lived, it has always been a great time to be a software developer. The economics keep getting better for us. My favorite quote:The one absolutely solid place to store your capital today — if you know how to do it –  is in software developers’ wallets. If the world survives looming financial apocalypse dangers at all, this is the one investment that will weather the storms. It doesn’t matter whether you are an individual or a corporation, or what corner of the world you in...

2,705 0       DEVELOPER ADVICE EFFICIENCY FOCUS REST


  Using PHP sessions across subdomains

By default, PHP uses the 'PHPSESSID' cookie to propagate session data across multiple pages, and by default it uses the current top-level domain and subdomain in the cookie declaration.Example: www.domain.comThe downside to this is that the session data can't travel with you to other subdomains. So if you started a session on www.domain.com, the session data would become unavailable on forums.domain.com. The solution is to change the domain PHP uses when it sets the 'PHPSESSID' cookie.Assuming you have an init file that you include at the top of every PHP page, you can use the ini_set() functi...

26,546 0       PHP SESSION SUBDOMAIN AVAILABILITY