Tuesday, May 21, 2013

MinGW on NetBeans

7 Steps

Moving from Java to C++ 2


Moving from Java to C++

http://horstmann.com/ccj2/ccjapp3.html
C++ is a much more complex language than Java.

time picker


  • id for JavaScript
  • name for PHP/Python

Datepicker
jquery-ui.js
jquery-ui.css

---
<script>
        $(function() {
            $( "#datepicker" ).datepicker({dateFormat:'M. dd, yy'});
        });
</script>

Fix the first column or first row in the table. HTML

source:
http://www.novasoftware.com/Download/jQuery_FixedTable/JQuery_FixedTable.aspx


jQuery.FixedTable

jQuery.FixedTable is a jQuery plugin to create a fixed header and columns on a HTML table. The idea is fromhttps://www.open2space.com/projects/fixedtable. We have improved it, and fixed some bugs.

double loop in Djano template

tentative solution

<table class="table table-striped table-bordered">
    <tr>
        <td>-</td>
        {% for timeFrame in timeFrames %}
            <td >{{ timeFrame }}</td>
        {% endfor %}
    </tr>
    {% for code, report in reports.items %}
        <tr>
            <td>{{ code }}</td>
            {% for key, value in report.items %}
                <td>{% if value.0 %}{{ value.0 }} ({{ value.1 }}%){% endif %}</td>
            {% endfor %}
        </tr>
    {% endfor %}
    </table>

Monday, May 20, 2013

Moving From Java to C++


Moving From Java to C++


main function

C++

// free-floating function
int main( int argc, char* argv[])
{
    printf( "Hello, world" );
}

Friday, April 19, 2013

Journey to R programming

time: 2013-4-19 19:37:30
R 3.0.0 http://cran.r-project.org/bin/windows/base/
system path: D:\Program Files\R\R-3.0.0\bin\x64
textbook: The Art of R Programming 2011

Good to go:


done

Saturday, February 16, 2013

Stop Your Mouse from Waking Up Your Windows Computer


http://www.howtogeek.com/howto/15132/stop-your-mouse-from-waking-up-your-windows-7-computer/
If you use Sleep Mode on your PC, have you ever noticed that moving your mouse will wake the computer from sleep mode? If you would prefer to only have the PC wake up when you hit a key instead, there’s a simple tweak.
Just type Mouse into the start menu search box, or the Control Panel search box, and then open up the Mouse Properties panel. Find the Hardware tab, select your mouse in the list, and then click the Properties button.
image

Saturday, January 19, 2013

eclipse C++ full install instruction

http://www3.ntu.edu.sg/home/ehchua/programming/howto/EclipseCpp_HowTo.html

Console2 - A Better Windows Command Prompt


http://www.hanselman.com/blog/Console2ABetterWindowsCommandPrompt.asp
---
I was working on my Mac today and while I maintain that the OS X finder is as effective as shooting your hands fill of Novocaine, I remain envious of the simplicity of their Terminal. Not much interesting has happened in the command prompt world in Windows since, well, ever. I actually blogged about text mode as a missed opportunity in 2004. That post is still valid today, I think. Text is fast. I spend lots of time there and I will race anyone with a mouse, any day.

Save doc as PDF in bulk (JavaScript +Powershell)

SaveAsPDF.js


var fso = new ActiveXObject("Scripting.FileSystemObject");
var docPath = WScript.Arguments(0);
docPath = fso.GetAbsolutePathName(docPath);

var pdfPath = docPath.replace(/\.doc[^.]*$/, ".pdf");
var objWord = null;

Tuesday, January 15, 2013

Install StatET in Eclipse

http://www.walware.de/it/downloads/rj.mframe

eclipse -> help -> install new software -> input the url above -> select all -> next ...

done

Monday, January 14, 2013

Python 代码模块八股文


 Python 代码模块八股文
  1. Path and unicode
  2. Module docstr
  3. __author__; __version__
  4. import
  5. Global Variables
  6. Class
  7. Function
  8. __name__=="__main__"

Tuesday, January 8, 2013

Remove advertisement in Foxit Reader

Foxit Reader
Foxit Advertisement Menuchange the default measurement unit:
http://en.kioskea.net/faq/19301-foxit-reader-change-the-default-measurement-units

Sunday, January 6, 2013

VMware 8 hide toolbar edge

Edit > Preferences > Display > Uncheck "Show toolbar edge when unpinned in full screen" you'll be all set!

Wednesday, January 2, 2013

Turn off Hibernate Windows 8


  1. C:/Windows/System32/cmd.exe (run as Administrator)
  2. powercfg -h off (powercfg -h on to turn it on)
  3. Will free up space of 75% of RAM

Tuesday, January 1, 2013

Simple Python Script in UNIX calculating the number of PHP session files

This script reads the number of PHP session files in your server's /tmp directory, then writes a summary report to a log file.


#!/usr/bin/python

import os
from time import strftime

stamp = strftime("%Y-%m-%d %H:%M:%S")
logfile = '/path/to/your/logfile.log'
path = '/path/to/tmp/directory/'

files = os.listdir(path)
bytes = 0
numfiles = 0

for f in files:
 if f.startswith('sess_'):
  info = os.stat(path + f)
  numfiles += 1
  bytes += info[6]
  

if numfiles > 1:
 title = 'files'
else:
 title = 'file'


string = stamp + " -- " + str(numfiles) + " session " \
+ title +", " + str(bytes) + " bytes\n"

file = open(logfile,"a")
file.writelines(string)
file.close()

Listing 12 shows the entire script. Open an editor, and paste the code into it and save the file as tmp.py somewhere on your system. Then run chmod + x on that file to make it executable

Next, create a variable called logfile and put in a path to a file (it doesn't need to exist yet) where you'll actually store log file messages. For simplicity, I put log files in a /logs folder, but you could put them anywhere. Similarly, you need a variable called path that contains the path to your /tmp directory. It can be any path you want as long as you end it with a trailing slash (/).