Skip to content

Instantly share code, notes, and snippets.

View rlingineni's full-sized avatar
💭
building cool stuff

Raviteja Lingineni rlingineni

💭
building cool stuff
View GitHub Profile
.data
str: .space 23 # buffer for input string
strNS: .space 23 # buffer for string w/o spaces
prompt: .asciiz "Enter a string up to 80 characters\n"
head1: .asciiz "\nOriginal String: "
head2: .asciiz "\nNumber of spaces: "
head3: .asciiz "\nWith spaces removed: "
head4: .asciiz "\nSeparated: "
endOfFileLine: .asciiz ".end"
@rlingineni
rlingineni / file update config function
Created November 23, 2016 20:07
Raspberry Pi Wifi Config update function
console.log("Updating Wifi to SSD: " + SSID);
var data = fs.readFileSync('/etc/wpa_supplicant/wpa_supplicant.conf', 'utf8');
var result = data.replace(/ssid="(.*)"/g, 'ssid="'+ SSID + '"');
var finalResult = result.replace(/psk="(.*)"/g, 'psk="'+ Password + '"');
console.log("Will print: \n" + finalResult); //this prints out correctly, finalResult holds what I want it ot
//need to fix writing to file (only writes like a piece of it)
fs.writeFile('/etc/wpa_supplicant/wpa_supplicant.conf', finalResult, 'utf8', function (err) {
@rlingineni
rlingineni / Color Conversions
Created February 13, 2017 01:42
Different Conversions of Color Representations
using System;
using System.Collections.Generic;
namespace rgbConverter
{
class MainClass
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
@rlingineni
rlingineni / Parent.java
Created February 25, 2017 04:03
Reading a Stream in Java
StringBuilder sb = new StringBuilder();
Runtime rt = Runtime.getRuntime();
//You need to use this!
String current = System.getProperty("java.class.path");
System.out.println("Current dir:"+current);
//Make sure to use -classpath flag
Process proc = rt.exec("java -classpath " + current + " Memory");
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Sample.HelloWorldPage"
BackgroundColor= "Black">
<ContentPage.Content>
<ScrollView>
<Grid RowSpacing="5">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
@rlingineni
rlingineni / scheduler.java
Created April 16, 2017 01:31
Scheduling Algorithm driver
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Scheduler {
public static void main(String args[]) throws FileNotFoundException
{
@rlingineni
rlingineni / Job.Java
Created April 26, 2017 22:36
Java implementation of a ShortestRemainingScheduler that takes in a list of Jobs
public class Job {
public Job(String n, int e, int d)
{
name = n;
entryTime = e;
duration = d;
serviceTime = duration;
}
@rlingineni
rlingineni / rock_collect.py
Created August 16, 2017 18:22
Dr.Chrono Rock_Collection Python
# Complete the function below.
def get_rock_index(quantity):
jamie = quantity
print jamie
ned = list(quantity)
ned.sort()
print ned
geoffrey = []
@rlingineni
rlingineni / event.json
Created August 28, 2017 17:40
AWS Lambda Proxy Event
{
"message": "Hello me!",
"input": {
"path": "/test/hello",
"headers": {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Encoding": "gzip, deflate, lzma, sdch, br",
"Accept-Language": "en-US,en;q=0.8",
"CloudFront-Forwarded-Proto": "https",
"CloudFront-Is-Desktop-Viewer": "true",
module testMul3 ;
reg [7:0] in ;
reg error ;
wire out ;
Multiple_of_3 dut(in, out) ;
initial begin
in = 0 ; error = 0 ;