I started this blog as a personal notepad, but it seems I'm getting more and more hits. Since people are reading this I starting sharing anything that I find interesting or usfull. I'm currently dedicating my time to expanding my knowledge into the more modern languages and ideas. If you find this information useful or a waste of your tome let me know by leaving commits or using the google +1 function at the bottom of the post. Thanks for viewing Daniel Haro
Thursday, September 6, 2012
MY hard drive situation :(
About six months ago I lost my primary hard drive. Usually not a big deal however this happened right smack in the middle of the hard drive crisis. There was not a $100 hard drive to be found anywhere. The least expensive options where low end undesirable drives at around $400 at the time and I just refused to do it. The solution was to buy a 120 Gig SSD which was at least monetarily less costly about $220. This was a more desirable drive and I convinced myself that it would be enough as I still have secondary drives with mass storage to save large programs etc. Well it is enough kind of, I generally have about 16 to 30 gigs free at any given time. I have to maintain the drive like crazy moving things off into the secondary storage device to stop it from filling up. I don't like seeing theses low numbers and it drives me nuts. So just a fair suggestion to anyone out there reading this buy at least the 250 SSD gig and save yourself a few headaches!
Wednesday, September 5, 2012
java script tags
<tr> = table row
<td> = table cell
<td> rowspan = # = specifies the number of rows a cell should span
<td> = table cell
<td> rowspan = # = specifies the number of rows a cell should span
java Script Initalation notes
On load, run function when window is initlized.
<window.onload = function1();function2,...,functionN>
<window.onload = function1();function2,...,functionN>
Java Script Events
simple mouse events:
<onclick = function1();function2,...,functionN>
Simple mouse event with a button
<button onclick = function1();function2,...,functionN>
<onclick = function1();function2,...,functionN>
Simple mouse event with a button
<button onclick = function1();function2,...,functionN>
Sunday, September 2, 2012
SOUND CARDS
The other day I purchased a copy of the Hunger Games on Blue Ray. I could not for the life of me get the sound to work correctly on my PC. I remembered having Sound issues years ago with DVD movies. The problem in the past had to do with 5.1,6.1 ect sound systems and DTS drivers. The solution back then was just to upgrade my whole computer sound system.
So I thought to myself does this apply in today world, well for me probably as I have just been using the on board sound that came with my Asus m/b ever since I burnt up my last sound card. The sound could have always been better but never me any real problems. Now that I am older and don't really play video games and less dependant on my PC for entertainment the solution was fine. Long past the day that I spent thousands of dollars every year keeping my Power of Tower god like.
So after doing some research, the bottom line is that sound has taken a major leap forward with 3-d sound and other features and my on board sound system just was not up to challenge. So I broke down and purchased a Sound Blaster Recon (the cheap version) it was about $100. I have to tell you guys that this card makes such a huge difference not only can I now watch my Blue ray's on my PC but everything else sounds 100 time better.
I am sure there are many of you out there that have just let your sound system go, but this is an upgrade worth doing, I love it to death.
So I thought to myself does this apply in today world, well for me probably as I have just been using the on board sound that came with my Asus m/b ever since I burnt up my last sound card. The sound could have always been better but never me any real problems. Now that I am older and don't really play video games and less dependant on my PC for entertainment the solution was fine. Long past the day that I spent thousands of dollars every year keeping my Power of Tower god like.
So after doing some research, the bottom line is that sound has taken a major leap forward with 3-d sound and other features and my on board sound system just was not up to challenge. So I broke down and purchased a Sound Blaster Recon (the cheap version) it was about $100. I have to tell you guys that this card makes such a huge difference not only can I now watch my Blue ray's on my PC but everything else sounds 100 time better.
I am sure there are many of you out there that have just let your sound system go, but this is an upgrade worth doing, I love it to death.
Saturday, August 25, 2012
Multi Threadinging in Java
The Basics
to create a thread-able program you need the following
requires
Runnable interface -> Runnable Object
Requires a Thread Manager (in main) -> Thinking to use hash-map to handle this
Requires Thread Launch -> Start method;
------------------------
-------
--------------------
**********************ugly class notes ignore this is for me only***************
Runnable Object ->(Starter Method) an object that is runnable (multi thread)
public void run() -->launch 2ND thread
Runnable Object is an Object that implements an interface Runnable which contains a single method
Creator of Threads: how to create a thread manager Object
Java Support
Thread (Manager) || Runnable
uggg explanation is a mess but here is the a code example
public class Message implements Runnable {
private String message;
public Message (String msg)
{
message = msg;
}
@Override
public void run()
{
while(true)
{
for (int i = 0 ; i < 100; i++)
System.out.print(message);
//Thread.yield()// TODO Auto-generated method stub
System.out.println();
Thread.yield();
}
}
}
to create a thread-able program you need the following
requires
Runnable interface -> Runnable Object
Requires a Thread Manager (in main) -> Thinking to use hash-map to handle this
Requires Thread Launch -> Start method;
------------------------
-------
--------------------
**********************ugly class notes ignore this is for me only***************
Runnable Object ->(Starter Method) an object that is runnable (multi thread)
public void run() -->launch 2ND thread
Runnable Object is an Object that implements an interface Runnable which contains a single method
Creator of Threads: how to create a thread manager Object
Java Support
Thread (Manager) || Runnable
uggg explanation is a mess but here is the a code example
public class Message implements Runnable {
private String message;
public Message (String msg)
{
message = msg;
}
@Override
public void run()
{
while(true)
{
for (int i = 0 ; i < 100; i++)
System.out.print(message);
//Thread.yield()// TODO Auto-generated method stub
System.out.println();
Thread.yield();
}
}
}
public class Main {
public static void main(String[] args)
{
//create Runnable objects
Message m1 = new Message("X");
Message m2 = new Message("Y");
Message m3 = new Message("Z");
//Create Thread manager objects
Thread t1 = new Thread (m1);
Thread t2 = new Thread (m2);
Thread t3 = new Thread (m3);
//start threads
t1.start();
t2.start();
t3.start();
for (int i = 0 ; i < 1000; i++)
System.out.print("M");
// System.out.println(m1);
//System.out.println(m2);
//System.out.println(m3);
}
}
Tuesday, August 21, 2012
JAVASCRIPT == or ===
In JavaScript we have loosely defined vars so this means that if you have
a = "5"
b = 5
that using (a==5) will return true even though they are not the same var (object) type. This can be annoying and can lead to errors. On the more realistic side who compares strings to ints without first parsing anyway. Well being a loose var system I guess it could happens to anyone. So the solution is to use === which will test for both value and object type to be equal.
Now the question comes up, what about comparing properties in polymorphic objects. At first thought we you might think that === will cause the comparison to fail when comparing two objects that are of different sibling types of a common parent. However this is not an issue as when doing this comparison we are actually only test each var that was extracted from those objects and not the object themselves. In other words the var type of the property becomes the comparable object which requires us to revert to using the === anyways.
So to answer the unanswered question: who compares strings to ints without parsing first well the answer would JavaScript programmers :)
a = "5"
b = 5
that using (a==5) will return true even though they are not the same var (object) type. This can be annoying and can lead to errors. On the more realistic side who compares strings to ints without first parsing anyway. Well being a loose var system I guess it could happens to anyone. So the solution is to use === which will test for both value and object type to be equal.
Now the question comes up, what about comparing properties in polymorphic objects. At first thought we you might think that === will cause the comparison to fail when comparing two objects that are of different sibling types of a common parent. However this is not an issue as when doing this comparison we are actually only test each var that was extracted from those objects and not the object themselves. In other words the var type of the property becomes the comparable object which requires us to revert to using the === anyways.
So to answer the unanswered question: who compares strings to ints without parsing first well the answer would JavaScript programmers :)
JAVASCRIPT : ECMASCRIPT STANDARDS and GREAT RESOURCES
Finally figuring this out, JAVASCRIPT API or at least the standards guide follows ECMASCRIP requirements. So Finlay an actually resource that actually means something. This is so important.
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
also see the following book
Event Processing in Action
Authors:Opher Etzion
Peter Nibblett
book 2: This is the best Java Script book I have to date, the best part is it actually has a real API in it, I have been looking for this for weeks now I found it. This book is key to learning JavaScript correctly.
Java Script : The Definitive Guide , 6th edition or higher
By:David Flanagan publisher: O'REILEY
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf
also see the following book
Event Processing in Action
Authors:Opher Etzion
Peter Nibblett
book 2: This is the best Java Script book I have to date, the best part is it actually has a real API in it, I have been looking for this for weeks now I found it. This book is key to learning JavaScript correctly.
Java Script : The Definitive Guide , 6th edition or higher
By:David Flanagan publisher: O'REILEY
Monday, August 20, 2012
Event Handdling in General
Ever get frustrated while programing your event handling: mouse, keyboard,buttons etc. I have found this missing link, I ran across this book call Event Processing in Action. I was curious and was frustrated programming my mouse in JavaScript so I bought it. I read the first three chapters so far and it's a wonderful book. It teaches event handling from a theoretical point of view so it might not help you with whatever language your working with, however it will improve your understanding of what is really happening in the background. Armed with this knowledge you will be able to turn your self in a Event Handling Guru. So just to share with whoever is interested in the topic I thought this book should be brought to light.
The book :
Event Processing in Action
Authors: Opher Etzion & Peter Niblett
The book :
Event Processing in Action
Authors: Opher Etzion & Peter Niblett
Friday, August 17, 2012
JAVA SCRIPT: arguments variable
arguments
this is a key word var in javascript it holds all vars past to a function regardless if the constructor could assign them or not. So in short this allows you to create functions with an arbitrary number of functions.
this is a key word var in javascript it holds all vars past to a function regardless if the constructor could assign them or not. So in short this allows you to create functions with an arbitrary number of functions.
JAVASCRIPT:JS-LINT
Today I learned about JSLINT. Js Lint is a program to which you can run your javascript through to check for errors, coding style and various conventions. As javascript has very loose rules it difficult to debug. Following the JSLINT conventions and rules will hopefully help you produce better, more reusable and sharable code. JSLINT was a developed by Yahoo's top developers.
you can get JSLINT and documentation at:
http://www.jslint.com/
also see the videos by Douglas Crockford at
http://www.youtube.com/results?search_query=Douglas+Crockford&oq=Douglas+Crockford&gs_l=youtube.3..35i39j0l9.5610.7677.0.8340.5.5.0.0.0.0.208.775.0j4j1.5.0...0.0...1ac.RCxFWzyRivM
you can get JSLINT and documentation at:
http://www.jslint.com/
also see the videos by Douglas Crockford at
http://www.youtube.com/results?search_query=Douglas+Crockford&oq=Douglas+Crockford&gs_l=youtube.3..35i39j0l9.5610.7677.0.8340.5.5.0.0.0.0.208.775.0j4j1.5.0...0.0...1ac.RCxFWzyRivM
Douglas Crockford: The JavaScript Programming Language
Why learn JavaScript & some great video footage
Watch these videos (sorry have to use youtube) since the normal hosting site is a joke!
I have update this link, will make it easier to locate all 3 movies!
http://www.youtube.com/playlist?list=PL5586336C26BDB324&feature=plcp
Watch these videos (sorry have to use youtube) since the normal hosting site is a joke!
I have update this link, will make it easier to locate all 3 movies!
http://www.youtube.com/playlist?list=PL5586336C26BDB324&feature=plcp
I'm always reading about creating fast and usable websites
Ever wounder why people refuse to use or abandon websites: I have started a list of examples of such sites.
1.) http://www.yuiblog.com/blog/2010/02/03/video-crockonjs-1/ # just try to down load the HD videos have fun, or you an opt for the alternative and watch the embedded one which will give you a total headache in minuets because of the poor sound and video quality.
1.) http://www.yuiblog.com/blog/2010/02/03/video-crockonjs-1/ # just try to down load the HD videos have fun, or you an opt for the alternative and watch the embedded one which will give you a total headache in minuets because of the poor sound and video quality.
Thursday, August 16, 2012
javaScript: Nested Functions
Another Intresting concept that poped up in JavaScript
:nested functions inside of other functions : This provides a way to make a function private. If you want these be accessable there must be a accessor method in the outfunction otherwise they will be unreachable outside of the outter function
Here is an Example of what this looks like.
<!DOCTYPE html>
<html>
<head>
<title>Nested Functions</title>
<script type="text/javascript">
function initiateMadness() {
var sparta = {
name : "Sparta"
};
function madness() {
alert("THIS. IS. " + this.name.toUpperCase() + ".");
}
document.onclick = makeAMessenger(madness, sparta);
}
//access the content of the inner function
function makeAMessenger(func, context)
{
window.name = context.name;
func();
}
initiateMadness();
</script>
</head>
<body>
<script type="text/javascript">
</script>
<h1> Heading 1 </h1>
<p> THis is my program </p>
</body>
</html>
:nested functions inside of other functions : This provides a way to make a function private. If you want these be accessable there must be a accessor method in the outfunction otherwise they will be unreachable outside of the outter function
Here is an Example of what this looks like.
<!DOCTYPE html>
<html>
<head>
<title>Nested Functions</title>
<script type="text/javascript">
function initiateMadness() {
var sparta = {
name : "Sparta"
};
function madness() {
alert("THIS. IS. " + this.name.toUpperCase() + ".");
}
document.onclick = makeAMessenger(madness, sparta);
}
//access the content of the inner function
function makeAMessenger(func, context)
{
window.name = context.name;
func();
}
initiateMadness();
</script>
</head>
<body>
<script type="text/javascript">
</script>
<h1> Heading 1 </h1>
<p> THis is my program </p>
</body>
</html>
Java Script : Array of functions
Another intersting concept that I came across:
Java Script allows you to create an array of functions, took me a while to make this work but I finally got it. Here is example of how to do this:
<!DOCTYPE html>
<html>
<head>
<title>Array of functions</title>
<script type="text/javascript">
function transform(array)
{
function makeFunction(value)
{return function()
{
return value;
}
}
var output = new Array();
for(var i = 0; i < array.length; ++i)
{
output[i] = makeFunction(array[i]);
}
return output;
}
</script>
</head>
<body>
<script type="text/javascript">
myArray = [1,2,3,4,5];
myArray = transform(myArray);
for(var i =0 ; i < myArray.length; ++i)
{
alert( myArray[i]());
}
</script>
</body>
</html>
Java Script allows you to create an array of functions, took me a while to make this work but I finally got it. Here is example of how to do this:
<!DOCTYPE html>
<html>
<head>
<title>Array of functions</title>
<script type="text/javascript">
function transform(array)
{
function makeFunction(value)
{return function()
{
return value;
}
}
var output = new Array();
for(var i = 0; i < array.length; ++i)
{
output[i] = makeFunction(array[i]);
}
return output;
}
</script>
</head>
<body>
<script type="text/javascript">
myArray = [1,2,3,4,5];
myArray = transform(myArray);
for(var i =0 ; i < myArray.length; ++i)
{
alert( myArray[i]());
}
</script>
</body>
</html>
After college light reading
Now that I'm out of college I can fianlly take the time to leaen how software is built in the real world :)
Tuesday, August 14, 2012
Java Script Notes + html
!
<!-- script goes here //--> #this format will hide the script from the user
A
action =[url] #Specifies where to send the form-data when a form is submitted
B
boxes # pops up a box for the user to interact with
types
alert #alert("sometext"); use to alter user they missed something
confirm#comfirm("some text"); use to confirm something
prompt#prompt("some text",defaultValue)
example# var userName=prompt("Please enter your name","Harry Potter");
Break in line #<br /> #add a line break
button # creates a button user can interact with
Sub Types
#button
#<button type="button" onclick="myFunction()">
button methods # used to program the button
#onclick
#<button type="button" onclick="myFunction()">
D
document #javascript class with many function
functions
.getElementById #access html element
#document.getElementById("demo").innerHTML="My First JavaScript";
.write # write directly into the html document
#document.write("<p>My First JavaScript</p>");
F
<form> Creates a form for the user to enter data
function <function name> #design your own java Script function f
#function myFunction(){code goes here}
I
id " " id html element
#<p id="demo">My First Paragraph</p>
input type = "type goes here "#create a moduel the user can interact with
#button
R
return #used to return a value at end of a function
S
scr = "scriptname.js" # points and loads external java script file
<script> Insert Java Script
<script type =" script type">
#text/javascript
U
<ul> #unordered list
#followed by several <li> # list item
V
value # assign a value to a button (value is usally a string of text)
var [var name] # declare a variable
<!-- script goes here //--> #this format will hide the script from the user
A
action =[url] #Specifies where to send the form-data when a form is submitted
B
boxes # pops up a box for the user to interact with
types
alert #alert("sometext"); use to alter user they missed something
confirm#comfirm("some text"); use to confirm something
prompt#prompt("some text",defaultValue)
example# var userName=prompt("Please enter your name","Harry Potter");
Break in line #<br /> #add a line break
button # creates a button user can interact with
Sub Types
#button
#<button type="button" onclick="myFunction()">
button methods # used to program the button
#onclick
#<button type="button" onclick="myFunction()">
D
document #javascript class with many function
functions
.getElementById #access html element
#document.getElementById("demo").innerHTML="My First JavaScript";
.write # write directly into the html document
#document.write("<p>My First JavaScript</p>");
F
<form> Creates a form for the user to enter data
function <function name> #design your own java Script function f
#function myFunction(){code goes here}
I
id " " id html element
#<p id="demo">My First Paragraph</p>
input type = "type goes here "#create a moduel the user can interact with
#button
R
return #used to return a value at end of a function
S
scr = "scriptname.js" # points and loads external java script file
<script> Insert Java Script
<script type =" script type">
#text/javascript
U
<ul> #unordered list
#followed by several <li> # list item
V
value # assign a value to a button (value is usally a string of text)
var [var name] # declare a variable
Saturday, August 11, 2012
Notes on Git / GIT HUB
Git add # add file to the stage
[file name] add file to stage
. # add all file and sub directories to stage
-all #add all file in current directory
Git commit # commit staged files
-m add a message# " message goes here "
git remote
add # add a remote to remote list
rm # delete a remote from the remote list
git remote add #example
git remote add origin https://github.com/DanielHaro/my_project.git
git init # create a Git repository for current project
git push remote # pushes code to remote site
Master (or any branch) send code to stated branch
git pull remote # pulls data from remote and updates local data
Master(or any Branch) grabs data from stated branch
How to start a new repsoitory
1) Declare the depository on your git site in my case git hub
2) in the root directory of your project issue command ->git init
3) issue-> git add .
4)issue ->git commit -m "inital commit"
5) create remote ie ->git remote add origin https://github.com/DanielHaro/my_project.git
6) git pull origin master
7) git push origin master
That's it your done :)
[file name] add file to stage
. # add all file and sub directories to stage
-all #add all file in current directory
Git commit # commit staged files
-m add a message# " message goes here "
git remote
add # add a remote to remote list
rm # delete a remote from the remote list
git remote add #example
git remote add origin https://github.com/DanielHaro/my_project.git
git init # create a Git repository for current project
git push remote # pushes code to remote site
Master (or any branch) send code to stated branch
git pull remote # pulls data from remote and updates local data
Master(or any Branch) grabs data from stated branch
How to start a new repsoitory
1) Declare the depository on your git site in my case git hub
2) in the root directory of your project issue command ->git init
3) issue-> git add .
4)issue ->git commit -m "inital commit"
5) create remote ie ->git remote add origin https://github.com/DanielHaro/my_project.git
6) git pull origin master
7) git push origin master
That's it your done :)
Music That I listen to while coding
I have been listening to theses groups lately
Aphex Twins
Massive attack
Orbital
Zero_Seven
Thievery Corp
OSunLade
Aphex Twins
Massive attack
Orbital
Zero_Seven
Thievery Corp
OSunLade
WebSites That I have joined or use as a resource
General /tools
http://stackoverflow.com #programmers blog site and much much more
https://github.com # Code storage and sharing site
http://newrelic.com # monitors web site performance and helps improve it
http://www.blogger.com # where I keep my programming notes :)
http://www.heroku.com # Launching site to test my web programs
http://www.linkedin.com # resume and serves as a central hub to my professional info /projects
http://www.behance.net # Where I can display some of my more graphical programming projects
HardWare/ Supplies / Books / software
http://www.amazon.com # where I get most my programming books and spend most my money
http://www.newegg.com # they take what ever money is left over ->preferred hardware shop
http://www.studica.com # Great place to get compilers and other software at academic pricing
API/DOCS
https://developer.mozilla.org/en-US/docs/JavaScript/Language_Resources?redirectlocale=en-US&redirectslug=JavaScript_Language_Resources #deocs on java script
http://api.jquery.com/ #api for JQuery
http://ruby-doc.org/core-1.9.3/ # api for ruby
http://docs.oracle.com/javase/6/docs/api/ #api for java
http://gitref.org/ # docs for git
http://www.w3schools.com/default.asp # has docs / api /tutorial for many languages
http://stackoverflow.com #programmers blog site and much much more
https://github.com # Code storage and sharing site
http://newrelic.com # monitors web site performance and helps improve it
http://www.blogger.com # where I keep my programming notes :)
http://www.heroku.com # Launching site to test my web programs
http://www.linkedin.com # resume and serves as a central hub to my professional info /projects
http://www.behance.net # Where I can display some of my more graphical programming projects
HardWare/ Supplies / Books / software
http://www.amazon.com # where I get most my programming books and spend most my money
http://www.newegg.com # they take what ever money is left over ->preferred hardware shop
http://www.studica.com # Great place to get compilers and other software at academic pricing
API/DOCS
https://developer.mozilla.org/en-US/docs/JavaScript/Language_Resources?redirectlocale=en-US&redirectslug=JavaScript_Language_Resources #deocs on java script
http://api.jquery.com/ #api for JQuery
http://ruby-doc.org/core-1.9.3/ # api for ruby
http://docs.oracle.com/javase/6/docs/api/ #api for java
http://gitref.org/ # docs for git
http://www.w3schools.com/default.asp # has docs / api /tutorial for many languages
Ruby Rails: switches
Rails new:
-T #do not generate a test Directory; do this to replace test with Rspec also need to install Rspec $rails generate rspec:install
-T #do not generate a test Directory; do this to replace test with Rspec also need to install Rspec $rails generate rspec:install
HTML CHEAT SHEET :TAGS
%
<%=link_to 'link name', .... > create a link
B
<body> This is core html coding area: contains all data and interaction with the user
<br> single line break #has not end tag
H
<h#> HTML header # documented to only be (1-6)?
<head> container for the head elements # see http://www.w3schools.com/tags/tag_head.asp
<HTML> root element also lets browser know that this is a HTML document
P
<p> paragraph tag, start a new paragraph #adds spaing and formating to document text
T
<tr> define a row
<th>header cell
<td>standatd cell
<table> create a table
<title> Create a title # this is a required <head> element
<%=link_to 'link name', .... > create a link
B
<body> This is core html coding area: contains all data and interaction with the user
<br> single line break #has not end tag
H
<h#> HTML header # documented to only be (1-6)?
<head> container for the head elements # see http://www.w3schools.com/tags/tag_head.asp
<HTML> root element also lets browser know that this is a HTML document
P
<p> paragraph tag, start a new paragraph #adds spaing and formating to document text
T
<tr> define a row
<th>header cell
<td>standatd cell
<table> create a table
<title> Create a title # this is a required <head> element
using Json in Java: non file output
I had to write some java code that used JSON format for the final out but did so with out using files:
Here was the soulition to make this happen
while(counter < numOfTags)
{
if(outList[counter].getType() == 0)
temp.addProperty(outList[counter].getTagName(),outList[counter].getFloatData());
else
temp.addProperty(outList[counter].getTagName(),outList[counter].getStringData());
counter++;
}
String outputString = mySon.toJson(temp);
notes:
int counter;
Device[] outList;
Gson mySon = new Gson();
JsonObject temp = new JsonObject();
int numOfTags;
Here was the soulition to make this happen
while(counter < numOfTags)
{
if(outList[counter].getType() == 0)
temp.addProperty(outList[counter].getTagName(),outList[counter].getFloatData());
else
temp.addProperty(outList[counter].getTagName(),outList[counter].getStringData());
counter++;
}
String outputString = mySon.toJson(temp);
notes:
int counter;
Device[] outList;
Gson mySon = new Gson();
JsonObject temp = new JsonObject();
int numOfTags;
pushing to HeroKu : ERROR sqlite3
I have not really got to the source of the problem, I even read somewhere
that heroku does not allow sqlite for security reason: who know the really
story of why this does not work. Regardless here is the fix/
Add this code to the ruby gem file and commit it to your project and then you will be able to upload to heroku.
group :production do
gem 'pg', '0.12.2'
end
group :development do
gem 'sqlite3', '1.3.4'
end
Add this code to the ruby gem file and commit it to your project and then you will be able to upload to heroku.
group :production do
gem 'pg', '0.12.2'
end
group :development do
gem 'sqlite3', '1.3.4'
end
Ruby programming !sort
I was searching for a quick way to sort objects in Ruby and
I found this ingenious method online.
deviceArray.sort! {|a,b| a.getName.downcase <=> b.getName.downcase}
notes
deviceArray : an array of objects of type device
downcase : only needed if sorting alpa numerically or can use upcase
GIT HUB: Error while pushing
Error : did you run git update server....
1. I fixed this by updating my remote: the problem is that the url is case sensitive\
Error: files out of Sync
1. to fix this use git pull [remote name] [branch name] #branch name usally master
Error: No branch specified : add brach at end of push or pull comde
1. I fixed this by updating my remote: the problem is that the url is case sensitive\
Error: files out of Sync
1. to fix this use git pull [remote name] [branch name] #branch name usally master
Error: No branch specified : add brach at end of push or pull comde
Subscribe to:
Posts (Atom)