Id int64 34.6M 60.5M | Title stringlengths 15 150 | Body stringlengths 33 36.7k | Tags stringlengths 3 112 | CreationDate stringdate 2016-01-01 00:21:59 2020-02-29 17:55:56 | Y stringclasses 3 values |
|---|---|---|---|---|---|
38,017,804 | I want to use bat to split string which use ; as delims | i want to delete a special path using bat,i cannt use set somevar=" %path:specialstr=%",because the specialstr has dynamic partγ can I use bat to remove strings which are produced by %cd% from a large string like %path%οΌ | <batch-file><path> | 2016-06-24 16:13:45 | LQ_EDIT |
38,018,201 | What is wrong in this code php? | <p>What is wrong in this code php ?
netbeans 8.1 program have been tried and when I write $ _GET problem that occurs</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code> <html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<?php
if ($_GET['button']) {
if ($_GET['name']) {
echo "Your Name Is".$_GET['name'];
}else {
echo "Plz Enter your Name";
}
}
?>
<div>
<label for="name">Name :</label>
<input type="text" name="name"/>
<input type="submit" name="button" value="Submit" for="name" />
</div>
</body>
</html></code></pre>
</div>
</div>
</p>
| <php><html> | 2016-06-24 16:34:05 | LQ_CLOSE |
38,018,321 | Python: data Structures inside another | <p>In Perl you can do stuff like this:</p>
<pre><code>my $data->[texts}->{text1} = "hey";
print data->{texts}->{text1};
</code></pre>
<p>and it will print "hey". It is like a data structure (sort of array) inside another data structure...</p>
<p>Obviously this is possible in Python:</p>
<pre><code>data = { 'jack': 4098, 'sape': 4139 }
print data['jack'];
</code></pre>
<p>But I want something like: data['texts']['text1'] like it was done in Perl.</p>
<p>And I need to be able to easily remove and add to this structure...</p>
<p>Help?</p>
| <python><perl><memory><structure> | 2016-06-24 16:41:06 | LQ_CLOSE |
38,018,449 | C# Script unable to find namespace in new IIS setup | So we have some scripts that utilize an API that is developed in-house by our parent company. Basically, we have utilized their API to create some ASP.NET code to retrieve check images, deposit images, statements, etc. through the customer's internet banking interface.
We recently started working with a brand new IIS on a new server.
The script we are trying to call is called Checks.aspx.cs.
The script it is trying to reference is called UnityC.cs.
The first file is located at C:\inetpub\wwwroot\TestIB\Checks.aspx.cs.
The second file is located at C:\inetpub\wwwroot\TestIB\App_Code\UnityC.cs
Basically, the Checks.aspx.cs script parses out the GET call and feeds the variables into the UnityC.cs script, where the check image is returned to the user in a browser.
At this site, I keep getting the following error:
"Error CS0246: The type or namespace name 'InternetBankingUnity' could not be found (are you missing a using directive or an assembly reference?)"
This is setup the same at this site as it is at our other sites, so I am very confused. The line that throws the error in the Checks.aspx.cs script is as follows:
InternetBankingUnity.OBUnityC OB_Unity = new InternetBankingUnity.OBUnityC();
Here is a little bit of code from the top of the Checks.aspx.cs file. I have tried doing using InternetBankingUnity to no avail. If I include the using statement, the error is on that line instead of the line mentioned above.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
using System.Text;
using InternetBankingUnity;
public partial class _default : System.Web.UI.Page
{
A little exerpt from the UnityC.cs file showing the using statements, namespace, and class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Hyland.Types;
using Hyland.Unity;
using System.IO;
using System.Configuration;
using System.Collections;
using System.Drawing;
namespace InternetBankingUnity
{
public class OBUnityC
{
I am at a loss as to why these scripts would be working fine at one site and be giving me compilation errors at another. We did just copy the scripts over from our TestIB setup to their site's TestIB setup...is there something I am missing here?
Thanks in advance for your advice. | <c#><asp.net> | 2016-06-24 16:49:53 | LQ_EDIT |
38,019,267 | Import data from excel spreadsheet to django model | <p>I'm building a website that'll have a django backend. I want to be able to serve the medical billing data from a database that django will have access to. However, all of the data we receive is in excel spreadsheets. So I've been looking for a way to get the data from a spreadsheet, and then import it into a django model. I know there are some different django packages that can do this, but I'm having a hard time understanding how to use these packages. On top of that I'm using python 3 for this project. I've used win32com for automation stuff in excel in the past. I could write a function that could grab the data from the spreadsheet. Though what I want figure out is how would I write the data to a django model? Any advice is appreciated.</p>
| <python><django><database><excel><model> | 2016-06-24 17:43:17 | HQ |
38,019,570 | How can I get data from a database to my iOS app? | <p><strong>I've designed my app in Xcode</strong></p>
<p>But , it doesn't have any data ! And I want to get data from a database .</p>
<p>I don't know where to start ? And what should I use ?</p>
<pre><code>*php , sql , json ?*
</code></pre>
| <database><swift><swift2><xcode7> | 2016-06-24 18:05:13 | LQ_CLOSE |
38,019,788 | PHP & MySQL: Good/efficient of showing statistics from thousands of rows on each page load | <p>I know this is the wrong way to go about it, but I have a database filled with stats about vehicles that are imported from excel files.</p>
<p>For each vehicle(about 100 currently, updated each three days) I have from 500 to 2000 rows of data which is used to build graphs regarding fuel consumption, distance driven etc..
This is fairly simple and it takes from 1 to 3 seconds to load, but I also need the total stats and compare it against each car.</p>
<p>So if I build the graph for car id 1, I want to see the difference between its fuel consumption and the global fuel consumption (of all existing cars).</p>
<p>Is there a way of doing this without querying not only the single car but also all cars on each page load ?</p>
<p>Thank you</p>
| <php><mysql> | 2016-06-24 18:19:03 | LQ_CLOSE |
38,021,661 | Copy multiple files from s3 bucket | <p>I am having trouble downloading multiple files from AWS S3 buckets to my local machine. </p>
<p>I have all the filenames that I want to download and I do not want others. How can I do that ? Is there any kind of loop in aws-cli I can do some iteration ?</p>
<p>There are couple hundreds files I need to download so that it seems not possible to use one single command that takes all filenames as arguments. </p>
| <amazon-web-services><amazon-s3><aws-cli> | 2016-06-24 20:32:19 | HQ |
38,021,899 | What does the "operation name" reference? | <p>I'm learning about GraphQL and I'm very interested in the <code>operation name</code> the part of the query that comes after the <code>query</code> or <code>mutation</code> (depending on the root query type). I found a couple of code examples using the operation name, and I'm confused as to where they come from? There seems to be no references in the code about them, and they seem completely arbitrary.</p>
<pre><code>query Welcome {
echo (email: "hi@example.com")
}
</code></pre>
<p>and</p>
<pre><code>query HeroNameQuery {
hero {
name
}
}
</code></pre>
<p>I don't understand why a given schema can't just contain the queries and types that follow (eg. <code>user</code>, <code>article</code>, <code>order</code>, etc.), and I don't understand the namespacing system and the operation name provides any sort of advantage.</p>
<p><a href="https://github.com/mugli/learning-graphql/blame/master/7.%20Deep%20Dive%20into%20GraphQL%20Type%20System.md#L436" rel="noreferrer">https://github.com/mugli/learning-graphql/blame/master/7.%20Deep%20Dive%20into%20GraphQL%20Type%20System.md#L436</a></p>
<p><a href="http://graphql.org/docs/queries/" rel="noreferrer">http://graphql.org/docs/queries/</a></p>
| <graphql> | 2016-06-24 20:48:25 | HQ |
38,024,591 | parse json array with javascript | I have a mySQL database with a table of Latitudes and longitudes with associated data. I'm trying to create a Google Map and want to parse the JSON string using Javascript. I have looked here and on youtube and I don't know how to solve what I'm doing wrong.
Here is my json string that I get with my echo statement:
{"cm_mapTABLE":[["1","Angels Rest Photos OR","Angels_Rest_Photos_OR","663","aaj.jpg","2","Angel's Rest","Hike one of the trails in the Gorge with a scenic overlook, stream, and waterfall.","0","blue","4.5","45.5603","-122.171","http:\/\/www.eyehike.com\/pgallery\/index.php?\/category\/6","Angels_Rest_Photos_OR\/aae.thumb.jpg\" ALIGN=left HEIGHT=115 WIDTH=150>","http:\/\/www.eyehike.com\/pgallery\/i.php?\/galleries\/Angels_Rest_Photos_OR\/aaj-th.jpg","","","",""],["2","Ape Canyon Photos WA","Ape_Canyon_Photos_WA","681","PICT0114.jpg","3","Ape Canyon Trail","This trail is popular with hikers and mountain bikers with great views of several mountains.","0","blue","11","46.1653","-122.092","http:\/\/www.eyehike.com\/pgallery\/index.php?\/category\/8","Ape_Canyon_Photos_WA\/PICT0114.thumb.jpg\" ALIGN=left HEIGHT=115 WIDTH=150>","http:\/\/www.eyehike.com\/pgallery\/i.php?\/galleries\/Ape_Canyon_Photos_WA\/PICT0114-th.jpg","","","",""]]}
Here is my code:
<!DOCTYPE html>
<head>
<?php
require("phpsqlsearch_dbinfo.php"); // This is the file with your logon info
//$host="localhost"; //replace with your hostname
//$username="root"; //replace with your username
//$password=""; //replace with your password
//$db_name="$database"; //replace with your database
$con=mysqli_connect("$hostname", "$username", "$password", "$database")or die("cannot connect");
//mysqli_select_db("$db_name")or die("cannot select DB");
$sql = "select * from location_markers WHERE mrk_id < 3"; //replace emp_info with your table name
$result = mysqli_query($con, $sql);
$json_string_data = array();
if(mysqli_num_rows($result)){
while($row=mysqli_fetch_row($result)){
$json_string_data['cm_mapTABLE'][]=$row;
}
}
mysqli_close($con);
// You have to give the json a name to make it accessible by JS, e.g.:
// echo 'file='.json_encode($json_string_data),';';
// This statement will echo the json output in the displayed web page
echo json_encode($json_string_data);
// please refer to our PHP JSON encode function tutorial for learning json_encode function in detail
?>
</head>
<body>
<script>
for (i = 0;i < $json_string_data.length;i++){
var javascript_string_data=<?php echo json_encode($json_string_data); ?>;
document.write(cm_mapTABLE.rank[i]);
}
</script>
</body>
</html>
I'm using Firebug and here is the error:
ReferenceError: $json_string_data is not defined
for (i = 0;i < $json_string_data.length;i++){
Could someone please tell me the proper way to refer to elements in my JSON string? Do I need to somehow get the field names in my JSON string?
| <javascript><php><mysql><json><google-maps> | 2016-06-25 03:16:41 | LQ_EDIT |
38,024,613 | Dynamic Tree in C# | <p>Could anybody help me doing this in c# and allow the user to add or remove nodes or is there any library.
Thanks</p>
<p><a href="https://i.stack.imgur.com/L9tEp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L9tEp.jpg" alt="enter image description here"></a></p>
| <c#><winforms><tree> | 2016-06-25 03:20:03 | LQ_CLOSE |
38,025,295 | Popular special characters in git branch names | <p>I'm writing an application where I limit allowed characters in git branch names. Currently the limit is [a-zA-Z0-9/_-]+. What other special characters may be requested by users? I know that / is popular that's why I've included it, is there other such character?</p>
| <git><branch><git-branch> | 2016-06-25 05:25:20 | LQ_CLOSE |
38,026,232 | Why is my code returning true for cases that should return false? | <p>I am writing a code that will import a string of characters from a text file, analyze the string using a stack and determine which "language" the string belongs to based on whether or not it fits certain rules. The code below tests to see if an input follows the pattern (A^nB^)^p (where n is greater than or equal to 0). The way I have it written is to load the first set of A's and B's onto a stack, then load the second set of A's and B's onto another stack, pop the two stacks at the same time and compare the returned values. If they match, move on (until the two stacks empty at the same time, hopefully) if they don't then return false.</p>
<pre><code> public static boolean checkL4(File file) throws IOException
{
Stack stack1 = new Stack();
Stack stack2 = new Stack();
Stack stack3 = new Stack();
boolean firstCompare = true;
boolean bStart = false;
char w = 0;
try (Scanner sc = new Scanner(file).useDelimiter("\\s*"))
{
while (sc.hasNext()){
w = sc.next().charAt(0);
if (w == 0) {
return true;
}
if (w != 'A' && w != 'B')
{
return false;
}
if (w == 'A') {
if(!bStart) {
stack1.push(w);
stack3.push(w);
}
if(bStart && stack2.isEmpty()) {
stack2.push(w);
} else {
if (firstCompare) {
while (!stack1.isEmpty() || !stack2.isEmpty()) {
if (!stack1.isEmpty() && stack2.isEmpty())
{
return true;
}
if (stack1.isEmpty() && !stack2.isEmpty()) {
return false;
} else {
if (stack1.pop() == stack2.pop()) {
return true;
} else {
return false;
}
}
}
stack1.push(w);
firstCompare = false;
} else {
if(stack1.isEmpty()){
while (!stack3.isEmpty() || !stack2.isEmpty()) {
if (stack3.isEmpty() && !stack2.isEmpty()) {
return false;
} else {
if (stack2.isEmpty() && !stack3.isEmpty()) {
return false;
} else {
if (stack3.pop() == stack2.pop()) {
return true;
} else {
return false;
}
}
}
}
stack1.push(w);
}
if (stack3.isEmpty()){
while (!stack1.isEmpty() || !stack2.isEmpty()) {
if (stack1.isEmpty() && !stack2.isEmpty()) {
return false;
} else {
if (stack2.isEmpty() && !stack1.isEmpty()) {
return false;
} else {
if (stack1.pop() == stack2.pop()) {
return true;
} else {
return false;
}
}
}
}
stack1.push(w);
}
}
}
}
if (w == 'B') {
bStart = true;
if(bStart && stack2.isEmpty()) {
stack2.push(w);
}
if(bStart && !stack2.isEmpty()) {
if (!stack1.isEmpty()) {
stack3.push(w);
}
if(!stack3.isEmpty()) {
stack1.push(w);
}
}
}
}
}
return false;
}
</code></pre>
<p>This code works correctly for most inputs (returning true for AB and AABBBAABBB, and returning false for BBAA) but in some cases where it should return false (like ABBA and AABBCCD) it returns true. So why is it returning true for cases that are palindromes and cases where there are non A and non B letters. I know I have a statement in there that states if w (the input) is not and A and not a B, return false. This is worked in similar methods I have written, so why not this one? I have also written this to return false if the two returned values don't match (which they shouldn't if the input is a palindrome).</p>
| <java> | 2016-06-25 07:47:49 | LQ_CLOSE |
38,026,516 | How to build a powerful crawler like google's? | <p>I want to build a crawler which can update hundreds of thousands of links in several minutes.
Is there any mature ways to do the scheduling?
Is distributed system needed?
What is the greatest barrier that limits the performance?
Thx.</p>
| <performance><scrapy><web-crawler><distributed-system> | 2016-06-25 08:27:32 | LQ_CLOSE |
38,027,539 | IF statement with multiple expressions | <p>I'm trying to construct IF statement with multiple conditions but I can't get echo 'TRUE' with this PHP code.</p>
<pre><code><?php
$totalDays = 4;
$startDateL = 'Friday';
$endDateL = 'Monday';
$pickupTime = '12:00:00';
$returnTime = '9:00:00';
if($totalDays == 4 AND
$pickupTime == '12:00:00' AND
$returnTime == '09:00:00' AND
$startDateL == 'Friday' AND
$endDateL == 'Monday') {
echo 'TRUE';
}
?>
</code></pre>
| <php><if-statement> | 2016-06-25 10:39:27 | LQ_CLOSE |
38,027,555 | JAVA class hierarchy: Which of the following lines will not compile? | <p>Having the following class hierarchy:</p>
<pre><code>Interface Animal {β¦}
class Dog implements Animal{β¦}
class Poodle extends Dog {β¦}
class Labrador extends Dog {β¦}
</code></pre>
<p>Which of the following lines will not compile? </p>
<pre><code>Poodle poodle = new Poodle(); //1
Animal animal = (Animal) poodle; //2
Dog dog = new Labrador(); //3
animal = dog; //4
poodle = dog; //5
Animal labrador = new Labrador(); //6
Dog dog2 = new Labrador(); //7
dog 2=labrador;//8
</code></pre>
<p>I think line 5: because of poodle's and dog's static binding.</p>
<p>Line 8 : only static binding is relevant for an assignment .</p>
<p>Am I right? May you give an explanation? </p>
| <java><compiler-errors><hierarchy> | 2016-06-25 10:41:06 | LQ_CLOSE |
38,029,267 | Creating jks keystore with openssl | <p>does anybody know how to create a jks keystore?
I've been looking for ages how to create a jsk keystore for my sava program but every website gives different tutorials.</p>
<p>thx for help
Steff</p>
| <java><ssl><keystore><jks> | 2016-06-25 13:55:17 | LQ_CLOSE |
38,031,012 | segmantaion fault occurs in c program | I'm solving a problem in hacker rank, when I'm running the following code in my local system it's not showing any error but when i submit it's showing segmentation fault.
it accepted the first test case but remaining test cases it is showing segmentation fault.
#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int n,q,i,j;
scanf("%d %d",&n,&q);
int k,l,m,seq,lastAns=0;
int **arr;
arr=(int **) malloc(sizeof(int )*n);
if(!arr) return 0;
arr[0] = (int *) malloc(sizeof(int )*q*n);
for(i = 0; i < n; i++)
arr[i] = *arr + i*q ;
if(!*arr) return 0;
for(i = 0; i < q ; i++)
{
scanf("%d%d%d",&k,&l,&m);
switch (k)
{
case 1: seq= (l^lastAns)%n;
for(j = 0 ; j < q; j++)
{
if(!arr[seq][j])
{
arr[seq][j]=m;
break;
}
}
break;
case 2:
seq= (l^lastAns)%n;
lastAns = arr[seq][m % n];
printf("%d\n", lastAns);
break;
}
}
free(arr[0]);
free(arr);
return 0;
}
thanks in advance. | <c><segmentation-fault> | 2016-06-25 17:19:03 | LQ_EDIT |
38,031,089 | Impact of matrix sparsity on cblas_gemm and cublasSgemm | I have recently discovered that the performance of a cblas_sgemm call for matrix multiplication dramatically improves if the matrices have a "large" number of zeros in them. It improves to the point that it beats its cublas cousin by more than a 100 times. This could be most probably attributed to some **automatic detection of sparsity** and suitable format conversion by cblas_sgemm function.
Unfortunately, no such behavior is exhibited by its cuda counterpart i.e. cublasSgemm.
So, the question is, how can I get the same type of optimization on cublasSgemm for matrices that **may have** a large number of zeros.
And what technique does cblas_sgemm use to automatically adjust to sparse matrices?
Please, do not recommend cuSparse / CUSP etc because
1. I am not sure about the sparsity of input matrices beforehand
2. I am working on an iterative algorithm where for initial few iterations the matrices **may be** sparse but gradually become dense as time goes on.
Thanks in advance | <cuda><ubuntu-14.04><blas><cublas> | 2016-06-25 17:26:05 | LQ_EDIT |
38,031,745 | How to migrate from HTTP/1.1 to HTTP/2 from SEO point of view? | <p>I'm aware that HTTP/2 is using only <code>https</code>.</p>
<p>My existing implementation are all HTTP/1.1 with <code>http</code> protocol for all the urls on the website.</p>
<p>To add HTTP/2 support, without change the html source code, I plan to redirect all <code>http</code> requests to <code>https</code> on the nginx server block level.</p>
<p>With this approach, is there any drawback/impact on search engine indexing and bot crawling?</p>
| <nginx><https><seo><bots><http2> | 2016-06-25 18:37:00 | LQ_CLOSE |
38,033,761 | how can i set value in a select with angularJS | i want set a option from a select getting id, and all others objects to a directive and show it.
Let me explain:
I'm trying edit a object "dynamically"
Here is my obj structure
[
{
nome: "name", //phone company
codigo: "id", //that isn't sequential (14, 16, 29...)
categoria: "category", //cellphone or landline
preco: "price" //float digits
}
]
"Contato" is my contact object, structure:
[
{
nome:"name",
telefone:"1233-1233",
data:"2016-06-25T22:03:21.508Z",
operadora:
{
nome:"name",
codigo:"(code)", -> int
categoria:"category",
preco:"(price)" -> float
},
serial:"<H_ZZ<ET9B" -> randomic ASCII generated
}
]
Price is decorative, all things don't make sense, just for "learning"
Then i call directive:
<ui-accordions>
<ui-accordion ng-repeat="contato in contatos | filter:{nome: criterioBusca} | orderBy:criterioDeOrdenacao:direcaoOrdenacao" username= contato.nome serial= contato.serial telefone= contato.telefone data = contato.data operadora = contato.operadora operadoras=operadoras >
</ui-accordion>
</ui-accordions>
//orderBy:criterioDeOrdenacao: direcaoOrdenacao -> orderBy: orderCritery: orderDirection
//filter:{nome: criterioBusca} -> name: searchCritery
I use directive "uiAccordions" because can open one accordion each
I use directive "uiAccordion" to get params and show with external Url (html file)
My select in html external file (directive use that)
<select class="form-control" ng-model="contatoOperadoras" ng-options="operadoraTemp.nome + ' (' + (operadoraTemp.preco | currency) +')' for operadoraTemp in operadoras | orderBy:'nome'">
<option value=""></option> <!-- This is who i want select -->
</select>
I put that gay in uiAccordion call (look ui declaration)
operadora = contato.operadora
This give me actual operadora object (phone company) of this contato (contact/user)
All this is just learning but i can't solve that. I think if i create other param index and pass in the option tag (value), but how?
I want show like that
<option value=(selected "codigo">(selected {{operadora.nome}})</option>
Sorry for a not grammatical english, but here on my country english is the last language encouraged by authorities (like in high school, like that), i'm learning by myself. Any doubt about code/grammatical, ask =)
Thanks guys.
[]'s
Best regards, Luan
| <javascript><angularjs> | 2016-06-25 23:15:41 | LQ_EDIT |
38,034,131 | SQL Connection without log steal | <p>I'm making a game with a login system which connect to a database, but my source code is not crypted and I worried about if someone decompile my program, he can get the SQL logins and wanted to know how prevent from that?</p>
| <c#> | 2016-06-26 00:22:30 | LQ_CLOSE |
38,034,789 | Getting started with encryption in Objective-C/iOS | <p>I'm starting to learn more about public and private keys with encryption and how security and encryption works. I have been looking on Google for good tutorials about how to secure data and build encryption into iOS applications. Does anyone know of any good open source APIs/code or tutorials that have examples for iOS encryption? Specifically I'm looking to figure out a way to be able to encrypt data send the encrypted data to another device or service and be able to decode that data.</p>
<p>I was looking at <a href="https://github.com/ideawu/Objective-C-RSA" rel="nofollow">this Github repo</a> and under the usage section it shows example of how to encrypt a string with the public key. How would one go about generating that key to be able to encrypt the data?</p>
<p>Any getting started pointers would be much appreciated!</p>
| <ios><security><encryption><cryptography> | 2016-06-26 02:46:15 | LQ_CLOSE |
38,034,991 | How to handle alert having javascript embedded into a button? | <p>I am automating a sharepoint website using webdriver and java, which contains javascript embedded into the button code. </p>
<p>Please find the HTML snippet of the same :</p>
<pre><code><input id="ctl00_ContentPlaceHolder1_btnDelete" class="btn" type="submit" onclick="javascript:return confirm('Please select OK to proceed else Cancel.');" value="Delete" name="ctl00$ContentPlaceHolder1$btnDelete"/>
</code></pre>
<p>Please find my code to handle the same :</p>
<pre><code>String js = "if (window.alert.myAlertText == undefined) {window.alert.myAlertText = null; window.alert = function(msg){ window.alert.myAlertText = msg; };}";
//Click delete button
((JavascriptExecutor) driver).executeScript("arguments[0].click();", driver.findElement(By.xpath(".//*@id='ctl00_ContentPlaceHolder1_btnDelete']")));
((JavascriptExecutor) driver).executeScript("arguments[0].click();", driver.switchTo().alert(), js);
</code></pre>
<p>But i am not able to accept or dismiss alert.</p>
<p>Kindly help!!!!</p>
<p>Snapshot of the button :</p>
<p><a href="http://i.stack.imgur.com/6UL88.jpg" rel="nofollow">Snapshot Alert</a></p>
| <javascript><java><selenium><alert> | 2016-06-26 03:36:04 | LQ_CLOSE |
38,035,170 | error while using ternary operartor, | public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String s = in.nextLine();
String l,b;
for(int i=0;i<(s.length()-2);i++)
{if(i==0)
{l=s.substring(i,i+3);s.substring(i,i+3).compareTo(s.substring(i+1,i+4))>0?
l=s.substring(i,i+3):l=s.substring(i+1,i+4); // assigned values s.substring(i,i+3).compareTo(s.substring(i+1,i+4))<0 ?
b=s.substring(i,i+3):b=s.substring(i+1,i+4); }
why does it show variable i and b not assigned | <java><string> | 2016-06-26 04:18:57 | LQ_EDIT |
38,036,377 | make a div a square in css | how do i make those box divs look like a little box or a square however you want to call them, please, i set #header's width and height and on those it doesn't work...
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>A Page</title>
<link type="text/css" rel="stylesheet" href="css/main.css" />
<!-- GOOGLE FONTS -->
<link href="https://fonts.googleapis.com/css?family=Prompt" rel="stylesheet" />
</head>
<body>
<div id="header">
<div id="search">
<form>
<div id="box" class="text">
<input type="text" placeholder="Search" />
</div>
<div id="box" class="small">
<input type="image" src="" alt="submit" />
</div>
</form>
</div>
<div id="menu">
<a href=""><div id="box" class="big"></div></a>
<a><div id="box" class="small"><img></img></div></a>
<a><div id="box" class="small"><img></img></div></a>
<span id="notifications"></span>
</div>
</div>
<br />
<div id="box" class="big">
</div>
and this is the css i tried:
body{
font-family: 'Prompt', sans-serif;
background: #707070;
}
#header{
background: #e2ecf2;
opacity: 0.87;
border-radius: 30px;
height: 60px;
width: 1000px;
position: fixed;
left: 50%;
top: 25px;
transform: translateX(-50%);
}
#box{
outline: 3px;
outline-style: solid;
outline-color: #d7d7d7;
}
#box .small{
width: 35px;
height: 35px;
}
#box .big{
width: 50px;
height: 50px;
}
#header #search{
margin-left: 37px;
}
#header #search input{
float: left;
margin-left: 20px;
}
pls. i doesn't make any sense... i am litterally crashing here :((
| <html><css> | 2016-06-26 07:56:07 | LQ_EDIT |
38,037,324 | Mobile View of Website | <p>I'm currently developing a site that can be found at <a href="http://bnlfinance.com" rel="nofollow">http://bnlfinance.com</a>, and I'm having issues with bootstrap with wordpress. The homepage, and the posts, do not resize correctly on mobile. The about us page does resize. I'm sure it's something simple, but this is the first website that I've created using wordpress. Thanks in advance for all the help!</p>
| <html><wordpress><twitter-bootstrap><mobile> | 2016-06-26 10:03:43 | LQ_CLOSE |
38,039,147 | How to download visual basic 2008 | <p>I was tired of going to download visual studio. I need to download vb.net . i tried that. but i am confusion about vb.net, Asp.net and .net. Are they related to each other? what are the differences between them ? </p>
| <asp.net><.net><vb.net><visual-studio-2008> | 2016-06-26 13:50:40 | LQ_CLOSE |
38,039,313 | How to perform arithmetic operations inside concatenating string in PHP? | <p>This code:</p>
<pre><code>$a = "100";
echo "abc" . $a - 1;
</code></pre>
<p>prints out <code>-1</code> instead of <code>abc99</code>.</p>
<p>Obvious workaround would be:</p>
<pre><code>$a = "100";
$tmp = $a - 1;
echo "abc" . $tmp;
</code></pre>
<p>But is there a way to calculate <code>$a - 1</code> without creating temporary variable?</p>
| <php><concatenation> | 2016-06-26 14:08:47 | LQ_CLOSE |
38,039,963 | Set default image if img src= null | <pre><code> <img src="<%# ReturnEncodedBase64UTF8(Eval("Data")) %>" style="width:100%; height:30%;"/>
</code></pre>
<p>Hi, I'm new to C# and ASP.NET, I would like to know how do I set the img src to a default img for example ~\images\myimage.png if the img src above return null?</p>
| <c#><asp.net> | 2016-06-26 15:18:23 | LQ_CLOSE |
38,040,099 | What is the correct css for the list of results to show correctly in this situation? | <p>What is the correct css for the list of results to show correctly? Here are the steps to view the results:</p>
<p>1) Navigate to <a href="http://mypubguide.com/good-pubs/east-region" rel="nofollow">http://mypubguide.com/good-pubs/east-region</a></p>
<p>2) Type "Hull" in the search input on the navigation bar and enter</p>
<p>3) Check: You see a list of results but the styling is incorrect, e.g., the anchor tag is not showing the text correctly and other elements look badly formatted.</p>
<p>How do I resolve this?</p>
| <html><css> | 2016-06-26 15:32:01 | LQ_CLOSE |
38,040,282 | Retrieve the tables from sql server management studio from visual studio | I am working with C# Visual studio sql server has back end. This is my code in following code I am trying to retrieve table names based on database name.The command which used that is working perfectly in sql server management studio query builder but when I am running this it showing error "Object reference not set to instance of an object" in following line- cmbAlterAdd1.Items.Add(Reader2["name"].ToString());
I given name because in result column name is coming has name only has shown image. I think I need expert advice to solve this problem please help!!
ConnectionPath = sqlPath;
DBName = databaseName;
SqlConnection con = new SqlConnection(ConnectionPath);
con.Open();
SqlCommand cmd = new SqlCommand("USE "+DBName+" SELECT name FROM sys.Tables", con);
SqlDataReader Reader2 = cmd.ExecuteReader();
while (Reader2.Read())
{
cmbAlterAdd1.Items.Add(Reader2["name"].ToString());
}
con.Close();
[IMAGE LINK][1]
[1]: http://i.stack.imgur.com/xJC7D.jpg | <c#><sql-server> | 2016-06-26 15:49:26 | LQ_EDIT |
38,041,776 | if (!strcmp(a,b)) when it returns value? | If we have the code below, what is the meaning of `!strcmp(a,b)`? We suppose that we work with `strcmp(a,b)`, and as I know if `a = b`, it returns `0`, if `a<b` it returns `-1`, if `a>b` it returns `1`. `!` sign should negate that function, so when it will return value `i`? I'm confused.
for(i=1;i<var;i++)
if(!strcmp(s,anotherVar[i]))
return i;
| <c> | 2016-06-26 18:29:53 | LQ_EDIT |
38,042,075 | Javascript Regex Selector | I need some help with my javascript regex I need a way to select the following:
${user.name}
${user.age}
from the following html:
<!-- language: lang-html -->
<tr>
<td>${user.name}</td>
<td>${user.age}</td>
</tr>
There could be multiple <td> with different values in them and the 'user' part of the string is not always going to be user. it could be anything.
Ideally i would like them back as an array, although at the moment i'll settle for anything.
Thanks in advance,
Tom
| <javascript><html><regex><templates> | 2016-06-26 18:55:34 | LQ_EDIT |
38,042,333 | C++ destructor for class contains array of ptr to objects | <p>For example if we have 2 classes</p>
<pre><code>class A{
int size;
A** arr;
}
class B{
int size;
A** arr;
}
</code></pre>
<p>For A's constructor I wrote:</p>
<pre><code>A::A(){
this->arr=new A* [20];
}
</code></pre>
<p>For B's constructor I wrote:</p>
<pre><code>B:B(){
this->arr=new A* [20];
}
</code></pre>
<p>For A's destroctor I wrote: </p>
<pre><code>A:~A(){
for(int i=0;i<this->size;i++){
delete this->arr[i];
}
delete [] this->arr;
}
</code></pre>
<p>For B's destructor I wrote:</p>
<pre><code> B:~B(){
for(int i=0;i<this->size;i++){
delete this->arr[i];
}
delete [] this->arr;
}
</code></pre>
<p>Note that the size will grow as I put more obj into the arr.
Now my question is, while I am testing, there's nothing wrong, but after the main program returns, it gives me segfault?</p>
| <c++><destructor> | 2016-06-26 19:21:44 | LQ_CLOSE |
38,044,057 | C++ beginner - trying to write a function but getting a identifier...is undefined | I am a student and am tasked with creating a program that will determine if a person is rich or not. My code is below and I keep getting an error that "identifier "isRich" is undefined. Can someone help me figure out where I went wrong? The instructions are:
We want to determine if someone is βrich.β The definition of being rich depends upon a number of factors such as age, number of dependents, amount of debt, etc., as well as other subjective factors.
Write a program that incorporates the use of functions:
In the main() function , display a pleasing banner of your choosing
From the main function, call a user-defined function calcWealth() which prompts the user for his age, amount of cash on hand, number of dependents, and amount of money owed to creditors. You should use an βintβ to represent age and number of dependents but use a βlongβ to represent amount of cash on hand and amount owed.
Next, from the main() function, call a user-defined boolean function, isRich(), which accepts as arguments the age, cash on hand, number of dependents, and amount owed. isRich() will calculate the βtrue cash valueβ and then determine if someone is rich. Here are the criteria for isRich():
The amount owed must be subtracted from the cash on hand to determine a preliminary βtrue cash valueβ
If a person is has no dependents and a true cash value of $1 million or more, he can be considered rich β regardless of age.
If a person is < 40 years old, subtract $150,000 from his true cash value for each dependent (e.g., if a person has three dependents, subtract $450,000)
If a person is 40-50 years old, subtract $75,000 from his true cash value for each dependent
If a person > 50 years old, subtract $25,000 from his true cash value for each dependent
Return the value of βtrueβ to main() is the personβs true cash value >= $1 million; otherwise, return a value of βfalseβ
The main() function receives the boolean value from isRich() and displays a message indicating whether a person is rich or not.
#include "stdafx.h"
#include <iostream> //for input and output
#include "Cusick Project 5.h"
using namespace std;
void calcWealth(int age, long cash, int dependants, long debt)
{
cout << "Please enter your age: ";
cin >> age;
cout << "Please enter the amount of cash on hand: ";
cin >> cash;
cout << "Please enter the amount of dependents you have: ";
cin >> dependants;
cout << "Please enter the amount of money you owe";
cin >> debt;
bool isRich(int *age, long *cash, int *dependants, long *debt);
{
long trueCash;
bool status = false;
trueCash = cash - debt;
if (dependants == 0)
{
if (trueCash >= 1000000)
{
status = true;
}
else
status = false;
}
else if (age < 40)
{
trueCash = trueCash - (dependants * 150000);
if (trueCash >= 1000000)
{
status = true;
}
else
status = false;
}
else if (age > 39 && age < 51)
{
trueCash = trueCash - (dependants * 75000);
if (trueCash >= 1000000)
{
status = true;
}
else
status = false;
}
else
{
trueCash = trueCash - (dependants * 25000);
if (trueCash >= 1000000)
{
status = true;
}
else
status = false;
}
}
}
int main()
{
int age;
long cash;
int dependants;
long debt;
bool status;
cout << "Welcome to the wealth indicator..." << endl;
calcWealth(age, cash, dependants, debt);
if (isRich(status) = true)
{
cout << "Congratulations! We consider you as being \"rich.\"" << endl;
}
else
{
cout << "I am sorry! You are not yet \"rich.\"" << endl;
}
} | <c++><boolean> | 2016-06-26 23:18:28 | LQ_EDIT |
38,046,960 | remove all clasees which contain following style | how do i remove all classes which contain the following style...
**HTML**
<div class="viewed" style="background:#F9F0D5">
<div class="left">
<span class="title">My </span>
<p>MPA </p>
</div>
<div class="right">
<span>5</span>
</div>
</div>
**code sample**
document.getElementsByClassName('viewed')[0].style.background:#F9F0D5)[0].remove(); | <javascript><jquery><firefox><greasemonkey> | 2016-06-27 06:13:29 | LQ_EDIT |
38,047,914 | How to send a packed structure in C++ and recieve it in C# | I need to write a client on C++, which would send packed structure to the server. Server must be written on C#. I dont understand, how to convert it in C#. May be you will suggest a better way to do this. | <c#><c++><network-programming> | 2016-06-27 07:14:21 | LQ_EDIT |
38,048,144 | how to add my button in refrence in java? |
i want to add and sub counter but i can only added "add" in R.Java
[![enter image description here][1]][1]and can't added "sub" in R.Java .and i have this error in my program
"btnsub cannot be resolved or is not a field"?
Thank you;
[1]: http://i.stack.imgur.com/R6Gyd.jpg | <java><android> | 2016-06-27 07:27:37 | LQ_EDIT |
38,049,540 | Storing MySQL query result into a PHP array | <p>Looking at all the questions are using the depreciated <code>mysql_fetch_assoc/array,</code> hence I don't think that this is a duplicate question.</p>
<p>I have a MySQL table with 5 columns, </p>
<p><code>ID | NAME | AGE | GENDER | HEIGHT</code></p>
<p>If I want to store the values of <code>NAME, AGE, GENDER</code> in a PHP array, </p>
<pre><code>$query=$mysqli->query("SELECT NAME,AGE,GENDER FROM TableName")
while($result = $query->fetch_assoc()
{
$array = [];
}
</code></pre>
<p>Will my array be stored in the format of
<code>$array=[[Name,Age,Gender],[Name,Age,Gender]]</code>?</p>
<p>If not, what would be my approach in doing this?</p>
| <php><mysql><arrays><mysqli> | 2016-06-27 08:49:27 | LQ_CLOSE |
38,051,230 | string does not exsist in current context | string declared inside class MyClass(TransactionId And pnrno)
is not working in button click
> ERROR MESSAGE
> the name (TransactionId And pnrno) does not exsist in current context
class MyClass
{
public string TransactionID { get; set; }
public string pnrno { get; set; }
public string trainno { get; set; }
public string dateofbooking { get; set; }
public string className { get; set; }
public string Quota { get; set; }
public string text { get; set; }
}
protected void btnsave_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=logistics.jayom.org,1434;Initial Catalog=logistics_kl;User ID=kl_admin;Password=Admin@2222");
SqlCommand cmd = new SqlCommand("insert into testfbhv (TransactionId, pnrno) values('" + TransactionID + "','" + pnrno + "')", con);
con.Open();
cmd.ExecuteNonQuery();
con.Close();
}
| <c#> | 2016-06-27 10:10:47 | LQ_EDIT |
38,054,747 | Running chmod command as root with "." | <pre><code>Line#1 pwd
Line#2 /Users/jigarnaik/Documents/test
Line#3 sh-3.2# chown -R jigarnaik .
</code></pre>
<p>What will be the effect of line no 3 ?
Will it change owner of the entire device in linux OS OR
the current folder and it's sub-folders OR
all the folders and files in the path given ?</p>
<p>I ran the command as root </p>
| <linux> | 2016-06-27 13:04:13 | LQ_CLOSE |
38,055,452 | phpmailer undefined variable | <p>Hi i am getting this erorrs but i dont know where the problem is.
IΒ΄ill be grateful for any advice.</p>
<p>Notice: Undefined variable: headers in C:\wamp\www\restaurace\kongresform.php on line 59</p>
<p>Notice: Undefined variable: messageb in C:\wamp\www\restaurace\kongresform.php on line 72</p>
<pre><code> if (empty($errors)) { //If everything is OK
// send an email
// Obtain file upload vars
// Headers
$headers.= "From: $emailfr \n";
$headers.= "BCC: $emailcc ";
// creates a boundary string. It must be unique
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
// Add the headers for a file attachment
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
"boundary=\"{$mime_boundary}\"";
$messageb.="DobrΓ½ den,<br>\n";
$messageb.="JmΓ©no a pΕijΓmenΓ: <b>".$namefrom."</b><br>\n";
$messageb.="Email: <b>".$email."</b><br>\n";
$messageb.="Prostor pro poznΓ‘mky: ".$message."<br><br>\n";
$messageb.="S pozdravom<br>\n";
$messageb.="tΓ½m Fincentrum Reality<br>\n";
$messageb.="<br>\n";
$messageb.="========================================================================<br>\n";
$messageb.="Tento e-mail byl odeslanΓ½ automaticky z webu. ProsΓm, neodpovΓdejte na nΔj.<br>\n";
$messageb.="========================================================================<br>\n";
$subject="PotvrzenΓ\n";
// PHP Mailer
$mail = new PHPMailer;
//$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'mattoni.resta.test@gmail.com'; // SMTP username
$mail->Password = 'mattonirestaurace'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
$mail->setFrom($emailfr);
$mail->addAddress($to); // Add a recipient
//$mail->addReplyTo('webform@fincentrum.com', 'Information');
//$mail->addCC($emailcc);
$mail->addBCC($emailcc);
//$mail->addAttachment('/var/tmp/file.tar.gz'); // Add attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $subject;
$mail->Body = $messageb;
$mail->CharSet = 'UTF-8';
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
exit("Mail could not be sent. Sorry! An error has occurred, please report this to the website administrator.\n");
//echo 'Mailer Error: ' . $mail->ErrorInfo;
}
else {
echo '<div id="formfeedback"><h3>DΔkujeme za VaΕ‘Γ zprΓ‘vu!</h3><p>'. $thanksmessage .'</p></div>';
unset($_SESSION['yellloForm']);
print_form();
} // end of if !mail
}
</code></pre>
| <php><phpmailer> | 2016-06-27 13:37:25 | LQ_CLOSE |
38,057,499 | Mx record for subdomain | <p>My domain mybasiccrm.com is hosted on hostgator.com</p>
<p>The subdomain tr1.mybasiccrm.com is hosted on tr8.mybasiccrm.com</p>
<p>I have created an MX record on the server tr8 for the domain tr1.mybasiccrm.com but when I check this <a href="http://mxtoolbox.com/SuperTool.aspx?action=mx%3atr1.mybasiccrm.com&run=toolpage" rel="nofollow">http://mxtoolbox.com/SuperTool.aspx?action=mx%3atr1.mybasiccrm.com&run=toolpage</a>
it says that "No Records Exist"</p>
<p>How can I have a proper mx recort for tr1.mybasiccrm.com ?</p>
<p>PS: I can send an email from my gmail account to the address email@tr1.mybasiccrm.com without a problem.</p>
<p>Thank you all!</p>
| <cpanel><mx-record> | 2016-06-27 15:11:39 | LQ_CLOSE |
38,057,604 | iPython how to resize images ? | I am getting confused over all the different iPython datatypes. I wrote a face recognition algorithm in Matlab. I want to redo it it iPython. I am stuck trying to resize my images. How do I do that ? Can someone link me to the things that i need to read to understand the difference in the functions between matlab in ipython ? Like matlab got imresize but python got what ?
**Is there something like import all_matlab_functions so i can ipython in matlab language ?**
I cant believe im struggling so hard. Help ! My code below shows how stupid i am with ipython currently.
%matplotlib inline
import matplotlib.image as mpimg
import glob
import matplotlib.pyplot as plt
image_list = []
for filename in glob.glob('<directory>.pgm'):
im = mpimg.imread(filename)
image_list.append(im) # read all image
from PIL import Image
haha = image_list[1].resize((10 10), resample=0) # try to resize image BUT FAIL | <python><matlab><matplotlib><python-imaging-library> | 2016-06-27 15:17:06 | LQ_EDIT |
38,058,009 | Is there any difference between AES_128_CBC and AES_128_CBC_SHA algoritham? | Is there any difference between AES_128_CBC and AES_128_CBC_SHA algoritham? I have a client document which says AES_128_CBC_SHA algorithm for data encryption. could anybody can share some Library files (.net, C,C#) which does AES_128_CBC_SHA algorithm. I am using LabVIEW for data encryption.
My module will accept encrypted data in AES_128-CBC_SHA algorithm.
| <.net><encryption><aes><labview><encryption-symmetric> | 2016-06-27 15:35:52 | LQ_EDIT |
38,059,301 | Data Conversion from atoi and atof | <p>I am making a record in which I used atoi and atof conversions to convert string into int and float. But the compiler is giving me this error: "[Error] cannot convert 'int*' to 'char*' for argument '1' to 'char* gets(char*)".
The code is:</p>
<pre><code>int main()
{
int ch_id[25];
float ch_gp[25];
struct Data
{
char name[25];
char Fname[25];
int idno;
float Gpa;
};
Data emp;
cout<<"Enter name:";
gets(emp.name);
cout<<"Enter fathers's name:";
gets(emp.Fname);
cout<<"Enter Id number:";
gets(ch_id);
emp.idno=atoi(ch_id);
cout<<"Enter GPA:";
gets(ch_gp);
emp.Gpa=atof(ch_gp);
}
</code></pre>
<p>I tried resolving it but I couldn't figure out the mistake.Help!</p>
| <c++> | 2016-06-27 16:52:59 | LQ_CLOSE |
38,059,328 | using conditional operation in for loop | <p>I need to skip certain part of the code if condition is true, How to do it in php</p>
<pre><code> if ($a==0 && $b==0)
{
//skip this part of the code and exit loop
}
</code></pre>
| <php><if-statement><conditional-statements><logical-operators> | 2016-06-27 16:55:03 | LQ_CLOSE |
38,059,551 | How do you do a post request with xml? | <p>I'm trying to reproduce an post request but the examples of sending a post request include parameters and the example I'm trying to reporduce doesn't show parameters, just xml</p>
| <python> | 2016-06-27 17:09:34 | LQ_CLOSE |
38,059,628 | bash: What are the purposes of the two semicolons in echo? | Can someone explain the meaning of the following bash script? I am mainly confused about the echo usage. What are the purposes of the two semicolons?
for addr in $@; do
for i in $(seq 8 -2 2); do echo -ne "\x${addr:$i:2}"; done
done
| <bash> | 2016-06-27 17:14:07 | LQ_EDIT |
38,059,876 | jquery .attr() to replace href value not workign in Safari browser | My code below is designed to append two query string parameters on all the <a href tags on my page. The code works fine in chrome but does not work on Safari. For some reason on Safari browser it is not appending the parameters. Chrome seems to be working fine. Any ideas why chrome and safari would have different results with these jquery functions? From what i have read it may be related to the way i am using $this in the .each loop.
Looking forward to your help.
$(document).ready(function(){
// function to get query string for given parameter
function GetQueryString( field, url ) {
var href = url ? url : window.location.href;
var reg = new RegExp( '[?&]' + field + '=([^&#]*)', 'i' );
var string = reg.exec(href);
return string ? string[1] : null;
};
var aid = GetQueryString('affiliate'); // returns 'chicken'
var cmp = GetQueryString('campaign'); // returns 'sandwich'
var href_param;
$('a').each(function() {
if ($(this).is('[href*="?"')) {
href_param = '&';
}
else
{
href_param = '?';
}
var $this=$(this);
$this.attr("href",$this.attr("href") + href_param + "affiliate=" + aid + "&campaign=" + cmp);
});
}); | <javascript><jquery> | 2016-06-27 17:29:18 | LQ_EDIT |
38,060,363 | Reading mails through gmail apis | <p>I am trying to build an application which needs to read mails of user once authorised. As a starter, I want to know, whether gmail allows third party applications to do so, if yes, how to get started on it.</p>
| <java><gmail-api> | 2016-06-27 18:01:07 | LQ_CLOSE |
38,060,831 | Passing over variables from a file to another using jQuery/AJAX shows empty result | <p>I want to fetch the list of transactions through jQuery/AJAX so it will update on any page I have that list on, when I update the content of this file I want to use. But I don't want to have the SQL queries in the file that I get through jQuery/AJAX since I use different queries for different pages on my website.</p>
<ul>
<li>The file <strong>transactions.php</strong> contains all the SQL queries that I need. In that file, I also have this line: <code><div id="transactions"></div></code>.</li>
<li>The file <strong>fetch-transactions.php</strong> contains this list I want to show on the page. In it I have 2 globals (you know, <code>global $thevariable</code>) for 2 required variables (<code>$count_transactions</code> (to count the transactions) and <code>$get_transactions</code> (to loop the transactions into the list)) that can be found in transactions.php.</li>
<li>The <strong>javascripts.js</strong> contains all the needed JavaScript codes I have for my website, including this line: <code>$.get(folder_name + 'ajax/fetch-transactions.php', function(s) { $('div#transactions').html(s); });</code></li>
</ul>
<p>As you maybe already have figure out, <strong>s</strong> contains the content of <strong>fetch-transactions.php</strong>.</p>
<p>The thing is that none of the variables I have set globally in <strong>fetch-transactions.php</strong> have any data in them. The are empty! Why is that? Is it because they are not globally set? I don't want to use <code>define</code> as a variable. I don't think that is even possible for fetching data from the database :P</p>
<p>How can I fix this problem?</p>
| <php><jquery><mysql><ajax> | 2016-06-27 18:30:38 | LQ_CLOSE |
38,062,592 | Use Jquery to show an element by its ID | <p>I know this is a simple question but I couldn't find the answer, I know you can use Jquery's show method on a class such as: </p>
<pre><code>$('.class1').show();
</code></pre>
<p>But if I just want to call it on an element but not its entire class, for example with an id name of "am0" how do I do that? I tried:</p>
<pre><code>$("am0").show();
</code></pre>
<p>But this doesn't work. </p>
| <javascript><jquery> | 2016-06-27 20:24:00 | LQ_CLOSE |
38,063,096 | Simple client - server application via REST | <p>How can one build Java application which consists of a client and a server that communicate using REST. I've been thinking to build client using Java FX(because it looks simple) and server as a Java servlet. I am fresh with Java but I am sitting with PHP everyday so I am well awared of MVC pattern but the real question is how to get this done simply in Java? Would you recommend me some framework? The app will be really simple because it will just have only few screens. There sould also be authentication using login and password for users, but thats all! Should I look into Spring maybe? Wouldn't it be overkill?</p>
| <java><rest><model-view-controller><javafx><client-server> | 2016-06-27 20:56:28 | LQ_CLOSE |
38,063,283 | Is there a python 3.x debugger like gdb | <p>I am wondering if there is a python debugger as powerful as gdb, for example at setting breakpoints, stepping into functions, and the like. I have been working with gdb in c and assembly and it has been excellent. SO is there a python debugger like so?</p>
| <python><debugging> | 2016-06-27 21:09:42 | LQ_CLOSE |
38,065,143 | how to get an object (font style, font size, color, borders, lines, cell size) from excel using C#? | how to get an object (font style, font size, color, borders, lines, cell size) from excel using C#? PLEASE HELP! I don't where to start or how to start. | <c#><excel> | 2016-06-28 00:16:01 | LQ_EDIT |
38,065,638 | Hacker accessing PHP function through SSL by using exitant session | <p>A person execute a PHP function through SSL by using curl. I added verification by IP adresse for session and I added HTTPS feature to the website, but even now that not working. I'm using CodeIgniter and I'm a C/C++ programmer, not a very good PHP programmer. Can someone tell me how the person does that?</p>
<p>I try to prevent it, but it wount stop.</p>
| <php><codeigniter><security><session> | 2016-06-28 01:22:34 | LQ_CLOSE |
38,067,165 | Want use animation when display data | <p>How to display data that i retrieved from database using animation like waterfall effect or rolling effect?have no idea how to do it,please give some idea/reference.</p>
| <css><asp.net><webforms> | 2016-06-28 04:39:26 | LQ_CLOSE |
38,067,662 | Python says else has invalid syntax | <p>I'm not sure if it's just because I'm not very good at this but what's happening is I'm trying to get</p>
<pre><code>jug = input('Welcome to the 1-99 site swap generator. Enter a number
between/including 1 and 99 and I will determine whether or not it is possible to juggle it')
juggl = int(jug)
juggle = jug % 3
if juggle = 0
print ("It's very possible to juggle this! Have fun!")
else print("Unfortunately that is not possible :(")
</code></pre>
<p>What's happening is, in 'juggle = 0' it's saying = is being used in the wrong context and then tells me to instead use a colon. However if I were to replace = with a colon</p>
<p>ex.</p>
<pre><code>juggle : 0
</code></pre>
<p>it presents me with an error and instead says else has invalid syntax</p>
| <python><python-3.x> | 2016-06-28 05:23:57 | LQ_CLOSE |
38,068,045 | what is the error C4996 means? | there is a simple case of C++
#include <cstring>
using namespace std;
int main(int argc, _TCHAR* argv[])
{
char str[80];
cout << "θΌΈε
₯εδΈ²οΌ";
gets(str);
cout << "θΌΈε
₯ηεδΈ²οΌ" << str << endl;
return 0;
}
when click running there is a error
"ιθ――1 error C4996: 'gets': This function or variable may be unsafe.
Consider using gets_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details." | <c++><visual-c++> | 2016-06-28 05:54:25 | LQ_EDIT |
38,069,257 | Google Speech API + Flex API | <p>This might be considered a very broad question but, I am trying to introduce speech into a web application built using Flex API.
My initial plan is to introduce something like the Google homepage with a text box and a mic icon which will trigger the speech api on click.</p>
<p>Having done research, I havent found a way yet.</p>
| <apache-flex><speech-to-text><google-speech-api> | 2016-06-28 07:04:12 | LQ_CLOSE |
38,069,373 | Displaying iReport from jFrame by jButton click event | I am using NetBeans 8.0.2. I have already created iReport using iReport5.6.0. After designing I moved it into my existing Java Application project in NetBeans into new folder called **reports**. My jFrame file **reportform.java** is in same project under **appfolder**. I wish to display/preview my already created report by click of a Button on jFrame **reportform.java**. My report is working/displaying fine otherwise in the same project. | <java><jframe><jasper-reports> | 2016-06-28 07:10:37 | LQ_EDIT |
38,070,080 | How do I cout items right below the category? | [image][1]
[1]: http://i.stack.imgur.com/zvKLa.png
Yeah so I guess the question is self evident from the image,I want the output text to be right below its category(eg. ID, name etc.)
Here is the code snippet:
FILE *fp;
fp = fopen("Records.txt","r");
cout<<"Category ID Name Author Quantity Price Rack\n\n";
while(fread(&b,sizeof(b),1,fp)==1){
cout<<b.category<<" "<<b.id<<" "<<b.name<<" "<<b.author<<" "<<b.quantity<<" "<<b.price<<" "<<b.rackno;
cout<<endl<<endl;
}
fclose(fp);
Where "b" is object of class BOOK
Thank YOU! | <c++> | 2016-06-28 07:43:59 | LQ_EDIT |
38,070,336 | How to read the below text file in matlab and plot. I have similar multiple files I need to run over loop to read and plot. Help me | WC-02 18507.0 1115851.0 1092068.3 4239.94 Fault_interpretation_22 1 WC-02
WC-02 18451.0 1114476.0 1091761.0 5012.56 Fault_interpretation_22 1 WC-02 | <matlab> | 2016-06-28 07:56:49 | LQ_EDIT |
38,070,627 | get data from two table from single stored procedure? | i have two tables one is for task and one for alljobs.i am giving departmentid to sp and want to get all the jobid from task table and job table and return all detail of these jobs from jobid table...please tell me if there is any solution.
this is my task table
[![enter image description here][1]][1]
this is my job table
[![enter image description here][2]][2]
[1]: http://i.stack.imgur.com/EWGd5.png
[2]: http://i.stack.imgur.com/TcPBC.png
In task table the parameter department id goes to AssignedToDepartmentId.
In JobId table the parameter depatment id goes to DepartmentId
First get all jobid from both tables by departmentid and then get details of all jobid and return detail of jobid. | <sql><sql-server> | 2016-06-28 08:13:17 | LQ_EDIT |
38,071,856 | overloading >> in class with instream | <p>i have the following code:</p>
<pre><code>class someclass
{
private :
unsinged char a;
public :
...
}
</code></pre>
<p>I want to use </p>
<pre><code>std::istream& operator>>(std::istream &in, someclass &x)
{
in>>x.a;
return in;
}
int main()
{
someclass test;
std::cin>>test;
return 0;
}
</code></pre>
<p>My problem is that, as a user, I want to insert an integer between 0-255. However, it only accepts single chars. How am I supposed to "cast" it to integers only?</p>
<p>Thank you.</p>
<p>Greetings.</p>
| <c++><operator-overloading> | 2016-06-28 09:10:19 | LQ_CLOSE |
38,072,528 | sql query command | i am new on sql and i need to find a command in order to generate a report regarding a table i have:
column1 Tax Amount
350 45 x
6500 53 y
800 25 z
i need to calculate x, y and z. I need to do the math: =IF(column1<=5000,column1+tax,column1) - (in words) i need to calculate x/y/z as the sum of column1+Tax with the options: if column1 is smaller or equal than 5000 then x=column1+tax;
If column1>5000 then x or y or z should have the column1 value as a result.
Can you help me to find the sql query that calculates x or y or z?
Many thanks
| <sql><sum> | 2016-06-28 09:39:24 | LQ_EDIT |
38,073,327 | what should be the regex, if i need the text withing the quotes as one element? | my input string is: apple, orange, "banana,cherry", peach
i need the output as:
apple
orange
banana,cherry
peach | <java><regex> | 2016-06-28 10:12:13 | LQ_EDIT |
38,073,328 | In selenium,If Element is not exists then its takes alot of time to Execute next line of code | Iam Ravi ,Working as Automation Engineer using selenium, I have found one problem with selenium,If Element is not exists in the HTML page or DOM its take a lot of time to find that element more than 5 min after 5 mins its executes next line of code I want if that element not exists in the page it immediately go to the next line of code but it takes more time.In Some cases element exists in page so I did if element exist then come this code otherwise go to else code I have a lot of cases like these so it takes a lot of take to execute complete code,I tried with all possible ways like list ,try and Catch but unable to reduce time,Can you please give any solution for this in selenium.
please give solution for that above problem.
Thanks,
Ravikiran. | <java><selenium> | 2016-06-28 10:12:16 | LQ_EDIT |
38,073,948 | Requires extended permission on facebook for send notification | <p>I am new in developing Facebook App. When i am trying to send user notification and test sent notification on <strong>Graph API Explorer</strong> ,I am getting this error <strong>(#200) Requires extended permission: manage_notifications</strong> .</p>
| <php><facebook-graph-api> | 2016-06-28 10:41:10 | LQ_CLOSE |
38,075,745 | display image and text using division tag rowspan in html | <p>I want to achieve the below format which i could easily do it using TD tags.</p>
<p>But if i have to make use of only div tags(rowspan) how is that possible.
Below is the format.
<a href="https://i.stack.imgur.com/DK8zu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DK8zu.png" alt="enter image description here"></a></p>
| <css><html> | 2016-06-28 12:03:58 | LQ_CLOSE |
38,076,279 | how insert different images into rows of a listview | how can i insert different `imageView` into rows of a `list view`?
I hope that you can help me!
Thanks in advance everybody!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> PLANET ADAPTER:
public abstract class PlanetAdapter extends ArrayAdapter<Planet> implements CompoundButton.OnCheckedChangeListener
{
private List<Planet> planetList = null;
private Context context = null;
ArrayList<Birra> objects;
public boolean Checked;
public PlanetAdapter(List<Planet> planetList, Context context) {
super(context, R.layout.single_listview_item, planetList);
this.planetList = planetList;
this.context = context;
}
public class PlanetHolder {
public TextView planetName;
public TextView distView;
public TextView valuta;
public CheckBox chkBox;
public EditText edit;
public TextView caratteristica;
public boolean checked;
public TextView id;
public ImageView image;
}
@Override
public int getCount() {
return planetList.size();
}
@Override
public Planet getItem(int position) {
return planetList.get(position);
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
View row = convertView;
PlanetHolder holder = null;
if (row == null) {
LayoutInflater inflater = ((Activity) context).getLayoutInflater();
row = inflater.inflate(R.layout.single_listview_item, parent, false);
holder = new PlanetHolder();
holder.planetName = (TextView) row.findViewById(R.id.name);
holder.distView = (TextView) row.findViewById(R.id.dist);
holder.valuta = (TextView) row.findViewById(R.id.valuta);
holder.chkBox = (CheckBox) row.findViewById(R.id.chk_box);
holder.edit = (EditText) row.findViewById(R.id.editText);
holder.caratteristica=(TextView) row.findViewById(R.id.caratteristica);
holder.image=(ImageView) row.findViewById(R.id.ivImage);
holder.edit.setVisibility(View.GONE);
holder.edit.setEnabled(false);
// holder.id = (TextView) row.findViewById(R.id.id);
row.setTag(holder);
} else {
holder = (PlanetHolder) row.getTag();
}
final Planet p = planetList.get(position);
holder.planetName.setText(p.getName());
holder.distView.setText("" + p.getDistance());
holder.valuta.setText("" + p.getValuta());
holder.chkBox.setChecked(p.isSelected());
holder.chkBox.setTag(p);
holder.caratteristica.setText(p.getCaratteristica());
holder.edit.setEnabled(false);
SharedPreferences states = getContext().getSharedPreferences("states", Context.MODE_PRIVATE);
boolean isChecked = states.getBoolean("holder.chkBox" + holder.planetName.getText().toString(), false);
System.out.println(isChecked);
if (isChecked) {
holder.chkBox.setChecked(true);
holder.edit.setVisibility(View.VISIBLE);
holder.edit.setEnabled(true);
SharedPreferences statess = getContext().getSharedPreferences("states", Context.MODE_PRIVATE);
String string = statess.getString("finalHolder.edit" + holder.planetName.getText().toString(), holder.edit.getText().toString().trim());
holder.edit.setText(string);
} else {
holder.chkBox.setChecked(false);
holder.edit.setVisibility(View.GONE);
holder.edit.setEnabled(false);
}
holder.chkBox.setOnCheckedChangeListener(PlanetAdapter.this);
// final BirraHolder finalHolder = birraHolder;
final PlanetHolder finalHolder = holder;
holder.chkBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (finalHolder.chkBox.isChecked()) {
finalHolder.edit.setVisibility(View.VISIBLE);
finalHolder.edit.setEnabled(true);
SharedPreferences states = getContext().getSharedPreferences("states", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = states.edit();
editor.putBoolean("holder.chkBox" + finalHolder.planetName.getText().toString(), true);
editor.commit();
finalHolder.edit.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
p.setQuantitΓ (finalHolder.edit.getText().toString().trim());
SharedPreferences states = getContext().getSharedPreferences("states", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = states.edit();
editor.putString("finalHolder.edit" + finalHolder.planetName.getText().toString(), finalHolder.edit.getText().toString().trim());
editor.commit();
}
});
/* SharedPreferences states = getContext().getSharedPreferences("states", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = states.edit();
editor.putBoolean("holder.chkBox" + finalHolder.planetName.getText().toString(), true);
editor.commit();*/
//Utility.putPizzaItem(p);
//Utility.getPizzaItem(p);
} else {
finalHolder.edit.setVisibility(View.GONE);
finalHolder.edit.setEnabled(false);
finalHolder.edit.setText("");
}
}
});
/*holder.chkBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (finalHolder.chkBox.isChecked()) {
finalHolder.edit.setVisibility(View.VISIBLE);
finalHolder.edit.setEnabled(true);
SharedPreferences states = getContext().getSharedPreferences("states", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = states.edit();
editor.putBoolean("holder.chkBox", true);
//pizzaSelected.put(p.getId(), p);
System.out.println(p.getId());
} else {
finalHolder.edit.setVisibility(View.GONE);
finalHolder.edit.setEnabled(false);
finalHolder.edit.setText(null);
pizzaSelected.remove(p.getId());
}
}
});
*/
/* finalHolder.edit.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
@Override
public void afterTextChanged(Editable s) {
p.setQuantitΓ (finalHolder.edit.getText().toString().trim());
SharedPreferences states = getContext().getSharedPreferences("states", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = states.edit();
editor.putString("finalHolder.edit" + finalHolder.planetName.getText().toString(), finalHolder.edit.getText().toString().trim());
editor.commit();
}
});
*/
// holder.planetName.setText(p.getName());
// holder.distView.setText("" + p.getDistance());
// holder.valuta.setText("" + p.getValuta());
// holder.chkBox.setChecked(p.isSelected());
// holder.chkBox.setTag(p);
// holder.edit.setEnabled(false);
// holder.id.setId(p.getId());
return row;
}
ArrayList<Planet> getBox() {
ArrayList<Planet> box = new ArrayList<Planet>();
for (Planet p : planetList) {
if (p.isSelected())
box.add(p);
}
return box;
}
}
> PLANET:
public class Planet {
private String name;
private String distance;
private String quantitΓ ;
private String valuta;
private String caratteristica;
private boolean selected = false;
//boolean mCheckBoxState;
public String getCaratteristica() {
return caratteristica;
}
public void setCaratteristica(String caratteristica) {
this.caratteristica = caratteristica;
}
public Planet(String name, String distance, String valuta,String caratteristica) {
super();
this.name = name;
this.distance = distance;
this.valuta = valuta;
this.caratteristica=caratteristica;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDistance() {
return distance;
}
public void setDistance(String distance) {
this.distance = distance;
}
public boolean isSelected() {
return selected;
}
public void setSelected(boolean selected) {
this.selected = selected;
}
public String getQuantitΓ () {
return quantitΓ ;
}
public void setQuantitΓ (String quantitΓ ) {
this.quantitΓ = quantitΓ ;
}
public String getValuta() {
return valuta;
}
public void setValuta(String valuta) {
this.valuta = valuta;
}
}
| <java><android><listview><adapter> | 2016-06-28 12:27:19 | LQ_EDIT |
38,076,770 | Why is Python re.sub capture not zero indexed? | <p>When capturing <code>Boiler</code> and <code>1</code> shown below, they are then referenced as \1 and \2. This took me a while to figure out why this was not working as I expected the capture group to be zero indexed. Why is the capture group not zero indexed unlike nearly everything in Python?</p>
<pre><code>string = "BoilerRoom_Boiler_Booster_On"
re.sub('(Boiler)_(\d)', r'\1-\2', string)
Out[21]:
'BoilerRoom_Boiler-1_Booster_On'
</code></pre>
| <python><regex> | 2016-06-28 12:51:30 | LQ_CLOSE |
38,077,426 | How to clear history in browser by using selenium webDriver? | <p>Actually I am using code as shown bellow but, I am getting error like.History.clear is not a function. Build info: version: '2.53.0', revision: '35ae25b', Can anyone help me out. What is the problem in this code?</p>
<pre><code>JavascriptExecutor js=(JavascriptExecutor) driver;
js.executeScript("History.clear();");
</code></pre>
<p>Thanks,
Nagaraj Ediger.</p>
| <javascript> | 2016-06-28 13:20:03 | LQ_CLOSE |
38,077,637 | How to delete last found value in Bash | <p>Say I have a string <code>0.0.25</code>, how do I delete the last part after dot (including it) to make it like <code>0.0</code>? Note that last part can have variable number of digits. </p>
| <linux><bash> | 2016-06-28 13:30:07 | LQ_CLOSE |
38,077,659 | How can i display NO. of songs in place of UILABEL -Objective C | How can i count artist song from itunes library display NO. of songs in place of UILABEL -Objective C | <objective-c><arrays><itunes> | 2016-06-28 13:30:59 | LQ_EDIT |
38,078,322 | Skipping "IF" function when working with structures | <pre><code>#include <stdio.h>
#include <string.h>
#include <stdlib.h>
struct res{
int win;
int defeat;
};
struct tenis_player{
char name[20];
char last_name[20];
int pos;
char hand[10];
struct res comp;
}Ten[20];
int main(){
int i, n;
float comparison, br=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%s",&Ten[i].name);
scanf("%s",&Ten[i].last_name);
scanf("%d",&Ten[i].pos);
scanf("%s",&Ten[i].hand);
scanf("%d/%d",&Ten[i].comp.win,&Ten[i].comp.defeat);
}
printf("Results:\n");
for(i=0; i<n; i++){
comparison = Ten[i].comp.win/Ten[i].comp.defeat;
if(Ten[i].hand == "left" && comparison>3){
printf("%s %s %f",Ten[i].name,Ten[i].last_name,comparison);
br++;
printf("\n");}}
if (br==0)
printf("No tenis players");
return 0;
}
</code></pre>
<p>My code keeps skipping the "if(Ten[i].hand == "left" && comparison>3)" and just prints out "No tenis players" no matter what I input.
Any help would be appreciated ! :)</p>
| <c> | 2016-06-28 14:00:30 | LQ_CLOSE |
38,078,358 | Need help pivot columns to rows sql server with count | This is what I am trying to achieve in SQL server but no luck.
I have table as below
ID Start Dt End Dt Count
1 3/1/2016 6/1/2016 3
This is what I need, If Count column is 3 then I need to generate three rows
ID Start Dt End Dt Count
1 3/1/2016 4/1/2016 1
1 4/1/2016 5/1/2016 1
1 5/1/2016 6/1/2016 1
Appreciate your help..
| <sql-server><pivot> | 2016-06-28 14:02:02 | LQ_EDIT |
38,078,631 | how to solve bean exception in spring framework? |
package test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import beans.Test;
public class Client
{
public static void main(String args[])
{
ApplicationContext ap=new ClassPathXmlApplicationContext("res/spring.xml");
Test t=(Test)ap.getBean("t");
t.printData();
}
}
βββββββββββββββββββββββββββββββββββ
package beans;
public class Test {
private String name;
private int age;
public Test(String name) {
this.name=name;
}
public Test(int age)
{
this.age=age;
}
public void printData()
{
System.out.println("age="+age);
System.out.println("name="+name);
}
}
βββββββββββββββββββββββββββββββββββ-
**Jun 28, 2016 4:01:06 PM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@138eb89: startup date [Tue Jun 28 16:01:06 IST 2016]; root of context hierarchy
Jun 28, 2016 4:01:06 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [res/spring.xml]
Jun 28, 2016 4:01:06 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@616ca2: defining beans [t]; root of factory hierarchy
Jun 28, 2016 4:01:06 PM org.springframework.beans.factory.support.DefaultListableBeanFactory destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@616ca2: defining beans [t]; root of factory hierarchy
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 't' defined in class path resource [res/spring.xml]: Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)**
βββββββββββββββββββββββββββββββββββ
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd
(http://www.springframework.org/dtd/spring-beans-2.0.dtd)">
<beans>
<bean id="t" class="beans.Test">
<constructor-arg value="vikram" type="java.Lang.String" index="0"/>
<constructor-arg value="123" type="int" index="1"/>
</bean>
</beans>
| <java><spring> | 2016-06-28 14:13:18 | LQ_EDIT |
38,078,711 | How to verify if a date has expired/passed? | <p>I have a column of dates in the format dd mmm'yy (ex: 26 Jun'17).These dates have to be checked if they are expired using Ruby.How can i do that?</p>
<p>Thanks!</p>
| <ruby> | 2016-06-28 14:16:34 | LQ_CLOSE |
38,080,391 | SQL Image field divided by 2 | <p>Could anyone help me on the below please?</p>
<p>I have a field called F1.Images and I need to divide by 2 ONLY when my other field W1.Plex is Duplex else I need to retain the F1.Images count.</p>
<p>Thanks Satya</p>
| <sql> | 2016-06-28 15:28:49 | LQ_CLOSE |
38,085,803 | Is it possible to send mail in ORACLE | <p>Is there any way to send mail in oracle ? Can anyone give an example.</p>
<p>I tried but not working.</p>
| <oracle><smtp> | 2016-06-28 20:34:16 | LQ_CLOSE |
38,086,728 | SQL Server and Azure Websites | <p>I am thinking about putting a SQL Server behind my Azure website. Is the sql server also free when using Windows Azure Websites? </p>
| <azure><azure-web-sites> | 2016-06-28 21:37:31 | LQ_CLOSE |
38,086,922 | round a column in dataframe | <p>I have a dataframe 'dayData' and I am trying to round a zero decimal places one of the columns (the column is called 'trace')</p>
<p>I have tried using the following but with no success:</p>
<pre><code>dayData["trace"] = dayData["trace"].round(0)
</code></pre>
<p>I get the exception:</p>
<pre><code>AttributeError: 'numpy.float64' object has no attribute 'rint'
</code></pre>
<p>Could someone let me know the correct syntax please.</p>
<p>Many thanks</p>
| <python><pandas> | 2016-06-28 21:53:10 | LQ_CLOSE |
38,087,397 | JavaScript Same Event on Multiple Methods | <p>window.addEventListener("mousemove", rotate);</p>
<p>window.addEventListener("mousemove", getAngle);</p>
<p>Here I am adding the same event to different methods. I found out that my getAngle method runs only once when I move the mouse but my rotate method is fine. Is the above code legal; does it add the same event to both methods?</p>
| <javascript> | 2016-06-28 22:37:30 | LQ_CLOSE |
38,087,947 | Send dynamically div image to client mail | <p>i am using html2canvas with barcode to make a dynamically image to specific div with the below function </p>
<pre><code>$(function() {
$("#btnSave").click(function() {
html2canvas($('#printableArea'), {
onrendered: function(canvas) {
var img = canvas.toDataURL()
window.open(img);
}
});
});
});
</code></pre>
<p>The image opens into new winodw in base64
My problem is that i want to send the image to client mail for printing.
The image changes for each client accordingly and is specific </p>
<p>my php file is </p>
<pre><code><?php
include("auth.php");
//message
$message = $_POST['msg'];
$username =$_REQUEST['username'];
$surname =$_REQUEST['surname'];
$name= $_REQUEST['name'];
//mail body - image position, background, font color, font size...
$body = "Dear $surname $name
Thank you for your Pre-registration for Global.
Please print the attached e-ticket with your personal barcode and bring it to the reception of the exhibition.
This barcode includes data about you which is required during registration. Having this barcode will considerably speed up the registration process
Organizing committee.\n".
$body = "Print e-ticket
(http://panosmoustis.netai.net/barcodeimage/E-ticket_2016.pdf) .\n".
$headers='MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html;charset=iso-8859-1' . "\r\n";
$headers .= 'From: <http://panosmoustis.netai.net/>' . "\r\n";
$to = $_POST['mail'];
$subject = "EXPRESS REGISTRATION (Global)";
//mail function
$email = mail($to, $subject, $body, $headers);
if(!$email) {
echo "Error sending email";
} else {
echo "Your email was sent successfully.";
}
?>
</code></pre>
<p>thank you</p>
| <javascript><php><html><html-email> | 2016-06-28 23:35:51 | LQ_CLOSE |
38,088,566 | How does the browser manage it's memory or clean its DOM? | <p>I am learning Backbone and want to better understand how the browser keeps it DOM clean and how to be efficient overall with my code. From my understanding, we use Backbone as a framework to throw on views onto an element that is usually found in the index.html (most of the time being the body tag). The view we throw in uses up the Browser's memory, and because of this, we want to do something like <code>$(body).html('')</code> to erase everything when we switch to another view or no longer need the old view. Is this correct?</p>
| <dom><backbone.js><browser> | 2016-06-29 00:52:05 | LQ_CLOSE |
38,088,610 | PHP int checking not working | <p>Well, I've tried making a rank system but it doesn't seem to work?
I'm new but learning please take it easy on me.
Here is where I check for users info</p>
<p><strong>GetInfo.php</strong>
<pre><code> # Check if user is valid
session_start();
if(!isset($_SESSION['username'])) {
header('location: login.php');
die();
} else {
$my_username = $_SESSION['username'];
}
# Get User Information
$db_get_user = mysqli_query($con, "SELECT * FROM users WHERE username='$my_username'");
# Get The User Information
$row = mysqli_fetch_array($db_get_user);
$my_email = $row['email'];
if($my_rank = $row['rank'] = 0){
echo '000';
}else if($my_rank = $row['rank'] = 1){
echo '111';
}else if($my_rank = $row['rank'] = 2){
echo '222';
}else if($my_rank = $row['rank'] = 3){
echo '333';
}else if($my_rank = $row['rank'] = 4){
echo '444';
}else if($my_rank = $row['rank'] = 5){
echo '555';
}
?>
</code></pre>
| <php> | 2016-06-29 00:57:36 | LQ_CLOSE |
38,090,148 | folowing "What's a Creel?"s tutorial: Can't create a IWICBitmapDecoder, in visual studio 2015 | I've been following "what's a Creel?"'s tutorial for direct 2d. i got to tutorial 8: 'Loading an image'. I didn't have the `spritesheet` object save the pointer to the `Graphics` object as this caused problems with this version of visual studio, so it's passed every time something needing it is called. main point: when i try creating a `IWICBitmapDecoder` with the `wicfactory->CreateDecoderFromFile()` method, i get the following error:
Exception thrown at 0x008C70A7 in Project8.exe: 0xC0000005: Access violation reading location 0x00000000.
and in the Autos i get:
`hr | E_NOINTERFACE No such interface supported.
this | 0x00c1a5c8 {bmp=0x00000000 <NULL> } spritesheet *
wicfactory | 0x00000000<NULL>
wicdecoder | 0xcccccccc{...}`
the code being this:
#pragma once
#include <wincodec.h> //include windowscodecs.lib in the linker input
#include "Graphics.h"
#include <d2d1.h>
#include<string>
class spritesheet {
public:
ID2D1Bitmap* bmp;
spritesheet() {}
spritesheet(LPCWSTR file, graphics* gfx) {
//this->gfx = gfx;
//bmp = NULL;
HRESULT hr;
//create an image factory
IWICImagingFactory *wicFactory;
hr = CoCreateInstance(
CLSID_WICImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
CLSID_WICImagingFactory,
(LPVOID*)&wicFactory
);
//create a decoder
IWICBitmapDecoder *wicdecoder;
hr = wicFactory->CreateDecoderFromFilename(
file,
NULL,
GENERIC_READ,
WICDecodeMetadataCacheOnLoad,
&wicdecoder
);
IWICBitmapFrameDecode* wicframe = NULL;
hr = wicdecoder->GetFrame(0, &wicframe);
IWICFormatConverter *wicconverter = NULL;
hr = wicFactory->CreateFormatConverter(&wicconverter);
hr = wicconverter->Initialize(
wicframe,
GUID_WICPixelFormat32bppPBGRA,
WICBitmapDitherTypeNone,
NULL,
0.0,
WICBitmapPaletteTypeCustom
);
gfx->gettarget()->CreateBitmapFromWicBitmap(
wicconverter,
NULL,
&bmp
);
if (wicdecoder) wicdecoder->Release();
if (wicFactory) wicFactory->Release();
if (wicconverter) wicconverter->Release();
if (wicframe) wicframe->Release();
}
void init(wchar_t * file, graphics * gfx) {
//this->gfx = gfx;
//bmp = NULL;
HRESULT hr;
//create an image factory
IWICImagingFactory* wicFactory;
hr = CoCreateInstance(
CLSID_WICImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
CLSID_WICImagingFactory,
(LPVOID*)&wicFactory
);
//create a decoder
IWICBitmapDecoder* wicdecoder;
hr = wicFactory->CreateDecoderFromFilename(
file,
NULL,
GENERIC_READ,
WICDecodeMetadataCacheOnLoad,
&wicdecoder
);
IWICBitmapFrameDecode* wicframe = NULL;
hr = wicdecoder->GetFrame(0, &wicframe);
IWICFormatConverter *wicconverter = NULL;
hr = wicFactory->CreateFormatConverter(&wicconverter);
hr = wicconverter->Initialize(
wicframe,
GUID_WICPixelFormat32bppPBGRA,
WICBitmapDitherTypeNone,
NULL,
0.0,
WICBitmapPaletteTypeCustom
);
gfx->rendertarget->CreateBitmapFromWicBitmap(
wicconverter,
NULL,
&bmp
);
if (wicdecoder) wicdecoder->Release();
if (wicFactory) wicFactory->Release();
if (wicconverter) wicconverter->Release();
if (wicframe) wicframe->Release();
gfx->rendertarget->DrawBitmap(
bmp,
D2D1::RectF(0.0f, 0.0f, 10, 10), //dest rect
1.0f,
D2D1_BITMAP_INTERPOLATION_MODE::D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, //effect for scaling
D2D1::RectF(0, 0, 10, 10)); //scource rect
}
void draw(graphics *gfx) {
gfx->rendertarget->DrawBitmap(
bmp,
D2D1::RectF(0.0f, 0.0f, 10, 10), //dest rect
1.0f,
D2D1_BITMAP_INTERPOLATION_MODE::D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, //effect for scaling
D2D1::RectF(0, 0, 10, 10)); //scource rect
}
};
now, just to test things, i did put a `ID2D1Bitmap* bmp;` at the start of each method just to see where things got, but the `wicdecoder` error message just changed to a random place in memory. if anyone has ether done this, or followed some other tutorial, or done it on their own, and has been successful, please help. | <c++><visual-studio-2015><direct2d><wic> | 2016-06-29 04:00:20 | LQ_EDIT |
38,090,621 | Command to find Linux terminal of the process | <p>I have pid of a process on linux machine.I want to retrieve the terminal/console on which the standard output is getting displayed. </p>
| <linux> | 2016-06-29 04:48:54 | LQ_CLOSE |
38,091,612 | Why does this variable change in the code? | <p>I wrote a mergesort function in c++. In which a pass wrong value(array out of bound) of upper limit in function.</p>
<pre><code>int a[]={6,5,2,4,6,78,88,76,33,44,54,212,344,56,677};
int n=sizeof(a)/sizeof(a[0]);
printf("n=%d\n",n);
merges(a,0,n); // if should be 'merges(a,0,n-1)'
printf("n=%d\n",n);
</code></pre>
<p>I think in argument only copy of a variable is passed. Original value does not change. but Checking before and after merges() function I got two different values. I can't figure out why?
output:</p>
<pre><code>n=15
n=677
</code></pre>
<p>Here is complete code:</p>
<pre><code>#include<bits/stdc++.h>
using namespace std;
void mergeit(int a[],int l,int mid,int r)
{
int n1=mid-l+1;
int n2=r-mid;
int ll[n1+1];ll[n1]=INT_MAX;
for(int h=0;h<n1;h++)ll[h]=a[l+h];
int rr[n2+1];rr[n2]=INT_MAX;
for(int h=0;h<n2;h++)rr[h]=a[mid+1+h];
int i=0,j=0;
for(int k=l;k<=r;k++)
{
if(ll[i]<rr[j])
{
a[k]=ll[i];i++;
}
else{a[k]=rr[j];j++;}
}
}
void merges(int a[],int l,int r)
{
if(l<r)
{
int mid=(l+r)/2;
merges(a,l,mid);
merges(a,mid+1,r);
mergeit(a,l,mid,r);
}
}
int main()
{
int a[]={6,5,2,4,6,78,88,76,33,44,54,212,344,56,677};
int n=sizeof(a)/sizeof(a[0]);
printf("n=%d\n",n);
merges(a,0,n); //array out of bound- it should be 'merges(a,0,n-1)'
printf("n=%d\n",n);
}
</code></pre>
| <c++><arrays><mergesort> | 2016-06-29 06:10:40 | LQ_CLOSE |
38,092,241 | Javascript help. stuck | <pre><code>var msg = 'Santi Valle';
for(var x = -2; x < (msg.length - 4); x++) {
if (msg.length == 5) {
for(var i = 0; i < 3; i++) {
console.log(i);
}
} else {
for(var i = msg.length; i > (msg.length - 1); i--) {
console.log(i);
}
}
}
</code></pre>
<p>Not sure what i;m doing incorrectly. i'm supposed to predict the outcome. is it undefined?</p>
| <javascript> | 2016-06-29 06:47:50 | LQ_CLOSE |
38,092,744 | Substract two textbox time values and display the result in a third textbox automatically | How would I check time difference from two text-boxes and show the result in third textbox in Javascript?
Two times are in 12 hours format.
![![enter image description here][1]
[1]: http://i.stack.imgur.com/ITcYx.png
| <javascript><jquery><date><time> | 2016-06-29 07:12:47 | LQ_EDIT |
38,092,997 | SQL get the min time record per date | i need a help here, im trying to build a query which returns the max and min time per date in one row for example i have this table:
+---------+------------------------+----------+
|name |Dates |Door |
+---------+------------------------+----------+
|Maria |2012-02-14 09:04:45.397 |Garage |
|Maria |2012-02-14 12:14:20.997 |Enctrance |
|Maria |2013-02-14 12:20:59.407 |Exit |
|Maria |2012-02-13 12:24:20.997 |garage |
|Eli |2013-02-13 10:30:59.407 |Entrance |
|Eli |2013-02-13 12:30:59.407 |Exit |
+---------+------------------------+----------+
the results should be like
+---------+------------------------+-----------------------------+
|name |Entrance |Exit |
+---------+------------------------+-----------------------------+
|Maria |2012-02-14 09:04:45.397 |2013-02-14 12:20:59.407 |
|Maria |2012-02-13 12:14:20.997 | null |
|Eli |2013-02-13 10:30:59.407 |2013-02-13 12:30:59.407 |
+---------+------------------------+-----------------------------+
any help would appreciate :) | <mysql><sql><datetime><max><min> | 2016-06-29 07:26:08 | LQ_EDIT |
38,094,021 | How to do URL encryption in PHP | <p>I am making an application in PHP in which user names are showing in URL like
www.mysite.com/user/shahroze</p>
<p>I want to encrypt the name something like that
www.mysite.com/user/ZxtccQO58</p>
<p>how can i do that to save my sensitive data?</p>
| <php><encryption> | 2016-06-29 08:18:20 | LQ_CLOSE |
38,094,528 | Fix children container width truble | [Width Bug][1]
[1]: http://i.stack.imgur.com/8Y8fM.png
My children view may be a different width, but it not be bigger than parent view.How can i fix it?
| <react-native> | 2016-06-29 08:45:06 | LQ_EDIT |
38,094,791 | When you coding, it is not very often have to write duplicate code? | As shown, the two pieces of code is almost the same, but a little different, each written duplicates a lot of trouble, if you encounter such situations, you are how to solve?
[enter image description here][1]
[enter image description here][2]
[1]: http://i.stack.imgur.com/j6VdG.png
[2]: http://i.stack.imgur.com/fzQha.png | <c++> | 2016-06-29 08:57:33 | LQ_EDIT |
38,097,287 | displaying name and age in same label via JSON | <p>I have been trying to fetch data from JSON to the label of collection view cell. I need to display name and age within a same label and city and distance within a same label just like this.</p>
<p><a href="https://i.stack.imgur.com/umPtn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/umPtn.png" alt="enter image description here"></a>. </p>
<p>I have already done fetching data but by taking different labels for all the four of them. How can i do the same thing in two different labels.</p>
| <ios><objective-c> | 2016-06-29 10:44:05 | LQ_CLOSE |
38,098,054 | Get a list of current running APP in Anrdroid | I want use the ActivityManager to get a list of current APPs and return the newest process` name to the system clipboard.Just like this
protected void onStart() {
super.onStart();
Amanager=(ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
ActivityManager.RunningAppProcessInfo App=null;
List<ActivityManager.RunningAppProcessInfo> RunningTasks;
try {
RunningTasks = Amanager.getRunningAppProcesses();
App = RunningTasks.get(0);
}catch (final Exception e){Log.d(TAG, "List ERROR");}
if(App!=null) {
String result =App.processName;
contentText.setText(result);;
Clipboard.setText(result);
}else {
Log.d(TAG, "COMPONENT ERROR");
}
}
But when running at the Simulator, some errors occured:
java.lang.RuntimeException: Unable to start activity ComponentInfo{//the absolute address}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.EditText.setText(java.lang.CharSequence)' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.j
| <android> | 2016-06-29 11:19:10 | LQ_EDIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.