Stored Procedure Example 1
- check for valid input parameter
- declare handler for db error (
1062
=> duplicate key) - insert data
- return status
|
|
1062
=> duplicate key)
|
|
This post shows an empty basic game loop in Android, similar to how we used to make game loops on the J2ME platform.
The View
implements Runnable
and starts a render thread itself. An interesting thing is that we can’t invalidate
the View from its own thread, as invalidate
must be called from the main UI thread only. Instead we use postInvalidate
which sends a message to the UI thread’s message queue. The consequences are that drawing is not performed immediately, but only when the UI thread handles the message.
It’s a little bit tricky to parse and use XML data when tags have different namespaces. We would have to use the namespace string when accessing the objects like below with $dc_namespaces
:
XML with two different namespaces
|
|
PHP code to access the parsed object:
A simple example for creating a jQuery function called setPosition
which can be used to set the top and left CSS properties of an element.
The function can be used like this:
|
|
Below is the authenticated request we want to build. It carries a username and password authentication header.
SOAP XML request
|
|
tnsnames.ora
configuration excerpt:
Connect and execute a prepared statement from PHP code.
|
|
“When you see the right thing, do it — this may look like more work in the short term, but it’s the path of least effort in the long run. If you don’t know what the right thing is, do the minimum necessary to get the job done, at least until you figure out what the right thing is. To do the Unix philosophy right, you have to be loyal to excellence. You have to believe that software design is a craft worth all the intelligence, creativity, and passion you can muster. Otherwise you won’t look past the easy, stereotyped ways of approaching design and implementation; you’ll rush into coding when you should be thinking. You’ll carelessly complicate when you should be relentlessly simplifying — and then you’ll wonder why your code bloats and debugging is so hard. To do the Unix philosophy right, you have to value your own time enough never to waste it. If someone has already solved a problem once, don’t let pride or politics suck you into solving it a second time rather than re-using. And never work harder than you have to; work smarter instead, and save the extra effort for when you need it. Lean on your tools and automate everything you can.
Software design and implementation should be a joyous art, a kind of high-level play. If this attitude seems preposterous or vaguely embarrassing to you, stop and think; ask yourself what you’ve forgotten. Why do you design software instead of doing something else to make money or pass the time? You must have thought software was worthy of your passion once…. To do the Unix philosophy right, you need to have (or recover) that attitude. You need to care. You need to play. You need to be willing to explore.”