My Sites


Thursday, November 5, 2015

(pending—Waiting for next available executor) - FIX

For the master, this is set in Manage Jenkins > Configure System > # of executors
For the slaves (nodes), it is set in Manage Jenkins > Nodes > (each node) > Configure > # of executors

How to schedule jobs (Cron) in Jenkins

Cron job - run periodically at fixed times, dates, or intervals.

A CRON expression is a string comprising five or six fields separated by white space[10] that represents a set of times, normally as a schedule to execute some routine.
    MINUTES Minutes in one hour (0-59)
    HOURS Hours in one day (0-23)
    DAYMONTH Day in a month (1-31)
    MONTH Month in a year (1-12)
    DAYWEEK Day of the week (0-7) where 0 and 7 are sunday

If you want to shedule your build every 5 minutes, this will do the job : */5 * * * *
If you want to shedule your build every day at 8h00, this will do the job : 0 8 * * *
15 13 * * * you tell jenkins to schedule the build every day of every month of every year at the 15th minute of the 13th hour of the day. (13:15)

http://www.unixgeeks.org/security/newbie/unix/cron-1.html

01 * * * * root echo "This command is run at one min past every hour"
17 8 * * * root echo "This command is run daily at 8:17 am"
17 20 * * * root echo "This command is run daily at 8:17 pm"
00 4 * * 0 root echo "This command is run at 4 am every Sunday"
* 4 * * Sun root echo "So is this"
42 4 1 * * root echo "This command is run 4:42 am every 1st of the month"
01 * 19 07 * root echo "This command is run hourly on the 19th of July"

Wednesday, November 4, 2015

Unable to debug in Java with eclipse + Fix

ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:708]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

It seams that in some cases DNS is expected to resolve this, and if
firewall prevents localhost requests to DNS - stuff breaks. I had to
alter hosts file and remove comments in following lines.
# 127.0.0.1 localhost    # ::1 localhost   

Use the $in Operator with a Regular Expression + Mongo + Java + Morphia

https://docs.mongodb.org/v3.0/reference/operator/query/in/
The $in operator can specify matching values using regular expressions of the form /pattern/. You cannot use $regex operator expressions inside an $in.

Perform Case-Insensitive Regular Expression Match
https://docs.mongodb.org/manual/reference/operator/query/regex/#perform-case-insensitive-regular-expression-match

Example :-
db.Course.find( { $and: [{callNo: {$in : ["testcourse"]} },{myId :123456 }]})
db.Course.find( { $and: [{callNo: {$in : [/^testcourse$/i]} },{myId :123456 }]})

jmkgreen/morphia (MongoDB object-document mapper in Java. Uses mongo-java-driver. )
https://github.com/jmkgreen/morphia/blob/master/morphia/src/main/java/com/github/jmkgreen/morphia/query/Query.java

Pattern regexDbObject = Pattern.compile("^" + originalCourseCallNo + "$", Pattern.CASE_INSENSITIVE);
mongoDatastore.find(EmployeeEntity.class).filter("email", regexp).get();

List<Pattern> courseCallNoList = new ArrayList<Pattern>();courseCallNoList.add(regexDbObject); 
List<Course>  courses= getDataStore().createQuery(Course.class).field
(Constants.Course.COURSE_CALL_NO).in(courseCallNoList).field
(Constants.Course.CLIENT_ID).equal(clientId).field
(Constants.Course.COURSE_CALL_NO_EXPIRATION_DATE).greaterThanOrEq(courseCallNoExpDate).asList();


http://www.tutorialspoint.com/java/java_regular_expressions.htm

Thursday, October 29, 2015

Java SE 8 - Oracle Certified Associate - 1Z0-808

Register : http://www.pearsonvue.com/oracle/

Guide Book (OCA: Oracle Certified Associate Java SE 8 Programmer I Study Guide: Exam 1Z0-808) : (Free Download :-) ) http://miageprojet2.unice.fr/@api/deki/files/2477/=LivreJava.pdf 

