Is it possible to do DATE_SUB( ".$date." , INTERVAL 100 DAY ) if the type of the column where the date is stored is varchar(255) or I need to convert that column to "DATE" type?
All,
I am trying to perform a nested AJAX call using the following code. The nested call doesn't seem to work. Am I doing anything wrong?
$.ajax({
type: 'GET',
url: "/public/customcontroller/dosomething",
cache: false,
dataType: "html",
success: function(html_input)
{
$.ajax({
type: 'GET',
url: "/public/customcontroller/getjobstatus",
cache: false,
dataType: "html",
success: function(html_input){
alert(html_input);
}
});
}
});
Thanks
this is my google-map code:
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=0.3,maximum-scale=5.0,user-scalable=yes">
</head>
<body onload="initialize()" onunload="GUnload()">
<style type="text/css">
*{
margin:0;
padding:0;
}
</style>
<!--<div style="width:100px;height:100px;background:blue;"> </div>-->
<div id="map_canvas" style="width: 500px; height: 300px;"></div>
<script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAA-7cuV3vqp7w6zUNiN_F4uBRi_j0U6kJrkFvY4-OX2XYmEAa76BSNz0ifabgugotzJgrxyodPDmheRA&sensor=false"type="text/javascript"></script>
<script type="text/javascript">
var aFn;
//**********
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
var g = new GGeoXml("b.kml");
map.addOverlay(g);
var center=new GLatLng(37.42228990140251,-122.0822035425683);
map.setCenter(center, 0);
}
}
//*************
</script>
</body>
</html>
and this is my b.kml file:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Placemark>
<name>Simple placemark</name>
<description>Attached to the ground. Intelligently places itself
at the height of the underlying terrain.</description>
<Point>
<coordinates>-122.0822035425683,37.42228990140251,0</coordinates>
</Point>
</Placemark>
</kml>
why cann't show the point ..
thanks
I am writing my xml file manually. And I am writing that for storing data and retrieving data from that.
I have written file like for the table PersonalInfo.
<?xml version="1.0" standalone="yes"?>
<PersonalInfo>
<xs:schema id="PersonalInfo" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xs:element name="PersonalInfo" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="PesonalInfo.">
<xs:complexType>
<xs:sequence>
<!--Define Column Here....-->
<xs:element name="name" type="xs:string" />
<xs:element name="address" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<!--First Row-->
<PersonalInfo.>
<name>Harikrishna</name>
<address>India</address>
</PersonalInfo.>
<!--Second Row-->
<PersonalInfo.>
<name>Jatin</name>
<address>India</address>
</PersonalInfo.>
</PersonalInfo>
Please suggest any mistake with writing file here.
And now I want define more than table in this file.
And here I have to write data for the table like
<PersonalInfo.>
<name>Harikrishna</name>
<address>India</address>
</PersonalInfo.>
<PersonalInfo.>
<name>Jatin</name>
<address>India</address>
</PersonalInfo.>
Is not possible some thing writing data when defining columns
EDIT :
<xs:element name="name" type="xs:string",Harikrishna,Jatin.... />
<xs:element name="address" type="xs:string",India,India.... />
And how to define more than one table in a single xml file ?
is it possible to define resources in the style rather then using a template?
<ListView.Resources >
<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="Transparent" />
</Style>
</ListView.Resources>
How can I wrap this thing into:
<Style TargetType="{x:Type ListView}">
</Style>
?
I have an AppEngine application that uses the blobstore to store user-provided image data. When I upload images to that application from a form in Chrome it works fine. When I try to upload an image from an Android application it fails. Both methods work fine if I am running against the development server, but the Android upload doesn't work against the live service.
This is the request from Chrome:
POST /_ah/upload/?userToken=11001/AMmfu6ZCyMQQ9YdiXal3SmSXIRTQIuSRXkNc-i3JmU0fqx_kJbUJ2OMLcS2lXhVJSK4qs7regViTKzOPz5ejoZYi0nAD5o8vNltiOViQw6DZO7_byZz3Ut0/ALBNUaYAAAAAS_lusgPMAGmpPrg0BuNsJyymX-57ob4i/ HTTP/1.1
Host: photohuntservice.appspot.com
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1064 Safari/532.5
Referer: http://photohuntservice.appspot.com/debug_newpuzzle?userToken=11001
Content-Length: 60360
Cache-Control: max-age=0
Origin: http://photohuntservice.appspot.com
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarybl05YLmLbFRf2MzN
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
------WebKitFormBoundarybl05YLmLbFRf2MzN
Content-Disposition: form-data; name="userToken"
11001
------WebKitFormBoundarybl05YLmLbFRf2MzN
Content-Disposition: form-data; name="img"; filename="Photo_020908_001.jpg"
Content-Type: image/jpeg
<image data>
------WebKitFormBoundarybl05YLmLbFRf2MzN
Content-Disposition: form-data; name="longitude"
-122.084095
------WebKitFormBoundarybl05YLmLbFRf2MzN
Content-Disposition: form-data; name="latitude"
37.422006
------WebKitFormBoundarybl05YLmLbFRf2MzN--
This is the request from my client (which is written in Java on Android, but I don't think that's relevant):
POST /_ah/upload/?userToken=11001/AMmfu6Zf9an6AU4lT9UuhIpxOZyOYb1LMwimFpeSh8zr6J1sX9F2ddJW3Qlsw0kwV3oALv-TNPWRQ6g4_Dgwk0UTwF47bbc78Yl44kDeV69MydTuR3N46S4/ALBNUaYAAAAAS_mMr3CYqTg3aVBDjhRxP0DyyRdvotyG/ HTTP/1.1
Content-Type: multipart/form-data;boundary=----WebKitFormBoundaryhdyNAhmOouRDGErG
Cache-Control: max-age=0
Accept: */*
Origin: http://photohuntservice.appspot.com
Connection: keep-alive
Referer: http://photohuntservice.appspot.com/getuploadurl?userToken=11001
Content-Length: 2638
Host: photohuntservice.appspot.com
User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)
Expect: 100-Continue
------WebKitFormBoundaryhdyNAhmOouRDGErG
Content-Disposition: form-data; name="userToken"
11001
------WebKitFormBoundaryhdyNAhmOouRDGErG
Content-Disposition: form-data; name="img";filename="PhotoHunt.jpg"
Content-Type: image/jpeg
<image data>
------WebKitFormBoundaryhdyNAhmOouRDGErG
Content-Disposition: form-data; name="latitude"
37.422006
------WebKitFormBoundaryhdyNAhmOouRDGErG
Content-Disposition: form-data; name="longitude"
-122.084095
------WebKitFormBoundaryhdyNAhmOouRDGErG--
In both cases the AppEngine Python code to catch the request is the same:
class UploadPuzzle( blobstore_handlers.BlobstoreUploadHandler ):
def post(self):
upload_files = self.get_uploads( )
The problem is that when running on the production AppEngine service self.get_uploads() returns an empty list when the request is made from my client app. Both requests return what I expect (a list with one blob_info in it) on the development server, and Chrome returns what I expect in both cases.
I keep seeing poeple using doubles in C#. I know I read somewhere that double sometimes loose precision.
My question is when should a use a double and when should I use a decimal type?
which type is suitable for money computations? (ie. greater than $100 million)
I want to filter certain rows out of a table and am using classes to categorise the rows.
The below code enables me to show and hide row data categorised as "QUO" and "CAL" (eventually there will be other categories.
Can someone point me towards a more elegant solution, so I don't have to duplicate code for each category as I have below?
Thanks!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html>
<head>
<title>Untitled</title>
<style>
</style>
<script src="Javascript/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#toggle_ac_cal").click(function()
{
var checked_status = this.checked;
if (checked_status==true)
{
$(".ac_cal").show()
}
else
{
$(".ac_cal").hide()
}
});
$("#toggle_ac_quo").click(function()
{
var checked_status = this.checked;
if (checked_status==true)
{
$(".ac_quo").show()
}
else
{
$(".ac_quo").hide()
}
});
});
</script>
</head>
<body>
<input type="checkbox" id="toggle_ac_cal" checked="checked" />CAL<br/>
<input type="checkbox" id="toggle_ac_quo" checked="checked" />QUO<br/>
<table>
<tbody>
<tr class="ac_cal">
<td>CAL</td>
<td>10 Oct</td>
<td>John Barnes</td>
</tr>
<tr class="ac_cal">
<td>CAL</td>
<td>10 Oct</td>
<td>Neil Burton</td>
</tr>
<tr class="ac_quo">
<td>QUO</td>
<td>11 Oct</td>
<td>Neil Armstrong</td>
</tr>
</tbody>
</table>
</body>
</html>
It's not the largest integer type anymore now that there's "long long".
It's not a fixed-width type: It's 32 bits on some platforms and 64 on others.
It's not necessarily the same size as a pointer (for example, on 64-bit Windows)
So, does "long" have any meaning anymore? Is there ever a reason to declare a long instead of a ptrdiff_t or int64_t?
What's the difference between 'a[,,] and 'a[][][]? They both represent 3-d arrays.
It makes me write array3d.[x].[y].[z] instead of array3d.[x, y, z].
Why I can't do the following?
> let array2d : int[,] = Array2D.zeroCreate 10 10;;
> let array1d = array2d.[0];;
error FS0001: This expression was expected to have type
'a []
but here has type
int [,]
Hi there,
I am combing the jQuery validation plug-in with the jQuery Form Plugin to submit the form via AJAX.
This works perfectly in Firefox & Chrome, but (as usual) Internet Explorer is being a pain. For reasons that are alluding me, IE is ignoring the ajaxSubmit, as a result it submits the form in the normal fashion.
I've followed the validation plug-in's documentation when constructing my code:
JS:
$(document).ready(function() {
var validator = $("#form_notify").validate({
messages: {
email: {
required: 'Please insert your email address. Without your email address we will not be able to contact you!',
email:'Please enter a valid email address. Without a valid email address we will not be able to contact you!'
}
},
errorLabelContainer: "#error",
success: "valid",
submitHandler: function(form) {$(form).ajaxSubmit();}
});
$('#email').blur(function() {
if (validator.numberOfInvalids() 0) {
$("#label").addClass("label_error");
return false;
}
else {$("#label").removeClass("label_error");}
});
$('#form_notify').submit(function() {
if (validator.numberOfInvalids() == 0) {
$(this).fadeOut('fast', function() {$('#thank-you').fadeIn();});
return true;
}
return false;
});
});
Form HTML:
<form id="form_notify" class="cmxform" name="form_notify" action="optin.pl" method="get">
<fieldset>
<div class="input">
<label id="label" for="email">Email Address:</label>
<input type="text" id="email" name="email" value="" title="email address" class="{required:true, email:true}"/>
<div class="clearfix"></div>
</div>
<input type="hidden" name="key" value="sub-745-9.224;1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0;;subscribe-224.htm">
<input type="hidden" name="followup" value="19">
<input type="submit" name="submit" id="submit-button" value="Notify Me">
<div id="error"></div>
</fieldset>
</form>
I can't understand what is causing IE to act differently, any assistance would be greatly appreciated.
I can provide more information if needed.
Thanks in advance!
Hi guys
I want to make a program which takes video and audio and merges them. Video Type or audio type is not important for me. I just want to make so- called program. How can i make this ? does any library exist for this ? (I know there are many program about this topic but i want to learn how to implement such a program.)
Help me please about this topic.
I'm new to Python. I have a method that begins:
def foo(self, list):
length = len(list)
I've called len() successfully in other cases, but here I get:
TypeError: object of type 'type' has no len()
How do I convince Python that this object passed in is a list? What am I missing?
This is an "is this okay, or can it be done better" question.
Topic: Storing typed objects in memory.
Background information: I'm building a compiler for the x86-32 platform for my language. My goal includes typed objects.
Idea: Every primitive is a semi-class (it can be used as if it was a normal class, but it's stored more compact). Every class is represented by primitives and some meta-data (containing class-properties, inheritance stuff, etc.). The meta-data is complex: it doesn't use fields but instead context-switches. For primitives, the meta-data is very small, compared to a "real" class, which is alot bigger. This enables another idea that "primitives are objects", in my language, which I found nessecairy.
Example: If I have an array of 32 booleans, then the pure content of this array is exactly 4 byte (32 bits of booleans). The meta-data will contain flags that the type is an array of booleans, which contains 32 entries.
The meta-data is very compacted, on bit-level: using a sort of "packing" mechanism, which is read by a FSM at runtime, when doing inspection of the type (like when passing the object to methods for checking, etc.) For instance (read from left to right, top to bottom, remember vertical possition when going to the right, and check nearest column header for meaning of switch):
Primitive? Array? Type-Meta 1 Byte? || Size (1 byte)
1 1 [...] 1 [...] done
0 2 Bytes? || Size (2 bytes)
1 [...] done
|| Size (4 bytes)
0 [...] done
Integer? 1 Byte? 2 Bytes?
0 1 0 1 done
1 done 0 done
Boolean? Byte?
0 1 0 done
1 done
More-Primitives
0 ....
Class-Stuff (Huge)
0 ...
(After reaching done the data is inserted. || = byte alignement. [...] is variable sized. ... is not described here, for simplicity. And let's call them cost-based-data-structures.)
For an array of 32 booleans containing all true values, the memory for this type would be (read top-down):
1 Primitive
1 Array
1 ArrayType: Primitive
0 Not-Array
0 Not-Integer
1 Boolean
0 Not-Byte (thus bit)
1 Integer Size: 1 Byte
00100000 Array size
11111111 11111111 11111111 11111111 Data
Thus, 8 bytes represent 32 booleans in an array:
11100101 00100000 11111111 11111111 11111111 11111111
Is this okay, or can it be done better?
scroll UIScrollview on editing of UITextView
I have 1 view on that view I have 1 UITextfield,UILabel and UITextview
when i click on UITextview and as i type on it my UIScrollview should go up so that Text inside UITextview go up and also the whole view also goes up as i type
Hi,
In MS Excel, consider i have the word 'Microsoft' in a cell. And in the cell below I want to type the word 'Microhard'.
When I start typing Microhard, the word Microsoft appears shaded in black.
Now how can I select the part 'Micro' alone from Microsoft and type 'hard' alone. Hope my question is clear.
I have the following Python 2.6 program and YAML definition (using PyYAML):
import yaml
x = yaml.load(
"""
product:
name : 'Product X'
sku : 123
features :
- size : '10x30cm'
weight : '10kg'
"""
)
print type(x)
print x
Which results in the following output:
<type 'dict'>
{'product': {'sku': 123, 'name': 'Product X', 'features': [{'weight': '10kg', 'size': '10x30cm'}]}}
It is possible to create a strongly typed object from x?
I would like to the following:
print x.features(0).size
I am aware that it is possible to create and instance from an existent class, but that is not what I want for this particular scenario.
I have written a winform application to manage a certain type of project. I want to charge my users on a per project basis, e.g. they purchase a base version of my app to manage 3 projects for 300$ and can buy extensions for 100$ per project.
Do you know of any good tools that support this type of licensing?
Currently the project counter is buried in the database, but I am looking for something more reliable.
Hi all,
I want to ask about the form in javascript ..
I want to do a game that the user enter the correct word, then alert message will apeared for correct word.. When the user do the first word correctly, the program will display another word (to be corrected) ..
but the problem which i faced that i can't make the form display again to continue play the game ..
i used :
var d = document.getElementById("form1"); d.style.visibility = "visible";
but it doesn't work !!
This is my code:
<title>Word Decoder</title>
<script type="text/javascript">
function checkWord(word, score){
var ok = words[score].valueOf();
var ok1 = document.getElementById("wordid");
if(ok1.value == ok){
score ++;
alert("Correct, your score is: " + score);
var d = document.getElementById("form1");
d.style.visibility = "visible";
return false;
} else {
alert("Wrong Spelling");
return false;
}
}
</script>
</head>
<body>
<script type="text/javascript">
var words = new Array ("apple", "orange", "banana", "manago", "table");
var reWords = new Array ("alpep", "ergano", "aaabnn", "goamna", "lbeat");
var count = 0;
var score = 0;
"</br>";
</script>
<form id="form1">
<br>
<dir id="displayForm" style="position: relative; visibility: visible; display: block">
<h3><b> <script> document.write(reWords[score]);</script> </b></h3>
<br>
Enter the correct word: <input type="text" value="" id="wordid"/>
<input type="submit" value="Check Answer ??" onclick="return checkWord(wordid, score);" />
</dir>
</form>
</body>
Can help me to solve the problem?
Again: I want the game will display a scrambled word and the user must unscrambled the word to move to the other word. The problem is i can't display the form again to make the user unscrambled the second, third ..etc words..
<body>
<form action="<%= blobstoreService.createUploadUrl("/upload") %>" method="post" enctype="multipart/form-data">
<input type="file" name="myFile">
<input type="submit" value="Submit">
</form>
</body>
the above code throws a java.lang.NoSuchMethodError on compilation.I can't understand and what is blobstoreService in the above code ?
Hi,
I have a website that changes his inputs ids, and I'm trying to make a semi auto-login, filling automatically the email and the password part...
I'm doing this with greasemonkey and jQuery...
I'm trying something like this
$("input[@type=text]").setValue("[email protected]");
but had no success...
The Page has only the login part, two text type inputs...
What am I missing here?
Hey folks,
OK - I'll admit, I'm quite a beginner in this jQuery-department. I've probably made some amateur mistake, but hey, you gotta learn somewhere! :)
So I'm using jScrollPane: http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html
I want to use it style the scrollable area in my second column. Specifically, I would like to apply and format the scrollbars on the div #ajaxresults
My page is... rather jQuery heavy. I don't know if any variables are conflicting or something... in fact I really have no idea at all why this isn't working.
Take a look at my problematic page: http://furnace.howcode.com
In the header, I've set this to go:
<!-- Includes for jScrollPane -->
<script type="text/javascript" src="http://localhost:8888/js/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://localhost:8888/js/jScrollPane.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="http://localhost:8888/stylesheets/jScrollPane.css" />
<script type="text/javascript">
$(function() {
$('#ajaxresults').jScrollPane();
});
</script>
(I've changed localhost on the server copy though)
Nothing ever seems to work with the #ajaxresults div. I've set, as the jScrollPane docs say, overflow:auto on it but still no luck. I find that when jScrollPane DOES seem to 'run' it just moves the div down about 100 pixels. Try it for yourself.
Perhaps someone could help? There's quite a few jQuery plugins there so I don't know if something's colliding/crashing etc...
Please note the site is still in development between myself and a friend, which explains the personal messages we submit to each other ('Hi Donnie!' etc. :D ). Also, when you view the page nothing may appear in the second column for a few seconds - it's just fetching the data via Ajax. So give it a little time.
Thanks very much!
Jack
I'm working on a compact framework project and whilst most of the properties are fairly straight forward (I.e. mark them as browsable in the xmta file), I'm struggling to get this to work for more complex types - on the full framework, I'd just implement a custom TypeConverter and go from there, but it seems the CF TypeConverter doesn't have any of the type converting methods to override, which has left me a little stuck?
It probably should be blindingly obvious but how would I go about supporting design time property support for more complex type?