I still wonder how come that after so many years of HTML existence there is no easy way to output date/time values in local time. What could be as simple as having an element like <localdatetime value="2015-05-06 10:39:00" format="hh:mm"/> to make sure that user sees the time in the local timezone? (the value as you may have already guessed comes as UTC date/time and the format allows to control which parts of date/time have to appear in the result)
The problem is that even in the simplest case of a static page that, for example, now and then has to display a maintenance warning like "due to maintenance works the site will be unavailable till 10:00 of local time" the developer must use javascript or something else to render the time correctly. That's quite annoying.
"I'm just sitting here watching the wheels go round and round, I really love to watch them roll..." John Lennon
Wednesday, May 6, 2015
Tuesday, November 27, 2012
Win7 Russian - RunAs command not working with error 1332: No mapping between account names and security IDs was done.
Spent a half day to find the reason for the problem. I am running Windows 7 Professional Russian on my box. Yesterday I discovered that RunAs command was not working. Neither was the "Run as different user" shell menu command. In any case the error message was the same - "No mapping between account names and security IDs was done.". In the case of the RunAs command some extra info was displayed in the console. It was the ERROR_NONE_MAPPED 1332(0x534) error code.
I searched and read Google for many hours, tried different command line arguments, created a new user to test with, double-checked that seclogon (Secondary Logon or "Вторичный вход в систему" in Russian) service is up and running, looked through local security policies to find anything related, even ran a malware detection utility. No luck. I even went so far as creating a small C# snippet that tried to run a process with different credentials:
Finally, desperate and disappointed of wasting so much time, I found the cause - the Control Panel/"Clock, Language, and Region"/"Region and Language"/"Administrative"/"Language for non-Unicode programs"/"Change system locale" was set to "English" and that totally broke the internal user account mappings for the underlying system call.
Here is the screenshot of where it is in Russian version of Win7:
Once I had changed the setting to "Russian" and restarted the box everything started to work as expected.
What can I say about that experience? Now I hate localized versions of Windows even more than before.
I searched and read Google for many hours, tried different command line arguments, created a new user to test with, double-checked that seclogon (Secondary Logon or "Вторичный вход в систему" in Russian) service is up and running, looked through local security policies to find anything related, even ran a malware detection utility. No luck. I even went so far as creating a small C# snippet that tried to run a process with different credentials:
var pswd = new System.Security.SecureString();
foreach(char ch in "test123")
pswd.AppendChar(ch);
var psi = new ProcessStartInfo {
UserName = @"my-pc/testuser",
Password = pswd,
FileName = @"c:\windows\system32\notepad.exe",
WorkingDirectory = @"c:\",
UseShellExecute = false
};
Process.Start(psi);
It failed with exactly the same error.Finally, desperate and disappointed of wasting so much time, I found the cause - the Control Panel/"Clock, Language, and Region"/"Region and Language"/"Administrative"/"Language for non-Unicode programs"/"Change system locale" was set to "English" and that totally broke the internal user account mappings for the underlying system call.
Here is the screenshot of where it is in Russian version of Win7:
Once I had changed the setting to "Russian" and restarted the box everything started to work as expected.
What can I say about that experience? Now I hate localized versions of Windows even more than before.
Monday, September 26, 2011
Java, GC - object layout thoughts
Just some very draft thoughts - would it be possible to approach some of well-known GC-related memory problems by simply separating structure and data? What I mean is navigational links of an object, i.e. references to other objects, can be kept aside of the flat data associated with the object. In that case structural part of all objects will constitute a smaller memory region compared to the one created by how it is done currently. This may probably improve the efficiency of GC since the collector would need to scan smaller memory spaces with closer reference locality.
The data region would likely need lighter collection algorithms than it currently does. However, a certain side-effect of the approach is that the run-time would have to do an extra navigation every time when a reference has to be resolved into the corresponding data.
UPD 2012-07-16 Here is another experimentally-proven approach which relies on separating of pointer and data values at a finer grain. The key idea is again in that the pointer-data separation allows for building very efficient garbage collection algorithms.
The data region would likely need lighter collection algorithms than it currently does. However, a certain side-effect of the approach is that the run-time would have to do an extra navigation every time when a reference has to be resolved into the corresponding data.
UPD 2012-07-16 Here is another experimentally-proven approach which relies on separating of pointer and data values at a finer grain. The key idea is again in that the pointer-data separation allows for building very efficient garbage collection algorithms.
Wednesday, April 27, 2011
Win7 Calc is cool!
Having recently upgraded Vista to Win7 I didn't notice firstly that Calc.exe has been renovated significantly. Now there are four different calculator types - Standard, Scientific, Programmer, and Statistics. Plus there are new panels for unit conversion and date calculations.
Monday, April 18, 2011
Follow-up: Why I consider these features missing in Java
Some time ago I created a list of features I consider missing in the current Java implementation. As I recently realized it makes sense to provide reasoning for some of them to be in the list.
Friday, March 18, 2011
Eclipse CDT crashes on jdk1.6.0_23/24
Just came across a known bug with the latest JVM releases 1.6.0_23 or 24 - Eclipse CDT crashes on start-up. Solution is to add -XX:-UseCompressedOops in the eclipse.ini file.
Oracle tracks the problem in this record. According to it a fix will be delivered with 1.6.0_25.
Oracle tracks the problem in this record. According to it a fix will be delivered with 1.6.0_25.
Sunday, February 27, 2011
Oracle: PL/SQL vs Java - one unconventional question
All the time since the introduction of Java engine within Oracle RDBMS people have been wondering how performance of Java stored procedures compare to orthodox ones written in PL/SQL. There are lots of performance tests demonstrating where things stand. Surprise! I am not going to discuss it here. What I am really curious about is what we may expect in future. Might it happen that one day PL/SQL will be fully replaced with the Java engine?
Wednesday, February 9, 2011
jvisualvm from jdk1.6.0_22 crashes on my Vista x64
Just discovered that jvisualvm.exe from jdk1.6.0_22 crashes with no apparent reason while starting up on my Vista x64 laptop. This is quite weird as yesterday I managed to start it many times without a problem, although there were two or three crashes. Not sure what has happened. Assuming that some of plug-ins may be corrupt I tried to remove the configuration under Application Data\.visualvm\6u20 folder. It started well a few times then again rejected to start. The same utility from jdk1.6.0_16 seems to operate well.
I am going to upgrade to jdk1.6.0_23 and see whether it solves the problem.
UPD Seems it is more stable in jdk1.6.0_23.
UPD #2 Here VisualVM dev team mention a Java bug that affects 64bit systems and they suggest adding "
UPD #3 In JDK1.6.0_23 this option is already provided by default in ${JDK_HOME}\lib\visualvm\etc\visualvm.conf.
I am going to upgrade to jdk1.6.0_23 and see whether it solves the problem.
UPD Seems it is more stable in jdk1.6.0_23.
UPD #2 Here VisualVM dev team mention a Java bug that affects 64bit systems and they suggest adding "
-J-Dsun.java2d.d3d=false" to the command line as a solution.UPD #3 In JDK1.6.0_23 this option is already provided by default in ${JDK_HOME}\lib\visualvm\etc\visualvm.conf.
Friday, February 4, 2011
Why no ClassShutter in Java6 JS engine?
There is one thing about Java6 I am in a way baffled by. As far as I remember the JavaScript scripting engine in Java6 has been based on Mozilla Rhino. How did it happen that the implementation in Java6 is missing the original Rhino functionality for restricting the set of classes that may be loaded by a script?
I assume the feature has been replaced by allowing a custom implementation of java.lang.ClassLoader in one of javax.script.ScriptEngineManager constructors. This offers unlimited flexibility for other scripting engines that might be plugged in the JVM instance. Then another question - is there any built-in ClassLoader in Java6 that supports class filtering? Because of safety reasons it is quite natural to limit the set of classes loadable by scripting extensions. However it seems there is no standard or default way to do that. So everybody willing to ensure better control over the extension scripts has to build their own implementation of essentially the same functionality. Not quite encouraging.
I assume the feature has been replaced by allowing a custom implementation of java.lang.ClassLoader in one of javax.script.ScriptEngineManager constructors. This offers unlimited flexibility for other scripting engines that might be plugged in the JVM instance. Then another question - is there any built-in ClassLoader in Java6 that supports class filtering? Because of safety reasons it is quite natural to limit the set of classes loadable by scripting extensions. However it seems there is no standard or default way to do that. So everybody willing to ensure better control over the extension scripts has to build their own implementation of essentially the same functionality. Not quite encouraging.
Friday, December 24, 2010
JPA + Hibernate: optimizing queries on a many-to-many relationship
Following up a discussion (in Russian) on a developers' forum on advanced querying against many-to-many mapping in JPA I have compiled all my findings in this post. I intentionally leave all object and database names close to the original maybe with minor changes.
Friday, December 17, 2010
Splitting the blog in two
Finally this is the time to sort out the mess of English and Russian posts in the same blog. I feel much easier when writing about IT and related technologies in English. So I will split the blog and go on posting in English here. All posts in Russian are moving to yegodm-ru.blogspot.com.
Wednesday, February 3, 2010
Idea of a litmus test for the company that hires you
I suspect this might be a good question to raise on an interview with any potential employer in software engineering industry:
"With regard to the engineering you do when creating your product(s), if you were a car manufacturer what kind of car make would you match your whole production line with - AvtoVAZ, Toyota, Ferrari?". The list, of course, can vary to contain names known to the other party but the idea would still be the same.
I see no other way to quickly reveal how significant and relevant the tools and technologies employed by the company are. Sometimes they might tell you they use Perforce but then it appears they don't use branches and store compiled binaries in it for some wierd reason. Sometimes they claim to use Continuous Integration system but then you find out they don't write unit-tests so it makes using of CI close to sheer nonsense. Or, even worse, they do write unit-tests but without assertions. Some mention they are Agile but meaning by that things are in total mess and uncontrolled. Think for some time and I bet you will be able to find your own examples of such lies.
It is just a rough guess, yet I hope it is on the right track.
I see no other way to quickly reveal how significant and relevant the tools and technologies employed by the company are. Sometimes they might tell you they use Perforce but then it appears they don't use branches and store compiled binaries in it for some wierd reason. Sometimes they claim to use Continuous Integration system but then you find out they don't write unit-tests so it makes using of CI close to sheer nonsense. Or, even worse, they do write unit-tests but without assertions. Some mention they are Agile but meaning by that things are in total mess and uncontrolled. Think for some time and I bet you will be able to find your own examples of such lies.
It is just a rough guess, yet I hope it is on the right track.
Tuesday, February 2, 2010
Servlets vs Messaging
Being kind of not a big fan of Web development I wonder what is so special about Servlets that requires a separate API to use them?
Integer.valueOf(): a few facts
Integer.valueOf(int x) added since Java 1.5 has one interesting feature - it resolves all incoming int values through a cache so to minimize the number of java.lang.Integer instances in application by re-using the cached values. This cache is also configurable with a system property java.lang.Integer.IntegerCache.high which is used to define the upper bound to populate the cache to. The minimum value is hard-coded and it is -128.
Surprisingly the upper bound for java.lang.Long, where a similar cache also exist, is hard-coded to 127 and is not at all configurable.
Surprisingly the upper bound for java.lang.Long, where a similar cache also exist, is hard-coded to 127 and is not at all configurable.
Subscribe to:
Comments (Atom)