We can use the regexp feature of the find/replace tool in Word.
Search for:
\\code\{(*)\}
Where:
- \ is the escape char (thus the \\ for detecting a Latex tag)
- * means “everything”
- ( ) creates a logical entity that you can re-use in the replace field.
and replace by:
\1
which refers to the entity we created by using ().
More info on this doc
Use this command:
sudo update-rc.d -f SERVICE_NAME remove
where SERVICE_NAME is the name of the service to remove, e.g. vsftpd.
More info on the topic: http://www.unixtutorial.org/2009/01/disable-service-startup-in-ubuntu/
May 29th, 2010 in
Linux |
No Comments
Run sudo update-java-alternatives -l to see the current configuration and possibilities.
Run sudo update-java-alternatives -s XXXX to set the XXX java version as default.
For Sun Java 6 this would be sudo update-java-alternatives -s java-6-sun
Run java -version to ensure that the correct version is being called.
Source: https://help.ubuntu.com/community/Java
April 20th, 2010 in
Java,
Linux |
No Comments
find . -name ".svn" -exec rm -rf {} \;
October 8th, 2009 in
Dev Logbook,
Linux | tags:
command,
svn |
No Comments
if (Desktop.isDesktopSupported()) {
Desktop dt = Desktop.getDesktop();
if (dt.isSupported(Desktop.Action.BROWSE)) {
dt.browse(new URI("http://localhost:8182/EnergieVisible"));
}
}
From Java 1.6.
October 3rd, 2009 in
Java |
No Comments
You probably are REST lovers like I personally am.
Thus you were probably quite frustrated when seeing that a GWT (Google Web Toolkit) client cannot send other requests than POST or GET.
Well here is the solution:
public class RequestBuilderForAnyHTTPMethodTypeExample extends RequestBuilder {
/**
* Constructor that allows a developer to override the HTTP method
* restrictions imposed by the RequestBuilder class. Note if you override the
* RequestBuilder's HTTP method restrictions in this manner, your application
* may not work correctly on Safari browsers.
*
* @param httpMethod any non-null, non-empty string is considered valid
* @param url any non-null, non-empty string is considered valid
*
* @throws IllegalArgumentException if httpMethod or url are empty
* @throws NullPointerException if httpMethod or url are null
*/
public RequestBuilderForAnyHTTPMethodTypeExample(String httpMethod, String url) {
super(httpMethod, url);
}
i.e. simply subclass the RequestBuilder
Source: (see the bottom of the page).
If like me you export your Visual Studio (2008) .NET C++ project as an EXE, copy it on another machine and get: “This application has failed to start because the application configuration is incorrect”. Then it might be because the target machine is actually missing the Microsoft .NET Framework.
Since I did not really felt like asking all the future users of my app to install the .NET framework, I started looking for a way of embedding these libs in my final app.
While it is apparently not possible to do so without requiring a special (commercial) tool, there is a workaround that worked for me. By forcing the C/C++ to by statically linked the framework functions actually are embedded into the EXE (which, btw, gets much bigger then).
To do so (in Visual Studio .NET 2008 C/C++, Express) do:
Property Page -> Configuration Properties -> C/C++ -> Code Generation then “Runtime Library” should be set to an “non-dll” option such as Multi-threaded (for the release target) or Multi-threaded Debug (to debug your app).
Here we go!
Sources:
http://stackoverflow.com/questions/271290/can-visual-studio-2008-standard-create-a-single-exe-that-does-not-require-net-fr
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/36971526-95f3-4a9f-a601-1843c86332c1
“Bug” number two for today is a little more tricky.
I was retrieving a JSON object in the GWT (Google Web Toolkit) and putting its Java representation in a HashMap. The only problem is that I could never find it again by referring to its key which I also extracted from JSON object. Here is why:
currentCons.get("URI").isString().toString()
Is actually not returning the String representation of a JSONString object but the quoted representation of that String: e.g. “key” and not key. It was in the API but it took me a while to figure it out…
The solution is:
currentCons.get("URI").isString().stringValue();
Which gets what I wanted, i.e. the String representation without the quotes.
Two nice little bugs today which sums up most of my day
How not to use iterators:
while(views.iterator().hasNext()) {
View currentView = (View) views.iterator.next();
currentView.update();
}
Bing that basically crashed my Firefox (this is part of a GWT app) when running it as well as my Netbeans / GWT debugger. Notice that Firefox was so good to tell me that apparently the script I was running in a weird manner.
And it was indeed in an endless loop as you can guess: invoking the iterator() method returns a new Iterator object every time (which it is supposed to do, I’m the dumb one in that story). Thus, I was basically getting the same “next()” object every time and hasNext() was thus always true
Anyway that fixes it:
Iterator viewsIt = views.iterator();
while(viewsIt.hasNext()) {
View currentView = (View) viewsIt.next();
currentView.update();
}
Ok that was a trivial one, but actually so trivial that I just felt like shaming me a little more and publishing it here
Customize the Default Username (Author) in Netbeans 6.7:
- Open the netbeans.conf file
- Locate the ‘netbeans_default_options’ property
- Add the discussed property to the list of options as ‘-J-Duser.name=\”Dominique Guinard\”‘
Source