XL2411 ICC Profile

I just bought this monitor and what the reviews are saying is true. The screen has really washed colors. I managed to get my hands on Spyder5ELITE calibration tool and made a new .icm profile, that actually makes this monitor pretty.

You can get the profile here: https://drive.google.com/file/d/1eZrTygcnQGoFHL7JEC3Hv9Pe1Tu9MhMS/view?usp=sharing

Let me know if it works for you. It should work for XL2411T, XL2411Z or zowie XL2411.

1M mark

Yesterday I had a chance to test the server on dual x5670 workstation, with the benchmark (weighttp) running on the same machine. The results are:

finished in 9 sec, 759 millisec and 429 microsec, 1024650 req/s
requests: 10000000 total, 10000000 started, 10000000 done, 10000000 succeeded, 0 failed, 0 errored
status codes: 10000000 2xx, 0 3xx, 0 4xx, 0 5xx

Javascript Page snapshot

Edit: Currently far better method for headless browser snapshots is using phantomjs.

I want to write a simple code for anyone thinking about how to make client-side rendered pages available for google, bing etc. I was thinking about the way to do it and came to a solution that might actually work pretty well. I will leave the SEO implementation to you, but would like to touch a topic, as how to make a snapshot of a dynamically generated web page using Javascript.

There is a Java utility that can help you do just that, and its name is htmlunit and you can read more details on their home page. It is based on Rhino’s engine (Mozilla project) and is fairly simple to use.

Code:

package htmlunitpagescraper;
import java.io.IOException;
import java.net.MalformedURLException;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import java.io.Console;
public class HtmlUnitPageScraper {

/**
* @param args the command line arguments
*/
public static void main(String[] args) throws Exception {

final WebClient webClient = new WebClient();
final HtmlPage page = webClient.getPage(args[0]);
Thread.sleep(5000);
final String pageAsText = page.asXml();
System.out.print(pageAsText);
webClient.closeAllWindows();

}

}

As you can see above, we run the program using the style:

java -jar program_name.jar http://www.google.com

The program will load the page with all the css and javascript files wait for 5 second to make sure all the javascript gets executed and write to console the rendered result.

Its actually that simple, so now you don’t have to worry about server side rendering and use only your javascript template files to render the html.

I hope this post helps you in implementing this kind of SEO ready dynamic javascript pages.

If you need any help setting up a project in ide, feel free to comment and I will try to answer your questions.

Multithreaded server on linux

I am writing a multithreaded multiplexing server in c++. The server enables dynamic handlers / logic for installed sites, that is basen on mvc design. What I would like it to become is a fully functional easy to use high performance server for anyone to use.

Is anyone interested in a tutorial? I am thinking about writing a series of tutorials. Please let me know what you think.

ISPConfig3 Roundcube password change

I will write how to enable the password plugin for roundcube on ISPConfig3 server configuration:

In roundcube, you first have to enable the password plugin. You can do so by editing the config.inc.php in roundcube/config directory.
Edit this line: $rcmail_config[‘plugins’] = array();
to: $rcmail_config[‘plugins’] = array(‘password’);
And save the configuration.

After that what you have to do is set the password plugin, so it connects to the database and changes the password.
Go into roundcube/plugins/password and copy config.inc.php.dist to config.inc.php

Firsts make sure you are using SQL driver by having the password driver set to: $rcmail_config[‘password_driver’] = ‘sql’;

Now what you have to do is edit the connector so that the plugin knows on what database to run the function to change the password
you do this by editing this line: $rcmail_config[‘password_db_dsn’] = ‘mysql://username:password@localhost/databasename’; (default installation: $rcmail_config[‘password_db_dsn’] = ‘mysql://ispconfig:password@localhost/dbispconfig’;) where you change the username, password and databasename according to your installation configuration.
You can find the database password in /usr/local/ispconfig/interface/lib/config.inc.php

