onsdag den 4. juli 2012

Movement speed OVER Magic Find

If you're at the point where you are considering packing on lots of Magic find and going for farms at lower difficulty, consider Movement speed first.

Movement speed(MVS) will boost everything, if you have good enough gear, elite mobs in f.ex. Act I are just a bump.

If you are farming elites only, there will be a lot of running involved. When I do runs, I'm running like 3/4 of the time.

Consider the math.

Movement speed is capped to 25%, you can get there with 12% on boots (obviously) and then mixing in some legendary armour to boost MVS. Equipment tips in the bottom of this article.

Lets say the run takes 30 mins. With 25% MVS, you can decrease it to:
(3/4 X 30 min) X 0,8* + (1/4 X 30 min) = 25.5 min per run
*0,8 is the MVS factor, increasing your MVS by 25%, makes you finish a lap at 80% of the time. That comes to 30 / 25.5 = 1.176, increasing your runs på 17.6%

How does that relate to Magic Find?
Magic find, you can get to 125% very easily, for a total of 200% with Nephalem buffs.

Running 17.6 % faster means you get the equivalent of 200 * 1.176 = 235.2 MF

And it scales very well

With 300% MF at max, you get 300 * 1.176 = 352.8 MF

Conclusion

The higher MF you have the more MVS is worthwhile. MVS at percent by percent starts to outweigh MF at as low levels as 125% MF, also take into consideration the guaranteed rare drops from elite and bosses where you rolled low on MF, you'll get more of those with higher MVS. Also consider that MVS does the exact same thing for Gold Find at the same time. Also consider that Blizzard might nerf MF anytime soon, see Magic Find Gear Swapping

Equipment tips

Don't go for movement speed on weapons, those weapons usually have too poor dps and we need to keep killing fast.

On my build I have 'Inna's glory' pants, with 7% move, 11% MF, a little resist and 140+ vit. Very crappy pants for main build, but excellent for MF build.

For bracers I have 'Lacuni prowlers' woth 6% move, 12% MF, 5% IAS, increased gold pickup. Increased gold pickup is very nice for speeding up runs.

fredag den 27. april 2012

Migrate from SQL Server to MySQL

On 64-bit windows
Download MySQL GUI tools
Make sure to have a 32-bit java
Run tool from CMD line
MySQLMigrationTool.exe -verbose -debug
-jvm "C:\Program Files (x86)\Java\jre7\bin\client\jvm.dll"
Alert box may appear with problem finding msvcr100.dll
In that case, rename msvcr100_clr0400.dll to msvcr100.dll in C:\Windows\SysWOW64
When tool is up and running, choose MS SQL server as source and MySQL as dest
If you are using UTF8, choose multilingualism and shit
Export inserts to a file
Check that encoding is correct with a tool, maybe Notepad++
If not correctly encoded, run tool again till an advanced tab shows you the JDBC connection string
find the string for MS SQL and copy it (UPDATE: its 'characterEncoding=UTF-8')
Go back to 'source selection', click 'advanced', input JDCB string, remove any encoding options
This way, the output is not encoded before being written to output
If encoding still fails, try setting environment option JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8, before running tool again

onsdag den 18. januar 2012

uncheck checkboxes with jQuery

$('input[type=checkbox]').removeAttr('checked');

tirsdag den 1. juni 2010

JavaScript self-replicating program (or Quine)

This program will output the code for itself:
using function.toString()

(function() {var f;function r() {
return "(function() {var f;" + f + ";f=rep.toString();return r();})();";
};f = r.toString();return r();})();

using unescape()

var a = "(function() { return 'var a = ' + unescape('%22') + a + unescape('%22') + ';' + a; })();";(function() { return 'var a = ' + unescape('%22') + a + unescape('%22') + ';' + a; })();

torsdag den 29. oktober 2009

Python UTF-8 for non english characters

Configure module
First make sure your python module is saved as UTF-8

Next, in the top of your python module add the setting:

# -*- coding: utf-8 -*-


this will tell the compiler to use UTF-8 instead of OS specific

Prefix a 'u' for all strings
print u"rødgrød med fløde"

- will work

print "red porridge with cream"

- wil work because no non-english characters are present
(or whatever difference between your OS and UTF-8)

print "rødgrød med fløde"


- will not work because the encoding is misinterpreted

Entire python script

# -*- coding: utf-8 -*-
print u"rødgrød med fløde"

mandag den 31. august 2009

KHAN's ladder to programming excellence!

