Sunday, February 24, 2013

Fixing the 'SQLite compiled ...' problem on OpenWRT

Some users maybe noticed that after installing subversion server on their OpenWRT device (mine is Tp-Link TL-WR1043ND with ATTITUDE ADJUSTMENT (bleeding edge, r31214)) they cannot import or export files to it due to old libsqlite3. So, to fix it, just update the library with the following commands:
opkg update
opkg upgrade libsqlite3

Then stop and start the server with:
/etc/init.d/subversion stop
/etc/init.d/subversion start

There you go - no more sqlite error when transferring files :)

Important: It is possible to face the 'General error 5: database is locked' even when svn server is removed. Probably the reason is somewhere in PDO and usage of newer libsqlite3 version ... Doh

Friday, February 1, 2013

The SQLite Amalgamation and your C++ app are friends ...

... NOT!

  The amalgamation is a single C code file, named "sqlite3.c", that contains all C code for the core SQLite library and the FTS3 and RTREE extensions. This file contains about 110K lines of code (65K if you omit blank lines and comments) and is over 3.8 megabytes in size.

Corresponding to information from http://www.sqlite.org/crew.html , we can find that around 36666.666...7 lines (averaged) from the code are dedicated to each one of the devs. I don't know if there are more devs working on SQLite and I don't care too much, but have a question - we are in year 2013, so why not "sqlite3.cpp"? And why not implemented SOCI library as part of SQLite API?

Now I'm going to think how to embed sqlite3 dll in the executable. Wish me luck!
Edit: One simple solution to statically link sqlite library is to add the files from amalgamation package to 'include/sqlite/' dir of your IDE, add file sqlite3.c to your project and add '#include <sqlite/sqlite3.h>' into 'main.cpp' or whatever source file you choose in your project.

Sunday, December 30, 2012

Worst game servers in Europe #1 - noAim.eu

One of the worst game servers are those administred by http://www.noaim.eu staff.
Just a small example what you'll find in their Counter-Strike: Source cs_italy server:

  • not working anti-cheat system(s) - there is constant wallhack/no-recoil cheaters. EVERY SINGLE ROUND
  • not properly working high latency kicker - allows huge drift in latency for long time. Also doesn't ban the laggers after 3-4 times of joining
  • server has bad hit registration - sometimes bullets don't hit the target from close distances, sometimes the models pop from nowhere/will not be rendered; no matter if the player(s) has very good connection (low latency and no chokes/lost packets)
  • votekick/voteban system used by players without sense - for example a random player becomes the last man standing of his team, and one of the best tactics is to barricade himself somewhere. THIS IS WRONG! The other players just can't stand the pressure of waiting the round to end - they put the guy directly on kick list ... Funny because at least 75% of the voting idiots* are low to mediocre players
  • missing proper autoteambalance plugin - it is common to see players from a clan to join in different teams, of course this just screams in your eyes "TEAM SPEC CHEATERS!"
  • throwing a HE grenade and hitting an enemy brings the damage done to center of your screen. Is it supposed to know that you actually hit someone and how much health points he has?
  • speaking of throwing the nades - they put a plugin that disables team-flashing. Is it working? Nope. In fact you are flashed for around half an second ... The other bug is brought by the transparent models plugin which blocks players stucking in each other. Well, guess what happens when someone throws the smoke grenade through your model :|
* - I seriously think to write an IQ plugin that will block a part of people with polished brains to joining the servers

The list is longer and is in rule for the other noAim.eu servers ... So don't expect something cool to happen there. I warned you!

Friday, December 21, 2012

Simple way to search in JavaScript array

var myarray = ["aaa", "bbb", "ccc", "ddd"];
var myelement = document.getElementById(elementID);
if (myarray.indexOf(myelement) > -1)
{
  myelement.scrollIntoView(true);
  myelement.focus();
}
else
{
  alert("Hello, chimpworld!");
}


Note that some older browsers don't support indexOf (for example IE 6, 7, 8)

Thursday, December 20, 2012

My future toy or the long road of DIY cnc router

Just to start from somewhere, I purchased this kit with double shaft steppers, 3Nm ... a bit weak* :
http://www.ebay.co.uk/itm/380531764624?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

Next step will be purchasing the spindle, but cause they are expensive (way too much if you ask me; 170 pounds for 1kW with 8mm collar and 42-43mm collet @ 10k-29k rpm) I'll go with proffesional 1-1.5kW drill with manual regulation of rpms, which will be converted to digital regulation later. Probably will change the collet for using with bigger cutters/bores.

3rd step is buying/making all the other parts for the project:

  • the profiles for the main construction - the gate/portal and the base. Working area will be 1200mm x 1200mm x 250mm (that's right - 250mm Z-axis)
  • lead screws 2x ~1300mm for X- and Y-axis (50mm for each end-connection - motor) and 1x ~350mm for Z-axis
  • ball bearings, probably industrial class model(s) resistant to radial and axial loads
  • additional cables
  • stepper drivers 1/256
  • casing for the router control panel
4th step is a bit dificult cause the whole machinery will be commanded from mini Android PC, but for now I don't know if there's a Mach3 or similar program for Android OS. Also I don't know if it is problem-free to connect the breakout board to usb ports with Parallel-to-USB adapter and they work well under Andro ...

* - 3Nm is cool for soft materials but it's a lot cooler to see 200Nm steppers of proffesional milling machine with weight around 1500 kgs that move a block of steel .45 with dimensions 600mm x 600mm x 200mm

Sunday, October 21, 2012