get

How to get the value of autoincrement of last row at the insert

家住魔仙堡 提交于 2019-11-27 01:49:20
问题 I have googled this problem one week and no thing useful I think am not using the correct word I am using SQL Server 2008 with t-sql and my need is to optimise my function when I insert a new row. I have a table with first column is the key of integer autoincrement type and other columns are just for information When we do an insert, SQL Server increments the key automatically and I have to do a select max to get the value, so is there a way like a global variable like @@IDENTITY or a

Url to get a file from Amazon S3

こ雲淡風輕ζ 提交于 2019-11-27 01:45:21
问题 I am having some trouble figuring out how to access a file from Amazon S3. Lets say that the bucket that the file lives in is BUCKET_NAME, the file is FILE_NAME, etc. I have tried the following two urls: https://s3.amazonaws.com/BUCKET_NAME/FILE_NAME/ ?Expires=EXPIRATION &Signature=SIGNATURE &SignatureVersion=2 &SignatureMethod=HmacSHA1 &AWSAccessKeyId=KEYID But this gives me the following error: NoSuchKey The specified key does not exist. and I have also tried https://s3.amazonaws.com/BUCKET

jQuery how to load some json records into a form fields?

Deadly 提交于 2019-11-27 01:42:15
问题 i have a json file: { "data": "Click", "size": "Here" } and a form: <form> First name: <input type="text" name="firstname" /><br /> Last name: <input type="text" name="lastname" /> </form> i was wondering what is the correct sintax for loading multiple json records into multiple form elements?? Something like a form that u want to u want to modify and the values get queered into those fields i know i can use: $getJSON('link_to_json_file' function() { }); but i'm stuck here thanks 回答1: Or if

PHP - Plus sign with GET query

你离开我真会死。 提交于 2019-11-27 01:32:25
I have a PHP script that does basic encryption of a string through the method below: <?php $key = 'secretkey'; $string = $_GET['str']; if ($_GET['method'] == "decrypt") { $output = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "\0"); } if ($_GET['method'] == "encrypt") { $output= base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key)))); } echo $output; ?> An example of a URL to encrypt a string would look like this: Encrypt.php?method=encrypt&str=the quick fox Which would return this

Android - Read an XML file with HTTP GET

别来无恙 提交于 2019-11-27 01:29:27
问题 I need to explore for my project use of web services on Android. I know that there is no official library for XML - RPC web service. But there is for REST XML and i need to test it. I would like to read XML on my web page (Where i have to pass username and Password) from Android with HTTP GET. OR Suppose, i follow This link, then where do i pass username and password? Can anybody help me on this. 回答1: HttpGet uri = new HttpGet("http://example.com"); DefaultHttpClient client = new

Passing $_GET parameters to cron job

点点圈 提交于 2019-11-27 01:28:57
问题 I am new at cron jobs and am not sure whether this would would work. For security purposes I thought about making a one page script that looks for certain GET values (a username, a password, and a security code) to make sure that only the computer and someone that knows all 3 can run the command. I made the script and it works running it in a browser but is it possible to run the cron job with GET values? a example would be me running * 3 * * * /path_to_script/cronjob.php?username=test

How to pass an array via $_GET in php?

匆匆过客 提交于 2019-11-27 00:56:18
How can I pass one or more variables of type array to another page via $_GET? I always passed variable values in the form ?a=1&b=2&c=3 What about passing a=[1,2,3] ? Do I need to write a for loop and append all the values? Thanks You can use the [] syntax to pass arrays through _GET: ?a[]=1&a[]=2&a[]=3 PHP understands this syntax, so $_GET['a'] will be equal to array(1, 2, 3) . You can also specify keys: ?a[42]=1&a[foo]=2&a[bar]=3 Multidimentional arrays work too: ?a[42][b][c]=1&a[foo]=2 http_build_query() does this automatically: http_build_query(array('a' => array(1, 2, 3))) // "a[]=1&a[]=2

HTTP get with headers using RestTemplate

邮差的信 提交于 2019-11-27 00:50:42
问题 How can I send a GET request using the Spring RestTemplate? Other questions have used POST, but I need to use GET. When I run this, the program continues to work, but it seems that the network is clogged because this is in an AsyncTask, and when I try to run another asynctask after I click on the button for this one, they won't work. I tried doing String url = "https://api.blah.com/2.0/search/cubes?w=jdfkl&whitespace=1"; MultiValueMap<String, String> map = new LinkedMultiValueMap<String,

Getting DOM element value using pure JavaScript

感情迁移 提交于 2019-11-27 00:44:20
Is there any difference between these solutions? Solution 1: function doSomething(id, value) { console.log(value); //... } <input id="theId" value="test" onclick="doSomething(this.id, this.value)" /> ...and Solution 2: function doSomething(id) { var value = document.getElementById(id).value; console.log(value); //... } <input id="theId" value="test" onclick="doSomething(this.id)" /> Yes , most notably! I don't think the second one will work (and if it does, not very portably ). The first one should be OK. // HTML: <input id="theId" value="test" onclick="doSomething(this)" /> // JavaScript:

Can't access cookies from document.cookie in JS, but browser shows cookies exist

爷,独闯天下 提交于 2019-11-27 00:25:12
I can't access any cookie from JavaScript. I need to read some value and send them via JSON for my custom checks. I've tried to access cookies from JS, like it was described at: http://www.w3schools.com/js/js_cookies.asp Get cookie by name As you can see at the code, it's seen as clear as a crystal the next: var c_value = document.cookie; When I'm trying to access the document.cookie value from the Chrome's web-debugger, I see only the empty string at the Watch expressions : So I can't read cookies value, which I need. I've checked the cookie name, which I'm sending to get an associated value