This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** | |
SELECT * FROM seo_templates | |
WHERE main_copy LIKE '20%' | |
OR page_title LIKE '20%' | |
*** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Updating values - simple | |
-- SET is the column name(s), and the new values | |
-- Include where statement to target a specific row | |
--1. simple update of values | |
Update dbo.dealers | |
SET latitude='34.000854', longitude='-81.099379' | |
WHERE dealer_code = '39054' | |
*** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This will throw a 'System.IO.FileNotFoundException' | |
public class ProcessFile | |
{ | |
public static void Main() | |
{ | |
try | |
{ | |
StreamReader sr = File.OpenText("data.txt"); | |
Console.WriteLine("The first line of this file is {0}", sr.ReadLine()); | |
sr.Close(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
namespace CONSOLE | |
{ | |
class MainLoader | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String GetHttpResponse(string url) | |
{ | |
HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create("http://" + url); | |
//webRequest.AllowAutoRedirect = false; | |
HttpWebResponse response = (HttpWebResponse) webRequest.GetResponse(); | |
response.Close(); | |
return response.StatusCode.ToString(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--wrap the column name with this... | |
SELECT '="' + dealer_code + '"', dealer_name | |
FROM dealers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p { | |
color: blue; | |
margin: 8px; | |
} | |
b { | |
color: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var modelSeries = $('#seriesName').text(); | |
var gradeLevel = $('#gradeLevel').text(); | |
function seriesFormatter (series, grade) { | |
var result = (series.indexOf(grade.toLowerCase()) >= 0) ? series : series + " " + grade; | |
return result; | |
} | |
var str = seriesFormatter(modelSeries, gradeLevel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--1. BEGIN transaction, write your query and execute. | |
SELECT * | |
FROM [stuart_sandbox].[dbo].[Categories] | |
BEGIN transaction | |
UPDATE [stuart_sandbox].[dbo].[Categories] | |
SET Description ='Sushi' | |
WHERE CategoryID = '8' | |
--2. Check the results of your query |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Car(type) { | |
this.speed = 0; | |
this.type = type || "No type"; | |
this.drive = function(newSpeed) { | |
this.speed = newSpeed; | |
} | |
} | |
//creating a new instance of the Car object, the bmw. | |
var bmw =new Car("BMW"); |
OlderNewer