Jump to content

mikebald

Member
  • Posts

    42
  • Joined

  • Last visited

Awards

About mikebald

  • Birthday Apr 17, 1984

Profile Information

  • Gender
    Male
  • Occupation
    Software Developer
  1. Thanks! You're 100% correct and I agree; I wish I would have been faced with a takedown notice instead of them requiring a payment, but I understand their side as well. I'm going to be using it as the learning experience it is and make all my own images from now on. On an unrelated note, on the WAN show I hear you referenced a lot for your different posts; so thanks for that!
  2. I guess I should have linked http://www.gettyimages.com/ ... ?
  3. I was watching the WAN show this week and linus mentioned that SquareSpace uses Getty Images for providing images for their site. So I wanted to get some people's opinions in working with Getty Images. I'll add in my experience with Getty Images. They sent me a copyright letter where they claim, without any proof, that they own an image I've been using on my site. A nephew of the former owner of the site was hired to do some graphics work and that's how I ended up with the image. Upon being notified I immediatly took down the image as I don't want to violate anyone's copyright, but now they're demanding monitary repirations that I can't give the details of because "The terms of this settlement offer shall be kept confidential". Long story short, my experience with Getty Images is that they're using legal extortion tactics to push around small companies. What has your experience been with them? Some additional links that I've found useful: http://artlawjournal.com/getty-images-sued-deceptive-practices/ http://www.isba.org/ibj/2014/11/lawpulse/yourclientgotgettyimagesdemandlette
  4. I'm going to try and reword this to see if I understand what you're looking for. You want a script that takes 5 arguments and generates a string of length 9 for every permutation of the input arguments. Additionally, the output string must always contains at least 1 copy of the 5th argument. Example Input: A,B,C,D,Q Example Output: AAAAAAAAQ AAAAAAABQ ... DDDDDDDDQ ... QQQQQQQQQ Is this what you're asking for?
  5. My initial thought is that those people are running the game at an obscure aspect ratio and that makes the game render the numbers different. An example of this is 1920x1080 vs 1920x1200 where it's 16:9 vs 16:10; you should be able to find if that's the case by looking at the dimensions of the screenshots. Edit: I like the t-shirt in your avatar.
  6. Why did you copy and paste http://plv.csail.mit.edu/ur/ / http://www.impredicative.com/ur/?
  7. You mentioned wanting to learn a programming language and I think that's wonderful! Before getting into programming have you considered looking at a book like Code: The Hidden Language of Computer Hardware and Software? It covers topis from logic-gates to high-level programming languages and I think it's an excellent read.
  8. Going to preface by saying that it's more than 100 lines :-). I implemented the Smith-Waterman algorithnm used for local sequence alignment of DNA strings to score the difference between given DNA strings and find the best match. The program takes a DNA sequence and a file of sequences to compare to the given sequence. import java.io.*;import java.lang.Math;class Alignment{ public static final int GAP_SCORE = -3; public static int[][] similar = null; public static int[][] align = null; public static int slen_1, slen_2; public static int bestVal, best_x, best_y; public static int f_score; public static String f1, f2; public static void makeSimilarityMatrix() { similar = new int[ 4 ][ 4 ]; similar[ 0 ][ 0 ] = 10 ; similar[ 1 ][ 0 ] = -1 ; similar[ 2 ][ 0 ] = -3 ; similar[ 3 ][ 0 ] = -4 ; similar[ 0 ][ 1 ] = -1 ; similar[ 1 ][ 1 ] = 7 ; similar[ 2 ][ 1 ] = -5 ; similar[ 3 ][ 1 ] = -3 ; similar[ 0 ][ 2 ] = -3 ; similar[ 1 ][ 2 ] = -5 ; similar[ 2 ][ 2 ] = 9 ; similar[ 3 ][ 2 ] = 0 ; similar[ 0 ][ 3 ] = -4 ; similar[ 1 ][ 3 ] = -3 ; similar[ 2 ][ 3 ] = 0 ; similar[ 3 ][ 3 ] = 8 ; } public static void printMatrix( int[][] matrix, String seq1, String seq2, int max_x, int max_y, boolean align ) { if(align) { for(int x = 0; x < slen_1; x++) System.out.print( "\t" + seq1.charAt(x) ); System.out.println(" "); } for(int y = (align ? 1 : 0); y < max_y; y++) { System.out.print( seq2.charAt(y - (align ? 1 : 0) ) + "\t"); for(int x = (align ? 1 : 0); x < max_x; x++) { System.out.print( matrix[x][y] + "\t" ); } System.out.println(""); } } public static void calculateMatrix( String seq1, String seq2 ) { int choices[] = new int[3]; align = new int[ slen_1 + 1 ][ slen_2 + 1 ]; for(int x = 0; x < slen_1; x++) align[x][0] = GAP_SCORE * x; for(int y = 0; y < slen_2; y++) align[0][y] = GAP_SCORE * y; for(int x = 1; x <= slen_1; x++) for(int y = 1; y <= slen_2; y++) { choices[0] = align[ x - 1 ][ y - 1 ] + similar[ getVal( seq1, x-1) ][ getVal( seq2, y-1) ]; choices[1] = align[x - 1][y] + GAP_SCORE; choices[2] = align[x][y - 1] + GAP_SCORE; align[x][y] = getMax( choices ); if ( align[x][y] > bestVal ) { bestVal = align[x][y]; // Don't forget the GAP_SCORE padding best_x = x; best_y = y; } } } public static int getMax( int[] in ) // Get max or return 0; { return Math.max( Math.max( in[0], in[1]), Math.max( in[2], 0 ) ); } public static int getVal(String seq, int index) { switch (seq.charAt(index)) { case 'A': return 0; case 'G': return 1; case 'C': return 2; case 'T': return 3; } return -1; } public static void showPath(String s1, String s2, boolean recordBest) { String new_s1 = "", new_s2 = ""; int i = slen_1, j = slen_2; int score = 0, score_diag = 0, score_up = 0, score_left = 0; while( i > 0 && j > 0 ) { score = align[i][j]; score_diag = align[i - 1][j - 1]; score_up = align[i][j - 1]; score_left = align[i - 1][j]; if(score == 0) // Dead End break; if( score == score_diag + similar[ getVal( s1, i-1) ][ getVal( s2, j-1) ] ) // Going Diag { new_s1 = s1.charAt(i-1) + new_s1; new_s2 = s2.charAt(j-1) + new_s2; i--; j--; } else if( score == score_left + GAP_SCORE ) // Going Left { new_s1 = s1.charAt(i-1) + new_s1; new_s2 = "-" + new_s2; i--; } else if( score == score_up + GAP_SCORE ) // Going Up { new_s1 = "-" + new_s1; new_s2 = s2.charAt(j-1) + new_s2; j--; } } if(recordBest) { f1 = new_s1; f2 = new_s2; } System.out.println( new_s1 ); System.out.println( new_s2 ); } public static void main(String[] args) throws IOException { f1 = ""; f2 = ""; f_score = 0; if( args.length < 2 ) { System.out.println( "Usage: java Alignment <sequence> <filename>" ); return; } BufferedReader linereader; try { linereader = new BufferedReader(new FileReader(args[1])); } catch(FileNotFoundException e) { System.out.println("Error, file [" + args[1] + "] was not found!"); return; } String seq1 = ""; String seq2 = args[0]; // Input sequence slen_2 = seq2.length(); // Fill and Print Similarity Matrix makeSimilarityMatrix ( ); System.out.println("\nSimilarity Matrix : "); printMatrix( similar, " ", " ", 4, 4, false); while( (seq1 = linereader.readLine()) != null) { // Initialize Values slen_1 = seq1.length(); bestVal = 0; best_x = 0; best_y = 0; // Fill and print Alignment Matrix System.out.println("\nAlignment Matrix : "); calculateMatrix( seq1, seq2 ); printMatrix( align, seq1, seq2, slen_1 + 1, slen_2 + 1 , true); // Record Best Score if( bestVal > f_score ) { f_score = bestVal; System.out.println("\nScore: " + bestVal + " [" + best_x +"][" + best_y + "]\n"); showPath( seq1, seq2, true); } else { System.out.println("\nScore: " + bestVal + " [" + best_x +"][" + best_y + "]\n"); showPath( seq1, seq2, false); } } System.out.println("====================================="); System.out.println("Best Score: " + f_score); System.out.println(" " + f1 + "\n " + f2); }}
  9. It looks like you're looking into creating apps for hangout, not hooking into hangout from your site like you want to. I'd be surprised if google would allow you to post data outside their Hangouts sandbox [i'm assuming here] to a site of your choosing, so it seems like what you're proposing is impossible. It's possible that I missed something, but just the Getting Started documentation seems to spell out the usage of the Hangouts API.
  10. Wow, MM_ functions... haven't seen those in many years.
  11. If you're talking about making an always-on device you guys might want to look into a technique that I had the pleasure of working with in 2009. I haven't kept an eye on the research, but I imagine someone has improved it by this time. The particular algorithm I worked with was called Wake-Up-Word; the idea being to pick up on the particular word when it's in the correct context. For example, if your word is "Jarvis" you don't want to be talking in your house to a friend and say, "Yeah jarvis works very well, you should try it out!" and have the computer trying and figure out what you mean when you say "works bery well, you should try it out!". You would only want the system to pick up when you're addressing it directly instead of speaking about it. Here's the paper on Wake-Up-Word speech recognition: http://my.fit.edu/~vkepuska/share/MyPapers/WUWPaper.pdf and it looks like it's been added to Sphinx as well. A note, I won't be able to assist on the particulars of the algorithm as I only assisted in converting some C into ASM to make it run faster and I never really looked at the underlying theory behind it.
  12. If you're good at java, I wrote pretty much the same thing a while ago. This one I'm posting accepts input from the console. If you provide L <equation> it will go from left to right, if you just provide the <equation> it will start with the correct order of operations: import java.util.StringTokenizer;import java.text.DecimalFormat;class calc { public static void main(String[] args) { String tmp = new String(), problem = new String(); if(args[0].charAt(1) == 'L') { checkinput(args[1]); problem = args[1]; tmp = leftright(args[1]); } else { checkinput(args[0]); tmp = args[0]; problem = args[0]; tmp = eval(tmp,"*/"); tmp = eval(tmp,"+-"); } DecimalFormat df = new DecimalFormat("0"); tmp = df.format(Double.parseDouble(tmp)); System.out.println(problem + " = " + tmp); } public static String eval(String tmp, String cha) { StringTokenizer st = new StringTokenizer(tmp,cha,true); if(st.countTokens() > 1) { String firsttoken = st.nextToken(); String adden = st.nextToken(); String secondtoken = st.nextToken(); String first = getPart(firsttoken , 1); String second = getPart(secondtoken , 2); double total = evaluate(first,second,adden); tmp = tmp.substring(0, firsttoken.length() - first.length()) + total + tmp.substring(firsttoken.length() + 1 + second.length()); if(st.hasMoreTokens()) { tmp = eval(tmp,cha); } else { return tmp; } } return tmp; } public static double evaluate(String first, String second, String cha) { switch(cha.charAt(0)) { case '*' : return Double.parseDouble(first) * Double.parseDouble(second); case '/' : return Double.parseDouble(first) / Double.parseDouble(second); case '+' : return Double.parseDouble(first) + Double.parseDouble(second); case '-' : return Double.parseDouble(first) - Double.parseDouble(second); } return 0; } public static String getPart(String value, int part) { switch(part) { case 1: StringBuffer sb = new StringBuffer(value); sb.reverse(); StringTokenizer st = new StringTokenizer(sb.toString(),"*/+-"); sb = new StringBuffer(st.nextToken()); sb.reverse(); return sb.toString(); case 2: StringTokenizer st1 = new StringTokenizer(value,"*/+-"); return st1.nextToken(); } return ""; } public static String leftright(String args) { StringTokenizer st = new StringTokenizer(args,"*+-/",true); if(st.countTokens() <= 2) { return st.nextToken(); } else { String first = st.nextToken(); String adden = st.nextToken(); String second = st.nextToken(); return leftright(evaluate(first,second,adden) + args.substring(first.length() + second.length() + 1)); } } public static void checkinput(String arg) { StringTokenizer st1 = new StringTokenizer(arg,"0123456789"); String tmp = new String(); while(st1.hasMoreTokens()) { tmp = st1.nextToken(); if(tmp.length() > 1) { System.out.println("Syntax Error!"); System.exit(1); } } }}
  13. You could add an easter egg where it shows a little 2d car that someone can drive around your application by pressing the different arrow buttons.
  14. If this is a linux based machine you can use the class made by dell_petter at hotmail dot com found at http://php.net/manual/en/function.exec.php: <?php // You may use status(), start(), and stop(). notice that start() method gets called automatically one time. $process = new Process('ls -al'); // or if you got the pid, however here only the status() metod will work. $process = new Process(); $process.setPid(my_pid); // Then you can start/stop/ check status of the job. $process.stop(); $process.start(); if ($process.status()){ echo "The process is currently running"; }else{ echo "The process is not running."; }?><?php/* An easy way to keep in track of external processes.* Ever wanted to execute a process in php, but you still wanted to have somewhat controll of the process ? Well.. This is a way of doing it.* @compability: Linux only. (Windows does not work).* @author: Peec*/class Process{ private $pid; private $command; public function __construct($cl=false){ if ($cl != false){ $this->command = $cl; $this->runCom(); } } private function runCom(){ $command = 'nohup '.$this->command.' > /dev/null 2>&1 & echo $!'; exec($command ,$op); $this->pid = (int)$op[0]; } public function setPid($pid){ $this->pid = $pid; } public function getPid(){ return $this->pid; } public function status(){ $command = 'ps -p '.$this->pid; exec($command,$op); if (!isset($op[1]))return false; else return true; } public function start(){ if ($this->command != '')$this->runCom(); else return true; } public function stop(){ $command = 'kill '.$this->pid; exec($command); if ($this->status() == false)return true; else return false; }}?> If you're not on linux, I would look into proc_open.
  15. I am confused by your question, you mention "MySQL" and "Server Management Studio 2008" and those are 2 distinct things. MySQL and MSSQL are 2 different RDBMSs and it doesn't appear as if Microsoft Server Management Studio works with MySQL. If you're wrong about the MySQL part then ZEJ's answer is probably going to be the easiest method. If you're confused about the Server Management Studio 2008 then the other answers provided will be your best bet.
×