Recent Notes

Displaying notes 1 - 10
Created by woolf on April 24, 2014 17:07:16    Last update: April 24, 2014 17:07:16
I didn't get networking to work with qemu. This note just records what I tried. $ /usr/local/bin/qemu-system-mipsel -kernel bin/ma... $ cat /usr/local/etc/qemu/bridge.conf allow vi... $ ifconfig virbr0 Link encap:Ethernet HWadd... Documentation: http://wiki.qemu.org/Features/HelperNetworking
Created by James on April 21, 2014 15:34:36    Last update: April 21, 2014 15:34:36
Rodney Rehm gave an example of how to add a val() method to a <div> : $.valHooks.div = { get: function(elem) { ... We can use the same method to override the val() function for a text input: <html> <head> <title>Test valHooks</title> ...
Created by James on April 21, 2014 15:17:45    Last update: April 21, 2014 15:17:45
The .prop() method gets or sets the property value of the first element in the matched set. The .attr() method does the same to an attribute . So what is an attribute and what is a property? Roughly speaking, an attribute is something you specify in the HTML markup. A property is a property of the element, but its initial value may be derived from the value of an attribute. For example, selectedIndex is a property of <select> that does not have a corresponding attribute in HTML markup. The <input> element can have a value attribute that specifies the initial value of a text input, but its value property reflects the current text entered into the text input. Setting the value property does not affect...
Created by Dr. Xi on April 16, 2014 16:26:36    Last update: April 16, 2014 16:26:36
Basically, you are requesting "Active" content via HTTP from a page served via HTTPS. And Firefox blocked it. What is "Active Content"? Examples are JavaScript, CSS, objects, xhr requests, iframes, and fonts. More info: Mixed Content Blocking Enabled in Firefox 23!
Created by Dr. Xi on April 16, 2014 16:15:27    Last update: April 16, 2014 16:15:27
Create a list, assign it to another variable. They both refer to the same object: >>> a = [ 1, 2, 3, 4 ] >>> b = a >>> a [1... List comprehension, assign value to a . Now a and b are different: >>> a = [ e for e in a if e > 2 ] >>> a [3, ... Splicing changes list in place, a and b refer to the same object after assignment: >>> a = b >>> a[:] = [ e for e in a if e > 2 ] ...
Created by Dr. Xi on April 16, 2014 15:40:09    Last update: April 16, 2014 15:40:09
The "with" statement makes it easy to open a file, use it then finally close it, without explicitly coding with a " try...finally " block. Example: >>> import yaml >>> with open("app.yaml") as f:... More info: Understanding Python's "with" statement
Created by voodoo on April 15, 2014 16:25:09    Last update: April 15, 2014 16:25:09
Example session for Lua string concatenation: > a = { 'a', 'b' } > for i, v in pairs(a) d...
Created by voodoo on April 15, 2014 16:20:36    Last update: April 15, 2014 16:20:36
For arrays with numerical indices: > a = { 'a', 'b' } > =#a 2 > =table.g... However, the # operator or table.getn does not count elements with string indices: > a['a'] = 1 > a['b'] = 2 > return #a ... Further, the pairs function does not list keys accessible made available via setmetatable : > setmetatable(a, {__index = function(table, k...
Created by Dr. Xi on April 15, 2014 12:03:45    Last update: April 15, 2014 12:03:45
To show the file type identified by vim for the file you are currently editing, type " :set filetype " in vim command. From vim Help, this is how vim identifies file type: Detail: The ":filetype on" command will load one o...
Created by Dr. Xi on April 15, 2014 11:32:50    Last update: April 15, 2014 11:32:50
You can set (shell) environment variables $VIM and $VIMRUNTIME and vim will honor them. But there are default values that vim takes if you don't set them. Here are some methods to find the default values. Enter :verson vim command. It displays all compilation flags used to compile vim, including "fall-back for $VIM". Enter :set runtimepath vim command (or shorthand :set rtp ) Run this command in shell: vim -e -T dumb --cmd 'exe "set t_cm=\<C-M>"|echo $...
Previous  1 2 3 4 5 6 7 8 9 10 Next