Getting WAN Address Java - java

I have been using the automation feature of whatismyip.com to provide a WAN to my program. However, I recently was banned for overuse (I didn't realizing I was accessing the site every time I started the program to test it). That was my mistake... it wasn't intentional. I've contacted them about it, but in the mean time I need another method.
Are there any other ways to do it and/or does anyone know of another site that provides an automation function?

http://whatismyipaddress.com, but they may well share the same ban list. Both sites have obvious notes embedded in their page source about scripting against their service. I suggest you follow the directions and contact them before you screen scrape them.

I know that http://speedtest.net/ shows your IP, but I am not sure if that is what you need.

Related

Captcha creation without a third party

Newbie over here. I'm designing and coding a few websites using Adobe Dreamweaver. I'm about 3 months in to web development at my current job at this point. I haven't had any formal training in web development, but I have an eye for design and attention to detail.
However, more technical things are difficult for me as I'm just getting started. I want to create a self contained Captcha within two websites without using a third party service or any downloadable plugins. This is important, because I am creating the website for the company I work for full time as part of my job description.
How would I go about making a simple contact form and captcha using PHP & Java for example? I'm only slightly familiar with PHP and Java.
If someone could just explain this to me in an idiot-proof way I'd really appreciate it. I've been browsing Stack Overflow, but I can't seem to find anything specific and I'd prefer a fresh answer.
Thanks all. I'm also not familiar with most of the jargon yet, so forgive me for my lack of knowledge presently.
If this is an incredibly stupid question also, I apologize - but I still really need an answer.
Using PHP:
start a session
create a random string
store the string into a session variable
create an image to display using php imagecreate
use imagettftext to position the characters one at a time at random angle
Verify user input against the stored session variable

Create a user in IronMQ via API

I'm trying to set up a message queue service for an application I am developing.
I already tried AWS SQS, but it doesn't really fit for our needs, mainly for the issues with the FIFO and the limited message persistence.
So I turned to IronMQ, to see how this could work, but I'm already having issues with the creation of users via java APIs.
There's no class dedicated and it seems nobody cares about that. Does anybody know anything about how to do that? Do I have to write my own APIs?
EDIT: as manveru pointed out, I'm talking about tokens, not users.
Another issue is about setting other permissions than "Admin", but I guess I'll confront it later.
Right now, our API doesn't support creating new access tokens. I think it's something that could be really powerful, though (generate a token per server as part of the build process, for example).
I've created an issue in our global issue tracker. If you like, you can follow that to get a notification when something on this front changes. We have a lot of stuff we're working on right now, so I can't even guess at a timeline, unfortunately. :(
Hope that helps!

Cannot locate Quartz Window Services

I need to find the coordinates of windows open even when they are not launched by my application, and after some searching I came across quartz window services. However, the reference document I linked to does not mention where this is located, and it was the only document I could find about it. I have looked through other frameworks reference documents, but none of them so much as mention it.
The problem obviously arrises solely out of my own ignorance, and I did not really want to ask. But, I have searched all over the internet, and have been able to find absolutely no reference to the location of quartz windows service.
Where is it? Is it part of a framework, and if so what class is it in? All I know is what functions it contains, and that they look like exactly what I need!
Thank you in advance for any help. Also, if you know how I could figure this out for myself in the future, I would appreciate that as well.
Note: I don't know if it matters, but I am planning to use JNA to call it from Java as opposed to using it from C.
Yeah, that's a little less than obvious. By searching for "Quartz Window Services" I was able to find the link to the overview, such as it is: https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CGWindow_Reference/Reference/Introduction.html
That shows that it's in the ApplicationServices framework.
Well first off, I'm not 100% certain how you're going to access C methods from Java (I've never done it myself), but if it's possible to do the bridging, you can use the Accessibility API in order to get the windows for all of the running applications (see the answer to this related question). Once you have that list of windows, you can get the frame (coordinates) of where each of those windows lives on-screen.
Another thing about using the Accessibility API, the user has to "OPT IN" to allowing it. It's not normally turned on by default.
Here's another question that closely matches yours, but the accepted answer only provides a solution to retrieve the windows for your own (currently running) application.

Log into twitter?

Ok, basically what I am trying to do is get a boolean if I have logged in or not. I am using the Twitter4j library and they gave me the following three things to look at.
http://twitter4j.org/en/code-examples.html
https://github.com/yusuke/sign-in-with-twitter/blob/master/src/main/java/twitter4j/examples/signin/SigninServlet.java
https://github.com/yusuke/sign-in-with-twitter/blob/master/src/main/java/twitter4j/examples/signin/CallbackServlet.java
I have no idea how to log in and get if I logged in successfully.
Thanks, and I have no code btw... all I did was basically copy code and try different things.
PS. On a separate note how do I learn how to use someone elses library?
Twitter uses OAuth. There is no concept of having logged in from any external app. There is instead a concept of an app being authorized to communicate with your account on twitter. On how to learn to use somebody else's library... that's a really general question... reading the documentation is a good start, then the IRC channel for the relevant language (or library if it has its own IRC channel).
I've found people on IRC channels to be very helpful when you have a specific code problem you are trying to solve and the real time help often enables faster progress than waiting for answers to a question on a forum or SO.

Java applet communication with Rails application

I'm creating a Rails application and on it, there should be a Java Applet.
My question and problem is that the applet must be tightly integrated with the Rails parts. I must be able to get a list of all users, update an image, etc... And there's a surprisingly small amount of information available on the Internet of how to use applets with Rails. So please give me some hints. What is the best way to do it?
Send parameters to the applet?
Use Rails REST interface from the applet?
Use JRuby somehow?
Other....?
Thanks!
Can you provide more details? In the meantime, here's my take on your questions:
Send parameters to the applet?
Your rails app will be able to serve the applet, but once served I don think you'll be able to send messages to it (however you will be able to respond to messages from it, which is perhaps what your asking).
Use Rails REST interface from the applet?
You've kind of answered that one yourself. REST is an interface design and therefore can be accessed from anything that can issue a HTTP request. The trick is to correctly construct the URL so rails knows what you want to do. There's good info on configuring rails routes (REST and non-REST) here http://guides.rubyonrails.org/routing.html
Use JRuby somehow?
You could use jruby for this, but you dont need to. Your server (rails) and your client (browser/applet) talk to eachother via http and so don't need to be the same language or run on the same VM.
Hope that help....
I think the reason you probably haven't found anything specific about Applets and Rails is that they function a bit at different levels and aren't really dependent on one another. It looks like Rob was trying to clarify a few things, so I'll take it another step just to be sure we are all on the same page.
The job of Rails is to generate and serve up HTML/XML/Javascript/images via a web server to the user's web browser for rendering. Part of that HTML will be an APPLET (or possibly OBJECT) tag, which instructs the browser to load the applet. Usually, this instructs the browser to invoke the Java Plug-in and lets it handle loading the applet. Once loaded and running, however, even though the applet is displayed on the current web page in the browser (or maybe in another window even), it really isn't terribly aware of the web page it is sitting in. For the most part, applets don't care about the browser or the page they are "part of". So if an applet needs more information, or needs to ask for data, it usually will just send an HTTP request to the server it came from. It would then parse the data and update itself.
I am assuming what you probably need is for something to be clicked or entered into the applet, and that data be used to update the web page that Rails is serving to the browser. With an applet, you pretty much have 2 options:
Use the web server application to share state information
Use the Java-to-Javascript communication using JSObject as indicated at http://java.sun.com/products/plugin/1.3/docs/jsobject.html
Honestly, option number 2 comes with so many caveats, that I would never use it unless you had complete control over browser and Java versions on all potential users' systems. Even then, I'd be concerned of an update to something breaking it.
Basically, option number 1 leaves you with the Applet and the Javascript/HTML polling the web server (Rails) periodically to see if there are any updates or requests that they need to respond to for data exchange. If the applet is updated by the user, it sends a message to the web server via a URL request/post and the next query (probably via an AJAX-like call) by the web page will see the new data and the web page will be updated with it.
I hope that helps.
Two really great answers. I appreciate them a lot, thanks!
Reading your posts made me realize that the best choice is to use HTTP-requests to Rails REST interface. However, I see some downsides with this approach. But I don't see any better solution to it. One feature the applet should have, is to be able to browse and search in all products, which can be quite many. Sending a HTTP-request for each search will be expensive. Maybe I could solve this by loading all products when the applet starts. Then the browsing and searching would be fast. Or maybe do some nice caching. So once they are found, I don't fetch them again.
About not finding lots of information about this on the net. I see your point monceaux. But... I still think that there should be more. I mean, in my situation I would really like a Rails specific library that helped me send requests to correct urls. To bad Java is not that dynamic though. Kind of hard to do some stuff automatically, like in Ruby and Rails. Maybe I'll write a small library for this. I mean, I must write it anyway. So why not make a library of it? Some people might have use of it.

Categories