After all of that is done, roundcube will run the update_password function that is stored in your database. Currently none is existing so you can do it 2 ways. If you have ssh access you can do so by simply use sql prompt or you can use phpmyadmin and write sql query in there.
What you have to so is:
USE databasename; # Default: dbispconfig
DELIMITER //
CREATE FUNCTION update_passwd (pwd varchar(100), usr varchar(100)) RETURNS INT
BEGIN
UPDATE databasename.mail_user SET password=pwd WHERE login=usr LIMIT 1; # Default: UPDATE dbispconfig.mail_user SET password=pwd WHERE login=usr LIMIT 1;
RETURN ROW_COUNT();
END//
DELIMITER ;
Where you change databasename according to your installation configuration

There you go, now login to you email account using roundcube and click on settings, you should be able to see the password tab and change the password. In case you run into problems you can trace them in roundcube/logs/error

I hope you set the plugin without problems.

Yii url rewrite under iis

Hi,

I had some problems setting urlrewrite under iis server, since its rules doesn’t reflect the apache structure. I am guessing you have set your urlManager rules as well as set its urlFormat to ‘path’ and set the showScriptName to false.
So here is what you can do, and it really is a time saver:

1. Make sure you have the URL Rewrite module installed. Can be found here: http://www.iis.net/download/URLRewrite
2. Open the IIS Manager (run -> inetmgr)
3. Select your site you wish to add the rule to (for example: Default Web Site)
4. Double click the URL Rewrite, which will open the module interface
5. Click on the Add rule(s)…
6. Select the blank rule from the selection
7. Give it a name and write the following pattern using Regular expressions: ^nameOfTheSiteYourUsing/.+ (This will match your url)
8. Set the conditions like this: click add and in field “Check if input string” select “Is Not a file” and “Is Not a directory”. We want both, because we might access html filer with url manager rewrites as well as controller actions that look like directories.
9. Set the action properties to this: /nameOfTheSiteYourUsing/index.php/{R:0}

And thats it. You can set this for any site your developing with Yii.
I hope this tutorial comes in handy for anyone.

Thank you for reading

Flash 10 – Astro 3DS Loader

Just some example code to load 3DS files into flash. Not really finished, what is missing is to seperate map loading (Texture, Specular, Reflection), also it would eb nice to implement the keyframe loader, but that in some time to come. Oh and one more thing, the code for Mesh, Model objects is not published, it will be in time later:

