Monday, 19 August 2013

Is NS_AVAILABLE_IOS undocumented API?

Is NS_AVAILABLE_IOS undocumented API?

I want to use it as part of my XCode documentation so it detects and adds
this as part of the document, but I'm not sure if Apple considers this
undocumented.

Preset the values of a form with data form a BD

Preset the values of a form with data form a BD

I have a form in a web (build with html). Let's say that I have some
values for the form that can change, so I store them in a database. What I
want to do is that everytime that an user goes to the page where the form
is, the data from the database has to be read and the form has to be
filled with that information (For example, I have a field for an e-mail,
so I want to fill it with the e-mail I have in the database).
I've been looking for a way to do this, but I have not found any that I
really "like". The only way I can do it is by doing an AJAX request on
javascript to a PHP script, where I connect to the DB and get the data.
Once I get it, I modify the whole form via Javascript, but I'm not really
sure if it is safe enough.
Any ideas of how to do it in a different way or how to do it safely enough?
Thank you very much.

When I send SMS with my code it just send to myself

When I send SMS with my code it just send to myself

I connected a Galaxy S3 to my computer, then executed this code, it worked
,it sent the sms, but with a problem... it just send to myself and only
with the default message ("Hello from SMSLIB" ), even if I change the
number and the message, I don't know why this is happening... I need help
:/
package examples.modem;
import org.smslib.AGateway;
import org.smslib.IOutboundMessageNotification;
import org.smslib.Library;
import org.smslib.OutboundMessage;
import org.smslib.Service;
import org.smslib.modem.SerialModemGateway;
import org.smslib.helper.SerialPort;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.Formatter;
import org.smslib.helper.CommPortIdentifier;
public class SendMessage
{
public void doIt() throws Exception
{
OutboundNotification outboundNotification = new OutboundNotification();
System.out.println("Example: Send message from a serial gsm modem.");
System.out.println(Library.getLibraryDescription());
System.out.println("Version: " + Library.getLibraryVersion());
SerialModemGateway gateway = new SerialModemGateway("modem.com5",
"COM5", 57600, "Huawei", "E226");
gateway.setInbound(true);
gateway.setOutbound(true);
gateway.setSimPin("1010");
// Explicit SMSC address set is required for some modems.
// Below is for VODAFONE GREECE - be sure to set your own!
gateway.setSmscNumber("+555181136200");
Service.getInstance().setOutboundMessageNotification(outboundNotification);
Service.getInstance().addGateway(gateway);
Service.getInstance().startService();
System.out.println();
System.out.println("Modem Information:");
System.out.println(" Manufacturer: " + gateway.getManufacturer());
System.out.println(" Model: " + gateway.getModel());
System.out.println(" Serial No: " + gateway.getSerialNo());
System.out.println(" SIM IMSI: " + gateway.getImsi());
System.out.println(" Signal Level: " + gateway.getSignalLevel() + "
dBm");
System.out.println(" Battery Level: " + gateway.getBatteryLevel() +
"%");
System.out.println();
// Send a message synchronously.
OutboundMessage msg = new OutboundMessage("+554188262880", "Mensagem
enviada com sucesso!");
Service.getInstance().sendMessage(msg);
System.out.println(msg);
// Or, send out a WAP SI message.
//OutboundWapSIMessage wapMsg = new
OutboundWapSIMessage("306974000000", new
URL("http://www.smslib.org/"), "Visit SMSLib now!");
//Service.getInstance().sendMessage(wapMsg);
//System.out.println(wapMsg);
// You can also queue some asynchronous messages to see how the callbacks
// are called...
//msg = new OutboundMessage("309999999999", "Wrong number!");
//srv.queueMessage(msg, gateway.getGatewayId());
//msg = new OutboundMessage("308888888888", "Wrong number!");
//srv.queueMessage(msg, gateway.getGatewayId());
System.out.println("Now Sleeping - Hit <enter> to terminate.");
System.in.read();
Service.getInstance().stopService();
}
public class OutboundNotification implements IOutboundMessageNotification
{
public void process(AGateway gateway, OutboundMessage msg)
{
System.out.println("Outbound handler called from Gateway: " +
gateway.getGatewayId());
System.out.println(msg);
}
}
public static void main(String args[])
{
SendMessage app = new SendMessage();
try
{
app.doIt();
}
catch (Exception e)
{
e.printStackTrace();
}
}
}

Sunday, 18 August 2013

WWE SUMMERSLAM 18 AUGUST 2013 FULL REPLAY WATCH Online

WWE SUMMERSLAM 18 AUGUST 2013 FULL REPLAY WATCH Online

Watch WWE SummerSlam 2013 – August 18 2013 – 8/18/2013 HDTV Watch
Online/Download
Watch WWE SummerSlam 2013 - August 18 2013 - 8/18/2013 Live Streaming Cast
Online
LIVE STREAMING Ch 1-7 Sunday August 18 CLick Here Replay Links : Watch on
Dailymotion Live Rec HQ Click
http://alturl.com/fndce
http://alturl.com/fndce
The crowd will also follow the fortunes of Ring of Fire extravaganza
between Kane and Bray Wyatt. Wyatt relishes the tag of underdog and can
spill a few beans. Alberto del Rio will spread his weight on Christian at
the World Heavyweight clash. AN enticing doubles match is also scheduled
between Ziggler/Kaitlyn and Langston/Lee. In between, Cody Rhodes will
brush his corn on Damien Sandow. All in all, a night to remember and there
has obviously been too much following going on. Fans can pick their own
players and root for them on this pay-per-view ecstasy. It would be
premature to take a call on Cena and Bryan as the latter is quite
indefatigable.
Watch WWE SummerSlam 2013 Livestream Free Online – August 18 2013 is
placed below. While the entire week is filled with Superstar appearances
and various events leading up to the show, SummerSlam itself begins on
Sunday, Aug. 18 at 8ET/3PT. The pay-per-view will run U.S. fans $44.95. If
it's any consolation, Paul Heyman recently told Xfinity, "I humbly suggest
that Brock Lesnar vs. CM Punk is worth the price of admission alone." A
far cry from the days of closed-captioned TV, fans can watch the event in
a myriad of different ways. WWE.com lists all the cable services that fans
can order the pay-per-view from. SummerSlam is available on just about
every cable company in the United States from AT&T to Xfinity. Other
options include streaming it on WWE.com or on one's smart device via
iTunes, Google Play, Amazon.com and the Windows Store. Watch SummerSlam on
SMART TVs, XBox 360 or check out the list of blast areas in your town that
are showing the pay-per-view. WWE.com's "how to watch" section lists
places like Buffalo Wild Wings where fans can congregate and stuff their
face while the in-ring drama plays out.
Tonight the WWE will air its last edition of Monday Night Raw at the Sleep
Train Arena in Sacramento, Calif., before its second biggest pay-per-view
of the year, Summer Slam, which will air this upcoming Sunday.
After once again being ambushed by his SS opponent, Brock Lesnar, CM Punk
is scheduled to take on his former friend/manager Paul Heyman. While many
would undoubtedly like to see the self-proclaimed "Best In The World" get
his hands on Heyman, it will likely result in interference by one of his
current clients, Lesnar or Curtis Axel.
The WWE championship match between John Cena and challenger Daniel Bryan
at SS should take center stage tonight as well. Both Cena and Bryan are
clearly vulnerable by way of circumstance to both the chairman of the
board Vince McMahon and Raw's MITB briefcase holder Randy Orton. The
question on everyone's minds is whether Vinny Mac will cost Bryan the belt
or "The Viper" will decide to cash in.
With some other notable midcard matches on the card for this Sunday, the
respective storylines should be at their peak for the WWE Universe when
the flagship show airs later.

Initializing from irb succeeds, initializing from script fails

Initializing from irb succeeds, initializing from script fails

I'm trying to initialize a MongoClient from a script but I am failing.
What I simply do is:
require 'mongo'
include Mongo
client = MongoClient.new("localhost", 27017)
and it fails with the following error:
/var/lib/gems/1.9.1/gems/mongo-1.9.1/lib/mongo/cursor.rb:43:in
`initialize': undefined method `connection' for nil:NilClass
(NoMethodError)
from /var/lib/gems/1.9.1/gems/mongo-1.9.1/lib/mongo/db.rb:564:in `new'
from /var/lib/gems/1.9.1/gems/mongo-1.9.1/lib/mongo/db.rb:564:in
`command'
from
/var/lib/gems/1.9.1/gems/mongo-1.9.1/lib/mongo/mongo_client.rb:591:in
`block in check_is_master'
from /usr/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
from
/var/lib/gems/1.9.1/gems/mongo-1.9.1/lib/mongo/mongo_client.rb:590:in
`check_is_master'
from
/var/lib/gems/1.9.1/gems/mongo-1.9.1/lib/mongo/mongo_client.rb:474:in
`connect'
from
/var/lib/gems/1.9.1/gems/mongo-1.9.1/lib/mongo/mongo_client.rb:698:in
`setup'
from
/var/lib/gems/1.9.1/gems/mongo-1.9.1/lib/mongo/mongo_client.rb:155:in
`initialize'
from ./test.rb:52:in `new'
from ./test.rb:52:in `<main>'
But, when I try the exact same thing from irb, it works.
Ruby version is:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
irb is:
/usr/bin/irb1.9.1 --version irb 0.9.6(09/06/30)
I also tried requiring 'rubygems', but from what i know, Ruby 1.9 doesn't
need it. Am I forgetting something?

Unrecognized Selector when I click on CCMenuItemImage

Unrecognized Selector when I click on CCMenuItemImage

I'm trying to load a start menu for a game, and I've added a play button
using a CCMenuItemImage. Everything loads just fine. However, when I try
to click on the play button, I get this error message.
013-08-18 13:38:46.091 PeevedPenguins-iOS[5169:c07] * Terminating app due
to uncaught exception 'NSInvalidArgumentException', reason:
'-[StartMenuLayer ]: unrecognized selector sent to instance 0x9e5b400'
I don't know what I'm doing wrong since my selector is defined and all.
Please help me out? I've been pulling my hair out trying to figure out why
Xcode would do this
@interface StartMenuLayer ()
@end
@implementation StartMenuLayer
-(id) init
{
if ((self = [super init]))
{
CCMenu *myMenu = [CCMenu menuWithItems: nil];
CCMenuItemImage *menuBackground = [CCMenuItemImage
itemWithNormalImage:@"menu-background-hd.png"
selectedImage:@"menu-background-hd.png" target:self selector:nil];
[myMenu addChild:menuBackground];
CCMenuItemImage *menuPlayButton = [CCMenuItemImage
itemWithNormalImage:@"button-hd.png"
selectedImage:@"button-hd.png" target:self
selector:@selector(playGame:)];
menuPlayButton.position = ccp(0, 0);
[myMenu addChild:menuPlayButton];
CCMenuItemImage * menuItem3 = [CCMenuItemImage
itemWithNormalImage:@"catapult-hd.png"
selectedImage:
@"catapult-hd.png"
target:self
selector:@selector(doSomethingThree:)];
[myMenu addChild: menuItem3];
menuPlayButton.position = ccp(0,-83.5);
[self addChild:myMenu];
}
return self;
}
-(void) playGame:(CCMenuItem *)sender
{
// [[CCDirector sharedDirector] replaceScene: (CCScene*)[[GameLayer
alloc] init]];
NSLog(@"Play the game!");
}
- (void) doSomethingThree:(CCMenuItem *)sender
{
NSLog(@"The third menu was called");
}
@end

Serializing object to database

Serializing object to database

I know we can wrap FileOutputstream in ObjectoutputStream, FileInputStream
in ObjectInputStream and use ObjectOutputstream.writeObject and
ObjectInputstream.readobject() methods to serialize Java objects to a
file.
If instead of a file I want to serialize the object to a database then all
I would need to do is call setObject() method of PreparedStatement to
write the object and getObject() of ResultSet to retrieve the object.
If the class for the object we are attempting to serialize has not
implemented the Serializable interface then in case of serializing the
object to file we will get a NotSerializableException
However in case of serializing the object to DB since we are not at all
using writeObject but just using PreparedStatement setObject method,so the
JVM will throw any exception if class is not Serializable.
So does this mean that while serializing object to database it is not
necessary to implement Serializable interface?