Duration: 150  Number of Questions:  77   Passing Score:     65%
Exam Topics :

Java Basics 
  • Define the scope of variables 
  • Define the structure of a Java class
  • Create executable Java applications with a main method; run a Java program from the command line; including console output.
  • Import other Java packages to make them accessible in your code
  • Compare and contrast the features and components of Java such as: platform independence, object orientation, encapsulation, etc.
Working With Java Data Types 
  • Declare and initialize variables (including casting of primitive data types)
  • Differentiate between object reference variables and primitive variables
  • Know how to read or write to object fields
  • Explain an Object's Lifecycle (creation, "dereference by reassignment" and garbage collection)
  • Develop code that uses wrapper classes such as Boolean, Double, and Integer.  
Using Operators and Decision Constructs 
  • Use Java operators; including parentheses to override operator precedence
  • Test equality between Strings and other objects using == and equals ()
  • Create if and if/else and ternary constructs 
  • Use a switch statement 
Creating and Using Arrays 
  • Declare, instantiate, initialize and use a one-dimensional array
  • Declare, instantiate, initialize and use multi-dimensional array
Using Loop Constructs 
  • Create and use while loops
  • Create and use for loops including the enhanced for loop
  • Create and use do/while loops
  • Compare loop constructs
  • Use break and continue  
Working with Methods and Encapsulation 
  • Create methods with arguments and return values; including overloaded methods
  • Apply the static keyword  to methods and fields  
  • Create and overload constructors; including impact on default constructors
  • Apply access modifiers
  • Apply encapsulation principles to a class
  • Determine the effect upon object references and primitive values when they are passed  into methods that change the values
Working with Inheritance 
  • Describe inheritance and its benefits
  • Develop code that demonstrates the use of polymorphism; including overriding and object type versus reference type
  • Determine when casting is necessary
  • Use super and this to access objects and constructors
  • Use abstract classes and interfaces
Handling Exceptions 
  • Differentiate among checked exceptions, unchecked exceptions, and Errors
  • Create a try-catch block and determine how exceptions alter normal program flow
  • Describe the advantages of Exception handling 
  • Create and invoke a method that throws an exception
  • "Recognize common exception classes (such as NullPointerException, ArithmeticExcpetion, ArrayIndexOutOfBoundsException, ClassCastException)"
Working with Selected classes from the Java API 
  • Manipulate data using the StringBuilder class and its methods
  • Creating and manipulating Strings
  • Create and manipulate calendar data using classes from java.time.LocalDateTime,  java.time.LocalDate, java.time.LocalTime, java.time.format.DateTimeFormatter, java.time.Period 
  • Declare and use an ArrayList of a given type 
  • Write a simple Lambda expression that consumes a Lambda Predicate expression