In Maxwell Gladwells book 'Outliers' he mentions that in order to excel in anything you have to put atleast 10000 hours in to it, which is the equivalent of 6 hours each day in 5 years. 356 * 5 * 6 = 10680, well almost.

Here I present the ladder of programming excellenceu as perceived by me :)
Legend: HoP = Hours of Programming

KHAN's ladder to programming excellence!

I reckoned I hit the programming experience mark of 5000 hours 5 years ago.

Programming in Basic and DOS before my education = 1000 HoP

beginning programmer - 1000 HoP

Programming in high school Assembler, electronics, VB, Java, ASP, HTML: 1000 HoP

greenhorne programmer - 2000 HoP

Higher education as datamatician(mostly Java) 2 1/4 years, with an average of 140 hours a month: 4000 HoP

- at this point I broke the 5000 HoP

jorneyman programmer - 4000 HoP

After the bulk of work with non-contractor jobs 3 years, with an average of 180 hours a month: 6500 HoP
This involved mostly Java with J2EE, but I began on more complex tasks like configuring WebSphere servers, designing parts of enterprise wide technical solutions. Here I picked up many new complex skills, Eclipse RCP, Version control, functional programming, unit testing, server administration etc.
- here i accelarated because I had to break into many new concepts and frameworks, working after hours and reading a lot while experimenting.

veteran programmer - 8000 HoP

At this point I started my own company and began working as a freelancer. I had no products, no particular approach or plan, only my skill as a programmer. Though I discovered I also needed economical and business skills.
In this work I now have 2 years of experience, my pace has slowed down and I would now estimate to having 170 hours per month of IT experience: 4000 HoP, making a total of 16500 HoP.

expert programmer - 16000 HoP

master for me is 5 years away

master programmer - 32000 HoP

I might achieve programming guru before retirement

programming guru - 64000 HoP

//TODO insert lots of effort

deity programmer -
128000 HoP

I think of this scale as a logarithmic one. Each step requires the double amount of effort and I find this to be quite true. At a time while being greenhorne I experienced discovering new things more often, towards becoming a guru I can only guess to what I learn.

mandag den 13. april 2009

Automatically testing advanced web applications (revisited)

More than one and a half years ago I first posted a blog article 'high automatic test coverage of web applications'. While working with this and later projects I realized that in order to have complete coverage and a more dynamic testing environment I had to take it a step further and therefore started inventing my own test framework, described in the article 'full testing with javascript'.

Soon thereafter I discovered the Selenium Core framework which was still rather immature. Since it functions similar to the framework I was working on, I gave it a go and never looked back.

Testing priorities in a web application
When testing you have to first plan what areas need the most testing. Test driven development requires a lot of focus on unit testing and functional testing. I will not discuss unit testing here, since it depends heavily on the platform of the web application.
Aside from unit testing, functional testing is the most important testing for web applications, because it can be used to directly measure progress and prohibits regression.
On a second place comes integration testing, because alot of problems tend to occur in communication with other systems.
In third comes performance testing. This tends to be the focus of automatic tests, but that is an ancient view imo. Performance testing is important, but it's rather easy once functional testing has been done, because you can leverage the functional tests and scale them to performance tests.
On a fourth place comes installation testing. Redeploying a web application is important, both for testing environments, but also for reestablishing an environment.

Functional testing
this is exactly what Selenium is for. It's fast and works for Python, Java and several other popular platforms. I would go for Python because the interactive compiler is killer for writing test cases. Java is not a bad alternative with Seleniums excellent integration with JUnit.
You should not need any other tool for this task.

Performance testing
For performance testing you could use HTTPUnit, which also integrates well with JUnit. It's a rather simple, but powerful framework for controlling all parameters of requests and monitoring the responses.
Functional test cases written for functional testing using Selenium could be rewritten easily and scaled to do performance testing.

Integration testing
This depends on what technology is used for communication, I'll only present the most common one here. Integration in web applications are typically over Web Services, therefore testing could be done with a framework for easily creating web clients, like Axis 2 and using JUnit to execute it, but HTTPUnit is also viable.

Installation testing
Installation testing involves two parts. Scripts to deploy the application and verification of the function.
Scripts would typically depend on the platform of the web application. For WebLogic or WebSphere, you would use ant targets available from the vendor. How you manage to deploy the application automatically is rather irrelevant, since you needn't verify anything during the process.
The second part of verifying function after installation is rather easy, since it's just a matter of running the functional tests.

Conclusion
Using a few open source tools is an easy, fast and effective way to test advanced Web Applications with lots of javascript and complexity.
Standardizing the executing can be achieved using a common executing framework like JUnit.