Tuesday, May 8, 2012

Open prezi from app

I'm trying to open a prezi.com presentation from my app.



NSURL *url = [ [ NSURL alloc ] initWithString: @"prezi://open?oid=ftv9hvziwqi2" ];
[[UIApplication sharedApplication] openURL:url];


This piece of code opens the app, but not the presentation. When you visit this link on your ipad you get a page with a link the open the presentation.



http://prezi.com/ftv9hvziwqi2/coca-cola-companya/



But I can figure out the correct URL for opening a presentation in the prezi app. And i cant find any documentation from this either on the prezi site.





Classic form to XPAGES

I have a classic lotus notes form with 1800 fields and 7 tab,




  1. Will the performance improvement if i split the form in 7 different form and then bind to the xpages
    or

  2. if i directly bind the form to the xpages will there be any performance impact?



thanks





How does the man in the middle attack work in Diffie–Hellman?

I'm doubt about the mechanism of man in the middle attack in Diffie–Hellman key exchange. I have heard that it can be happened in the key agreement communication. But in the presence of CA (Certificate Authority) the receiver can authenticate the sender as he received the public key of the sender whoever he is. Therefore, how that man in the middle attack is possible????





Slot-machine-style logotype stripe

I am looking for a component to display affiliates' logotypes, preferably jQuery, then Flash, in a page-wide stripe (say: 800x100px). One that is fully automated, does not engage user operation and displays images much like a slot machine (one-armed bandit).



Can anybody recommend one, please?



(Or maybe I'm missing a jargon call for it and my searches are in vain...)





Set PHP configuration settings in application.ini

I forget how I can set PHP configuration settings from the application.ini of Zend Framework.



I want to set max_execution_time variable.



Help me please.





how to authenticate desktop application using java and restfb api

I am using restfb api and Java language. But my main concern is that how i authenticate my user, i mean how to take them to the login window and take the access token from the browser window.





Wednesday, May 2, 2012

Editing .txt file Java

I need to to write a Java program that will write entered information in the console to a .txt file. If the .txt file already exists it will have to open it and write the additional information on another line. If the .txt file doesn't exist for a new "Lifter" it will create the .txt and write it in. Basically I don't know how to create a new .txt for each name entered and how to edit it if the person's .txt already exists. How would I go about doing that?



import java.io.IOException;
import java.io.PrintWriter;
import java.util.Random;
import java.util.Scanner;

public class MeetPrinter {

public static void getInfo() {

Scanner scanner = new Scanner(System.in);
int question;
String firstName;
String lastName;
int squat;
int bench;
int lift;
String meetName;
do {

System.out.println("Enter first name: ");
firstName = scanner.next();

System.out.println("Enter Last Name: ");
lastName = scanner.next();

System.out.println("Enter new Meet Name: ");
meetName = scanner.next();

System.out.println("Enter max squat weight in kg: ");
squat = scanner.nextInt();

System.out.println("Enter max bench press in kg: ");
bench = scanner.nextInt();

System.out.println("Enter max deadlift in kg: ");
lift = scanner.nextInt();

System.out
.println("Enter '1' to enter more lifters or '2' if you are done entering.");
question = scanner.nextInt();
} while (question == 1);

try{
PrintWriter out = new PrintWriter("output.txt");
Random randomGenerator = new Random();
int randomInt = randomGenerator.nextInt(100000);
out.println(lastName + ", " + firstName + " Record #: " + randomInt);
out.println("");
String meet = "Meet Name";
String sq = "SQ Max";
String bp = "BP Max";
String sub = "SUB Total";
String dl = "DL Max";
String tot = "Total";
out.printf("%20s %15s %18s %19s %18s %18s",meet ,sq,bp,sub,dl,tot);
out.println("");
out.printf("%20s", meetName);
out.printf("%10d (%6.2f)", squat, squat * 2.2);
out.printf("%10d (%6.2f)", bench, bench * 2.2);
float subPounds = (float) ((float)(squat + bench) * 2.2);
out.printf("%10d (%6.2f)", squat + bench, subPounds);
out.printf("%10d (%6.2f)", lift, lift * 2.2);
float tPounds = (float) ((float)(squat + bench + lift) * 2.2);
out.printf("%10d (%6.2f)", squat + bench + lift, tPounds);
out.close();
}catch(IOException e){
e.printStackTrace();
}
}

}