What should be your goal ? A Full Stack developer


  1. Server, Network, and Hosting Environment.
    1. This involves understanding what can break and why, taking no resource for granted.
    2. Appropriate use of the file system, cloud storage, network resources, and an understanding of data redundancy and availability is necessary.
    3. How does the application scale given the hardware constraints?
    4. What about multi-threading and race conditions? Guess what, you won’t see those on your development machine, but they can and do happen in the real world.
    5. Full stack developers can work side by side with DevOps. The system should provide useful error messages and logging capabilities. DevOps will see the messages before you will, so make them count.
  2. Data Modeling
    1. If the data model is flawed, the business logic and higher layers start to need strange (ugly) code to compensate for corner cases the data model doesn’t cover.
    2. Full stack developers know how to create a reasonably normalized relational model, complete with foreign keys, indexes, views, lookup tables, etc.
    3. Full stack developers are familiar with the concept of non-relational data stores and understand where they shine over relational data stores.
  3. Business Logic
    1. The heart of the value the application provides.
    2. Solid object oriented skills are needed here.
    3. Frameworks might be needed here as well.
  4. API layer / Action Layer / MVC
    1. How the outside world operates against the business logic and data model.
    2. Frameworks at this level should be used heavily.
    3. Full stack developers have the ability to write clear, consistent, simple to use interfaces. The heights to which some APIs are convoluted repel me.
  5. User Interface
    1. Full stack developers: a) understand how to create a readable layout, or b) acknowledge they need help from artists and graphic designers. Either way, implementing a good visual design is key.
    2. Can include mastery of HTML5 / CSS.
    3. JavaScript is the up and coming language of the future and lots of exciting work is being done in the JavaScript world (node, backbone, knockout…)
  6. User Experience
    1. Full stack developers appreciate that users just want things to work.
    2. A good system doesn’t give its users carpal tunnel syndrome or sore eyes. A full stack developer can step back and look at a process that needs 8 clicks and 3 steps, and get it down to one click.
    3. Full stack developers write useful error messages. If something breaks, be apologetic about it. Sometimes programmers inadvertently write error messages that can make people feel stupid.
  7. Understanding what the customer and the business need.
    1. Now we are blurring into the line of architect, but that is too much of a hands off role.
    2. Full stack developers have a grasp of what is going on in the field when the customer uses the software. They also have a grasp of the business.
    Reference : http://www.laurencegellert.com/2012/08/what-is-a-full-stack-developer/

Tuesday, October 13, 2015

Sonar Integraion for Node.js and Java

Node.js
https://www.npmjs.com/package/grunt-sonar-runner
grunt  sonarRunner:analysis

Java (Maven)
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>sonar-maven-plugin</artifactId>
  <version>2.3</version>
</plugin>
maven command
sonar:sonar

Monday, October 5, 2015

DEVOPS TOOLS - Essentials

http://nemo.sonarqube.org/api/resources?resource=9917336&depth=0&metrics=coverage&includetrends=true

http://10.52.133.533:8080/job/Admin_Toooool_Staging_BVT/10/testReport/api/json?pretty=true

https://jira..com/jira/rest/api/2/project/key

https://jira..com/jira/rest/api/2/project/key/versions


https://jira..com/jira/rest/greenhopper/1.0/rapidview

https://jira..com/jira/rest/greenhopper/1.0/sprintquery/3139?includeFutureSprints=true

https://jira..com/jira/rest/greenhopper/1.0/rapid/charts/sprintreport?rapidViewId=3139&sprintId=40366

https://jira..com/jira/rest/api/2/project

https://jira..com/jira/rest/greenhopper/1.0/rapid/charts/scopechangeburndownchart

https://jira..com/jira/rest/greenhopper/1.0/rapid/charts/scopechangeburndownchart?rapidViewId=3139&sprintId=40366

https://jira..com/jira/rest/greenhopper/1.0/rapid/charts/releaseburndownchart?rapidViewId=3139&versionId=21232


http://fisheye..com/rest-service-fe/revisionData-v1/changeset/
http://fisheye..com/rest-service-fe/revisionData-v1/changesetList/MLP_Restexpress-portello

http://fisheye..com/rest-service-fe/revisionData-v1/changeset/MLP_Restexpress-portello/c90a6a553a890b8744ac1beb92546e852d80d5f2

http://fisheye..com/rest-service-fe/revisionData-v1/revisionInfo/MLP_Restexpress-portello?rev="c90a6a553a890b8744ac1beb92546e852d80d5f2"&path="src/main/java/com/pearson/portello/utill/SubPubSubcriptionUtils.java"

http://fisheye..com/rest-service-fecru/recently-visited-v1/reviews

https://jira..com/jira/rest/greenhopper/1.0/rapid/charts/releaseburndownchart?rapidViewId=1999&versionId=26802

