r/programing • • Mar 19 '16

a batch file request.

1 Upvotes

Hi guys, I need a script to write into a batch file. Something that will go into a specified folder and the folders it has in it, then replace a specified word in all the HTML files it finds (including their names), to a different expression.

Anyone up to the challenge? It's for work, I assumed the best way of having such a script is to ask here.


r/programing • • Mar 03 '16

[JS] Help with updating a variable from a php file

1 Upvotes

what we are trying to do is update a variable (valid) to 1. After the first execution valid is 0 but with the samee paramiters valid is 1.

function checkPass(str1, str2){
	if (str1.length == 0 || str2.length == 0) { 
   		 return;
	} 
	else {
  	  	var xmlhttp = new XMLHttpRequest();
  	  

    xmlhttp.open("GET", "checkpasswordJS.php?q=" + str1 + "&z=" + str2, true);//Change php file
    xmlhttp.send();

	}
		    xmlhttp.onreadystatechange = function() {
        	if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            	valid = xmlhttp.responseText;
        	}
    	}	
}

r/programing • • Feb 29 '16

Help with APP INVENTOR and a GPS CHIP

1 Upvotes

Hi, thx for reading.

I need help to make a school project. The project its a chip that u put it in you'r medicins, and when you get far away from them, lets say 20m, you'r mobile phone strats making noise. I need help with this because i don't know where to buy a gps chip to program it to make the think that i mentioned before (making that when the mobile gets 20m far away of the chips strats whistling).

Could u tell me where to buy the GPS chip and hot to program it? THX


r/programing • • Feb 29 '16

Help finding an alternative to code anywhere

1 Upvotes

I am currently doing html in my class at school and i was holding all my source files on google drive and using codeanywhere to edit them, but codeanywhere does not have any way of viewing your work. Is there any alternative that will let me see a preview of my work and provide linking to google drive


r/programing • • Feb 27 '16

My Name Says It All

1 Upvotes

Hello beautiful people!

Okay! Where to start? I have been doing UI/UX design for 7 years now, and recently I decided to dive in and create my own start-up. Unfortunately, I am am by no means an expert programer! Like at all! Frankly, I don't plan to be, but I sure as hell don't want to be the ignorant founder either. (Side-note: I have pretty much mastered JavaScript though)

Okay here is where I need your help! My platform is a creative based desktop, e-commerce application. For ease of explanation, think iTunes or Spotify. So you know it's not a ANOTHER music app If you are interested and want more info let me know or are a coding wizard and want a job let me know :P

Where do I start?? I am eager on learning the languages necessary to code a platform like this. From my research I found that C, C++ and variations of Python are the best to learn for this type of software. Am I totally wrong?

Thanks fam! I appreciate your help!


r/programing • • Feb 22 '16

Show HN: DNS server with ad sites blocked

Thumbnail dns.dbalan.in
1 Upvotes

r/programing • • Feb 18 '16

Help me with proposing a fair deal for my product

1 Upvotes

Hey guys, I just got out of college and have never had a programming job so I have no idea how much does what amount of work cost.

