The usual approach to build a timestamp for a log files in a batch is to use standard Windows utilities date and time. However the format of the output depends on locale and it is almost not possible to make the script which runs on any machine. A solution might be to create a small java […]
Category Archives: Programming
How to Get a Private Field of an Object using Reflection in Java
A useful function that allows to get access to a private field of an object. public static Object getFieldAsPublic(Object obj, String field) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Field f = obj.getClass().getDeclaredField(field); f.setAccessible(true); return f.get(obj); }
Personal File Sharing
If you need easy accessible personal file store, there are a lot of them on the web. Another solution is to use google blobstore service – a geek's choise :) import urllib from google.appengine.ext import blobstore from google.appengine.ext import webapp from google.appengine.ext.webapp import blobstore_handlers from google.appengine.ext.webapp.util import run_wsgi_app class MainHandler(webapp.RequestHandler): def get(self): upload_url = blobstore.create_upload_url('/upload') […]
Configuring Eclipse on Windows to Use With Google App Engine
The post "Configuring Eclipse on Windows to Use With Google App Engine" on Google has not been updated since 2008. Here is the updated version for Eclipse 3.7 (Indigo). Before you start, download and install the following components: Python – e.g. Python 2.7.2 Windows Installer for Windows Eclipse – e.g. Eclipse Classic 3.7 Google App […]
Python Google App Engine Calculator
Couple of months ago, accidentally I found myself on a conference for Python developers. I thought "what the hell am I doing here". Ok, now I got into an interesting project and have to learn Python… :) My first program – Calculator:) import webapp2 class MainPage(webapp2.RequestHandler): def get(self): # build a list of operations f […]
Activity Tracker
Do you have to fill timesheet weekly? I have to.. This small tool can help you to remember what you were doing last week :) You start the tool and minimize it to tray. It tracks activity on your computer and logs it to a file, so you can later see what you were doing. The […]
Log file with timestamp in Windows
How to build the log file name with timestamp in the format Log_yyyy_MM_dd_HHmm.log. Batch file @echo off REM get date in format yyyy-MM-dd FOR /f "tokens=1-3 delims=- " %%a IN ("%DATE%") DO (SET filedate=%%a_%%b_%%c) REM get time in format HHmm FOR /f "tokens=1-2 delims=:" %%a IN ("%TIME%") DO (SET filetime=%%a%%b) REM if time in format […]
Multiple selection in a TreeView
The code demonstrates an example how multiple selection can be implemented in C# using TreeView control. Download Source Code
Progress bar with background worker
This code sample shows how BackgroundWorker can be used for progress bar.
Drawing tutor
There are many brain fitness exercises on the web that helps to develop mental skills. There are not that much programs that help to develop visual skills. Well I do not know any of such. The purpose of this program is to develop visual skills. You could also improve your intellectual skills trying to figure […]