https://jira..com/jira/rest/api/2/version/26802/relatedIssueCounts
https://jira..com/jira/rest/api/2/version/26802/unresolvedIssueCount
https://jira..com/jira/rest/greenhopper/1.0/rapid/charts/sprintreport?rapidViewId=1999&sprintId=40689

https://jira..com/jira/rest/greenhopper/1.0/rapid/charts/sprintreport?rapidViewId=19805&sprintId=40689

https://jira..com/jira/rest/greenhopper/1.0/rapid/charts/releaseburndownchart?rapidViewId=19805&versionId=26802

Encoding URL query parameters

  • java.net.URLEncoder.encode(String s, String encoding) can help too. It follows the HTML form encoding application/x-www-form-urlencoded. URLEncoder.encode(query, "UTF-8");
  • URI uri = new URIBuilder(termsUrl).addParameter("X-Authorization",
                        "token " + token).build();
  •  URI uri = new URI(https://jira.pearsoncmg.com/jira/rest/greenhopper/1.0/rapid/charts/releaseburndownchart?rapidViewId=14141&versionId=1515");
  •  String q = "random word £500 bank $";
     String url = "http://example.com/query?q=" + URLEncoder.encode(q, "UTF-8");
    

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://YYY. (Reason: CORS header 'Access-Control-Allow-Origin' missing).


Browser security prevents making an ajax call from a page hosted on one domain to a page hosted on a different domain; this is called the "same-origin policy".

  • We can not get the data from third party website without jsonp.
  • JSONP or "JSON with padding" is a communication technique used in JavaScript programs running in web browsers to request data from a server in a different domain, something prohibited by typical web browsers because of the same-origin policy.
  • JSONP takes advantage of the fact that browsers do not enforce the same-origin policy on script tags.
  • Note that for JSONP to work, a server must know how to reply with JSONP-formatted results.
  • JSONP does not work with JSON-formatted results.


jqXHR → The jQuery XMLHttpRequest

JSONP is JSON with padding, that is, you put a string at the beginning and a pair of parenthesis around it. For example:
//JSON
    {"name":"stackoverflow","id":5}
//JSONP
    func({"name":"stackoverflow","id":5});


Use Server Level : Node.js

Monday, September 21, 2015

Transparent Background

background: rgba(255, 0, 0, 0.4);

CSS Transition

a {
  color:blue; background:white;
  -o-transition:color .2s ease-out, background 1s ease-in;
  -ms-transition:color .2s ease-out, background 1s ease-in;
  -moz-transition:color .2s ease-out, background 1s ease-in;
  -webkit-transition:color .2s ease-out, background 1s ease-in;
  /* ...and now override with proper CSS property */
  transition:color .2s ease-out, background 1s ease-in;
}
a:hover { color:red; background:yellow; }

Wednesday, September 16, 2015

Center Align CSS

<div id="thumbnailwrapper"> <!-- <<< This opening element -->
    <div id="artiststhumbnail">
    </div>
</div>
 
#artiststhumbnail {
    width:120px;
    height:108px;
    margin: 0 auto; /* <<< This line here. */
    ...
} 
 

Tuesday, August 11, 2015

Linux Essential Basic Installations

Install a .tar.gz (or .tar.bz2) file    
  1. open a console
  2. use the command cd to navigate to the correct folder. If there is a README file with installation instructions, use that instead.
  3. extract the files with one of the commands
    • If it's tar.gz use tar xvzf PACKAGENAME.tar.gz
    • if it's a tar.bz2 use tar xvjf PACKAGENAME.tar.bz2
  4. ./configure
  5. make
  6. sudo make install
Install .zip

unzip file.zip -d destination_folder 
sudo apt-get install unzip
  
Install .rpm

sudo apt-get install alien
sudo alien my_package.rpm
sudo dpkg -i my_package.deb
 
Install .deb 
Simply double click :D
or using CLI
  sudo dpkg -i skype-ubuntu-precise_4.2.0.11-1_i386.deb
  or
  sudo dpkg -R --install {package_location}
 
 