And there comes this guy (who is accidentally my notSoGoodRelationsBrother). He has a standard business and offers his clients a range of simple services (let's say a barber shop). He would like a new software for his workers and that's where I come in.

The thing is he is connected to a lot of similar businesses and he would like, not only to get a software, but to sell that software to them. So his proposal is following: he will deal with all the selling related stuff and I have to program the thing and offer a customer service (let's say they have a problem with the program, they will contact me for help). I think I can program it in a way that's idiot proof, but you never know. The workers don't have a complicated job so that's where I count on the "idiot proof" part.

So, in essence it is a classical "offer services and product" type of program with the possibility to have customer tracking (remembers what services did the customer buy, gives him some points for it. He can use the points for reduced prices). Oh, and the above mentioned technical support.

He offers me a 50/50 deal on all the sales and I don't know if that's fair. What do you think?


r/programing • • Feb 08 '16

What am I doing wrong?

1 Upvotes

I started to learn programming today, and after watching videos (Brackeys tutorials) I wanted to make a project, some type of calculator, this is the code:http://pastebin.com/XNuZD5YS

but I hit a roadblock, http://i.imgur.com/2mvECYW.png as you see when I press 1 for multiplying it won't do anything, what should I do to fix it?


r/programing • • Jan 15 '16

Can somebody recommend a good Twitter bot? (Updated with the new API please)

1 Upvotes

r/programing • • Dec 28 '15

Balancing a BST/AVL

1 Upvotes

Question: How to connect all the references balancing a BST/AVL? im trying to balance a tree with this data: 15, 13, 10, 9, 8 and im having some issues the firts one is that when i balance the tree the 9 node doesnt has a parent i mean it let the references of the parent in the air . Here is the snippet for visualize better what im saying:

                        class DuplicateKeyException extends Exception {

}

class KeyNotFoundException extends Exception { }

class InvalidIndexException extends Exception { }

class AVLTree<Key extends Comparable> {

class AVLNode<Key> {
	Key key;
	int height;
	AVLNode left, right;

	public AVLNode(Key _key) {
		key = _key;
		height = 0;
	}

}

public AVLNode<Key> root;
private int size;

public int height(AVLNode cur) {
	if (cur == null)
		return -1;
	return cur.height;
}

public void add(Key key) throws DuplicateKeyException {
	if (root == null) {
		root = new AVLNode(key);

		return;
	}

	AVLNode cur = root, prv = null;
	while (cur != null) {

		int cmp = key.compareTo(cur.key);
		if (cmp == 0) {
			throw new DuplicateKeyException();

		}
		prv = cur;
		if (cmp < 0)
			cur = cur.left;
		else
			cur = cur.right;
	}
	if (key.compareTo(prv.key) < 0) {
		prv.left = new AVLNode(key);
	} else {
		prv.right = new AVLNode(key);
	}

}

public AVLNode leftRotation(AVLNode cur) {
	AVLNode father = findPrevious(cur); // Padre del nodo recibido
	AVLNode a = cur;
	AVLNode b = cur.right;
	a.right = b.left;
	b.left = a;
	if(father != null)
		father.right = b;
	return b;
}

public AVLNode rightRotation(AVLNode cur) {
	AVLNode father = findPrevious(cur);
	AVLNode a = cur;
	AVLNode b = cur.left;
	a.left = b.right;
	b.right = a;
	if(father != null)
		father.left = b;
	return b;
}

public AVLNode leftRightRotation(AVLNode cur) {
	AVLNode father = findPrevious(cur);
	AVLNode a = cur;
	AVLNode b = cur.left;
	AVLNode c = b.right;
	a.left = c.right;
	b.right = c.left;
	c.left = b;
	c.right = a;
	if(father != null)
		father.left = c;
	
	return c;
}

public AVLNode rightLeftRotation(AVLNode cur) {
	AVLNode father = findPrevious(cur);
	AVLNode a = cur;
	AVLNode b = cur.right;
	AVLNode c = b.left;
	a.right = c.left;
	b.left = c.right;
	c.left = a;
	c.right = b;
	if(father != null)
		father.right = c;
	return c;
}

// Metodo Wrapper :D
public void setHeight() {
	root.height = setHeight(root);
}

private int setHeight(AVLNode cur) {
	int leftHeight, rightHeight;
	if (cur == null) {
		return -1;
	}

	leftHeight = setHeight(cur.left);
	rightHeight = setHeight(cur.right);
	if (leftHeight > rightHeight)
		return leftHeight + 1;
	else {

		return rightHeight + 1;

	}
}

public int balancedFactor(AVLNode cur) {
	return setHeight(cur.right) - setHeight(cur.left);
}

public boolean isAVl() {
	if (Math.abs(setHeight(root.right) - setHeight(root.left)) == 1
			|| setHeight(root.right) - setHeight(root.left) == 0)
		return true;
	return false;
}

public AVLNode findUnbalancedNode() {
	if (balancedFactor(root) == 0)
		return null;
	AVLNode cur = root;
	while (cur != null) {
		

		if (Math.abs(balancedFactor(cur)) == 2) {
			//System.out.println(cur.key);
			
			break;
		}

		if (balancedFactor(cur) < 0)
			cur = cur.left;
		else {
			cur = cur.right;
		}

	}
	return cur;

}

public void balancingRoot() {

	if (balancedFactor(root) == 2) {
		root = leftRotation(root);

	} else if (balancedFactor(root) == -2)

		root = rightRotation(root);

}

public AVLNode findPrevious(AVLNode node) {
	AVLNode prv = null, cur = root;
	while (cur != null) {

		int cmp = ((Comparable) node.key).compareTo(cur.key);
		if (cmp == 0) {
			return prv;

		}
		prv = cur;
		if (cmp < 0)
			cur = cur.left;
		else
			cur = cur.right;
	}
	return null;

}

public void balancing() {
	AVLNode temp = null;

	while (isAVl() == false) {
		
		temp = findUnbalancedNode();
		if( temp == null)
			return;
		System.out.println(temp.key);

		if (temp == root) {
			
			balancingRoot();
			
		}
		

		if (balancedFactor(temp) == 2) {
			
			if (temp.left == null) {
				temp = leftRotation(temp);
			}

			else {
				temp = rightLeftRotation(temp);
			}

		} else if (balancedFactor(temp) == -2) {
			

			if (temp.right == null) {

				temp = rightRotation(temp);

			} else {
				temp = leftRightRotation(temp);
			}
			
		}
		

	}

}

}

public class Rotation { public static void main(String[] args) throws Exception { AVLTree<Integer> tree = new AVLTree<Integer>(); tree.add(15); tree.add(13); tree.add(10); tree.add(9); tree.add(8); tree.setHeight(); tree.balancing();

	//System.out.println(tree.isAVl());

}

}


r/programing • • Dec 15 '15

This Arabic Programming Language Shows How Computers Revolve Around the Western World

Thumbnail
mic.com
1 Upvotes

r/programing • • Dec 15 '15

This Arabic Programming Language Shows How Computers Revolve Around the Western World

Thumbnail
mic.com
1 Upvotes

r/programing • • Dec 14 '15

Need a free opt in text service

1 Upvotes

We have a small business and would like to set up opt in short codes to deliver text messages. Is there any way to host Server, or does anyone know of a free service? Or maybe point me in the right direction?


r/programing • • Dec 05 '15

P2P Proxies Network | Proxies Network for Developers

Thumbnail
rev.proxies.online
1 Upvotes

r/programing • • Dec 02 '15

Java Programing Quesntion

1 Upvotes

I am currently using a mac to do some java programing. Currently I am using an online software, but the problem is that I am not always online. What is a good program that I can download so that I can code in java on my mac when offline?


r/programing • • Nov 29 '15

Base64 Decoding Question

1 Upvotes

Could someone explain how one would go about decoding and extracting the message encrypted in this base64 encoded image.

http://www.miza.org/base64.txt


r/programing • • Nov 27 '15

Charisma Cast Episode 4 - Computer Programming

Thumbnail
youtube.com
1 Upvotes

r/programing • • Nov 04 '15

How do i make a mp3 file that will open another random mp3?

1 Upvotes

alright to set the stage i use this program while i stream > http://sourceforge.net/projects/expsoundboard/ <. i play a moba, and when i used 'r' to use a specific ability it would play the chorus to action music like 'Figure 8 by Ellie Goulding'.

After consideration and opinions from frequent viewers it was getting annoying to hear the same song every time through out a game(i would cycle out a new song every game the best i was able). well i have a good 10 audio snips to use and was wondering if anyone knew of a way to make a file that this program could read that would play one of these snips at random each time i used my 'r' ability.

I'm not very familiar with any sorts of programming except arduino which i don't think would be useful in this situation. any constructive assistance could help a lot, and thanks a lot in advance.


r/programing • • Oct 31 '15

[Help] Looking for a text combiner (similar to excel's concatenate)

1 Upvotes

I have been working in excel to take commands for minecraft and turn them all into one command. I do a lot of concatenating and some small calculations. I was wondering if there was a program/programming language that is capable of doing this.


r/programing • • Oct 09 '15

I'm looking for a language or a framework for real-time sound modulation.

1 Upvotes

Hello, Here's what I want to do - I have a RPi 2 and I want to turn it into guitar pedal with N number of custom switchable effects. Since this is supposed to be my project for graduating it must be possible to be done until end of January. I'm open for any suggestions and questions.


r/programing • • Sep 27 '15

Where do I start?

1 Upvotes

You guys probably get a lot of these but indulge me for a minute. I want to learn programming but have no idea where to start. I have basic computer knowledge but actual coding still seems like magic to me. Any advice for where I can start or just tips for someone who wants to get into it?


r/programing • • Sep 04 '15

What is the opposite of screen-scraping?

1 Upvotes

I'm familiar with the idea of screen-scraping - getting data from websites where there's no nice feed to use.

Is there a name for the opposite i.e. when your program simulates a human inputting data to a site?


r/programing • • Aug 22 '15

Help with web.py

1 Upvotes

I am trying to get the todo list example (http://webpy.org/src/todo-list/0.3) running but I keep getting this error.

<class '_mysql_exceptions.OperationalError'> at / (1045, "Access denied for user 'justin'@'localhost' (using password: NO)")

I have gone to google and tried typing some commands into mysql but I have been unsecsessful.


r/programing • • Aug 20 '15

C++ question about headers and multi file projects.

1 Upvotes

I have been learning C++ from here and I'm a little confused about the difference between using:

#include "header.h"

and having two separate .cpp files linked in the compiler.

what is the practical difference between the two methods and when should each one be preferred?


r/programing • • Aug 19 '15

File converter from .docx to pdf

1 Upvotes

Hi, I am trying to convert files from .docx to .pdf but I have issues with the encoding that is provided by the .doc file and by the format that is not fully preserved when I turn it to a .pdf file.

I am using the PHPOffice library so far and I want to know if there are other/better solutions for this. other languages different form php welcome Good day