Ewald Horn 26 Newbie Poster

You can try this

window.setTimeout(function() {
    $("#myweb").load("webcamsnap.php");
}, 2000);

Inside your function. It will make the load wait 2 seconds before actually executing it.

Ewald Horn 26 Newbie Poster

Your JavaScripts are over-writing each other. Wrap them in anynomous functions, like so :

http://plnkr.co/edit/B6265864pZhZOsXGkBqL?p=preview

Basically, you want to wrap your entire JS in

(function(){ 
..... your code .....
})();

This will protect the methods from each other. When I do that, I have two working canvas elements.

Ewald Horn 26 Newbie Poster

This is actually a very rarely used feature, so finding documentation on it is difficult. I, for one, believe that sending a username and a password this way is risky, but, if you really need to do so, you can modify the SOAP header request.

The trick is to create a handler for this, there's excellent documentation at this site : http://www.javadb.com/using-a-message-handler-to-alter-the-soap-header-in-a-web-service-client/

My only question is, are you sure this is what you need to do?

Ewald Horn 26 Newbie Poster

I was just trying to point out that it's not a simple guessing exercise, it requires some kind of measurement.

Ancient Dragon commented: I agree +0
Ewald Horn 26 Newbie Poster

The best way is to expose some kind of web service or API that your Android app can talk to. Directly connecting a mobile application to a database is not a good idea, you have so many connectivity issues to deal with that it becomes a nightmare to ensure data integrity.

Ewald Horn 26 Newbie Poster

Hi.

Sorry I only saw this now.

Let's take it line by line:

  1. create a static method called analyAPI that takes a single parameter, pkgname. In Groovy, you do not have to specify the variable type, just the name, very much like in JavaScript.

  2. Define a variable called refs that uses a static method load in the Yaml object to load and parses a file as text. This will load the Yaml script and populate the variable called refs with all the information from the script.

  3. The variable refs will contain a reference to all the Classes and it will be a collection. Using refs.Classes.each allows you to loop through all the classes in this collection.

  4. Using a static method caled analyzeClassRef, parse the package name and the class name. The "it" refers to the current class being served by the "each" iterator. The "it" is a convenient method for getting hold of whatever is being iterated over and is very handy in Groovy.

  5. Declare our static method and specify the parameters. Again, note the abscence of types.

  6. Println is a method / function in Groovy that will print something to the console. Of special note is the use of "" quotes, that allow you to specify placeholders in the string that will be replaced by the content of the specified variables when the line is printed. For example, this string will contain the String representation of pgkname and name when printed.

  7. Define a variable called filename, and, using standard …

JamesCherrill commented: Very helpful, thanks +15
Ewald Horn 26 Newbie Poster

Hi,

dont' worry, this is a common issue with learning Java :

Monster.Java should be called Monster.java.

Java is case sensitive, so when it tries to find the Monster.java file, it's failing due to the naming issue. Rename it to Monster.java and it should be fine. (You can right-click on the file to rename it in Eclipse).

pwolf commented: solved my problem +2
Ewald Horn 26 Newbie Poster

Indexes...

You do not have indexes on the columns you are comparing, so it will be doing table scans all the time.

Simply create indexes on both tables, for those columns, before you run the query.

Ewald Horn 26 Newbie Poster

@Ray - Sure thing, what I have is a cron job that just runs a simple Python script (foundation source at http://www.decalage.info/fr/python/html) - the tricky part is of course reading the sensor data.

What format do you output this data, in CSV perhaps? I am happy to modify my code and put it here, I just need to remove a few bits that the company won't want shared.

Ewald Horn 26 Newbie Poster

Are you running through every pixel at a time?

How about using a scaling algorithm rather? Let's say, each entry in your grid equals 4 real pixels. Then you already have 1/4 of the number of calculations to do. I don't think that on a game like that, you really need to handle each pixel as a single block.

The original game was a text-mode game, so it worked on 80x25 characters! I guess things have changed a lot since then :)

Ewald Horn 26 Newbie Poster

Hi.

Even while using a cloud solution, you will have some data on your machine that is sensitive.

The best approach, even with a cloud host, is to encrypt your hard drive. Under Windows, you can use something like Check Point (http://www.checkpoint.com/products/full-disk-encryption/index.html) that will encrypt the entire drive.

I know there's a program called TrueCrypt, and it works very well, but I have found it's cumbersome to use and because it's not transparent, people don't bother to keep all their sensitive information in the TrueCrypt vault.

For Linux, you can set up an encrypted file system (Fedora 19, for example, ships with this built-in).

The best security you can have though, is to be diligent. Make sure you lock your computing device when not near it. Make sure you delete all sensitive data that you do not absolutely need. Also, ensure you do not place anything sensitive on an unencrypted device.

I hope this helps.

rch1231 commented: Great idea +9
Ewald Horn 26 Newbie Poster

The first error is easy - you are not specifying a return type. In Java, only constructors do not specify return types. Did you copy and paste this code into a new .java file? It looks like the original file was called MineCraftLoginReader.java - but you've changed that. Java requires that public classes and filenames match.

The second error, pretty much everything after that, are syntax errors. That is not proper Java code, and would never compile. Perhaps you made some mistakes when you copied the code? That might explain it as I see missing { brackets, ;'s in the wrong place etc.

Ewald Horn 26 Newbie Poster

I highly recommend that you consider the following online resources, in the order provided :

http://www.codecademy.com - a great resource for absolute beginners.
https://dash.generalassemb.ly/ - after CodeCademy, you'll be ready for these tutorials
http://www.codeavengers.com - even more exercises!

In my experience, I've found people progress through HTML5 very well after mastering the basics on CodeCademy, and moving forward from there. Anytime that you get stuck, there's a whole Daniweb community to help you out!

Good luck - learning HTML5 is a lot of fun, it gets hard here and there, but with a bit of patience and effort, you'll quickly become an expert.

Ewald Horn 26 Newbie Poster

Hi.

You are referencing R.id.container - but none of your components are called that. It looks like you are missing something from whatever tutorial you are using.

I can assure you that everything is not as it is in the tutorial :) - that code won't compile, thre's nothing with an android:id="@+id/container" in your XML files.

Ewald Horn 26 Newbie Poster

The problem is that you are adding a new SimpleAdapter each time you run through the loop.

You need to get all your data from the database first and store it in a memory structure. You then add a single adapter to the View, passing in this list of data.

Move this code :

 ListAdapter adapter = new SimpleAdapter(
this, Timetablelist,R.layout.list_item, new String[] { "Subject", "Day",
"Slot","Instructor" }, new int[] { R.id.subject,
R.id.day, R.id.slot,R.id.instructor });
setListAdapter(adapter); 

Outside the loop to right at the end. That way, you will have populated Timetablelist with all the information and will be adding it only once :)

Ewald Horn 26 Newbie Poster

To save data locally, why not look at something like the embeddable H2 database from http://www.h2database.com/html/main.html - it is a brilliant, small SQL database, written in pure Java.

As for the last view, you can easily serialize and deserialize the state of your application, if your design supports it, of course. If you followed the MVC pattern, it should be easy to add a layer that persists the program state to the database, and then read it back on startup. You shouldn't try to save the GUI components, just the data that led to that UI being built. That way, once you load the data, you can "replay" the sequence that led to that UI being built.

You can save user preferences and database credentials in the H2 database as well. I'd use the H2 database for all three your requirements, it is very easy to use and makes sense given that you already have database experience.

Ewald Horn 26 Newbie Poster

Try specifying the address as "http://www.mydirectedpage.com"