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
vim.cmd("set expandtab") | |
vim.cmd("set tabstop=4") | |
vim.cmd("set softtabstop=4") | |
vim.cmd("set shiftwidth=4") | |
vim.g.mapleader=" " | |
vim.cmd("set number") | |
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | |
if not (vim.uv or vim.loop).fs_stat(lazypath) then | |
local lazyrepo = "https://github.com/folke/lazy.nvim.git" |
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
# coding: utf-8 | |
# In[118]: | |
import gzip, io, os.path, json | |
# In[119]: |
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
-- Best used for learning purposes. Original developer also has an ER diagram available at https://dbseminar.r61.net/node/32 | |
--create tables | |
BEGIN; | |
CREATE TABLE regions | |
( region_id SERIAL primary key, | |
region_name VARCHAR(25) | |
); | |
CREATE TABLE countries |
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
doInstall <- TRUE | |
toInstall <- c("twitteR", "dismo", "maps", "ggplot2") | |
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")} | |
lapply(toInstall, library, character.only = TRUE) | |
searchTerm <- "#rstats" | |
searchResults <- searchTwitter(searchTerm, n = 1000) # Gather Tweets | |
tweetFrame <- twListToDF(searchResults) # Convert to a nice dF | |
userInfo <- lookupUsers(tweetFrame$screenName) # Batch lookup of user info |
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
extractLongLatData <- function(file) | |
{ | |
library(ggmaps) #In case you dont have the package, use this command - install.packages(ggmaps, dependencies = TRUE) | |
data <- read.csv(file) | |
v <- as.list(data["pincode"]) #assuming the attribute containing the pincodes in the supplied CSV file is named "pincode" | |
pc <- sapply(v,as.character) | |
pc <- sapply(pc,function(x) { paste(x,"India", sep = " ")}) #change the argument in paste() from "India" to whichever country the pincodes belong to | |
longlatpc <- geocode(pc, source = "google") | |
library(xlsx) #In case you dont have the package, use this command - install.packages(xlsx, dependencies = TRUE) | |
write.xlsx2(longlatpc,'longlatpincode.xlsx') |
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
tweets <- searchTwitter("hardik patel", n = 1000) | |
text <- sapply(tweets, function(x) x$getText()) | |
dat3 <- grep("text",iconv(text,"latin1","ASCII",sub = "text")) | |
dat4 <- text[-dat3] | |
dat5 <- paste(dat4, collapse = ", ") | |
corpus <- Corpus(VectorSource(dat5)) | |
tdm = TermDocumentMatrix( | |
corpus, | |
control = list( |
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
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.LinkedBlockingQueue; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
public class ProducerConsumerPattern | |
{ | |
public static void main(String args[]) | |
{ | |
BlockingQueue sharedQueue = new LinkedBlockingQueue<>(); |
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
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
//Producer Consumer using Threads | |
public class ProducerConsumerTest | |
{ | |
public static void main(String args[]) | |
{ |
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
javascript: (function() { | |
a = document.location.href; | |
a = a.replace(/.*?:\/\//g, ""); | |
b = "http://bcdboot.appspot.com/"; | |
c = b.concat(a); | |
this.document.location.href = c; | |
})(); |
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 static void permuteString(String beginningString, String endingString) { | |
if (endingString.length() <= 1) { System.out.println(beginningString + endingString); } | |
else { | |
for (int i = 0; i < endingString.length(); i++) { | |
try { | |
String newString = endingString.substring(0, i) + endingString.substring(i + 1); //current character removed from the new string | |
permuteString(beginningString + endingString.charAt(i), newString); | |
} catch (Exception e) { System.err.println(e.getMessage()); } | |
} | |
} |
NewerOlder