Skip to content

Instantly share code, notes, and snippets.

View alessandroleite's full-sized avatar

Alessandro Leite alessandroleite

View GitHub Profile
Barriers to speed reading
--------------------------
Subvocalizing. Repeating what you read in your head (reading with your ears).
If you hear yourself reading, read faster.
Vocalizing. If your lips move as you read you are vocalizing your text. As long as you read vocalizing, you will only be able to read as fast as you can speak.
Let the texts pass into the mind directly from the eye, skipping the mouth and ear.
# Latex files
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
@alessandroleite
alessandroleite / grammar-terminology.md
Last active April 14, 2024 19:24
Writing resources

Grammar terminology matters because it allows us to communicate efficiently about language. Of course, it is not necessary to know the terminology to speak a language. We all learn our first languages without first learning what a verb and noun are. However, when we speak about grammar, especially in the context of writing, it helps if we can refer to grammar using precise vocabulary.

There are many sources online and in books that will explain grammar terminology. Not all of them will use exactly the same terms for the same grammatical points (I know, frustrating!). However, if you get into the habit of learning to identify the names of grammatical objects, you will move forward in your understanding of written English.

Sites and books that you can use to look up the names of grammatical terms

Websites

  1. The Elements of Style http://bartleby.com/141/
  2. Using English: http://www.usingenglish.com/glossary/
@alessandroleite
alessandroleite / javascript-material
Created June 24, 2013 12:45
Link to sites that help learn javascript parts that are not well explained
<a href="http://bonsaiden.github.io/JavaScript-Garden/" target="">http://bonsaiden.github.io/JavaScript-Garden/</a><br />
<a href="http://stackoverflow.com/questions/111102/how-do-javascript-closures-work?rq=1" target="">http://stackoverflow.com/questions/111102/how-do-javascript-closures-work?rq=1</a><br />
<a href="http://stackoverflow.com/questions/418799/what-does-colon-do-in-javascript" target="">http://stackoverflow.com/questions/418799/what-does-colon-do-in-javascript</a><br /> <a href="http://stackoverflow.com/questions/12064104/prototype-keyword-in-javascript" target="" title="Link: http://stackoverflow.com/questions/12064104/prototype-keyword-in-javascript">http://stackoverflow.com/questions/12064104/prototype-keyword-in-javascript</a><br /> <a href="http://web.archive.org/web/20080209105120/http://blog.morrisjohns.com/javascript_closures_for_dummies" target="">http://web.archive.org/web/20080209105120/http://blog.morrisjohns.com/javascript_closures_for_dummies</a><br /> <a href="http://stackoverf
@alessandroleite
alessandroleite / Husband.java
Created March 6, 2013 14:06
Example of Observer Pattern with AspectJ
package example.types;
import java.util.Arrays;
import example.pattern.Observer;
import example.pattern.Subject;
public class Husband extends Person implements Observer {
private Person wife;
@alessandroleite
alessandroleite / MQCommunicator.java
Created February 17, 2013 13:56
this class provides access to the MQSeries queue facilities. Once instantiated, the main application program need only call the 'send' and 'receive' methods to put & get strings. The send method returns an MQMessage object the handle of which is used to retrieve the reply
/* This class provides access to the MQSeries queue facilities. Once
instantiated, the main application program need only call the 'send' and
'receive' methods to put & get strings. The send method returns an MQMessage
object the handle of which is used to retrieve the reply. */
import java.io.*;
import com.ibm.mq.*; // Include the MQ package
public class MQCommunicator {
private String hostname; // Define the name of your host to connect to
@alessandroleite
alessandroleite / Hosts.java
Created January 22, 2013 20:24
Hosts.java
package org.cloudbus.cloudsim.examples;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.cloudbus.cloudsim.Host;
@alessandroleite
alessandroleite / RoundRobinVmAllocationPolicy.java
Created January 22, 2013 20:20
Round-Robin {@link Vm} allocation policy for CloudSim
package org.cloudbus.cloudsim.examples;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.cloudbus.cloudsim.Host;
import org.cloudbus.cloudsim.Log;
import org.cloudbus.cloudsim.Vm;
import org.cloudbus.cloudsim.core.CloudSim;
@alessandroleite
alessandroleite / gist:4233584
Created December 7, 2012 14:28
Counting the CPU cycles of a function/procedure
/////////////////////////////////////////////////////////////////////////
static u_int64_t start = 0;
void access_counter(unsigned* hi, unsigned* low);
void start_counter()
{
unsigned hi, lo;
access_counter(&hi, &lo);
start = ((u_int64_t)hi << 32) | lo;