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
36,679,959
How to present data from a server into graph?
<p>I'm try to make a project by using php:</p> <p>The user input their health data and upload to the server. Assume the server is local host.</p> <p>Now how will I present those data to the user in graph? What is the logic behind that?</p>
<php><html><server>
2016-04-17 17:43:06
LQ_CLOSE
36,680,036
Error while Installing restart patches when launching android app with Android Studio 2.0
<p>Currently I'm using Android Studio 2.0 and installing my APK into my Samsung device (S6). However, when rebuilding my code and running it again I receive the following error:</p> <pre><code>Error installing cold swap patches: com.android.tools.fd.client.InstantRunPushFailedException: Error creating folder with: run-as com.appcustomer mkdir -p /data/data/com.appcustomer/files/instant-run/inbox Error while Installing restart patches </code></pre> <p>Does anyone have any idea what this issue is?</p>
<java><android><android-studio-2.0>
2016-04-17 17:49:43
HQ
36,680,153
How can I check if sp package (R software) is installed on my Linux and how can I install it?
<p>I have installed R on my Linux machine. Whenever I type </p> <pre><code>&gt; library(ps) </code></pre> <p>I get </p> <pre><code>Error in library(ps) : there is no package called ‘ps’ </code></pre> <p>How can I check if sp package (R software) is installed on my Linux and how can I install it? </p>
<r><linux><sp>
2016-04-17 17:59:51
LQ_CLOSE
36,680,389
C++ Using enum in a Class to specify value options for user input
I'm new to the implementation of enum, but have an idea on how it's supposed to be used. I have the bellow Allergy program to record information about an allergy provided by user input. I want to add another option for the user to select the "severity" of the allergy. I want to create an enum to hold the values the user should choose from. Here is what I have so far, but I'm just ignorant when it comes to enum and just how exactly it should be implemented. Thanks in advance for any help!! Allergy.hpp: #ifndef Allergy_hpp #define Allergy_hpp #include <iostream> #include <string> #include <list> using namespace std; class Allergy { public: enum severity {mild, moderate, severe}; Allergy(); Allergy(string, string, list <string>); ~Allergy(); //getters string getCategory() const; string getName() const; list <string> getSymptom() const; private: string newCategory; string newName; list <string> newSymptom; }; #endif /* Allergy_hpp */ Allergy.cpp: include "Allergy.hpp" Allergy::Allergy(string name, string category, list <string> symptom){ newName = name; newCategory = category; newSymptom = symptom; } Allergy::~Allergy(){ } //getters string Allergy::getName() const{ return newName; } string Allergy::getCategory() const{ return newCategory; } list <string> Allergy::getSymptom() const{ return newSymptom; } main.cpp: #include <iostream> #include <string> #include "Allergy.hpp" using namespace std; int main() { string name; string category; int numSymptoms; string symptHold; list <string> symptom; cout << "Enter allergy name: "; getline(cin, name); cout << "Enter allergy category: "; getline(cin, category); cout << "Enter number of allergy symptoms: "; cin >> numSymptoms; for(int i = 0; i < numSymptoms; i++){ cout << "Enter symptom # " << i+1 << ": "; cin >> symptHold; symptom.push_back(symptHold); } Allergy Allergy_1(name, category, symptom); cout << endl << "Allergy Name: " << Allergy_1.getName() << endl << "Allergy Category: " << Allergy_1.getCategory() << endl << "Allergy Symptoms: "; for(auto& s : Allergy_1.getSymptom()){ cout << s << ", "; } cout << endl; return 0; }
<c++><class><input><enums>
2016-04-17 18:19:56
LQ_EDIT
36,680,402
TypeError: only length-1 arrays can be converted to Python scalars while plot showing
<p>I have such Python code:</p> <pre><code>import numpy as np import matplotlib.pyplot as plt def f(x): return np.int(x) x = np.arange(1, 15.1, 0.1) plt.plot(x, f(x)) plt.show() </code></pre> <p>And such error:</p> <pre><code>TypeError: only length-1 arrays can be converted to Python scalars </code></pre> <p>How can I fix it?</p>
<python><numpy>
2016-04-17 18:21:42
HQ
36,681,078
Angular 2 Date deserialization
<p>I have an Angular 2 application. A service is requests data from an api that returns the results like the following:</p> <pre><code>{ "data":[ {"id":1,"timestamp":"2016-04-17T19:52:53.4510935+01:00","sourceDatabaseServer":"127.0.0.1","sourceDatabaseName":"Database1","targetDatabaseServer":"192.168.99.101","targetDatabaseName":"Database2"}, {"id":2,"timestamp":"2016-04-17T19:52:53.4510935+01:00","sourceDatabaseServer":"127.0.0.2","sourceDatabaseName":"Database3","targetDatabaseServer":"192.168.99.102","targetDatabaseName":"Database4"}, {"id":3,"timestamp":"2016-04-17T19:52:53.4510935+01:00","sourceDatabaseServer":"127.0.0.3","sourceDatabaseName":"Database5","targetDatabaseServer":"192.168.99.103","targetDatabaseName":"Database6"} ] } </code></pre> <p>My Angular 2 service looks like this (I've cut the error handling for brevity as we're on the happy path here):</p> <pre><code>getList() : Observable&lt;SomeModel[]&gt; { return this._http.get(this._getListUrl).map(this.extractData); } private extractData(res: Response) { return res.json().data || {}; } </code></pre> <p>and my component like this:</p> <pre><code>results: SomeModel[]; errorMessage: string; ngOnInit() { this._someService.getList() .subscribe( results =&gt; this.results = results, error =&gt; this.errorMessage = &lt;any&gt;error); } </code></pre> <p>and my model like this:</p> <pre><code>export class SomeModel { constructor( public id: number, public timestamp: Date, public sourceDatabaseServer: string, public sourceDatabaseName: string, public targetDatabaseServer: string, public targetDatabaseName: string ) { } } </code></pre> <p>Everything looked like it was working however when I tried to display timestamp using the DatePipe like so <code>{{item.timestamp | date:'short'}}</code> the application blows up with the following error message:</p> <pre><code>Invalid argument '2016-04-17T19:40:38.2424240+01:00' for pipe 'DatePipe' in [{{result.timestamp | date:'short'}} </code></pre> <p>After some investigation I believe that timestamp is not actually being converted to the <code>Date</code> type but is instead just being set a <code>string</code>. I'm guessing this is becuase the <code>Date</code> type isn't known at the time <code>Response.json()</code> is called? or am I missing something else entirely? Is there a fix or work around for this? </p>
<typescript><angular><rxjs>
2016-04-17 19:18:53
HQ
36,681,250
c++ read files from folder and save it to vector of strings
I am trying to read textfiles from an folder and save the names to a vector of strings. This is my code by now. I can compile and run it, but it is not saving my files to the vector. int main(){ Data Dataset; WIN32_FIND_DATA FindFileData; HANDLE hFind; // Find the first file in the directory. hFind = FindFirstFile(LPCTSTR("C:\\Users\\bla\\Desktop\\c++\\data\\*"), &FindFileData); if (hFind == INVALID_HANDLE_VALUE) { cout<<"ERROR"<<endl; } else{ while (FindNextFile(hFind, &FindFileData) != 0) { if(FindFileData.cFileName=="*.txt") { Dataset.name.push_back(FindFileData.cFileName); } cout<<FindFileData.cFileName<<endl; } FindClose(hFind); } for(int i=0; i<Dataset.name.size(); i++){ cout<<Dataset.name[i]<<endl; } } Hope you can help me. Thanks a lot. Peace
<c++><winapi><vector>
2016-04-17 19:34:38
LQ_EDIT
36,681,449
scikit-learn return value of LogisticRegression.predict_proba
<p>What exactly does the <code>LogisticRegression.predict_proba</code> function return?</p> <p>In my example I get a result like this:</p> <pre><code>[[ 4.65761066e-03 9.95342389e-01] [ 9.75851270e-01 2.41487300e-02] [ 9.99983374e-01 1.66258341e-05]] </code></pre> <p>From other calculations, using the sigmoid function, I know, that the second column are probabilities. The <a href="http://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html#sklearn.linear_model.LogisticRegression.predict_proba" rel="noreferrer">documentation</a> says, that the first column are <code>n_samples</code>, but that can't be, because my samples are reviews, which are texts and not numbers. The documentation also says, that the second column are <code>n_classes</code>. That certainly can't be, since I only have two classes (namely <code>+1</code> and <code>-1</code>) and the function is supposed to be about calculating probabilities of samples really being of a class, but not the classes themselves.</p> <p>What is the first column really and why it is there?</p>
<python><machine-learning><scikit-learn><probability><logistic-regression>
2016-04-17 19:52:40
HQ
36,681,685
C index in string inside array
<p>How can I access char from strings inside array of strings in index 1, but with pointer way I mean this way *(abc + i) for e.g:</p> <pre><code>int main(int argc, char** argv)// argc =2, argv = file name and "abcd" { printf("%c",____)//&lt;--- here i want b from argv ... } </code></pre>
<c><pointers><argv><argc>
2016-04-17 20:14:15
LQ_CLOSE
36,681,766
Im having issues in running my code , css please help me
<style> *{ z-index: 1; } body { margin: 0;} #product { height: 35em; background: #000; color: #fff; } #product ul { padding: 0; } #product ul li { height: 35em; width: 25%; float:left; background-color: red; position: relative; } #product p { position: relative; top: 40%; z-index: 15; } #product h1 { text-align: center;} #pos { position: absolute; z-index: 3; background-color:rgba(0, 0, 0,1); } #ovrl { background: rgba(0, 0, 0, .5); height: 35em; width: 100%; position: absolute; z-index: 2; } </style> </head> <body> <div id="product"> <div id = "pos"> <h1>Why Choose Us</h1> <hr> </div> <ul> <li ><p>Customized<br>Software</p></li> <li><p>Workshop</p></li> <li><p>Digital<br>Advertising</p></li> <li><p>E-learning</p</li> </ul> <div id="ovrl"></div> </div> </body> when i remove the code #product ul li{ position : realtive; } then text is fully white but when it;s present in the code text is not white. And another problem when i ONLY remove *{ z-index :1; } then also it works fine. But i cannot understand why. i need help please anyone solve my problem .
<html><css>
2016-04-17 20:21:30
LQ_EDIT
36,682,075
echo OOP php method
<p>I had one lesson in OOP which included messaging between classes. On the tutorial, the guy just showed var_dump output version of that. I wanted to play with the code and change from var_dump to echo output, because it would me more useful in future. I just couldn't find any solution so you guys are my only option. Here's the code.</p> <pre><code>&lt;?php class Person { protected $name; public function __construct($name) { $this-&gt;name = $name; } public function getName() { return $this-&gt;name; } } class Business { // adding Staff class to Business public function __construct(Staff $staff) { $this-&gt;staff = $staff; } // manual hire(adding Person to Staff) public function hire(Person $person) { // add to staff $this-&gt;staff-&gt;add($person); } // fetch members public function getStaffMembers() { return $this-&gt;staff-&gt;members(); } } class Staff { // adding people from Person class to "member" variable protected $members = []; public function __construct($members = []) { $this-&gt;members = $members; } // adding person to members public function add(Person $person) { $this-&gt;members[] = $person; } public function members() { return $this-&gt;members; } } // you can also create an array with this method $bros = [ 'Bro', 'Zdenko', 'Miljan', 'Kesten' ]; // pretty simple to understand this part $employees = new Person([$bros]); $staff = new Staff([$employees]); $business = new Business($staff); var_dump($business-&gt;getStaffMembers()); // or the print_r, it doesn't matter print_r($business-&gt;getStaffMembers()); ?&gt; </code></pre>
<php><oop>
2016-04-17 20:48:45
LQ_CLOSE
36,682,451
Rotating x label text in ggplot
<p>The code below should rotate and align the text labels on the x-axis, but for some reason it don't:</p> <pre><code>ggplot(res, aes(x=TOPIC,y=count), labs(x=NULL)) + scale_y_continuous(limits=c(0,130),expand=c(0,0)) + scale_x_discrete("",labels=c("ANA"="Anatomy","BEH"="Behavior","BOUND"="Boundaries", "CC"="Climate change","DIS"="Disease","EVO"="Evolution", "POPSTAT"="Pop status","POPABU"="Pop abundance", "POPTR"="Pop trend","HARV"="Harvest","HAB"="Habitat", "HABP"="Habitat protection","POLL"="Pollution", "ZOO"="Captivity","SHIP"="Shipping","TOUR"="Tourism", "REPEC"="Reprod ecology","PHYS"="Physiology","TEK"="TEK", "HWC"="HWC","PRED"="Predator-prey","METH"="Methods", "POPGEN"="Pop genetics","RESIMP"="Research impact", "ISSUE"="Other","PROT"="Protection","PA"="Protected areas", "PEFF"="Protection efficiency","MINOR"="Minor")) + theme(axis.text.x=element_text(angle=90,hjust=1)) + geom_bar(stat='identity') + theme_bw(base_size = 16) + ggtitle("Peer-reviewed papers per topic") </code></pre>
<r><ggplot2>
2016-04-17 21:28:43
HQ
36,682,820
Does the setTimeout() function wait until the function is executed before moving on to the next line?
<p>Does the setTimeout() function wait until the function inside of it is executed before moving on to the next line (the line AFTER "setTimeout()")? OR, does setTimeout() just parse through the code while setting the timer for the function to be activated after "x" amount of time? I ask this because I don't know if the "setTimeout()" function just finishes itself by setting a timer for another function before moving on (the function within "setTimeout()" doesn't have to be completed to move on), OR if the "setTimeout()" function stops the next line from executing until "setTimeout()'s" function is completed.</p>
<javascript>
2016-04-17 22:14:48
LQ_CLOSE
36,682,832
Export Tensorflow graphs from Python for use in C++
<p>Exactly how should python models be exported for use in c++?</p> <p>I'm trying to do something similar to this tutorial: <a href="https://www.tensorflow.org/versions/r0.8/tutorials/image_recognition/index.html" rel="noreferrer">https://www.tensorflow.org/versions/r0.8/tutorials/image_recognition/index.html</a></p> <p>I'm trying to import my own TF model in the c++ API in stead of the inception one. I adjusted input size and the paths, but strange errors keep popping up. I spent all day reading stack overflow and other forums but to no avail.</p> <p>I've tried two methods for exporting the graph.</p> <p>Method 1: metagraph.</p> <pre><code>...loading inputs, setting up the model, etc.... sess = tf.InteractiveSession() sess.run(tf.initialize_all_variables()) for i in range(num_steps): x_batch, y_batch = batch(50) if i%10 == 0: train_accuracy = accuracy.eval(feed_dict={ x:x_batch, y_: y_batch, keep_prob: 1.0}) print("step %d, training accuracy %g"%(i, train_accuracy)) train_step.run(feed_dict={x: x_batch, y_: y_batch, keep_prob: 0.5}) print("test accuracy %g"%accuracy.eval(feed_dict={ x: features_test, y_: labels_test, keep_prob: 1.0})) saver = tf.train.Saver(tf.all_variables()) checkpoint = '/home/sander/tensorflow/tensorflow/examples/cat_face/data/model.ckpt' saver.save(sess, checkpoint) tf.train.export_meta_graph(filename= '/home/sander/tensorflow/tensorflow/examples/cat_face/data/cat_graph.pb', meta_info_def=None, graph_def=sess.graph_def, saver_def=saver.restore(sess, checkpoint), collection_list=None, as_text=False) </code></pre> <p>Method 1 yields the following error when trying to run the program:</p> <pre><code>[libprotobuf ERROR google/protobuf/src/google/protobuf/wire_format_lite.cc:532] String field 'tensorflow.NodeDef.op' contains invalid UTF-8 data when parsing a protocol buffer. Use the 'bytes' type if you intend to send raw bytes. E tensorflow/examples/cat_face/main.cc:281] Not found: Failed to load compute graph at 'tensorflow/examples/cat_face/data/cat_graph.pb' </code></pre> <p>I also tried another method of exporting the graph:</p> <p>Method 2: write_graph:</p> <pre><code>tf.train.write_graph(sess.graph_def, '/home/sander/tensorflow/tensorflow/examples/cat_face/data/', 'cat_graph.pb', as_text=False) </code></pre> <p>This version actually seems to load something, but I get an error about variables not being initialized:</p> <pre><code>Running model failed: Failed precondition: Attempting to use uninitialized value weight1 [[Node: weight1/read = Identity[T=DT_FLOAT, _class=["loc:@weight1"], _device="/job:localhost/replica:0/task:0/cpu:0"](weight1)]] </code></pre>
<python><c++><export><tensorflow><deep-learning>
2016-04-17 22:18:13
HQ
36,682,905
Create new column based on partial string matching of other column (several patterns) R
In the post http://stackoverflow.com/questions/19747384/how-to-create-new-column-in-dataframe-based-on-partial-string-matching-other-col there is the answer to this question, but I am not able to apply it to my data. The problem is that in the column "Fertiliser" (strings) the amount of different types of fertiliser. The third number refers to manure. I want to create a new column which only the amount of manure (so then I can do regression analysis against yield). `Fertiliser millet_biomass millet_yield 1: 0-0-0 2659.608 710.6942 2: 0-0-100 2701.044 718.1154 3: 0-0-2700 3415.879 804.0360 4: 0-0-300 2781.639 730.5943 5: 0-0-900 2997.173 760.0136 6: 12-4-0 3703.255 772.1719 7: 12-4-100 3720.247 773.1759 8: 12-4-2700 3950.189 788.6133 9: 12-4-300 3751.400 775.1368 10: 12-4-900 3826.693 780.2623 11: 30-10-0 4180.323 798.2134 12: 30-10-100 4184.229 798.4918 13: 30-10-2700 4217.044 800.9312 14: 30-10-300 4187.014 798.6570 15: 30-10-900 4194.873 799.2085 16: 6-2-0 3296.274 765.8496 17: 6-2-100 3326.844 767.6693 18: 6-2-2700 3772.058 785.4535 19: 6-2-300 3381.152 760.7330 20: 6-2-900 3517.515 768.3018 21: 90-30-0 4542.924 831.2832 22: 90-30-100 4543.036 831.3983 23: 90-30-2700 4545.037 831.3227 24: 90-30-300 4543.240 831.3921 25: 90-30-900 4543.733 831.3727` Thus, there are five patterns patterns "-0$","-100$","-300$","-900$","270$", which need to be replaced by "0", "100","300","900","2700" I appreciate any help.
<r><pattern-matching>
2016-04-17 22:26:47
LQ_EDIT
36,683,388
I got some problems with 2 programs im working on
<p>i have been working on 2 programs:</p> <pre><code> void neg_zero(char* x) { if (*x &lt; 0) { x = 0; } } </code></pre> <p>this code above men't to check if a char that x point to is negative and if is negative the code will zero x.</p> <p>second code: </p> <pre><code> void weirdFunc(int* a, int * b) { **if (a == b)** { **a = a + b;** } else { **b = a - b;** } } void main() { int a = 0, y=0; int* x = NULL; x = &amp;a; a = 6; y = 5; **weirdFunc(x, y);** **printf("%d \n%d \n", x, y);** } </code></pre> <p>this function receive two pointers to int and them like that: if the two numbers equals it puts in the first parameter their combining. if the two numbers are different it put in the second parameters their difference.</p> <p>now the second function made in a very specific demand so if you can change only the marker'd parts (**).</p> <p>Thank you all! </p>
<c>
2016-04-17 23:35:25
LQ_CLOSE
36,683,533
Server-side warning: Aggregation query used without partition key
<p>While using the C/C++ driver of Cassandra, I at times see these kind of messages popping up in my console:</p> <pre><code>1460937092.140 [WARN] (src/response.cpp:51:char* cass::Response::decode_warnings(char*, size_t)): Server-side warning: Aggregation query used without partition key </code></pre> <p>Wondering whether someone knows what that means. What should I be looking for in my code that could generate this error, or is it just something on the server side that I have no control over?</p>
<c++><cassandra><warnings><cassandra-3.0>
2016-04-17 23:57:11
HQ
36,683,785
'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS
<p>I'm using Visual Studio 2015 and attempting to compile code that has worked before I updated from VS 2013.</p> <p><strong><em>'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS</em></strong></p> <pre><code>partner.sin_addr.s_addr = inet_addr(ip.c_str()); </code></pre> <p>I attempted to use the functions mentioned but they were undefined. I attempted to define the macro in many different spots but nothing happened. Another thread said that I should include Ws2tcpip.h instead of WinSock2 &amp; add Ws2_32.lib. I already have the library added, and when I used the include nothing happened. What is going on?!</p>
<c++><winsock>
2016-04-18 00:37:11
HQ
36,683,951
Generate random number with jinja2
<p>I need to generate a random number between 1 and 50. Aparently the random filter needs a <a href="http://jinja.pocoo.org/docs/dev/templates/#random" rel="noreferrer">sequence</a>. How can I create a list with numbers from 1 to 50 in Jinja? </p> <pre><code>{{ [1,n,50]|random() }} </code></pre>
<python-2.7><flask><jinja2>
2016-04-18 01:04:01
HQ
36,685,675
Unable to telnet to localhost
<p>While trying to telnet to localhost I get the below error</p> <pre><code>telnet localhost 32768 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Trying ::1... telnet: connect to address ::1: Network is unreachable </code></pre>
<linux><telnet><ports>
2016-04-18 04:50:40
LQ_CLOSE
36,685,980
Docker is installed but Docker Compose is not ? why?
<p>I have installed docker on centos 7. by running following commands, </p> <pre><code>curl -sSL https://get.docker.com/ | sh systemctl enable docker &amp;&amp; systemctl start docker docker run hello-world </code></pre> <p><strong>NOTE: helloworld runs correctly and no issues.</strong></p> <p>however when i trying to run docker-compose (docker-compose.yml exists and valid) it gives me the error on Centos only (Windows version works fine for the docker-compose file)</p> <pre><code>/usr/local/bin/docker-compose: line 1: {error:Not Found}: command not found </code></pre>
<docker><docker-compose><dockerfile>
2016-04-18 05:22:17
HQ
36,686,154
What is the best HTML layout technique? DIVs vs Tables
<p>I find using tables as the backbone easier to manipulate, specially when aligning things vertically. But I only seem to find code samples using DIV with heaps of CSS that looks like hacks into the inner workings of CSS.</p>
<html><css><html-table>
2016-04-18 05:37:24
LQ_CLOSE
36,686,512
Explain the out put of this code about Pointers
#include<stdio.h> main() { char *p="Hello world"; int *q; p++; q=(int*)p; q++; printf("\n %s\n%s",p,q); } The output of this program is this: ello world world Can anybody explain how this program works
<c><pointers>
2016-04-18 06:04:55
LQ_EDIT
36,686,547
Property or indexer 'NodaTime.LocalDateTime.Month' cannot be assigned to -- it is read only
<pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Reflection; using System.IO; using NodaTime; namespace MyApp { public partial class MainForm : Form { public class Foo { private LocalDateTime date_time; public Foo(string data) { Int32 i; char[] delimiters = { ',', '/', ':' }; string[] tokens = data.Split(delimiters); if( Int32.TryParse(tokens[0], out i )) { date_time.Month = i; } } }; public MainForm() { InitializeComponent(); } } } </code></pre> <p>The line where I set date_time.Month to i is where I get the error called out in the title - Property or indexer cannot be assigned to -- it is read only. I've searched through many of the similar posts, but wasn't able to find a solution. Any help would be greatly appreciated. Thanks in advance!</p>
<c#><nodatime>
2016-04-18 06:06:58
LQ_CLOSE
36,686,724
Ruby - Check if a particular element in the array starts with a String
So I have this array `a` with values such as `['___', 'abc', 'def']` How can I check if `a[0]` starts with `"___"` ? I have something like this `a[0].start_with?("___")`, but I get an error. I am running Ruby 2.1.8 Cheers!
<arrays><ruby>
2016-04-18 06:19:58
LQ_EDIT
36,687,256
can we compare two files one is having different fields and other is a c fie using shell script?
I am having two files File1: #include<stdio.h> printf,scanf #include<string.h> strcpy,strcat,strlen #include<time.h> time File2.c: > int main > { > char str1[20] = "BeginnersBook"; > printf("Length of string str1: %d", strlen(str1)); > return 0; > } My Question here is, we have to search for the functions of file1(field2) in file2, if exists then we should write the result to different file named as output, it should contain only the filename and the appropriate header file should be there like File2:headerfile1,headerfile2 It is possible to do it with grep and awk.
<c><linux><bash><shell><awk>
2016-04-18 06:56:10
LQ_EDIT
36,687,536
How to open 2 Visual Studio instances, with same Git projects and different branches
<p>I am needing to open 2 Visual Studio instances, one will be opened for me to just look the code of the Project X /Branch 1. Another, will be used to code in the Project X / Branch 2. How to do that and don't loose changes in commit operation? </p>
<git><visual-studio>
2016-04-17 19:32:55
HQ
36,688,022
Removing header column from pandas dataframe
<p>I have the foll. dataframe:</p> <p>df</p> <pre><code> A B 0 23 12 1 21 44 2 98 21 </code></pre> <p>How do I remove the column names <code>A</code> and <code>B</code> from this dataframe? One way might be to write it into a csv file and then read it in specifying header=None. is there a way to do that without writing out to csv and re-reading?</p>
<python><pandas>
2016-04-18 07:40:48
HQ
36,688,278
Unable to setup DKIM TXT-Value as DNS-Record
<p>I have a domain name which DNS is edited via Google Cloud DNS. And I have a Google Apps for Work Account with that domain name.</p> <p>I wanted to set up DKIM-authentication but when I try to save the corresponding TXT-Record I get the error that the Tag is invalid.</p> <p>I did the same before and it worked perfectly. I checked the old setup and I saw that the old DKIM-record was about half the length. The new one seems to be too long for a TXT-record in the Google Cloud Platform.</p> <p>Does anyone have a solution?</p>
<google-apps><google-cloud-dns>
2016-04-18 07:55:50
HQ
36,688,297
Non-consumable In App Purchases for 30k items
**Problem** I am working on app that has 30k digital items . I want to implement **InAppPurchases** for this . So as this is digital content and only once unlock-able/Purchase-able. **What i have already done.** I tried to do this via consumable for same price tier but apple rejected my app and forcing to use **non-consumable. **How to handle the following:** 1 - Do i need to create 30k in App Purchases at iTunes ???? (I read somewhere there is a limit of 10k) 2- Is there a way to reuse one in app purchase for type non-consumable. Thanks in advance.
<ios><in-app-purchase><app-store-connect>
2016-04-18 07:56:38
LQ_EDIT
36,688,356
When should we use '=== ' operator in javascript?
<p>When and why should we use '===' in javascript or jquery. Is it recommended to test string using === and if yes why. I have a code where i am checking a condition on the string like. if(a == "some-thing") is this right or should i use '===' </p>
<javascript><jquery>
2016-04-18 07:59:33
LQ_CLOSE
36,688,871
Which is the best practices to create a responsive table?
<p>I have this sample:</p> <p><a href="http://codepen.io/anon/pen/ONZBgB" rel="nofollow">link</a></p> <p><strong>CODE HTML:</strong></p> <pre><code>&lt;table class="table table-striped"&gt; &lt;thead&gt; &lt;tr&gt; &lt;td&gt;First Name&lt;/td&gt; &lt;td&gt;Last Name&lt;/td&gt; &lt;td&gt;Email&lt;/td&gt; &lt;td&gt;Phone&lt;/td&gt; &lt;td&gt;Adresss&lt;/td&gt; &lt;td&gt;Message&lt;/td&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;John&lt;/td&gt; &lt;td&gt;Smith&lt;/td&gt; &lt;td&gt;jhs@yahoo.com&lt;/td&gt; &lt;td&gt;0766323123&lt;/td&gt; &lt;td&gt;Test&lt;/td&gt; &lt;td&gt;Test&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Ronny&lt;/td&gt; &lt;td&gt;Stuard&lt;/td&gt; &lt;td&gt;ros@yahoo.com&lt;/td&gt; &lt;td&gt;0877223534&lt;/td&gt; &lt;td&gt;Test2&lt;/td&gt; &lt;td&gt;Test2&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>I found this example and want to do something like</p> <p><a href="https://css-tricks.com/examples/ResponsiveTables/responsive.php" rel="nofollow">sample responsive table</a></p> <p>What I do not understand is how CSS code is written. I need a short sample code CSS to turn my table to be like over there.Also if you know better examples to make a table responsive please put here</p> <p>After all that is the best way to make a table responsive?</p> <p>Thanks in advance!</p>
<html><css><twitter-bootstrap>
2016-04-18 08:26:27
LQ_CLOSE
36,691,707
How to declare a property of NSArray of NSObjects in Objective C
<p>I have a custom User class where I am storing user data. For now I have Group class where I want to add Users as an array. Somewhere I seen once something like, but I lost it and can't find.</p> <pre><code> @property (strong, nonatomic) User&lt;NSArray&gt; *groupUsers; </code></pre> <p>Do you know how to make it right syntax?</p> <p>Thanks!</p>
<ios><objective-c>
2016-04-18 10:43:12
LQ_CLOSE
36,693,194
hi,can anyone help how to push the data in xml view into the newly created json model?
can anyone help how to push the data in xml view into the newly created json model,i have created the comboBox and retrieved the data from json model and also created the text area when i select the item in combo box and insert data into the text area and submit a button both the data should be pushed to newly created json model in sapweb ide ui5
<sapui5>
2016-04-18 11:52:03
LQ_EDIT
36,694,057
Display timeline in HTML table
<p>I have this table, which shows the current status of the request. A sample table will look as below in HTML</p> <p><a href="https://i.stack.imgur.com/daDHy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/daDHy.png" alt="enter image description here"></a></p> <p>Table is pretty simple, only issue is how to display that timeline in the status. I won't mind using some grid for same purpose if it shows timeline as below or something similar.</p> <p>Timeline in New Approved In Progress etc.</p>
<jquery><html><css>
2016-04-18 12:29:53
LQ_CLOSE
36,694,473
Apple rejects app because it can't reach my ASP.NET API
I run my own VPS in Amsterdam where I have a MySQL database that is being populated and maintained using ASP.NET. It's a Windows Server. I use this API for four of my existing Android apps (published and working) with a few thousand users who never had any issues connecting to the API through those apps. Recently I finished one of the apps on the iOS platform and it got rejected because Apple couldn't get it to load any content, or it would get stuck on loading without ever returning anything (after we implemented a loading progress animation). After a lot of messaging between me and Apple's review team, they ended up accepting my app to be passed through review even though they never got it to work (or so I believe, they just said they would re-review it and it suddenly got approved after 7 rejects). None of my friends, family or users ever experienced any issues like this on either Android or iOS. A good friend of mine who did most of the work on the API is also from the USA, which makes me doubt it's a location problem. I must note that pretty much 99.99% of my users are Dutch and all my projects are build for Dutch users. Does anyone have experience or ideas in this field? I'm about to publish an update for the already published app and I'm afraid they will reject it because of the same issue. The exact message I got at first was: `Specifically, upon launch we found that the app failed to load any content.`
<ios><api><app-store><review>
2016-04-18 12:48:11
LQ_EDIT
36,695,311
How to use Progress bar in C#?
<p>I have created a windows form for login. On login button click it reads data from a text file for user name and password verification. In this verification duration i want to show a updating Progress bar to the user on login button click. How exactly it should be done ? Please share the snippet for it. P.S.:- Please share the snippet using backgroundworker thread if possible. Thanks in advance.</p>
<c#>
2016-04-18 13:24:32
LQ_CLOSE
36,695,522
Swapping strings
<p>Have written a routine to swap strings , the first routine fails where as the second routine correctly swaps . Need to know the reason for the same they seem to do the same thing not sure why the second one works perfectly not the first .</p> <p><strong>First Method</strong> </p> <pre><code>void swap(char *str1, char *str2) { char *temp = str1; str1 = str2; str2 = temp; } </code></pre> <p><strong>Second Method</strong> </p> <pre><code>void swap(char **str1, char **str2) { char *temp = *str1; *str1 = *str2; *str2 = temp; } </code></pre>
<c><string>
2016-04-18 13:32:31
LQ_CLOSE
36,696,662
How to for loop an image name based on user
<p>I'm trying to for loop the name of the photo in my database based on the username</p> <pre><code>&lt;?php $sql = "SELECT Name FROM images WHERE user=$user"; $result = mysqli_query($con, $sql); $name = $row['Name']; // loop through the array of files and print them all in a list for($index=0; $index &lt; $indexCount; $index++) { $extension = substr($dirArray[$index], -3); if ($extension == 'jpg'){ // list only jpgs echo '&lt;div class="container22"&gt;&lt;img class="testing2 img-thumbnail" src="users/userimg/'.$name.'' . $dirArray[$index] . '" alt="Image" /&gt;&lt;/div&gt;'; } } ?&gt; </code></pre>
<php><mysql>
2016-04-18 14:20:01
LQ_CLOSE
36,698,451
Issue when accessing hash by key
<p>I am doing my first Python project and I have the following code:</p> <pre><code> response = urlopen(request) flights = response.read() text_file = open("Output.txt", "w") text_file.write(flights) text_file.close() minPrice = LARGE_CONSTANT for flight in flights["Quotes"] if(flight["MinPrice"] &lt; minPrice) minPrice = flight["MinPrice"] </code></pre> <p>I am getting this error:</p> <pre><code> for flight in flights["Quotes"] ^ SyntaxError: invalid syntax </code></pre> <p>It seems like a very basic issue, but I'm unable to figure out what's wrong. The hash <code>flights</code> has the following content:</p> <pre><code>{"Quotes":[{"QuoteId":1,"MinPrice":721.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":40074,"DepartureDate":"2016-05-15T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":40074,"DestinationId":60987,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-16T13:58:00"},{"QuoteId":2,"MinPrice":490.0,"Direct":false,"OutboundLeg":{"CarrierIds":[835],"OriginId":50290,"DestinationId":42644,"DepartureDate":"2016-05-14T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":42563,"DestinationId":50290,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-17T21:04:00"},{"QuoteId":3,"MinPrice":596.0,"Direct":false,"OutboundLeg":{"CarrierIds":[835],"OriginId":50290,"DestinationId":42644,"DepartureDate":"2016-05-28T00:00:00"},"InboundLeg":{"CarrierIds":[1710],"OriginId":42644,"DestinationId":50290,"DepartureDate":"2016-05-29T00:00:00"},"QuoteDateTime":"2016-04-07T22:10:00"},{"QuoteId":4,"MinPrice":574.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":42664,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":42664,"DestinationId":60987,"DepartureDate":"2016-05-08T00:00:00"},"QuoteDateTime":"2016-04-13T02:09:00"},{"QuoteId":5,"MinPrice":856.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":42664,"DepartureDate":"2016-05-05T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":42664,"DestinationId":50290,"DepartureDate":"2016-05-10T00:00:00"},"QuoteDateTime":"2016-04-15T23:11:00"},{"QuoteId":6,"MinPrice":741.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1033],"OriginId":60987,"DestinationId":43139,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[1033],"OriginId":43139,"DestinationId":60987,"DepartureDate":"2016-05-16T00:00:00"},"QuoteDateTime":"2016-04-15T16:28:00"},{"QuoteId":7,"MinPrice":729.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":65633,"DestinationId":45676,"DepartureDate":"2016-05-07T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":45676,"DestinationId":60987,"DepartureDate":"2016-05-14T00:00:00"},"QuoteDateTime":"2016-04-07T05:58:00"},{"QuoteId":8,"MinPrice":848.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1033],"OriginId":60987,"DestinationId":47777,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[1033],"OriginId":47777,"DestinationId":60987,"DepartureDate":"2016-05-16T00:00:00"},"QuoteDateTime":"2016-04-09T10:48:00"},{"QuoteId":9,"MinPrice":804.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":49369,"DepartureDate":"2016-05-27T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":49369,"DestinationId":50290,"DepartureDate":"2016-05-30T00:00:00"},"QuoteDateTime":"2016-04-18T09:39:00"},{"QuoteId":10,"MinPrice":576.0,"Direct":false,"OutboundLeg":{"CarrierIds":[838],"OriginId":50290,"DestinationId":49369,"DepartureDate":"2016-05-03T00:00:00"},"InboundLeg":{"CarrierIds":[838],"OriginId":49369,"DestinationId":60987,"DepartureDate":"2016-05-05T00:00:00"},"QuoteDateTime":"2016-04-09T15:12:00"},{"QuoteId":11,"MinPrice":726.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":49793,"DepartureDate":"2016-05-17T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":49793,"DestinationId":60987,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-17T21:30:00"},{"QuoteId":12,"MinPrice":1172.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":50340,"DepartureDate":"2016-05-01T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":50340,"DestinationId":60987,"DepartureDate":"2016-05-04T00:00:00"},"QuoteDateTime":"2016-04-12T15:01:00"},{"QuoteId":13,"MinPrice":666.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1907],"OriginId":65633,"DestinationId":54353,"DepartureDate":"2016-05-10T00:00:00"},"InboundLeg":{"CarrierIds":[1907],"OriginId":54353,"DestinationId":65633,"DepartureDate":"2016-05-21T00:00:00"},"QuoteDateTime":"2016-04-04T01:14:00"},{"QuoteId":14,"MinPrice":802.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":54353,"DepartureDate":"2016-05-18T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":54353,"DestinationId":50290,"DepartureDate":"2016-05-25T00:00:00"},"QuoteDateTime":"2016-04-18T01:59:00"},{"QuoteId":15,"MinPrice":754.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":60987,"DestinationId":59078,"DepartureDate":"2016-05-15T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":59078,"DestinationId":60987,"DepartureDate":"2016-05-22T00:00:00"},"QuoteDateTime":"2016-04-15T01:55:00"},{"QuoteId":16,"MinPrice":1375.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":50290,"DestinationId":59117,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":59117,"DestinationId":50290,"DepartureDate":"2016-05-13T00:00:00"},"QuoteDateTime":"2016-04-06T09:28:00"},{"QuoteId":17,"MinPrice":893.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":50290,"DestinationId":60946,"DepartureDate":"2016-05-10T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":60946,"DestinationId":60987,"DepartureDate":"2016-05-17T00:00:00"},"QuoteDateTime":"2016-04-10T16:56:00"},{"QuoteId":18,"MinPrice":735.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":60987,"DestinationId":65393,"DepartureDate":"2016-05-16T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":65393,"DestinationId":60987,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-16T15:37:00"},{"QuoteId":19,"MinPrice":520.0,"Direct":false,"OutboundLeg":{"CarrierIds":[858],"OriginId":60987,"DestinationId":65465,"DepartureDate":"2016-05-21T00:00:00"},"InboundLeg":{"CarrierIds":[858],"OriginId":65698,"DestinationId":60987,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-09T18:44:00"},{"QuoteId":20,"MinPrice":538.0,"Direct":false,"OutboundLeg":{"CarrierIds":[858],"OriginId":60987,"DestinationId":65465,"DepartureDate":"2016-05-01T00:00:00"},"InboundLeg":{"CarrierIds":[858],"OriginId":65465,"DestinationId":60987,"DepartureDate":"2016-05-03T00:00:00"},"QuoteDateTime":"2016-04-17T17:29:00"},{"QuoteId":21,"MinPrice":602.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1081],"OriginId":60987,"DestinationId":65655,"DepartureDate":"2016-05-03T00:00:00"},"InboundLeg":{"CarrierIds":[1081],"OriginId":65655,"DestinationId":50290,"DepartureDate":"2016-05-12T00:00:00"},"QuoteDateTime":"2016-04-06T19:36:00"},{"QuoteId":22,"MinPrice":580.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1001],"OriginId":60987,"DestinationId":65655,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[1001],"OriginId":65655,"DestinationId":60987,"DepartureDate":"2016-05-25T00:00:00"},"QuoteDateTime":"2016-04-12T06:36:00"},{"QuoteId":23,"MinPrice":494.0,"Direct":false,"OutboundLeg":{"CarrierIds":[835],"OriginId":50290,"DestinationId":65698,"DepartureDate":"2016-05-12T00:00:00"},"InboundLeg":{"CarrierIds":[835],"OriginId":65698,"DestinationId":65633,"DepartureDate":"2016-05-14T00:00:00"},"QuoteDateTime":"2016-04-17T00:26:00"},{"QuoteId":24,"MinPrice":666.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1859],"OriginId":60987,"DestinationId":65698,"DepartureDate":"2016-05-05T00:00:00"},"InboundLeg":{"CarrierIds":[838],"OriginId":65698,"DestinationId":60987,"DepartureDate":"2016-05-17T00:00:00"},"QuoteDateTime":"2016-04-07T12:21:00"},{"QuoteId":25,"MinPrice":733.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1033],"OriginId":60987,"DestinationId":66076,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[1033],"OriginId":66076,"DestinationId":60987,"DepartureDate":"2016-05-16T00:00:00"},"QuoteDateTime":"2016-04-09T06:06:00"},{"QuoteId":26,"MinPrice":5673.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1385],"OriginId":60987,"DestinationId":66270,"DepartureDate":"2016-05-03T00:00:00"},"InboundLeg":{"CarrierIds":[1385],"OriginId":66270,"DestinationId":60987,"DepartureDate":"2016-05-25T00:00:00"},"QuoteDateTime":"2016-04-13T20:36:00"},{"QuoteId":27,"MinPrice":1379.0,"Direct":true,"OutboundLeg":{"CarrierIds":[2058],"OriginId":50290,"DestinationId":66270,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[2058],"OriginId":66270,"DestinationId":50290,"DepartureDate":"2016-05-21T00:00:00"},"QuoteDateTime":"2016-04-13T04:57:00"},{"QuoteId":28,"MinPrice":505.0,"Direct":true,"OutboundLeg":{"CarrierIds":[105],"OriginId":60987,"DestinationId":67662,"DepartureDate":"2016-05-12T00:00:00"},"InboundLeg":{"CarrierIds":[105],"OriginId":67662,"DestinationId":60987,"DepartureDate":"2016-05-20T00:00:00"},"QuoteDateTime":"2016-04-13T10:12:00"},{"QuoteId":29,"MinPrice":551.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":67662,"DepartureDate":"2016-05-20T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":67662,"DestinationId":60987,"DepartureDate":"2016-05-22T00:00:00"},"QuoteDateTime":"2016-04-12T02:42:00"},{"QuoteId":30,"MinPrice":906.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":50290,"DestinationId":68229,"DepartureDate":"2016-05-17T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":68229,"DestinationId":50290,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-17T15:23:00"},{"QuoteId":31,"MinPrice":804.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":70060,"DepartureDate":"2016-05-27T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":70060,"DestinationId":50290,"DepartureDate":"2016-05-31T00:00:00"},"QuoteDateTime":"2016-04-18T14:38:00"},{"QuoteId":32,"MinPrice":618.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":60987,"DestinationId":70060,"DepartureDate":"2016-05-19T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":70060,"DestinationId":60987,"DepartureDate":"2016-05-22T00:00:00"},"QuoteDateTime":"2016-04-09T17:33:00"},{"QuoteId":33,"MinPrice":823.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":70745,"DepartureDate":"2016-05-16T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":70745,"DestinationId":60987,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-16T21:40:00"},{"QuoteId":34,"MinPrice":1129.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1324],"OriginId":60987,"DestinationId":71017,"DepartureDate":"2016-05-23T00:00:00"},"InboundLeg":{"CarrierIds":[1324],"OriginId":71017,"DestinationId":60987,"DepartureDate":"2016-05-27T00:00:00"},"QuoteDateTime":"2016-04-03T21:25:00"},{"QuoteId":35,"MinPrice":798.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":82165,"DepartureDate":"2016-05-10T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":82165,"DestinationId":60987,"DepartureDate":"2016-05-17T00:00:00"},"QuoteDateTime":"2016-04-10T03:23:00"},{"QuoteId":36,"MinPrice":726.0,"Direct":false,"OutboundLeg":{"CarrierIds":[1523],"OriginId":60987,"DestinationId":82398,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[1523],"OriginId":82398,"DestinationId":60987,"DepartureDate":"2016-05-14T00:00:00"},"QuoteDateTime":"2016-04-16T23:32:00"},{"QuoteId":37,"MinPrice":475.0,"Direct":true,"OutboundLeg":{"CarrierIds":[1368],"OriginId":50290,"DestinationId":42563,"DepartureDate":"2016-05-18T00:00:00"},"InboundLeg":{"CarrierIds":[1368],"OriginId":42563,"DestinationId":50290,"DepartureDate":"2016-05-25T00:00:00"},"QuoteDateTime":"2016-04-18T02:26:00"},{"QuoteId":38,"MinPrice":795.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":63721,"DepartureDate":"2016-05-04T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":63721,"DestinationId":60987,"DepartureDate":"2016-05-09T00:00:00"},"QuoteDateTime":"2016-04-17T18:04:00"},{"QuoteId":39,"MinPrice":799.0,"Direct":false,"OutboundLeg":{"CarrierIds":[881],"OriginId":60987,"DestinationId":66217,"DepartureDate":"2016-05-16T00:00:00"},"InboundLeg":{"CarrierIds":[881],"OriginId":66217,"DestinationId":60987,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-10T19:24:00"},{"QuoteId":40,"MinPrice":819.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":82649,"DepartureDate":"2016-05-16T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":82649,"DestinationId":60987,"DepartureDate":"2016-05-23T00:00:00"},"QuoteDateTime":"2016-04-08T13:48:00"},{"QuoteId":41,"MinPrice":773.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":65633,"DestinationId":44620,"DepartureDate":"2016-05-09T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":44620,"DestinationId":65633,"DepartureDate":"2016-05-11T00:00:00"},"QuoteDateTime":"2016-04-08T22:21:00"},{"QuoteId":42,"MinPrice":995.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":47540,"DepartureDate":"2016-05-15T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":47540,"DestinationId":60987,"DepartureDate":"2016-05-24T00:00:00"},"QuoteDateTime":"2016-04-16T13:57:00"},{"QuoteId":43,"MinPrice":6835.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":42843,"DepartureDate":"2016-05-06T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":42843,"DestinationId":60987,"DepartureDate":"2016-05-21T00:00:00"},"QuoteDateTime":"2016-04-17T19:06:00"},{"QuoteId":44,"MinPrice":6826.0,"Direct":false,"OutboundLeg":{"CarrierIds":[],"OriginId":60987,"DestinationId":54367,"DepartureDate":"2016-05-05T00:00:00"},"InboundLeg":{"CarrierIds":[],"OriginId":54367,"DestinationId":60987,"DepartureDate":"2016-05-11T00:00:00"},"QuoteDateTime":"2016-04-13T09:33:00"}],"Places":[{"PlaceId":40074,"IataCode":"ABZ","Name":"Aberdeen","Type":"Station","CityName":"Aberdeen","CityId":"ABER","CountryName":"United Kingdom"},{"PlaceId":42563,"IataCode":"BFS","Name":"Belfast International","Type":"Station","CityName":"Belfast","CityId":"BELF","CountryName":"United Kingdom"},{"PlaceId":42644,"IataCode":"BHD","Name":"Belfast City","Type":"Station","CityName":"Belfast","CityId":"BELF","CountryName":"United Kingdom"},{"PlaceId":42664,"IataCode":"BHX","Name":"Birmingham","Type":"Station","CityName":"Birmingham","CityId":"BIRM","CountryName":"United Kingdom"},{"PlaceId":42843,"IataCode":"BLK","Name":"Blackpool","Type":"Station","CityName":"Blackpool","CityId":"BLAC","CountryName":"United Kingdom"},{"PlaceId":43139,"IataCode":"BRS","Name":"Bristol","Type":"Station","CityName":"Bristol","CityId":"BRIS","CountryName":"United Kingdom"},{"PlaceId":44620,"IataCode":"CAL","Name":"Campbeltown","Type":"Station","CityName":"Campbeltown","CityId":"CAMP","CountryName":"United Kingdom"},{"PlaceId":45676,"IataCode":"CWL","Name":"Cardiff","Type":"Station","CityName":"Cardiff","CityId":"CARD","CountryName":"United Kingdom"},{"PlaceId":47540,"IataCode":"DND","Name":"Dundee","Type":"Station","CityName":"Dundee","CityId":"DUND","CountryName":"United Kingdom"},{"PlaceId":47777,"IataCode":"DSA","Name":"Doncaster Sheffield","Type":"Station","CityName":"Doncaster","CityId":"DONC","CountryName":"United Kingdom"},{"PlaceId":49369,"IataCode":"EDI","Name":"Edinburgh","Type":"Station","CityName":"Edinburgh","CityId":"EDIN","CountryName":"United Kingdom"},{"PlaceId":49793,"IataCode":"EMA","Name":"East Midlands","Type":"Station","CityName":"Nottingham","CityId":"NOTT","CountryName":"United Kingdom"},{"PlaceId":50290,"IataCode":"EWR","Name":"New York Newark","Type":"Station","CityName":"New York","CityId":"NYCA","CountryName":"United States"},{"PlaceId":50340,"IataCode":"EXT","Name":"Exeter","Type":"Station","CityName":"Exeter","CityId":"EXET","CountryName":"United Kingdom"},{"PlaceId":54353,"IataCode":"GLA","Name":"Glasgow International","Type":"Station","CityName":"Glasgow","CityId":"GLAS","CountryName":"United Kingdom"},{"PlaceId":54367,"IataCode":"GLO","Name":"Gloucestershire","Type":"Station","CityName":"Gloucester","CityId":"GLOA","CountryName":"United Kingdom"},{"PlaceId":57113,"IataCode":"HUY","Name":"Humberside","Type":"Station","CityName":"Humberside","CityId":"HUMB","CountryName":"United Kingdom"},{"PlaceId":59078,"IataCode":"INV","Name":"Inverness","Type":"Station","CityName":"Inverness","CityId":"INVE","CountryName":"United Kingdom"},{"PlaceId":59117,"IataCode":"IOM","Name":"Ronaldsway","Type":"Station","CityName":"Castletown","CityId":"CAST","CountryName":"United Kingdom"},{"PlaceId":60946,"IataCode":"JER","Name":"Jersey","Type":"Station","CityName":"Jersey","CityId":"JERS","CountryName":"United Kingdom"},{"PlaceId":60987,"IataCode":"JFK","Name":"New York John F. Kennedy","Type":"Station","CityName":"New York","CityId":"NYCA","CountryName":"United States"},{"PlaceId":63721,"IataCode":"KOI","Name":"Orkney Kirkwall","Type":"Station","CityName":"Orkney","CityId":"ORKN","CountryName":"United Kingdom"},{"PlaceId":65393,"IataCode":"LBA","Name":"Leeds Bradford","Type":"Station","CityName":"Leeds","CityId":"LEED","CountryName":"United Kingdom"},{"PlaceId":65465,"IataCode":"LCY","Name":"London City","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":65633,"IataCode":"LGA","Name":"New York La Guardia","Type":"Station","CityName":"New York","CityId":"NYCA","CountryName":"United States"},{"PlaceId":65655,"IataCode":"LGW","Name":"London Gatwick","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":65698,"IataCode":"LHR","Name":"London Heathrow","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":66076,"IataCode":"LPL","Name":"Liverpool","Type":"Station","CityName":"Liverpool","CityId":"LIVE","CountryName":"United Kingdom"},{"PlaceId":66217,"IataCode":"LSI","Name":"Sumburgh Shetlands","Type":"Station","CityName":"Sumburgh","CityId":"SUMB","CountryName":"United Kingdom"},{"PlaceId":66270,"IataCode":"LTN","Name":"London Luton","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":67662,"IataCode":"MAN","Name":"Manchester","Type":"Station","CityName":"Manchester","CityId":"MANC","CountryName":"United Kingdom"},{"PlaceId":68229,"IataCode":"MME","Name":"Durham Tees Valley","Type":"Station","CityName":"Durham","CityId":"MMEA","CountryName":"United Kingdom"},{"PlaceId":70060,"IataCode":"NCL","Name":"Newcastle","Type":"Station","CityName":"Newcastle","CityId":"NEWC","CountryName":"United Kingdom"},{"PlaceId":70745,"IataCode":"NQY","Name":"Newquay","Type":"Station","CityName":"Newquay","CityId":"NEWQ","CountryName":"United Kingdom"},{"PlaceId":71017,"IataCode":"NWI","Name":"Norwich","Type":"Station","CityName":"Norwich","CityId":"NORW","CountryName":"United Kingdom"},{"PlaceId":82165,"IataCode":"SOU","Name":"Southampton","Type":"Station","CityName":"Southampton","CityId":"SOUT","CountryName":"United Kingdom"},{"PlaceId":82398,"IataCode":"STN","Name":"London Stansted","Type":"Station","CityName":"London","CityId":"LOND","CountryName":"United Kingdom"},{"PlaceId":82649,"IataCode":"SYY","Name":"Stornoway","Type":"Station","CityName":"Stornoway","CityId":"STOR","CountryName":"United Kingdom"},{"PlaceId":91075,"IataCode":"WIC","Name":"Wick","Type":"Station","CityName":"Wick","CityId":"WICK","CountryName":"United Kingdom"},{"PlaceId":3413153,"IataCode":"NYC","Name":"New York","Type":"City","CityName":"New York","CityId":"NYCA"}],"Carriers":[{"CarrierId":105,"Name":"Thomas Cook Airlines"},{"CarrierId":835,"Name":"Air Canada"},{"CarrierId":838,"Name":"Air France"},{"CarrierId":858,"Name":"Alitalia"},{"CarrierId":881,"Name":"British Airways"},{"CarrierId":1001,"Name":"Norwegian"},{"CarrierId":1033,"Name":"Aer Lingus"},{"CarrierId":1081,"Name":"Icelandair"},{"CarrierId":1324,"Name":"KLM"},{"CarrierId":1368,"Name":"Lufthansa"},{"CarrierId":1385,"Name":"EL AL Israel Airlines"},{"CarrierId":1523,"Name":"Austrian Airlines"},{"CarrierId":1710,"Name":"Brussels Airlines"},{"CarrierId":1859,"Name":"Virgin Atlantic"},{"CarrierId":1907,"Name":"WestJet"},{"CarrierId":2058,"Name":"La Compagnie"}],"Currencies":[{"Code":"USD","Symbol":"$","ThousandsSeparator":",","DecimalSeparator":".","SymbolOnLeft":true,"SpaceBetweenAmountAndSymbol":false,"RoundingCoefficient":0,"DecimalDigits":2}]} </code></pre> <p>Why can I not access the hash like this <code>flights["Quotes"]</code>?</p>
<python>
2016-04-18 15:34:37
LQ_CLOSE
36,698,827
Address is not incrementing?
<p>It is said that,in c,b++; is equal to b=b+1; if this is the fact test++ in my code why generate a compile time error. test+1 is working well but test++ is not working.but why?</p> <pre><code>#include&lt;stdio.h&gt; int main(void) { char test[80]="This is a test"; int a=13; for(;a&gt;=0;a--) { printf("%c",*(test++); } } </code></pre>
<c>
2016-04-18 15:53:40
LQ_CLOSE
36,699,708
How do I reference and dereference different data types from void pointer?
<pre><code>void *ptr; int num = 13; char c = 'q'; </code></pre> <p>Without using struct, is it possible to reference 'num' and 'c' and then deference from the void pointer?</p>
<c><pointers><void-pointers>
2016-04-18 16:42:30
LQ_CLOSE
36,700,341
Making a checkers board in python
<p>I am trying to make a 2D array that is 8x8 for a checkers game in python. How would I go about doing this? Here is my current code:</p> <pre><code>class Board(): board = [[]] def __init__(self,width,height): self.width = width self.height = height def __repr__(self): print(self.board) def setup(self): for y in range(self.height): for x in range(self.width): self.board[y].append(0) board = Board(8,8) board.setup() print(board.board) </code></pre>
<python>
2016-04-18 17:16:10
LQ_CLOSE
36,700,531
how reduce memory project console application c#
This is program memory 36.50 MB but I want be less than 32 MB ............................................................................................................................................................... public static void CreateText(string text) { if (Convert.ToInt32(text.Length) <= 80) { int n; string str = ""; string count = ""; char[] mas = text.ToCharArray(); for (int i = 0; i < Convert.ToInt32(mas.Length); i++) { if (int.TryParse(mas[i].ToString(), out n)) { count += mas[i].ToString(); } else { if (String.IsNullOrEmpty(count)) { str += mas[i].ToString(); } else { for (int j = 0; j < Convert.ToInt32(count); j++) { str += mas[i].ToString(); } count = ""; } } } Console.WriteLine(str); } else { Console.WriteLine("Error"); } } } }
<c#><memory>
2016-04-18 17:26:58
LQ_EDIT
36,700,756
Why is ToString() defined on Object in .NET?
<p>I have always wondered the design choices that lead to the creation of ToString on Object in .NET.</p>
<.net><object><inheritance><tostring>
2016-04-18 17:38:34
LQ_CLOSE
36,701,431
Custom loop in Python
<p>Hi i am trying to scrape a part of a website using python. here is code/result I want. Scraping multiple pages.</p> <pre><code>y = 7 print part[y].text print part[(y*2)+2].text print part[(y*4)+4].text print part[(y*6)+6].text print part[(y*8)+8].text print part[(y*10)+10].text </code></pre> <p>Is there any way to use while loop to get the data?</p>
<python><while-loop><web-scraping>
2016-04-18 18:15:48
LQ_CLOSE
36,703,217
Code Elegance: Java Strings
<p>A program that takes the first two characters of a string and adds them to the front and back of the string. Which version is better?</p> <pre><code>public String front22(String str) { if(str.length()&gt;2) return str.substring(0,2)+str+str.substring(0,2); return str+str+str; } </code></pre> <p>or</p> <pre><code>public String front22(String str) { // First figure the number of chars to take int take = 2; if (take &gt; str.length()) { take = str.length(); } String front = str.substring(0, take); return front + str + front; } </code></pre> <p>The former strikes me as more elegant. The latter is easier to understand. Any other suggestions for improvement of either is more than welcome!</p>
<java><string>
2016-04-18 19:58:49
LQ_CLOSE
36,706,406
HTML PHP: IF li element clicked, ORDERBY DESC or ASC
<p>I have a ascending and descending list element within my html. If the user clicks on the ascending li I wish for the products in my SQLi to be shown in ascending order, if descending, descending order. </p> <p>This is what I have come up with, but does not work.</p> <pre><code>&lt;ul align ="center"&gt; &lt;li name="asc" onclick="AscendingProds()"&gt;&lt;a&gt;Ascending to Descending&lt;/a&gt;&lt;/li&gt; &lt;li name="desc" onclick="DescendingProds()"&gt;&lt;a&gt;Descending to Ascending&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;?php AscendingProds(){ $results = $mysqli-&gt;query("SELECT prds ORDER BY price ASC"); } DescendingProds(){ $results = $mysqli-&gt;query("SELECT prds ORDER BY price DESC"); } </code></pre>
<php><html><sql><function>
2016-04-19 00:17:02
LQ_CLOSE
36,710,131
Mailing code giving an error
<p>I am new to php &amp; have tried out some code in php for sending mail to user by some simple means, i am facing some issues as code giving a error..!! please help me.</p> <p><strong>php</strong></p> <pre><code>$to = ' '". $_SESSION['email'] ."' '; $subject = 'Your vault number'; $message = 'Your vault number is '". $_SESSION['vault_no'] ."' '; $headers = 'From: innovation@miisky.com' . "\r\n" . 'Reply-To: innovation@miisky.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); </code></pre>
<php><email>
2016-04-19 06:23:22
LQ_CLOSE
36,710,818
Filtering out letters only and numbers only from dictionary
So basically I have a dictionary called dict_info. Which consists different types of keys. However, I'd like to iterate through these dictionaries then filter out the ones that has ONLY letters and ONLY integers. However if they have both for instance 123456s, 123456q and 123456b. These three key has letters and integers on it. So I'd like to create a json file saving these three key-value. And I'd like to have a space inbetween digits and letters. Like 123456 s, 123456 q, and 123456 b. So output in my json would something like with everything filtered out output: { 123456 q : check 123456 b : check 123456 s : check } def check_if_works(): dict_info = {} dict_info['1234'] = "check" dict_info['12456s'] = "check" dict_info['12456q'] = "check" dict_info['12456b'] = "check" dict_info['123456'] = "check" dict_info['asdftes'] = "check" dict_info['asdftess'] = "check" dict_info['asdftessd'] = "check" arr = [] for key,value in dict_info.iteritems(): try: check_if_digits_only = int(key) check_if_letters_only = key.isalpha() except: new_dict = {} new_dict[key] = value arr.append(new_dict) print arr with open('output.json','wb') as outfile: json.dump(arr,outfile,indent=4) check_if_works()
<python><json><filter>
2016-04-19 07:00:54
LQ_EDIT
36,710,882
Arithmatic Operation in Java
One of the interview question- Assume that i have one arithmatic function which will add two long variable and the return type also long. If pass Long.MaxValue() as argument it wont give perfect result.what will be the solution for that.Code is below- ` public class ArithmaticExample { public static void main(String[] args) { System.out.println(ArithmaticExample.addLong(Long.MAX_VALUE, Long.MAX_VALUE)); } public static long addLong(long a,long b){ return a+b; } } `
<java><core>
2016-04-19 07:04:23
LQ_EDIT
36,714,104
Call from TableView Swift2
I have anything like that http://i.imgur.com/Hmjidup.png I want when I push on the right number call. I try with **tel//:** but don't work. Is possible? Thanks!
<ios><swift><uitableview>
2016-04-19 09:22:41
LQ_EDIT
36,714,335
Unable to print the background text all pages
http://stackoverflow.com/questions/15986216/how-can-i-add-a-large-faded-text-background-via-css/15986317#15986317 Query similar to above. i am printing the page using window.print() if so only one page background the text is printing. how can i print to all pages in my document
<javascript><html><css>
2016-04-19 09:32:50
LQ_EDIT
36,715,375
PHP How to find the occurrence of each and every value in an array
i have this array and i would like to find the number of occurence of every value inside this array $theArray = array(1,1,2,3,3,3,3); I would like to have this result 1=2; 2=1; 3=4 Thanks
<php><arrays>
2016-04-19 10:14:32
LQ_EDIT
36,716,354
Copy a directory when logged in via ssh to my desktop via terminal
<p>How can I copy a directory to my local desktop from a remote machine ? I accessing the remote machine via ssh in the terminal.</p>
<macos><ssh><terminal>
2016-04-19 10:57:34
LQ_CLOSE
36,716,905
Used stored procedure with c#
I write c# code with use stored procedure, he work and write database, but write error where: while (rdr.Read()) { PrichinatextBox.Text = (string)rdr["Prichina"]; dateEdit.Text = (string.Format("{yyyy-MM-dd}", rdr["data"])); //error format exception } connection.Close(); MessageBox.Show("Ваши данные добавлены"); Write code for realize it.
<c#>
2016-04-19 11:21:34
LQ_EDIT
36,717,331
implicit conversion of 'nsinteger' (aka 'long') to 'nsstring *' is disallowed with arc
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"mnuSelected"]) { ViewController *v = segue.destinationViewController; if(self.searchDisplayController.active) { NSIndexPath *indexPath = nil; indexPath = [self.searchDisplayController.searchResultsTableView indexPathForSelectedRow]; v.str = [self.result objectAtIndex:indexPath.row]; NSIndexPath *rowSelected = nil; rowSelected = [self.searchDisplayController.searchResultsTableView indexPathForSelectedRow]; v.UserSelected = rowSelected.row; } else { NSIndexPath *indexPath = nil; indexPath = [self.tableView indexPathForSelectedRow]; v.str = [self.monthName objectAtIndex:indexPath.row]; NSIndexPath *rowSelected = nil; rowSelected = [self.tableView indexPathForSelectedRow]; v.UserSelected = rowSelected.row; } return; } } I have error in this line >> v.UserSelected = rowSelected.row; this error >> implicit conversion of 'nsinteger' (aka 'long') to 'nsstring *' is disallowed with arc
<objective-c><xcode><nsstring><string-comparison>
2016-04-19 11:41:26
LQ_EDIT
36,717,337
Insert data to the controls in one windows application from another application
<p>I am working on a windows application and I want to insert some data to the controls in another windows application from my application. I think it's possible using <strong>spy++</strong> or <strong>AutoIt.</strong> </p> <p>But on searching I found only code like clicking a button in another application from one application. </p> <p>What I need is, </p> <p>I have <strong>3</strong> textboxes in <strong>WindowsApp_1</strong> and I need to fill these from the value sending from <strong>WindowsApp_2</strong>. Could you please give me a sample code to achieve this ?</p>
<c#><.net><automation><autoit><spy++>
2016-04-19 11:41:45
LQ_CLOSE
36,717,455
How to short multidimensional PHP array (recent news time based implementation)
i got some recent news rss in xml format and change in to json format , it is needed for android application to display recent news. i have an following JSON array ... { "rss_news": [ { "title": " ", "rss_original_src": "recent_news1(google news)", "rss_original_src_img": "", "link": "", "pubDate": "Tue, 19 Apr 2016 14:05:47 +0530", "description": "" }, { "title": " ", "rss_original_src": "recent_news2(yahoo news)", "rss_original_src_img": "", "link": "", "pubDate": "Tue, 19 Apr 2016 16:05:47 +0530", "description": "" }, { "title": " ", "rss_original_src": "recent_news3", "rss_original_src_img": "", "link": "", "pubDate": "Tue, 19 Apr 2016 11:05:47 +0530", "description": "" }, .... ] } --------- Now i need ... PHP multi dimensional array short based on value(pubDate).. Thanks in advance..
<php><json><xml><rss>
2016-04-19 11:46:59
LQ_EDIT
36,718,186
styling the footer changes header parent element
<p>I am new to the front end stuff and having a bit of a moment endeavouring to style the footer on my project. </p> <p>My header and footer are both constructed using a ( UL LI and UL LI a )</p> <p>Problem: When I try and style the footer using CSS the header is also correspondingly changed with the same styling.</p> <p>How should I modify the footer in terms of coding so that when I apply styling to it, it does not change the header/parent element.</p> <p><a href="https://i.stack.imgur.com/cGbXN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cGbXN.jpg" alt="enter image description here"></a></p> <blockquote> <p>Header</p> </blockquote> <pre><code>&lt;nav class="navbar navbar-static-top navbar-default" role="navigation"&gt; &lt;div class="container"&gt; &lt;!-- Brand and toggle get grouped for better mobile display --&gt; &lt;div class="navbar-header"&gt; &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"&gt; &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/button&gt; &lt;a class="navbar-brand" href="/"&gt; &lt;img alt="Nippon Beauty" class="navbar-brand-icon" src="assets/nippon.svg"&gt; &lt;/a&gt; &lt;/div&gt; &lt;!--&lt;span style="color: #53100e"&gt;| Japanese and South Korean Luxury Skincare&lt;/span&gt; &lt;!-- Collect the nav links, forms, and other content for toggling --&gt; &lt;div class="collapse navbar-collapse navbar-ex1-collapse"&gt; &lt;ul class="nav navbar-nav navbar-right"&gt; &lt;li&gt;&lt;%= link_to "Home", root_path %&gt;&lt;/li&gt; &lt;li&gt;&lt;%= link_to "About", about_path %&gt;&lt;/li&gt; &lt;li&gt;&lt;%= link_to "Login", new_user_session_path %&gt;&lt;/li&gt; &lt;li&gt;&lt;%= link_to "Signup", new_user_registration_path %&gt;&lt;/li&gt; &lt;% if user_signed_in? %&gt; &lt;li&gt;&lt;%= link_to "Account Settings", edit_user_registration_path %&gt;&lt;/li&gt; &lt;li&gt;&lt;%= link_to "Log out", destroy_user_session_path, method: :delete %&gt;&lt;/li&gt; &lt;% else %&gt; &lt;% end %&gt; &lt;/ul&gt; &lt;/div&gt;&lt;!-- /.navbar-collapse --&gt; &lt;/nav&gt; </code></pre> <blockquote> <p>Footer</p> </blockquote> <pre><code>&lt;div class="row bottom-footer text-center-mobile"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Contact Us&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Returns Policy&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Terms and Conditions&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Privacy Policy&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;FAQ&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <blockquote> <p>CSS</p> </blockquote> <pre><code>@import url(https://fonts.googleapis.com/css?family=Lato:400,700); $body-bg: #ecf0f1; $font-family-sans-serif: 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif; $navbar-height: 70px; $navbar-default-bg: white; $navbar-default-brand-color: #c0392b; $brand-primary: #c0392b; $jumbotron-bg: white; @import 'bootstrap'; @import 'bootstrap-sprockets'; .center { text-align: center; } .navbar-brand { font-weight: bold; } .btn-lg { padding: 18px 28px; font-size: 22px; border-radius: 8px; } .jumbotron { width: 735px; padding-left: 30px; padding-right: 15px; padding-bottom: 20px; padding-top: 20px; } .container .jumbotron { border-radius: 35px; } .container { width: 1270px; } .navbar { min-height: 90px; } .navbar-brand { float: left; padding: 10px 15px; font-size: 14px; font-weight: normal; } .navbar-brand img { display: inline-block; } .navbar-brand span { display:inline-block; vertical-align : middle; height: 7px; } h1, { font-family: 'Lobster', cursive; color: #e22f8f; } .row { position: absolute; right: 0; bottom: 0; left: 0; padding: 1rem; background-color: #efefef; text-align: center; } li { display: inline-block; *display: inline; padding: 4px; color: #e22f8f; } </code></pre>
<html><css>
2016-04-19 12:19:08
LQ_CLOSE
36,718,219
Popup in android after i scan
[enter image description here][1] i want to add a popup like this in my app in android after i scan a HR code[enter image description here][2]. [1]: http://i.stack.imgur.com/gQjtJ.jpg [2]: http://i.stack.imgur.com/T7IPC.jpg
<android><android-studio>
2016-04-19 12:20:41
LQ_EDIT
36,718,226
Create XMl file in particular format in c#
<p>i want to create xml file in c# in below format.</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;custom&gt; &lt;text1&gt; &lt;value name="sample1"&gt;hello&lt;/value&gt; &lt;/text1&gt; &lt;text1&gt;&lt;value name="sample2"&gt;world&lt;/value&gt; &lt;/text1&gt; &lt;/custom&gt;</code></pre> </div> </div> </p>
<c#><xml>
2016-04-19 12:20:56
LQ_CLOSE
36,718,707
How to select the last blcok element in a repeated html in webdriver
This is the html code. I want to select export csv of the last block. which is present in a drop down tringle mark whose xpath is ".//*[@id='table-view-views']/div/div[1]/ul/li[12]/a/span" Highlighted mark having same **div** and **ul** tags but diffrent **li** tag. so I want to select last block element through csspath. Can anybody help. [![enter image description here][1]][1] [1]: http://i.stack.imgur.com/oFAZC.png
<python><css><selenium><webdriver>
2016-04-19 12:40:52
LQ_EDIT
36,724,441
php session not working when redirecting in another page
<p>session is not working in my code. i have a login form, and when a user is on db the the page redirects him in main.php but it's not working</p> <pre><code>//index.php &lt;?php session_start(); include('connect.php'); if(isset($_POST['submit'])){ $username = mysqli_real_escape_string($dbCon, $_POST['username']); $password = mysqli_real_escape_string($dbCon, $_POST['password']); $sql = "select username, password from users where username='$username'"; $res = mysqli_query($dbCon, $sql); if(!$res){ die(mysqli_errno); } while ($row = mysqli_fetch_assoc($res)){ $usr = $row['username']; $pass = $row['password']; } if($username == $usr &amp;&amp; $password == $pass){ $_SESSION["username"] = $username; header("Location: main.php"); exit(); } else { $error = "Invalid username or password"; } } ?&gt; </code></pre> <p>and here is my main.php</p> <pre><code>//main.php &lt;?php if(isset($_SESSION["username"])) { $username = $_SESSION["username"]; } else { header('Location: index.php'); die(); } ?&gt; </code></pre> <p>thanks</p>
<php><session>
2016-04-19 16:40:00
LQ_CLOSE
36,725,009
Read numerical values from a file with lines of strings
<p>I have a .txt file with N lines. I want to read the line number 8, and the line number 16, which look like these:</p> <pre><code>2016-04-01 04:27:30.6216 (2283721) (more text) 2016-04-01 04:59:20.3635 (2283721) (more text) </code></pre> <p>How can I recover the values 04:59:20.3635 and 04:27:30.6216 and substract them? I tried with opening and reading the file using</p> <pre><code>txt = open(filename) for line in txt: print line </code></pre> <p>But I don't know how to store each line in a variable, and then access the specific part of the line that I want to reach. I've tried some stuff, but I want to know which would be the most efficient way to handle this. Many thanks!!</p>
<python><readfile>
2016-04-19 17:07:53
LQ_CLOSE
36,725,975
Best way to achieve custom ui layout in Visual Studio (c#)
<p>I have a simple layout <a href="https://i.stack.imgur.com/c76CQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c76CQ.png" alt="enter image description here"></a></p> <p>What would the best way to achieve this? using WPF or Win forms with a custom list view?</p>
<c#><wpf><winforms><visual-studio>
2016-04-19 17:55:09
LQ_CLOSE
36,725,982
im having this error
im a beginner and also a diploma student... i have created database using localhost... im having problem viewing my database... please help me... i hope u can help me with a full code... this is the ERROR... Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\SLR\View S110 PC01.php on line 10 cannot select DB this is my code... <?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="slr"; // Database name $tbl_name="s110_pc01"; // Table name // Connect to server and select databse. mysqli_connect("$host", "$username", "$password")or die("cannot connect"); mysqli_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysqli_query($sql); $count=mysqli_num_rows($result); ?> <table width="400" border="0" cellspacing="1" cellpadding="0"> <tr> <td><form name="form1" method="post" action=""> <table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td bgcolor="#FFFFFF">&nbsp;</td> <td colspan="4" bgcolor="#FFFFFF"><strong>Delete multiple rows in mysql</strong> </td> </tr> <tr> <td align="center" bgcolor="#FFFFFF">#</td> <td align="center" bgcolor="#FFFFFF"><strong>Software ID</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Software Name</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Installed Date</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Expiry Date</strong></td> <td align="center" bgcolor="#FFFFFF"><strong>Product Key</strong></td> </tr> <?php while($rows=mysqli_fetch_array($result)){ ?> <tr> <td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></td> <td bgcolor="#FFFFFF"><? echo $rows['soft_id']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['soft_name']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['installed_date']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['expiry_date']; ?></td> <td bgcolor="#FFFFFF"><? echo $rows['product_key']; ?></td> </tr> <?php } ?> <tr> <td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td> </tr> <?php // Check if delete button active, start this if($delete){ for($i=0;$i<$count;$i++){ $del_id = $checkbox[$i]; $sql = "DELETE FROM $tbl_name WHERE soft_id='$soft_id'"; $result = mysqli_query($sql); } // if successful redirect to delete_multiple.php if($result){ echo "<meta http-equiv=\"refresh\" content=\"0;URL=View S110 PC01.php\">"; } } mysqli_close(); ?> </table> </form> </td> </tr> </table>
<php><mysql><mysqli>
2016-04-19 17:55:21
LQ_EDIT
36,726,727
What's the name of an OSX-like list object in Java FX in Windows?
I can't find an object with the same look and feel like this one here: [OSX list object][1] [1]: http://i.stack.imgur.com/noXe5.jpg
<java><windows><javafx><awt>
2016-04-19 18:35:31
LQ_EDIT
36,727,514
Are these statements equivalent?: import package vs from package import *
<p>Are these statements equivalent?:</p> <p><code>import math</code> and <code>from math import *</code></p>
<python><python-2.7>
2016-04-19 19:18:38
LQ_CLOSE
36,727,559
I want to print the most visited sites/urls in the browser.
Below is the code that I have written in C++ and it is printing the wrong result for the 2nd and 3rd output line. I am not able to figure it out why it is happening. Below is the code which I have written and it is a completely functional code on visual studio. This code expects the one input file named urlMgr.txt whose content should be URLs. Below is the sample URLs which I am using it. /* INPUT TO BE PASTED IN THE urlMgr.txt file so that program can fetch the input from this file. ANY HELP ON THIS WILL BE HIGHLY APPRECIATED. */ Code is also pasted below. #include <iostream> #include <string> #include <unordered_set> #include <algorithm> #include <fstream> #include <sstream> #include <functional> #include <unordered_map> #include <queue> using namespace std; class urlInfo { public: urlInfo(string &url):urlName(url),hitCount(1) { } int getHitCount() const { return hitCount; } string getURL() { return urlName; } string getURL() const { return urlName; } void updateHitCount() { hitCount++; } void setHitCount(int count) { hitCount = count; } private: string urlName; int hitCount; }; class urlInfoMaxHeap { public: bool operator() (urlInfo *url1, urlInfo *url2) const { if(url2->getHitCount() > url1->getHitCount()) return true; else return false; } }; bool operator==(const urlInfo &ui1,const urlInfo& ui2) { //return (ui1.getURL().compare(ui2.getURL()) == 0) ? 1:0; return (ui1.getURL() == ui2.getURL()); } namespace std { template <> struct hash<urlInfo> { size_t operator()(urlInfo const & ui) { return hash<string>()(ui.getURL()); } }; } class urlMgr { public: urlMgr(string &fileName) { ifstream rdStr; string str; rdStr.open(fileName.c_str(),ios::in); if(rdStr.is_open()) { int len; rdStr.seekg(0,ios::end); len = rdStr.tellg(); rdStr.seekg(0,ios::beg); str.reserve(len+1); char *buff = new char[len +1]; memset(buff,0,len+1); rdStr.read(buff,len); rdStr.close(); str.assign(buff); delete [] buff; } stringstream ss(str); string token; while(getline(ss,token,'\n')) { //cout<<endl<<token; addUrl(token); } } void addUrl(string &url) { unordered_map<string,urlInfo*>::iterator itr; itr = urls.find(url); if(itr == urls.end()) { urlInfo *u = new urlInfo(url); urls[url] = u; maxHeap.push_back(u); } else { itr->second->updateHitCount(); urlInfo* u = itr->second; vector<urlInfo*>::iterator vItr; vItr = find(maxHeap.begin(),maxHeap.end(),u); if(vItr!=maxHeap.end()) { maxHeap.erase(vItr); maxHeap.push_back(u); } } make_heap(maxHeap.begin(),maxHeap.end(),urlInfoMaxHeap()); } void releaseResources() { for_each(urls.begin(),urls.end(),[](pair<string,urlInfo*> p){ urlInfo* u = p.second; delete u; }); } void printHeap() { for_each(maxHeap.begin(),maxHeap.end(),[](urlInfo* u){ cout<<endl<<u->getHitCount()<<" "<<u->getURL(); }); } private: unordered_map<string,urlInfo*> urls; vector<urlInfo*> maxHeap; }; int main() { string fileName("urlMgr.txt"); urlMgr um(fileName); um.printHeap(); um.releaseResources(); cout<<endl<<"Successfully inserted the data"<<endl; }
<c++><heap><priority-queue>
2016-04-19 19:21:11
LQ_EDIT
36,728,042
Where i can learn about openstack and cloud computing
<p>Where i can learn about openstack and cloud computing Sites with proper courses and video tutorials will be prefered and i have no knowledge about them.</p>
<cloud><openstack><openstack-nova><openstack-neutron>
2016-04-19 19:45:39
LQ_CLOSE
36,728,913
Why compilation fails?
interface Rideable { String getGait(); } public class Camel implements Rideable { int weight = 2; public static void main(String[] args) { new Camel().go(8); } void go(int speed) { ++speed; weight++; int walkrate = speed * weight; System.out.print(walkrate + getGait()); } String getGait() { return " mph, lope"; } } Why does the compilation fails? I really don't know why the compile error? Please help.
<java><variables><interface><scope><access-modifiers>
2016-04-19 20:34:48
LQ_EDIT
36,728,981
Best merge or join function in r
<p>I have two dataframes df1 and df2. Both have a common identifier column.</p> <p>df1 has unique lines for each identifier. But has identifier values that are not in df2.</p> <p>df2 has multiple lines for each identifier value.</p> <p>I want to merge the two so that I preserve the number of rows of df2, but map the (repeating) relevant ID rows from df1 into df2.</p> <p>Is is best to use merge or join or something else? What arguments?</p> <p>Thanks :)</p>
<r>
2016-04-19 20:38:59
LQ_CLOSE
36,729,103
Need Assistance Understanding ls -d command in linux
<p>I'm trying to wrap my head around the 'ls -d' command.</p> <p>I run the command 'ls -d' in any given directory and all I get is a '.'</p> <p>I run the command 'ls -d */ and I get only the directories</p> <p>I run the command -ls -d * and I get all files, including those that aren't directories.</p> <p>The man page just states this:</p> <pre><code>list directories themselves, not their contents </code></pre> <p>Can someone please help explain how this switch is supposed to work?</p>
<linux><bash>
2016-04-19 20:45:28
LQ_CLOSE
36,729,206
getting a number using regular expressions
<p>I have the following string:</p> <p>PR-1333|testtt</p> <p>I want to get the number 1333 using regular expressions in javascript. How can I do that? </p>
<javascript><jquery><regex>
2016-04-19 20:51:10
LQ_CLOSE
36,730,541
what's wrong with this simple code
`public static void main (String[] args) { Scanner input = new Scanner(System.in); int[] array = new int[5]; System.out.print("Please enter five numbers. \na="); array[0] = input.nextInt(); System.out.print("\nb="); array[1] = input.nextInt(); System.out.print("\nc="); array[2] = input.nextInt(); System.out.print("\nd="); array[3] = input.nextInt(); System.out.print("\ne="); array[4] = input.nextInt(); boolean totalIsZero = false; for (int i=0;i<array.length ;i++) { for (int j=1;i>j ;j++ ) { if ((array[i] + array[j])==0) { System.out.println("The numbers " + array[i] + " and " + array[j] + " have a total sum equal to 0."); totalIsZero = true; } } } if (!totalIsZero) { System.out.print("None of the numbers have a total sum of 0 with each other. "); } }` Here is a simple code I just wrote. Its task is to check if the sum between every two numbers in an array(consisting of five numbers) is equal to zero. The problem I have is that when there are two couples of numbers, both equal to 0, at the end of the program there is a message for one of the couples only, not for both, as I expected. How can I fix that, so the user can read that there are two couples of numbers equal to 0. Thanks in advance!
<java><loops>
2016-04-19 22:22:35
LQ_EDIT
36,731,186
Python re.search Patterns
<p>I have a bunch of strings that consist of Q, D or T. Below are some examples.</p> <pre><code> aa= "QDDDDQDTDQTD" bb = "QDT" cc = "TDQDQQDTQDQ" </code></pre> <p>i am new to re.search, for each string, is it possible to get all patterns with any length that start with Q, and ends with D or Q, and there is no T in between the first Q and the last D or Q. </p> <p>So for aa, it would find "QDDDDQD"</p> <p>for bb, it would find "QD"</p> <p>for cc, it would find "QDQQD" and "QDQ" </p> <p>I understand the basic forms of using re.search like:</p> <pre><code> re.search(pattern, my_string, flags=0) </code></pre> <p>Just having trouble how to set up the patterns mentioned above, like how to find patterns start with Q, or ends with Q, etc. Any help would be greatly appreciated!</p>
<python><regex><python-3.x>
2016-04-19 23:25:25
LQ_CLOSE
36,731,682
Why does this change to the makefile make the performance go up?
<p>I recently completed a performance lab in class, but there was one thing that my buddy showed me that I can't figure out why. In the original makefile we had:</p> <pre><code>## ## CXX =g++ CXXFLAGS= -m32 -static </code></pre> <p>But I changed the CXXFLAGS to:</p> <pre><code>## ## CXX =g++ CXXFLAGS= -m32 -static -funroll-loops -O3 </code></pre> <p>What exactly does the -funroll-loops -O3 do that the original doesn't?</p>
<c><performance><makefile>
2016-04-20 00:19:09
LQ_CLOSE
36,733,078
What is the difference between events and helpers?
<p>What is the difference between <code>Meteor.templateName.events</code> and <code>Meteor.templateName.helpers</code>.</p> <p>and how do I know which one I need to implement for my template?</p>
<meteor>
2016-04-20 03:05:07
LQ_CLOSE
36,733,513
Keep getting matching error in haskell when testing function
<blockquote> <p>this is the function</p> </blockquote> <pre><code>toRevDigits :: Integer -&gt; [Integer] toRevDigits 0 = [] toRevDigits x | x&lt;0 = [] | otherwise = lastDigit x:(toRevDigits (dropLastDigit x)) </code></pre> <blockquote> <p>this is the test</p> </blockquote> <pre><code>testRevDigits :: (Integer, [Integer]) -&gt; Bool testRevDigits (n, [d]) = toRevDigits n ==[n] ex2Tests :: [Test] ex2Tests = [Test "toRevDigits test" testRevDigits [(321,[1,2,3]), (0,[]), ((-17),[])] ] </code></pre> <blockquote> <p>this is the error</p> </blockquote> <pre><code>*** Exception: LAB8Tests.hs:27:1-44: Non-exhaustive patterns in function testRevDigits </code></pre> <blockquote> <p>how can i fix the tester to function to make it work?</p> </blockquote>
<haskell><non-exhaustive-patterns>
2016-04-20 03:51:43
LQ_CLOSE
36,734,039
Getting Error I cannot ger it
04-20 00:40:11.688: E/AndroidRuntime(1623): FATAL EXCEPTION: AsyncTask #1 04-20 00:40:11.688: E/AndroidRuntime(1623): Process: com.clip.android, PID: 1623 04-20 00:40:11.688: E/AndroidRuntime(1623): java.lang.RuntimeException: An error occured while executing doInBackground() 04-20 00:40:11.688: E/AndroidRuntime(1623): at android.os.AsyncTask$3.done(AsyncTask.java:300) 04-20 00:40:11.688: E/AndroidRuntime(1623): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) 04-20 00:40:11.688: E/AndroidRuntime(1623): at java.util.concurrent.FutureTask.setException(FutureTask.java:222) 04-20 00:40:11.688: E/AndroidRuntime(1623): at java.util.concurrent.FutureTask.run(FutureTask.java:242) 04-20 00:40:11.688: E/AndroidRuntime(1623): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) 04-20 00:40:11.688: E/AndroidRuntime(1623): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 04-20 00:40:11.688: E/AndroidRuntime(1623): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 04-20 00:40:11.688: E/AndroidRuntime(1623): at java.lang.Thread.run(Thread.java:841) 04-20 00:40:11.688: E/AndroidRuntime(1623): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() 04-20 00:40:11.688: E/AndroidRuntime(1623): at android.os.Handler.<init>(Handler.java:200) 04-20 00:40:11.688: E/AndroidRuntime(1623): at android.os.Handler.<init>(Handler.java:114) 04-20 00:40:11.688: E/AndroidRuntime(1623): at android.widget.Toast$TN.<init>(Toast.java:327) 04-20 00:40:11.688: E/AndroidRuntime(1623): at android.widget.Toast.<init>(Toast.java:92) 04-20 00:40:11.688: E/AndroidRuntime(1623): at android.widget.Toast.makeText(Toast.java:241) 04-20 00:40:11.688: E/AndroidRuntime(1623): at com.clip.android.ClaimRegisterPage$AsyncCallWS.doInBackground(ClaimRegisterPage.java:124) 04-20 00:40:11.688: E/AndroidRuntime(1623): at com.clip.android.ClaimRegisterPage$AsyncCallWS.doInBackground(ClaimRegisterPage.java:1) 04-20 00:40:11.688: E/AndroidRuntime(1623): at android.os.AsyncTask$2.call(AsyncTask.java:288) 04-20 00:40:11.688: E/AndroidRuntime(1623): at java.util.concurrent.FutureTask.run(FutureTask.java:237) 04-20 00:40:11.688: E/AndroidRuntime(1623): ... 4 more 04-20 00:40:11.788: W/EGL_emulation(1623): eglSurfaceAttrib not implemented 04-20 00:40:12.238: E/WindowManager(1623): android.view.WindowLeaked: Activity com.clip.android.ClaimRegisterPage has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView{a56affd0 V.E..... R......D 0,0-571,339} that was originally added here 04-20 00:40:12.238: E/WindowManager(1623): at android.view.ViewRootImpl.<init>(ViewRootImpl.java:346) 04-20 00:40:12.238: E/WindowManager(1623): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:248) 04-20 00:40:12.238: E/WindowManager(1623): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.Dialog.show(Dialog.java:286) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.ProgressDialog.show(ProgressDialog.java:116) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.ProgressDialog.show(ProgressDialog.java:99) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.ProgressDialog.show(ProgressDialog.java:94) 04-20 00:40:12.238: E/WindowManager(1623): at com.clip.android.ClaimRegisterPage$AsyncCallWS.onPreExecute(ClaimRegisterPage.java:133) 04-20 00:40:12.238: E/WindowManager(1623): at android.os.AsyncTask.executeOnExecutor(AsyncTask.java:587) 04-20 00:40:12.238: E/WindowManager(1623): at android.os.AsyncTask.execute(AsyncTask.java:535) 04-20 00:40:12.238: E/WindowManager(1623): at com.clip.android.ClaimRegisterPage.onCreate(ClaimRegisterPage.java:93) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.Activity.performCreate(Activity.java:5231) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.ActivityThread.access$800(ActivityThread.java:135) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 04-20 00:40:12.238: E/WindowManager(1623): at android.os.Handler.dispatchMessage(Handler.java:102) 04-20 00:40:12.238: E/WindowManager(1623): at android.os.Looper.loop(Looper.java:136) 04-20 00:40:12.238: E/WindowManager(1623): at android.app.ActivityThread.main(ActivityThread.java:5001) 04-20 00:40:12.238: E/WindowManager(1623): at java.lang.reflect.Method.invokeNative(Native Method) 04-20 00:40:12.238: E/WindowManager(1623): at java.lang.reflect.Method.invoke(Method.java:515) 04-20 00:40:12.238: E/WindowManager(1623): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 04-20 00:40:12.238: E/WindowManager(1623): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 04-20 00:40:12.238: E/WindowManager(1623): at dalvik.system.NativeStart.main(Native Method)
<android><android-asynctask>
2016-04-20 04:46:30
LQ_EDIT
36,734,261
expected primary expression before ']' token ...... line 10 column 21
#include <iostream> using namespace std; void insertion_sort ( int c[]) ; int main () { int ch [] = { 314,463,25,46,24,554,99} ; insertion_sort( ch[] ); cout<<ch; return 0; } void insertion_sort ( int c [] ){ int size =0 , temp , i , j; while( c[size] != '\0' ){ ++size; } for ( i = 0 ; i < size ; ++i){ for ( j = i+1 ; j < size ; ++j ){ if ( c[i]<c[j] ){ c[i]=temp; c[i]=c[j]; c[j]=c[i]; } } } return ; }
<c++>
2016-04-20 05:04:35
LQ_EDIT
36,734,514
Counting the number of elements associated with another value in R
<p>For example, In a dataset, I have three groups as 1,2,3 and each group can either assign to 0 or 1. What is the code in R that allows me to count how many 0 assigned to group 1?</p>
<r><dataset>
2016-04-20 05:23:52
LQ_CLOSE
36,734,662
email and mobilenumber validation same textbox html5 with button
i want to validate both email,mobile number using single textbox. i tried in many ways but not working. i want to validate either it is javascript,html5,jquery,angularjs is not a problem. please help me to solve this problem. thanks in advancehttp://jsfiddle.net/ANxmv/3582/ Link: http://jsfiddle.net/ANxmv/3582/
<javascript><jquery><html><validation>
2016-04-20 05:35:48
LQ_EDIT
36,735,996
How to encrypt with both the private key and public key
<p>I have this bash script</p> <pre><code>#generate key openssl genrsa -out key.pem 2048 openssl rsa -in key.pem -text -noout #save public key in pub.pem file openssl rsa -in key.pem -pubout -out pub.pem openssl rsa -in pub.pem -pubin -text -nout #encrypt data openssl rsautl -encrypt -inkey pub.pem -pubin -in license.json -out license_encrypted.json #decrypt data openssl rsautl -decrypt -inkey key.pem -in license_encrypted.json </code></pre> <p>In the code you can see I encrypt the file using the public key and decrypt using the private key, I need to know how to encrypt using both the private key and the public key. Is this possible. Should I decrypt using the private key or can idecrypt using the public key, this is in regards to software licenses I am trying to encrypt</p>
<bash><encryption><ssh><openssl>
2016-04-20 06:54:28
LQ_CLOSE
36,736,009
How to acess different date format in js
I have 2 variables var myDate1 = "3.6.2015" AND var myDate2 = "6.2014" var date1= new Date(myDate1); var date2= new Date(myDate2); Here myDate2 donot contain days. It contains only year and month. I can't `alter(date2)`. How to do that.I am very new to js **Plz help**
<javascript><date>
2016-04-20 06:54:59
LQ_EDIT
36,736,134
Float Exponent from user input
so my question relates to float, I have used double for user input and end result and also for passing between function, the result is 1 when specifier is %lf%. #include <stdio.h> double pwra (double, double); int main() { double number, power, xx; printf("Enter Number: "); scanf("%lf", &number); printf("Enter Number: "); scanf("%lf", &power); xx=pwra (number,power); printf("Result: %lf", xx); return 0; } double pwra (double num, double pwr) { int count; int result = 1; for(count=1;count<=pwr;count++) { result = result*num; } return result; }
<c><exponent>
2016-04-20 07:00:38
LQ_EDIT
36,736,286
convert dollar into Indian rupee
Below two table I have with sample data. Table A contains dollar rate(into Indian rupee) as per year and Table B contains amount per year and I want to convert dollar into rupee as per year. Table A Rate Year 47 2001 49 2003 55 2004 Table B Amt Year 25$ 2001 34$ 2002 Question : for first record(year 2001) we have entry in both tables so we can do this easily by using below query sel A.Rate*B.Amt from A,B where B.year=A.year But for second record(i.e year 2002) we do not have entry in table A (which is rate table) so for these kind cases I want to use rate value from previous year (i.e : 47 rupee from year 2001)
<mysql><sql>
2016-04-20 07:07:35
LQ_EDIT
36,736,882
Grovy ALM HpQC - How to fill ST_ACTUAL design step field
i try to update HpQC result from SOAP-UI groovy script but i'm currently unable to modify ST_ACTUAL field of design Step, only to read the current value for my try, i have 2 steps under a test Could you help to solve my issue and tell me where i'm wrong in advance, thanks a lot for your help and answer <code> //############# Connexion a HpQC ############### def tdc = new ActiveXObject ('TDApiOle80.TDConnection') tdc.InitConnectionEx(addresse_qc) tdc.Login(login_qc, psw_qc) tdc.Connect(domain_qc, project_qc) log.info "*** connected to QC ***" //Catch the testSet campain in the Test Lab oTestSetFolder = tdc.TestSetTreeManager.NodeByPath(chemin_dans_qc) list_TestSetList = oTestSetFolder.FindTestSets(testSet_name_qc) oTestSet = list_TestSetList.Item(1) //catch the test list in the Test Lab oTestSetFactory = oTestSet.TSTestFactory testList = oTestSetFactory.NewList("") def nb_test = testList.Count() // select first test (item(1) -- Current status test Run - should be "No Run" selected_test = testList.Item(1) log.info("OnGoing test : " + "ID="+ selected_test.ID +" - "+ selected_test.name + " - status= "+selected_test.Status) // Create a new Test Run and modified final status for try OnGoing_RunTest= selected_test.RunFactory.AddItem('Comment 1') OnGoing_RunTest.Status = 'Blocked' def b=OnGoing_RunTest.ID OnGoing_RunTest.Post() OnGoing_RunTest.CopyDesignSteps() OnGoing_RunTest.Post() Stepslist_of_OnGoing_RunTest = OnGoing_RunTest.StepFactory.NewList("") //def nbsteps= Stepslist_of_OnGoing_RunTest.count() def c=1 for(designStep in Stepslist_of_OnGoing_RunTest) { // lecture designStep def a=designStep.ID // checking previous information : ok //log.info("DesignStep_ID="+designStep.ID) //log.info("ST_STEP_NAME = "+ designStep.field("ST_STEP_NAME")) //log.info("ST_STATUS = "+ designStep.field("ST_STATUS")) //log.info("ST_DESCRIPTION = "+ designStep.field("ST_DESCRIPTION")) //log.info("ST_EXPECTED = "+ designStep.field("ST_EXPECTED")) // updating Status and ST_ACTUAL field designStep.Status="Not Completed" // : OK // Updating ST_ACTUAL field // designStep.Field("ST_ACTUAL")="123" // => KO //designStep.item(c).Field("ST_ACTUAL")="123" // ==> KO // designStep.item(designStep.ID).Field("ST_ACTUAL")="123" // ==> KO // designStep.item(designStep.ID).Field("ST_ACTUAL")="123" // ==> KO c++ log.info("ST_ACTUAL = "+ designStep.field("ST_ACTUAL")) designStep.post() } //Updating Run QC selected_test.Post() log.info("*** ---- END Test --- ***") //######### déconnection de QC ############ tdc.Disconnect() //On écrit dans le log log.info("### -- QC disconnect -- ### -- END -- ###") </code>
<groovy><alm>
2016-04-20 07:35:24
LQ_EDIT
36,737,908
i want to display All "name" values in array (underscore/js)
var data=[{ "name": "cA", "leaf": false, "largeIconId": null, "label": "cA", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [{ "name": "cA-A", "leaf": false, "largeIconId": null, "label": "cA-A", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [{ "name": "cA-A-A", "leaf": false, "largeIconId": null, "label": "cA-A-A", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [{ "name": "cA-A-A-A", "leaf": false, "largeIconId": null, "label": "cA-A-A-A", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [{ "name": "cA-A-A-A-A", "leaf": true, "largeIconId": null, "label": "cA-A-A-A-A", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [] }] }] }] }, { "name": "cA-B", "leaf": true, "largeIconId": null, "label": "cA-B", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [] }, { "name": "cA-C", "leaf": true, "largeIconId": null, "label": "cA-C", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [] }] }, { "name": "A", "leaf": false, "largeIconId": null, "label": "A", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [{ "name": "A-Level1", "leaf": false, "largeIconId": null, "label": "A-Level1", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [{ "name": "A-Level2", "leaf": true, "largeIconId": null, "label": "A-Level2", "hideAllSearchFilters": false, "guidePage": null, "expanded": false, "defaultSearchCategory": false, "childCategories": [] }] }] }];
<javascript><arrays><underscore.js>
2016-04-20 08:23:50
LQ_EDIT
36,738,200
Is it possible to use the instance defined in managed C++ class in C#?
In the C++/CLI, I have defined some instance in the class as follow. public ref class A { public: int test(){return 0;} }; public ref Class B { public: static A^ a_Instance = gcnew A(); }; And in the C# side, I have create a B instance in order try to use the function in a_Instance as follow. private B b_instance = new B(); The question is, if it is possible for me to get the instance create in the managed C++ class and use the function in it? Thanks all.
<c#><.net><c++-cli>
2016-04-20 08:36:29
LQ_EDIT
36,738,439
Auto Generate alphanumeric Unique Id with C# with sql server
Need to create employee record based on branch I have a scenario, where if branch combo box value is selected xyz branch then ID starts with XYZ-0001 if combo box value is selected abc branch then ID starts with ABC-0001 and then so on Please suggest any idea on how to create this format.
<c#><sql><sql-server><winforms>
2016-04-20 08:47:11
LQ_EDIT
36,740,273
insert into column data into new table
I have one table that a two column and want to insert this two column data in another table means e.g. Table 1 Column1 Column2 A B table1 column1 and column2 value insert into second table as row wise means result should be below Table2 column3 A B
<sql-server><sql-insert>
2016-04-20 10:00:02
LQ_EDIT
36,741,334
Add a security code to http get request
I am searching a security function like this: The user can put his paypal address and an amount of money(which he gained in my app) in my application, and I will recieve it with an http request on my server. Now this is really insecure, anyone with the http requesturl can send me payout data for himself. So what I need is something like a code generator that only my app can create this sort of code, and my php script checks if the code doesnt fit, it wont accept the request. I thougt about java encryption, to encrypt the amount of money. but anybody with the skills to generate a java encrypter can also create an url to send a whitedraw request I think? I saw an app with this function, its called plus500 there you can whitedraw your money to a(your) paypal account, but I'm not that pro finding out how they do this feature securely.
<java><php><android><security><encryption>
2016-04-20 10:42:17
LQ_EDIT
36,741,932
Error: unexpected '}'
<p>I'm trying to generate a random data. Basically, I copied this code from the book, however it doesn't work for me. It works until it reaches the line stated in the warning: </p> <pre><code>Error: unexpected '}' in: "+ this.seg[,j] &lt;- rnorm(segSize[i], mean=segMeans[i,j], sd=segSDs[i,j]) + }" </code></pre> <p>The code looks as following:</p> <pre><code>for (i in seq_along(segNames)) { + cat(i, segNames[i], "\n") + + # empty matrix to hold this particular segment’s data + this.seg &lt;- data.frame(matrix(NA, nrow=segSize[i], ncol=length(segVars))) + + # within segment, iterate over variables and draw appropriate random data + for (j in seq_along(segVars)) { # and iterate over each variable + if (segVarType[j] == "norm") { # draw random normals + this.seg[,j] &lt;- rnorm(segSize[i], mean=segMeans[i,j], sd=segSDs[i,j]) + } else if (segVarType[j] == "pois") { # draw counts + this.seg[, j] &lt;- rpois(segSize[i], lambda=segMeans[i, j]) + } else if (segVarType[j] == "binom") { # draw binomials + this.seg[, j] &lt;- rbinom(segSize[i], size=1, prob=segMeans[i, j]) + } else { + stop("Bad segment data type: ", segVarType[j]) + } + } + # add this segment to the total dataset + seg.df &lt;- rbind(seg.df, this.seg) + } </code></pre> <p>Can somebody explain why it stucks on that line and what has to be changed? Thanks! </p>
<r><syntax-error><warnings>
2016-04-20 11:08:29
LQ_CLOSE
36,742,008
is it possible to use JavaScriptSpellCheck in jsp pages?
<p>I would like to perform Spell Checking on textarea and like to show invalid words onchange. For this i found JavaScriptSpellCheck plugin but looks it will not support for jsp pages. is it? if, yes please suggest one good plugin to make my work easier.</p>
<javascript><html><jsp>
2016-04-20 11:11:19
LQ_CLOSE
36,743,857
Map<String, Integer> foo - how do I get the value of the integer - JAVA
<p>I have a method:</p> <pre><code> public void updateBoard (Map&lt;String, Integer&gt; foo) </code></pre> <p>How do I find out the value of the Integer? I'm trying foo.get() but it just gives me the key.</p> <p>Thanks!</p>
<java><dictionary><hashmap>
2016-04-20 12:29:50
LQ_CLOSE
36,744,886
Facebook SDK iOS - User photos doesn't retrieving in release build but works perfectly in Debug build.
<p>I am facing a weird bug with Facebook SDK. When i trying to request user photos from the SDK it works perfect with Debug mode. When i tried with Release mode it fails to retrieve the photos(But still works with iPad 4,iPhone 5 and old devices). I doubt whether the issue is with arm64. Moreover my App status is live and it is available for public.</p>
<ios><objective-c><facebook><facebook-graph-api><ios9.3>
2016-04-20 13:09:41
LQ_CLOSE
36,746,382
Validate user input using seperate function
<p>How do I get this to not return 'brea outside loop'. I've read multiple other answers on stackoverflow but cannot grasp the concept as it's inside a seperate function.</p> <pre><code> def dayEntry(book,cmd): for x,type in zip(list, gettype): entry = input('?: ') validate(entry,type) results.append(entry) print (results) def validate(inval, intyp): if intyp == "date": try: datetime.datetime.strptime(inval, '%d-%m-%Y') except ValueError: print("Format not valid, use DD-MM-YYYY") break </code></pre>
<python><python-3.x><python-3.5>
2016-04-20 14:07:03
LQ_CLOSE
36,747,527
Get wikipedia city info - Java
Get city information from wikipedia, and show it on an Android APP. However, every time i try to transform the data to json, throws an exception https://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Threadless&rvprop=content&format=json&rvsection=0 JSONArray jsondata = new JSONArray(sb.toString());
<java><android><api><rest><wikipedia-api>
2016-04-20 14:49:41
LQ_EDIT