Monday, August 10, 2015

Unix Shell Scripting Tutorial

http://www.tutorialspoint.com/unix/unix-using-variables.htm

if [ "$1" = "cool" ]
then
    echo "Cool Beans"
elif [ "$1" = "neat" ]
then
    echo "Neato cool"
else
    echo "Not Cool Beans"
fi

echo "First Parameter"

NAME[0]="Zara"
NAME[1]="Qadir"
NAME[2]="Mahnaz"
NAME[3]="Ayan"
NAME[4]="Daisy"
echo "First Index: ${NAME[0]}"

val=`expr 2 + 2`
echo "Total value : $val"


for var in word1 word2 ... wordN
do
   Statement(s) to be executed for every word.
done


for var in 0 1 2 3 4 5 6 7 8 9
do
   echo $var
done

http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job

Sunday, August 9, 2015

Jenkins - Remote access API + Jobs with parameters + Eselenium

Execute Shell
  curl -X POST http://10.52.133.54:8080/view/BVT/job/testjobname/build \
  --data token=eagletoken \
  --data-urlencode json='{"parameter": [{"name":"suiteXmlFile", "value":"MlpBvt.xml"}, {"name":"browser", "value":"FIREFOX"} , {"name":"env", "value":"Staging"}]}'


if [ "$ENVIRONMENT" = "dev" ]
then
     echo "Running Test 1"
     curl -X POST http://10.163.26.64:8080/view/Ruby/job/test1/build \
        --data token=mlpeagletoken \
        --data-urlencode json='{"parameter": [{"name":"env", "value":"Prod"}]}'
elif [ "$ENVIRONMENT" = "stg" ]
then
     echo "
Running Test 2 "
     curl -X POST http://10.163.26.64:8080/view/Ruby/job/test2/ \
        --data token=mlpeagletoken \
        --data-urlencode json='{"parameter": [{"name":"env", "value":"Staging"}]}'
else
    echo "Running none"
fi


https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

Selenium + Headless Automation
http://stackoverflow.com/questions/31848410/selenium-test-execution-via-jenkins-on-linux-machine-without-gui-cli-only-he

http://elementalselenium.com/tips/38-headless

http://tobyho.com/2015/01/09/headless-browser-testing-xvfb/

http://tobyho.com/2015/01/09/headless-browser-testing-xvfb/

http://linuxg.net/how-to-install-firefox-28-on-ubuntu-linux-mint-debian-fedora-centos-opensuse-and-other-popular-linux-systems/

http://askubuntu.com/questions/500644/how-to-downgrade-firefox-from-30-to-28


Plugins
Post build task
Editable Email Notification

Saturday, August 1, 2015

YouTube Data API (v3) with javascript - Essentials



https://developers.google.com/youtube/v3/docs/playlists/list
https://developers.google.com/youtube/v3/docs/playlistItems/list
https://developers.google.com/youtube/v3/docs/videos/list

Monday, July 20, 2015

How to make Sublime Text your best IDE :D


Package Management
https://packagecontrol.io/installation


View --> Show Console
Ctrl + Shift + P
Install Package

