Invisible folder
Long time ago was MS/DOS (many of the connected people coming today on this site never known this…) but for some programmers remember it is possible to create a directory (or even a filename) made of invisible characters (i.e. the ASCII Code 255). Quite easy.
I found the new way to do it …on Windows Vista! Now, the name of the folder becomes invisible but also the folder itself. A great way to create a (more or less) secret folder on your desktop!

The original post:
http://www.makeuseof.com/tech-fun/create-invisible-folder/
Get and set properties in PHP (dynamically)
I worked in PHP 5.3 and I created some interesting stuff. But the most interesting thing about the classes are the properties of a class…
There is no big changes since PHP 4 except the visibility. Now variables can be public, protected or public. This is not a big behavior as every object-oriented language has defined this. Basically, you simply declare your properties like this:
class MyObject {
public $myProperty;
}
If you look carefully in the PHP documentation, you will find you can access your property simply writing $myInstance->myProperty where $myInstance is an instance of the object (as for any other language).
Which is interesting is the capability of PHP (same for Ruby, I do agree) to be fully dynamic. Then you can retrieve all the properties available (and their values) through the get_object_vars($myInsance) call. Then you get all your properties in an array (which is a hash table or a Map for Java developers).
This is good, then you know how to get the properties dynamically: if you have the name of the property stored in a variable, you get its value as show above. What about setting the value of a property?
Well, I try to find the answer in Google but I failed. No way to set dynamically a property (except using the __set() method but this one do not work on declared properties!). I looked for a set_object_vars() method, but nothing!
In fact, it is VERY simple: $myInstance->$propertyName is the solution. Simply note the “$” sign after the “->”: it means $propertyName is not the property name but a variable having the property name stored inside. That’s all. Very simple but no way to find it in a blog or in PHP documentation.
To be clear: $myInstance->$propertyName is equivalent to $myInstance->myProperty when $propertyName = "myProperty". See the code below (I changed names), at the end, the code will display “It works!”:
<?php
class TestIt {
public $hook;
}
$o = new TestIt();
$varname = "hook";
$o->hook = "Initial value";
$o->$varname = "It works!";
echo $o->hook;
?>
Impressive (and amazing), isn’t it?
Then I should be able to create a fully dynamic library to manipulate data between the database, the entity as an mapped object/relational and a simple form to input the data. If I have to write something in PHP, I will publish the code.
Thinking inside the app
This interesting article focuses on the MDM (Mobile Device Management) and MAM (Mobile Application Management). As MDM is important, it concerns the management of the devices inside the company (deployment, etc.), the MAM is a complement to know how the application has to manage itself and its security. This is a sort of second level of management for business centric applications.
As a conclusion of the article: “Although MDM is still very important, it’s becoming increasingly more effective to approach deployment of enterprise mobile Apps from the very start of the development process.”
The complete article from Chris Shroeder at Mobile Orchard: click here.
Apple is top staisfaction
Once again, Apple tops the J.D. Power rankings, see http://mobileorchard.com/once-again-apple-tops-j-d-power-rankings-for-smartphone-consumer-satisfaction/.
JAVA 7 is out
First version of JAVA from Oracle. JAVA 7 is available. There are 2 differents things very interesting about the syntax (other stuff like a brand new I/O API with a native file copy are also available).
Strings switch
It is new (even C/C++ does not include this feature) and very useful. From now, You can directly use the strings as arguments for the results of a switch:
switch( cheese ){
case "Camembert" : return FRANCE;
case "Cheddar" : return UNITED_KINGDOM;
}
It is a revolution. I hope they use the hash code of the strings to optimize the switch (I don’t know) but in any case, it is a very useful way to work with simple text analysis.
A complete example can be found at http://download.oracle.com/javase/tutorial/java/nutsandbolts/examples/StringSwitchDemo.java (see also the end of the page of the Java tutorial).
Multiple throw
Another frustrating syntax was linked to the try/catch. Especially when you want to catch multiple exceptions related to the same stuff (XML parsing for example can generate several type of exceptions, same when you use introspection).
Now, you can catch several exceptions by using the pipe (“|”) character. You can then write:
try {
...
}
catch( DOMException|ParseException ex ){
...
}
OpenJDK
OpenJDK is now available in version 7. Then open source is not yet broken by Oracle. Note the OpenJDK is not available for Windows where the official Sun release is the only available.
iPhone 5 – 3D Display
As a preview of very new features of iPhone5, we continue with the LED video projector. Better than previous video projector display included in some other smartphones, the iPhone gives you an incredible video display.
I am sure now you will buy one.
New iPhone 5
Now, the iPhone 5 will have an amazing keyboard easy to use. Look at the video below to see the biggest enhancement from the Apple company (thanks to Steve Jobs…)
Don’t look for a shortcut
The simplest way to find your way is to follow the map… Well, now the map follows you… and it is 3D!
A more complete article at http://www.engadget.com/2010/12/16/google-maps-5-0-hits-android-includes-new-3d-map-view-and-offli/
Tim Berners-Lee in Geneva
Just to inform interested people: Tim Berners-Lee gives a conference (with Gordon Brown) in the UNIGE University of Geneva next Wednesday. The future of the WEB will be discussed (nothing less!).
For those who forgot, Tim Berners-Lee is the creator of the WEB. The WEB born a few miles from the UNIGE in the CERN. Back to the future then
Of course, the appointment is in the room 404.
More information (in French): http://www.unige.ch/presse/archives/2011/web.html
IPv6 – what’s next?
I usually don’t speak about freedom on Internet. My concern is more oriented to open source programs. But I recently exchanged on the Internet privacy over private communication. I found some intresting links.
I recommand two articles:
- The first one is about IPv6 privacy.
- The second one is also about the IPv6 but discussion includes the replacement of our old-fashion DNS.
I think freedom of Internet is included in the low-level protocols. Do you share this idea?
-
Archives
- October 2011 (1)
- September 2011 (7)
- April 2011 (1)
- February 2011 (1)
- January 2011 (1)
- December 2010 (1)
- October 2010 (1)
- August 2010 (3)
- July 2010 (1)
- February 2010 (2)
- January 2010 (3)
- July 2009 (1)
-
Categories
-
RSS
Entries RSS
Comments RSS