package Lib.Mesh
{
import __AS3__.vec.Vector;
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.geom.Vector3D;
import flash.net.URLLoader;
import flash.net.URLLoaderDataFormat;
import flash.net.URLRequest;
import flash.utils.ByteArray;

public class MeshLoader extends EventDispatcher
{
public static var MESH_LOADED:String = “mesh_loaded”;
private var loader:URLLoader = null;
public var mesh:Mesh = null; // My own class for holding all the mesh data

public function MeshLoader() // Constructor
{
}

public function Load3DS(mURL:String):void { // The start loading function, notice no error checking, assuming all ok
var urlR:URLRequest = new URLRequest(mURL);
loader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE, MeshLoaded);
loader.load(urlR);
}

private function MeshLoaded(e:Event):void { // Actual loading function
var ChunkID:int = 0;
var ChunkLength:int = 0;

var ColorMode:String = “Ambient”;
var MaterialMapMode:String = “Texture”;
var currMeshObject:int = -1;
var currMeshMaterial:int = -1;
var MObj:MeshObject = null; // generic MeshObject to be used
var MFace:MeshFace = null; // generic MeshFace to be used
var MVertex:MeshVertex = null; // generic MeshVertex to be used
var MTexcoord:MeshTexCoord = null; // generic MeshTexCoord to be used
var MMaterial:MeshMaterial = null; // generic MeshMaterial to be used

try { // lets give it a shot
var data:ByteArray = loader.data;
data.endian = “littleEndian”; // Make sure we use little endian
var tmpData:ByteArray = new ByteArray();

while(data.bytesAvailable > 0) {
// read the chunkID
ChunkID = data.readUnsignedShort();

// read the Chunk length
ChunkLength = data.readUnsignedInt();

switch(ChunkID) {
case 0x4D4D: // Main Chunk
mesh = new Mesh();
break;
case 0x3D3D: // 3D Editor Chunk
break;
case 0x4000: // Object Chunk
currMeshObject++;

// here load the name of the object
var obi:uint = 0;
var name:String = “”;
var rc:String = “”;
var rb:int = 0;

do {
rb = data.readByte();
rc = String.fromCharCode(rb);
name += rc;
obi++;
} while(rb != 0 && obi<20);

var MObject:MeshObject = new MeshObject();
MObject.setName(name);

mesh.addObject(MObject);
break;
case 0x4100: // Triangular Mesh Chunk
break;
case 0x4110: // Mesh Vertex Chunk
var NumVertices:uint = 0;
NumVertices = data.readUnsignedShort();
var VerticesArray:Vector.<MeshVertex> = new Vector.<MeshVertex>();

for(var vi:uint = 0; vi < NumVertices; vi++) {
var x:Number = data.readFloat();
var y:Number = data.readFloat();
var z:Number = data.readFloat();

MVertex = new MeshVertex();
MVertex.setPosition(new Vector3D(x, y, z, 0));

VerticesArray.push(MVertex);
}

MObj = mesh.getObjectList()[currMeshObject];
MObj.setVertexList(VerticesArray);
break;
case 0x4120: // Mesh Face Chunk
var NumFaces:uint = 0;
NumFaces = data.readUnsignedShort();
var FacesArray:Vector.<MeshFace> = new Vector.<MeshFace>();
MObj = mesh.getObjectList()[currMeshObject];

for(var fi:uint = 0; fi < NumFaces; fi++) {
var fa:Number = data.readUnsignedShort();
var fb:Number = data.readUnsignedShort();
var fc:Number = data.readUnsignedShort();
var FaceFlags:Number = data.readUnsignedShort();
var VList:Vector.<MeshVertex> = new Vector.<MeshVertex>();

VList.push(MObj.getVertexList()[fa]);
VList.push(MObj.getVertexList()[fb]);
VList.push(MObj.getVertexList()[fc]);

MFace = new MeshFace();
MFace.setFaceVertices(VList);
MFace.setFaceIndices(new Vector3D(fa, fb, fc, FaceFlags));

FacesArray.push(MFace);
}

MObj.setFaceList(FacesArray);
break;
case 0x4130: // Mesh Face Material Chunk
var mi:uint = 0;
var mname:String = “”;
var mrc:String = “”;
var mrb:int = 0;

do {
mrb = data.readByte();
mrc = String.fromCharCode(mrb);
mname += mrc;
mi++;
} while(mrb != 0 && mi<20);

mname = mname.substr(0, mname.length-1);
MMaterial = mesh.getMaterialByName(mname);

var NumMaterialFaces:uint = 0;
var MaterialFacesArray:Vector.<Number> = new Vector.<Number>();
NumMaterialFaces = data.readUnsignedShort();

MObj = mesh.getObjectList()[currMeshObject];

for(var mfi:uint=0; mfi < NumMaterialFaces; mfi++) {
var mfIndex:Number = data.readUnsignedShort();
MFace = MObj.getFaceList()[mfIndex];
MFace.setFaceMaterialName(mname);
MFace.setFaceMaterialIndex(MMaterial.getMaterialIndex());
}
break;
case 0x4140: // Mesh Vertex TexCoord Chunk
var NumUVs:uint = 0;
NumUVs = data.readUnsignedShort();
var UVsArray:Vector.<MeshTexCoord> = new Vector.<MeshTexCoord>();
for(var uvi:uint = 0; uvi < NumUVs; uvi++) {
var u:Number = data.readFloat();
var v:Number = data.readFloat();
var MTexCoord:MeshTexCoord = new MeshTexCoord();

MTexCoord.setTexCoord(new Vector3D(u, v, 0, 0));
VerticesArray[uvi].setTexCoord(new Vector3D(u, v, 0, 0));
UVsArray.push(MTexCoord);
}
break;
case 0x4160: // Mesh Object Pivot Chunk
var TMV:Vector.<Number> = new Vector.<Number>();
for(var tmvi:uint=0; tmvi<12; tmvi++) {
TMV.push(data.readFloat());
}

var V:Vector.<Number> = Vector.<Number>([TMV[0], TMV[1], TMV[2], new Number(0), TMV[3], TMV[4], TMV[5], new Number(0), TMV[6], TMV[7], TMV[8], new Number(0), TMV[9], TMV[10], TMV[11], new Number(1)]);
var M:flash.geom.Matrix3D = new flash.geom.Matrix3D(V);
mesh.getObjectList()[currMeshObject].setTransformMatrix(M);
var tmviC:uint = 0;
break;
case 0xAFFF: // Material Chunk
currMeshMaterial++;
MMaterial = new MeshMaterial();
MMaterial.setMaterialIndex(currMeshMaterial);
mesh.addMaterial(MMaterial);
break;
case 0xA000: // Material Name Chunk
var mti:uint = 0;
var mtname:String = “”;
var mtrc:String = “”;
var mtrb:int = 0;

do {
mtrb = data.readByte();
mtrc = String.fromCharCode(mtrb);
mtname += mtrc;
mti++;
} while(mtrb != 0 && mti<20);

mtname = mtname.substr(0, mtname.length-1);
MMaterial = mesh.getMaterialList()[currMeshMaterial];
MMaterial.setMaterialName(mtname);
break;
case 0xA010: // Material Color Type Chunk (In our case)
ColorMode = “Ambient”;
break;
case 0xA020:
ColorMode = “Diffuse”;
break;
case 0xA030:
ColorMode = “Specular”;
break;
case 0x0011: // Color Chunk
var matRed:uint = data.readUnsignedByte();
var matGreen:uint = data.readUnsignedByte();
var matBlue:uint = data.readUnsignedByte();

MMaterial = mesh.getMaterialList()[currMeshMaterial];

switch(ColorMode) {
case “Ambient”:
MMaterial.setMaterialAmbientColor(new Vector3D(matRed, matGreen, matBlue));
break;
case “Diffuse”:
MMaterial.setMaterialDiffuseColor(new Vector3D(matRed, matGreen, matBlue));
break;
case “Specular”:
MMaterial.setMaterialSpecularColor(new Vector3D(matRed, matGreen, matBlue));
break;
}
break;
case 0xA200: // Material TextureMapChunk
break;
case 0xA300: // Material Map Name (In our case Texture Map, Dont use other texture Maps, otherwise implement other maps)
var mtmi:uint = 0;
var mtmurl:String = “”;
var mtmrc:String = “”;
var mtmrb:int = 0;

do {
mtmrb = data.readByte();
mtmrc = String.fromCharCode(mtmrb);
mtmurl += mtmrc;
mtmi++;
} while(mtmrb != 0 && mtmi<20);

mtmurl = mtmurl.substr(0, mtmurl.length-1);
MMaterial = mesh.getMaterialList()[currMeshMaterial];

switch(MaterialMapMode) {
case “Texture”:
MMaterial = mesh.getMaterialList()[currMeshMaterial];
MMaterial.setMaterialTextureMapURL(mtmurl);
break;
}
break;
default:
for(var di:uint=0; di<ChunkLength-6; di++)
data.readByte();
}
}
} catch(te:TypeError) {
trace(te.toString());
}
dispatchEvent(new Event(MESH_LOADED));
}
}
}