Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Fix issue "cannot load such file -- bcrypt_ext (LoadError)"

bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords. The bcrypt Ruby gem provides a simple wrapper for safely handling passwords.However, sometimes the rails application would fail to start after installing the bcrypt gem on Windows. The error would look similar to below.The issue is that it fails to load the bcrypt_ext which is the native built extension, the reason may be the library is wrongly built. To fix this issue, below steps can be followed. Open a command consolecd to the gem directory C:\RailsInstaller\Ruby2.2.0\...

8,577 1       RUBY SOLUTION RUBY ON RAILS BCRYPT LOAD ERROR


  Some tricks on PHP session

1. Session timeout problemThere is a nuance we found with session timing out although the user is still active in the session.  The problem has to do with never modifying the session variable. The GC will clear the session data files based on their last modification time.  Thus if you never modify the session, you simply read from it, then the GC will eventually clean up. To prevent this you need to ensure that your session is modified within the GC delete time.  You can accomplish this like below. if(!isset($_SESSION["last_access"]) || (time() - $_SESSION["last_access"]) >= ...

13,679 4       PHP SOLUTION SESSION TIMEOUT VARIOUS DOMAIN


  Workaround size limit of phpMyAdmin import sql file

When doing website development with MySQL, we often need to do database backup and restore. For website, the data in database will grow quickly, so when we back up the database, the size of the generated sql file may be over 80MB which is the max allowed size when we want to import a sql file for restoring our database using phpMyAdmin. To workaround this limit, we need to review the documentation of phpMyAdmin. Fortunately, I found an online article written by David Pratt  which gave us a very simple solution to this problem.Find the config.inc.php file located in the phpmyadmin director...

11,853 0       MYSQL SOLUTION PHPMYSQLADMIN 80M IMPORT LIMIT


  One reason why mcrypt responds slowly

This morning one colleague came over and talked about one script which used mcrypt responded very slowly, the server configurations are fine. But the reason for the slowness is unknown.Here is one script which reproduces the issue:<?php$dmcryptText = "dummy";$key = "foobar";$size = mcrypt_get_iv_size(MCRYPT_BLOWFISH,MCRYPT_MODE_ECB); $iv = mcrypt_create_iv($size); //Take care $m = mcrypt_ecb(MCRYPT_BLOWFISH, $key, $dmcryptText, MCRYPT_DECRYPT, $iv);var_dump($m);When 20 requests of this script are sent to the server in parallel, the response time of Apache server increases rapidly.The r...

9,096 8       PHP SOLUTION SLOW MCRYPT RESPONSE


  Show drop down list or menu above of a flash in webpage

How to make a drop down menu show above of a  flash in webpage?Normally when we embed a flash or swf file into our webpage, it is not one component of our webpage.So sometimes the flash will always show above of the webpage, it will not interact with our HTML page.To solve this problem,we need to use wmode property of object tag.wmode has three properties: window,opaque and transparent.window : the flash will show in its own rectangular window,which will not interact with           our webpage,so it will always show on top of the page.opaque :i...

3,662 0       HTML FLASH SOLUTION DROP DOWN MENU BLOCK


  QScrollArea Scrollbar Display Solution

Qt framework is a popular C++GUI framework developed by Nokia. And it is also cross platform compatible. Manydevelopers are using Qt to develop C++ GUI programs. In Qt, some importantcomponents are deserved our close attention. Many developers faced the problemwhen they put some widgets in a QScrollArea widget and they want it to displayscroll bars when the widgets inside the QScrollArea overflows. After manyexperiments, I propose a way which can show scroll bars as you expected. The relationship betweenwidgets and layout is the key here. Generally, we need not to add layout toscroll area dire...

16,511 3       C++ SOLUTION GUI QT QSCROLLBAR SCROLLBAR NOT DISPLAY


  Slow Datagridview... Oh No!

So we all have been here, I had finished a project using VS2008, implementing  Datagridviews on litterally each and every form of the system. This had been a requirement from the onset as to ensure easy searching,navigation and capturing of data. So the data capture ladies start doing their thing and low and behold the dreaded call... they are unhappy with the speed of the DataGridView. I had to agree with them, the repaint of the and overall perfromance of the grid is awfull. So started a tedious process of trying to speed this up...The first step was to look at ...

5,597 0       C# SOLUTION SLOW DATAGRIDVIEW


  A Solution to CPU-intensive Tasks in IO Loops

Back in October 2011, Ted Dziuba infamously said that Node.js is Cancer.  A provocative title to a provocative article.  The only thing it didn’t really provoke in the commentary was much thought ;)  Zing.My interpretation of the article is that Ted holds up the classic blocking-IO process-per-request (or  thread per request; same difference) model as superior.  Yet we all remember where the blocking-IO forking model got Apache in the early days.  So I’m a tad uncomfortable with his solution from the good old days.  But fundamentally you ca...

3,432 0       C++ SOLUTION CPU INTENSIVE IO LOOPS