|
About 20 hours too late. Read the other responses, especially after, so long, before replying. This advise was already given and your response added nothing to the thread, only to your ego.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello Mark,
I do appreciate your advice, I might have missed somewhere some thread; and the responses added unfortunately are no good to me and people shd do realise about time differences between the countries
|
|
|
|
|
What was that about ego?
|
|
|
|
|
Hey,
We are making a game like travian (www.travian.com) in php and SQL. Now we are facing a serious problem. We have the following example: Player A attacks player B, and this attack takes 1 hour. In the meantime player A and B are logged out. But the attack must be performed, since their teammates would like to know the status of the attack too. Now how can we execute a certain code at a specific time, NOT using players, so on the server? We're using a SQL database, and the coding is done in Php. I heard something about Stored Procedures...?
Thanks in advance,
Zaegra
Motivation is the key to software development.
|
|
|
|
|
I have one Idea
1. When ever a player attacks, insert the value in the database with the Execution timestamp.
2. Create a procedure to perform the tasks by fetching the rows from attack table(Which are pending, can be marked with status field)
3. Schedule the procedure to run after a particular interval of time.
I think it will solve your problem
|
|
|
|
|
I'm going through a Flash tutorial and comparing it against a Flash program we have received from a 3rd party. Within the 3rd party package there are separate files that contain code. The .fla file only appears to contain movie clips, jpegs, and etc. In the tutorial file it appears the code is layered in the .fla file.
My question is do flash developers alter the .fla files to hide code from end users, or is the .fla file just structured differently? I'm leaning towards an altered .fla file and only by accessing the .as files directly through the code folder, seeing I cannot find any code by going through the .fla file. Thanks for any help in advance.
|
|
|
|
|
It's just structured differently.
What if you had a 10,000 lines of code that converted text into speech, and you wanted to implement that cool functionality into a number of projects? Are you (a) going to copy/paste/fix the code into each new project, or are yopu going to (b) trty to put it into a library that you can re-use?
Separating the code from the content allows for (a) cleaner/clearer coding practices & (b) ease of reuse.
|
|
|
|
|
The library idea makes complete sense. It's used in other languages. Perhaps I'm not sure how to navigate thru the flash editor yet, but the library seems to only be filled with jpegs, movie clips, and etc. Is there a special section I should be looking in that I am just passing over?
|
|
|
|
|
Hi all
<HTML>
<HEAD>
<script language='javascript'>
function fChildren()
{
alert("The value is changed !");
}
</script>
</HEAD>
<BODY OnChange="javascript:fChildren()">
<P> </P>
<select name="ddlNumberOfChildren" id="ddlNumberOfChildren" >
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<INPUT TYPE="text" VALUE="Enter email address" NAME="userEmail" />
</BODY>
</HTML>
the above works in firefox as exptected
but it does not work in IE
Has any one know this issue? Please Help me !
Thanks in advance
|
|
|
|
|
Let me know what exactly you want to do?
I think you need onload rather than onchange or what you want.
There is no onchange event for Body tag according to W3C Standards.
|
|
|
|
|
What you expect this piece of code to do? Please refrain your question.
N.Surendra Prasad
|
|
|
|
|
You have already posted this in another forum. Do not repost. Read the forum guidelines
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
|
ArunkGeorge wrote: 1. Is there any standard on how the query string should look like? Should I use xml serialized date or Json serialzied date?
I think this is not good. Dont use Content-Type to determine the type of the response. I think it is better if you explicitely define a key for content type the client wants.
http:
See I used type key to get JSON response from the client, so the client which uses it have proper knowledge about what type of response it expects.
ArunkGeorge wrote: Should I use xml serialized date or Json serialzied date?
Yes, if you are creating JSON response, Use JSON serialized date, otherwise XML. (I guess it automatically does that way)
ArunkGeorge wrote: Question 2: Most of the deserialization APIs exposed (at least the ones I have seen) deserialize a stream, and not a single datetime value. Do I have to always wrap the datetime into a stream in order to get that deserialized?
Yes I think you are right, But you can create your own Serializer any time and use it.
ArunkGeorge wrote: Is there any easy way to get the query string parameter key-value pairs directly deserialized into a desired object?
Yes, I think there is. You might use Request.QueryString.AllKeys
ArunkGeorge wrote: Question XmlSerializer accepts only a child of ICollection and so I am not able to pass a HashTable etc.
Yes... HashTables are different than normal, you can pass hashtable.Value which is ICollection .
Hope you got it.
|
|
|
|
|
|
If someone wants to help, you shouldn't be replying like this. This way no one will be going to reply you.
ArunkGeorge wrote: Leave the job to someone who understands the question.
This might be your problem. You should make others understand what you wanted to tell us. Try to focus the terms on what exactly you want.
We all here doing voluntary help to you. We have lots of other work to do. At least you are not paying us for this.
Anyways...
Wish you luck with this.
|
|
|
|
|
ArunkGeorge wrote:
There are 1000 ways of hacking a solution or finding a work around. I am looking for a widely accepted and standard way of doing things.
Then why ask the question here?
ArunkGeorge wrote: Leave the job to someone who understands the question.
This is extremely rude, you joined this forum just a day ago and happily insult someone who has contributed greatly to the success of the site and its forums (check out his profile).
You seem to have a seriously poor attitude; may I suggest you take it elsewhere and leave this forum to those who appreciate someone trying to help them, and also know how to behave.
|
|
|
|
|
Richard MacCutchan wrote: Then why ask the question here?
If you don't understand the difference between a hack and an accepted solution, I have nothing more to say.
Form my question, (I hope) it was clear that I had a way of doing things. I was looking for 'better' or 'accepted' ways.
If you feel his reply added any value to me, you are mistaken. It was just rephrasing whatever statements I put in my question, that too with a suggestion to pass the content type as an extra parameter.
There is a famous article about things to do before you ask/answer questions in a forum. I think its by Ayende. Might be good to look for that.
|
|
|
|
|
With an attitude like that you are unlikely to win many friends on this forum.
Your original post did say:
ArunkGeorge wrote: Any suggestions or ideas will be greatly appreciated.
And then when someone posted an idea, you didn't appreciate it. Perhaps you should have said:
Only suggestions and ideas that I agree with will be appreciated.
|
|
|
|
|
David Skelly wrote: unlikely to win many friends on this forum
I was looking for a solution. I will be the last person to look for friends in 'The Code Project'
<blockquote class="FQ"><div class="FQA">David Skelly wrote:</div>when someone posted an idea,</blockquote>
Forgive me for not interpreting that suggestion to pass content type as an extra parameter as an 'idea'. My mistake. Apologies.
|
|
|
|
|
ArunkGeorge wrote: I have nothing more to say.
Most of us don't think you had anything to say in the first place.
|
|
|
|
|
|
ArunkGeorge wrote: what is your bloody problem?
I have no problem. I simply pointed out something that should have been self-evident to a perceptive fellow like you.
By the way, you can have the last word on this sub thread, I shan't read it.
|
|
|
|
|
Hello Friends,
I am looking for a script in which user can upload an image from his machine and place it over another image.
He should be allowed to place the new image anywhere on the already existing image and should be allowed to resize the uploaded image. Its something like customising a greeting card on moonpig.com where user can upload his image and place it over the card and resize it as well. Could anyone please point me to the correct script. I am looking for this in Javascript, DHTML, AJAX.
Thanks
|
|
|
|
|
It is not easy to achieve I guess. You need a strong knowledge on Javascript and ServerSide image resizing to do this.
Let me give you some hint from where to start :
Do a normal upload of an image file.
Put a div and load the image in its background using CSS
like background : url('imgurl')
Now place an absolute position div which allows you to resize just over the div you placed. you can adjust div.clientHeight, div.offsetLeft, div.scrollLeft to position the div on exactly over the image.
When user is done, you need to actually crop the image based on the size of the div which is floating above the div.
Cropping an image is not a big deal, there are lots of codes available for that, Just you need to find the actual value of the Rectangle that the user adjusted for cropping.
This might help you in this regard[^]
Wish you luck in this
|
|
|
|