Essential Plug-ins
1.) Dayle Rees Color Scheme
2.) Predawn
3.) Bracket HIghlighter
4.) Sidebar Enchacement
5.) SublimeCodeIntel
6.) Emmet
7.) SublimeLinter
8.) SublimeLinter-jshint (https://github.com/SublimeLinter/SublimeLinter-jshint)
https://www.youtube.com/watch?v=zVLJfrIwEP8

Preferences --> User --> Settings --> font face : monospace 13pt 

Saturday, July 18, 2015

AWS - How to select the right Architecture for your Web Application

https://www.youtube.com/watch?v=Ypwi1Ics91Y

Hosting a static site

  1. Amazon Route 53
  2. Amazon Cloud Front
  3. Simple Storage Service (S3)

http://docs.aws.amazon.com/gettingstarted/latest/swh/website-hosting-intro.html

Single Virtual Machine Architecture
  1. Amazon Route 53
  2. Amazon Cloud Front
  3. Simple Storage Service (S3)
  4. Elastic Compute Cloud (EC2)
  5. EBS - Elastic Block Storage

Deciding the right DB service

  1. DynamoDB - NOSQL
  2. RDS - Relational Database Service
  3. EC2 - Manage DB yourself 

Monday, July 13, 2015

ComparatorChain java impl

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-collections4</artifactId>
    <version>4.0</version>
</dependency>

private TermActiveComarator activeComarator;

ComparatorChain comparatorChain = new ComparatorChain();
        comparatorChain.addComparator(activeComarator);
        comparatorChain.addComparator(startDateComparator);
        Collections.sort(list, comparatorChain);

public class TermActiveComarator implements Comparator<TermDto> {

    @Override
    public int compare(TermDto o1, TermDto o2) {
        Boolean a1 = new Boolean(o1.isActive());
        Boolean a2 = new Boolean(o2.isActive());
        return a2.compareTo(a1);

    }

}

Tuesday, July 7, 2015

Java Joda Date Time Essentials

DateTime creationDateTime = new DateTime(DateTimeZone.UTC);
2015-07-07T06:28:19.911Z

DateTime expirationDateTime=creationDateTime.plusMonths(3);
DateTime expirationDateTime=creationDateTime.minus(3)

if(expirationDateTime.isAfterNow()){

}

String datePattern = "yyyy-MM-dd";
SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
sdf.setTimeZone(TimeZone.getTimeZone("America/Denver"));

Date endDate= sdf.parse(termDto.getEndDateTime().substring(0,10));
Calendar endDateCal = Calendar.getInstance();
endDateCal.setTime(endDate);
endDateCal.add(Calendar.DAY_OF_MONTH, gracePeriod);
endDate = endDateCal.getTime();

Calendar cal = Calendar.getInstance();
                //cal.setTimeZone(TimeZone.getTimeZone("America/Denver"));
                cal.setTime(new Date());
                cal.set(Calendar.HOUR_OF_DAY, 0);
                cal.set(Calendar.MINUTE,0);
                cal.set(Calendar.SECOND,0);
                cal.set(Calendar.MILLISECOND,0);
               
                if(stDate.compareTo(cal.getTime())<=0 && endDate.compareTo(cal.getTime())>=0){

}

DateTimeFormatter dateFormatter = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss'");
DateTime requestDateTime = dateFormatter.parseDateTime("timestamp");
DateFormat gmtFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
TimeZone gmtTime = TimeZone.getTimeZone("America/Denver");
gmtFormat.setTimeZone(gmtTime);
DateTime nowDate = dateFormatter.parseDateTime(gmtFormat.format(new Date()));

String datePattern = "yyyy-MM-dd'T'00:00:00";
        SimpleDateFormat sdf = new SimpleDateFormat(datePattern);
        sdf.setTimeZone(TimeZone.getTimeZone("America/Denver"));
        String nowDate = sdf.format(new Date());

Convert joda datetime to Util date
.toDate()

Convert from java.util.date to JodaTime
ava.util.Date date = ...
DateTime dateTime = new DateTime(date);



Encoding vs. Encryption vs. Hashing

https://danielmiessler.com/study/encoding_encryption_hashing/

Sunday, July 5, 2015

Cookie VS Session [UNREVEALED]



The concept is storing persistent data across page loads for a web visitor. Cookies store it directly on the client. Sessions use a cookie as a key of sorts, to associate with the data that is stored on the server side.
It is preferred to use sessions because the actual values are hidden from the client, and you control when the data expires and becomes invalid. If it was all based on cookies, a user (or hacker) could manipulate their cookie data and then play requests to your site.
Edit: I don't think there is any advantage to using cookies, other than simplicity. Look at it this way... Does the user have any reason to know their ID#? Typically I would say no, the user has no need for this information. Giving out information should be limited on a need to know basis. What if the user changes his cookie to have a different ID, how will your application respond? It's a security risk.
Before sessions were all the rage, I basically had my own implementation. I stored a unique cookie value on the client, and stored my persistent data in the database along with that cookie value. Then on page requests I matched up those values and had my persistent data without letting the client control what that was.
Session:
  1. IDU is stored on server (i.e. server-side)
  2. Safer (because of 1)
  3. Expiration can not be set, session variables will be expired when users close the browser. (nowadays it is stored for 24 minutes as default in php)
Cookies:
  1. IDU is stored on web-browser (i.e. client-side)
  2. Not very safe, since hackers can reach and get your information (because of 1)
  3. Expiration can be set (see setcookies() for more information)
Session is preferred when you need to store short-term information/values, such as variables for calculating, measuring, querying etc.
Cookies is preferred when you need to store long-term information/values, such as user's account (so that even when they shutdown the computer for 2 days, their account will still be logged in). I can't think of many examples for cookies since it isn't adopted in most of the situations.
SESSIONS ENDS WHEN USER CLOSE HIS BROWSER,

COOKIES ENDS DEPENDING ON THE LIFE TIME YOU SET FOR IT. SO IT CAN LAST FOR YEARS

“No 'Access-Control-Allow-Origin' header is present on the requested resource” SOLUTION

XMLHttpRequest cannot load http://myApiUrl/login. No
'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'null' is therefore not allowed access.
//Create a parseData json object
var parseData = {token : userToken};

var request = $.ajax({
        url: "http://localhost:8080/configurations/authenticate",
        type: "post",
        data: parseData
    });

http://davidwalsh.name/cdn-fonts
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://grid-static-stg.pearson.com/57-mlpui/0.0.4/assets/fonts/pearson-symbols/pearson-symbols.ttf. (Reason: CORS header 'Access-Control-Allow-Origin' missing).

 

Center a column using Twitter Bootstrap 3

http://stackoverflow.com/questions/18153234/center-a-column-using-twitter-bootstrap-3

https://shapebootstrap.net
http://www.wpfreeware.com/tutorial/outstanding-bootstrap-ecommerce-templates-free-premium/

The first approach uses Bootstrap's own offset classes so it requires no change in markup and no extra CSS. The key is to set an offset equal to half of the remaining size of the row. So for example, a column of size 2 would be centered by adding an offset of 5, that's (12-2)/2.
In markup this would look like:
<div class="row">
    <div class="col-md-2 col-md-offset-5"></div>
</div>

Friday, July 3, 2015

JQuery form submit + HTML 5 place holder conflict SOLUTION

<form id="sampleForm" >
  <input type="text" id="studentID" required />
  <button type="submit"> Submit </button>
</form>

$('#sampleForm').on('submit', function(e) { //use on if jQuery 1.7+        
e.preventDefault();  //prevent form from submitting/refreshing       
    });

MODAL SOLUTION
$('#myModal').modal('toggle');

Sunday, June 28, 2015

GIT essentials

git remote show origin
git remote set-url origin git://new.url.here

Bower essentials

npm install -g bower
bower install 
bower install jquery 
bower init
 
  

Linux Hard Disk Partitioning


Mobile First With Bootstrap 3

Device compatibility
<meta name="viewport" content="width=device-width, initial-scale=1.0">

Language and character encode
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />


<div class="container">
    <div class="row">
        <div class="col-xs-6">col-xs-6</div>
        <div class="col-xs-6">col-xs-6</div>
    </div>

</div>

Fonts
https://www.myfonts.com/topwebfonts/
https://www.google.com/fonts

https://www.youtube.com/watch?v=vUn9sBStMLA