Id
int64
34.6M
60.5M
Title
stringlengths
15
150
Body
stringlengths
33
36.7k
Tags
stringlengths
3
112
CreationDate
stringdate
2016-01-01 00:21:59
2020-02-29 17:55:56
Y
stringclasses
3 values
38,467,631
What's Object Oriented Programming?
<p>I'm pretty new to programming with Object Oriented Programming Languages. So please how do you explain the concept of object oriented programming to a kid?</p>
<oop>
2016-07-19 20:10:43
LQ_CLOSE
38,468,302
html layouts vs css layouts
<p>please, which is better? benefits and disadvantages</p> <p>Html Layouts </p> <pre><code>&lt;header&gt; &lt; nav&gt; &lt; aside&gt; </code></pre> <p>or </p> <p>css layouts (divs with float)</p> <p>thanks</p>
<html><css>
2016-07-19 20:51:49
LQ_CLOSE
38,469,631
how i can sort mysql table by max value?
<p>this is my first question on this website </p> <p>and i want to know how i can sort mysql table by max value?</p> <pre><code>| ID | Value | |----|-------| | 1 | 20 | | 2 | 30 | | 3 | 25 | | 4 | 70 | | 5 | 29 | </code></pre> <p>i want the table be like this</p> <pre><code>| ID | Value | |----|-------| | 1 | 70 | | 2 | 30 | | 3 | 29 | | 4 | 25 | | 5 | 20 | </code></pre> <p>or like this</p> <pre><code>| ID | Value | |----|-------| | 4 | 70 | | 2 | 30 | | 5 | 29 | | 3 | 25 | | 1 | 20 | </code></pre>
<php><android><mysql><sql>
2016-07-19 22:38:24
LQ_CLOSE
38,470,027
How do I make an element display for some time then fade away and when i refresh my page it doesn't show?
<p>I have a log in in page where by when I i log in it takes me to my homepage which has a <code>&lt;div class="alert alert-success</code>> message. I want this message to show for like 5 seconds then it fades out. How do I do that?? Also when i refresh my page I don't want the message to show again unless i log out then log in again. </p> <p>this is some of the code: &times; <strong>success!</strong> Login successfull! This is supposed to show when i have successfully logged in.</p>
<php><html><twitter-bootstrap>
2016-07-19 23:18:40
LQ_CLOSE
38,470,772
button [] [] to node -- java
I'll keep it quick. I'm trying to create a standard calculator. I want to use a BorderPane so I can keep my display: TextField display = new TextField(); pane.setTop(display); however I am using an array: I then would want to use an array of buttons as a single object to place in the center of the pane. Button [][] keys = new Button [a][b]; pane.setCenter(keys); however I get an error: Button [][] cannot be converted to Node. I would like to know if there is anyway I can parse the elements to become/assume the value of a Node or if i can create a method to do so. Appreciate the help, thanks!
<java><javafx>
2016-07-20 01:07:15
LQ_EDIT
38,471,098
Newbie (C program for loop not printing "@" char)
Hello I need some help Im tyring to print out a random number of "@" charactors but my code is printing out random "\\\" instead. Dont know whats going on here just need a little help. Thanks... int ran,i; ran = 1 + (rand() % 25 + 1 ); for (i = 0; i < ran; i++) { printf("%c", "@"); } printf("\n");
<c>
2016-07-20 01:55:09
LQ_EDIT
38,473,147
finding first transaction
In a consumer spend data, how to find the first transaction done by customers. For e.g if you have 50 transactions. and you have 10 different customers who have done these 50 transactions. Then how to find the first transaction done by each of these 10 customers? suggestions to do this in SAS or SQL would really help.
<sql><sas>
2016-07-20 05:45:38
LQ_EDIT
38,473,887
why file_get_content($url) return the empty string
Code: <?php $url = "oooff.com"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $curl_scraped_page = curl_exec($ch); curl_close($ch); echo $curl_scraped_page; ?> above code display the blank page why please anyone help to me
<php><curl>
2016-07-20 06:33:17
LQ_EDIT
38,474,288
Royal Free Flash Case Study 3–Pleuritic Chest Pa is showing ''Royal Free Flash Case Study 3 – Pleuritic Chest Pa'' at the time of excel export
When I am tring to download Project Name, i m getting different character for Special charter at the time excel export. protected void lnkExportToExcel_Click(object sender, EventArgs e) { //INS1-219 DataTable dt1 = DataHelper.ExecuteQuery(Session["strForExcelReport"].ToString()); DataTable dt3 = new DataTable(); dt3.Columns.Add("Project Code"); dt3.Columns.Add("Project Name"); dt3.Columns.Add("Client"); dt3.Columns.Add("Status"); dt3.Columns.Add("Sale Date"); dt3.Columns.Add("Project Type"); dt3.Columns.Add("Sales Agent"); dt3.Columns.Add("Project Incharge"); dt3.Columns.Add("Project Cost"); dt3.Columns.Add("Planned Cost"); dt3.Columns.Add("Additional Cost"); dt3.Columns.Add("Payment Raised"); dt3.Columns.Add("Payment Received"); dt3.Columns.Add("Planned Start Date"); dt3.Columns.Add("Revised Start Date"); dt3.Columns.Add("Actual Start Date"); dt3.Columns.Add("Planned End Date"); dt3.Columns.Add("Revised End Date"); dt3.Columns.Add("Actual End Date"); dt3.Columns.Add("Planned Efforts(Hrs.)"); dt3.Columns.Add("Revised Efforts(Hrs.)"); dt3.Columns.Add("Actual Efforts(Hrs.)"); dt3.Columns.Add("% TimeLine"); dt3.Columns.Add("% Effort Plan"); dt3.Columns.Add("% Revised"); dt3.Columns.Add("% Overall"); dt3.Columns.Add("Profitibility Number"); foreach (DataRow dr in dt1.Rows) { DateTime dtNullDate = new DateTime(2008, 1, 1); DateTime dtPlannedStart, dtPlannedEnd, dtActualStart, dtActualEnd; double dblPlanedDays = 0, dblActualDays = 0; double dblPlannedEffort = 0, dblCalculatedEffort = 0, dblPercentCompleteEffort = 0, dblPercentCompleteTimeLine = 0, dblPercentCompleteOverAll = 0, dblRevisedEffort = 0; DataRow drnew = dt3.NewRow(); TimeSpan oPlannedSpan = TimeSpan.Zero; TimeSpan oActualSpan = TimeSpan.Zero; string[] strArr = null; drnew["Project Code"] = dr["ProjectCode"].ToString(); drnew["Project Name"] = dr["ProjectName"].ToString(); drnew["Client"] = dr["OrganizationName"].ToString(); string PercentOverallComplete = dr["PercentageComplete_Overall"].ToString(); drnew["Status"] = dr["ProjectStatus"].ToString(); DateTime SaleDate = Convert.ToDateTime(dr["CreatedOn"]); drnew["Sale Date"] = SaleDate.ToString("dd-MMM-yyyy"); drnew["Project Type"] = dr["CustomProjectTypeName"].ToString(); drnew["Sales Agent"] = dr["SalesAgentFullName"].ToString(); drnew["Project Incharge"] = dr["UserFullName"].ToString(); drnew["Project Cost"] = TypeConvert.IsNullDecimal(dr["ProjectCost"], 0).ToString("N", en); drnew["Planned Cost"] = dr["ProjectCost"].ToString(); string sql = "EXEC SPGetProjectCostClassification " + dr["ProjectID"].ToString(); DataTable dtProjCost = DataHelper.ExecuteQuery(sql); if (dtProjCost != null) { drnew["Planned Cost"] = TypeConvert.IsNullDecimal(dtProjCost.Rows[0]["ProjectCostInitial"], 0).ToString("N", en); drnew["Additional Cost"] = TypeConvert.IsNullDecimal(dtProjCost.Rows[0]["AdditionalCost"], 0).ToString("N", en); } string RaisedAmt = dr["InvoiceRasiedAmount"].ToString(); drnew["Payment Raised"] = RaisedAmt; string receivedAmt = dr["PaymentReceived"].ToString(); strArr = TypeConvert.IsNullString(RaisedAmt, string.Empty).Split(' '); if (strArr.Length > 1) { drnew["Payment Received"] = strArr[0] + ' ' + receivedAmt; } else { drnew["Payment Received"] = receivedAmt; } DateTime PlannedStartDate = Convert.ToDateTime(dr["PlannedStartDate"]); drnew["Planned Start Date"] = PlannedStartDate.ToString("dd-MMM-yyyy"); if (drnew["Planned Start Date"].ToString() == "01-Jan-2008") { drnew["Planned Start Date"] = ""; } DateTime RevisedStartDate = Convert.ToDateTime(dr["AllocatedStartDate"]); drnew["Revised Start Date"] = RevisedStartDate.ToString("dd-MMM-yyyy"); if (drnew["Revised Start Date"].ToString() == "01-Jan-2008") { drnew["Revised Start Date"] = ""; } DateTime ActualStartDate = Convert.ToDateTime(dr["ActualStartDate"]); drnew["Actual Start Date"] = ActualStartDate.ToString("dd-MMM-yyyy"); if (drnew["Actual Start Date"].ToString() == "01-Jan-2008") { drnew["Actual Start Date"] = ""; } DateTime PlannedEndDate = Convert.ToDateTime(dr["PlannedEndDate"]); drnew["Planned End Date"] = PlannedEndDate.ToString("dd-MMM-yyyy"); if (drnew["Planned End Date"].ToString() == "01-Jan-2008") { drnew["Planned End Date"] = ""; } DateTime RevisedEndDate = Convert.ToDateTime(dr["AllocatedEndDate"]); drnew["Revised End Date"] = RevisedEndDate.ToString("dd-MMM-yyyy"); if (drnew["Revised End Date"].ToString() == "01-Jan-2008") { drnew["Revised End Date"] = ""; } DateTime ActualEndDate = Convert.ToDateTime(dr["ActualEndDate"]); drnew["Actual End Date"] = ActualEndDate.ToString("dd-MMM-yyyy"); if (drnew["Actual End Date"].ToString() == "01-Jan-2008") { drnew["Actual End Date"] = ""; } drnew["Planned Efforts(Hrs.)"] = dr["PlannedEfforts"].ToString(); drnew["Revised Efforts(Hrs.)"] = dr["AllocatedEfforts"].ToString(); string ActualEfforts = dr["ActualTime"].ToString(); if (ActualEfforts != "" && ActualEfforts != "0") { string[] tokens = ActualEfforts.Split(':'); if (tokens.Length == 2) { int HourValue = Convert.ToInt32(tokens[0]); int MinuteValue = Convert.ToInt32(tokens[1]); double MinutesInDecimalFormat = Convert.ToDouble(MinuteValue)/60; if (MinutesInDecimalFormat != 0) { string Minute = String.Format("{0:0.00}", MinutesInDecimalFormat); string[] tokensExcel = Minute.ToString().Split('.'); drnew["Actual Efforts(Hrs.)"] = HourValue + "." + tokensExcel[1]; } else { drnew["Actual Efforts(Hrs.)"] = HourValue + "." + MinutesInDecimalFormat; } } } dblPlanedDays = Convert.ToDateTime(dr["PlannedEndDate"]).Subtract(Convert.ToDateTime(dr["PlannedStartDate"])).TotalDays; oPlannedSpan = Convert.ToDateTime(dr["PlannedEndDate"]).Subtract(Convert.ToDateTime(dr["PlannedStartDate"])); dtActualStart = (dr["ActualStartDate"] is DBNull) ? DateTime.Now : Convert.ToDateTime(dr["ActualStartDate"]); if (dr["ActualEndDate"] is DBNull || (!(dr["ActualEndDate"] is DBNull) && Convert.ToDateTime(dr["ActualEndDate"]) == MiscConstants.DEFAULT_DATE)) dtActualEnd = DateTime.Now; else dtActualEnd = Convert.ToDateTime(dr["ActualEndDate"]); if (dtActualStart != dtNullDate) { oActualSpan = dtActualEnd.Subtract(dtActualStart); if (oPlannedSpan.Ticks != 0) { if (oActualSpan.Ticks >= oPlannedSpan.Ticks) dblPercentCompleteTimeLine = (100 + (((oActualSpan.Ticks - oPlannedSpan.Ticks)*100)/ oPlannedSpan.Ticks)); else dblPercentCompleteTimeLine = ((oActualSpan.Ticks*100)/oPlannedSpan.Ticks); } } else { dblPercentCompleteTimeLine = 0; } drnew["% TimeLine"] = dblPercentCompleteTimeLine.ToString("F"); dblPlannedEffort = Convert.ToDouble(dr["PlannedEfforts"]); dblRevisedEffort = Convert.ToDouble(dr["AllocatedEfforts"]); dblCalculatedEffort = Convert.ToDouble(dr["ActualTime"].ToString().Replace(':', '.'));// Convert.ToDouble(actualTime); double dblPercentCompleteEffortRevised = 0; if (dblPlannedEffort > 0) { if (dblCalculatedEffort > dblPlannedEffort) dblPercentCompleteEffort = (100 + (((dblCalculatedEffort - dblPlannedEffort) * 100) / dblPlannedEffort)); else dblPercentCompleteEffort = ((dblCalculatedEffort * 100) / dblPlannedEffort); } else { dblPercentCompleteEffort = 100; } drnew["% Effort Plan"] = dblPercentCompleteEffort.ToString("F"); if (dblRevisedEffort > 0) { if (dblCalculatedEffort > dblRevisedEffort) dblPercentCompleteEffortRevised = (100 + (((dblCalculatedEffort - dblRevisedEffort) * 100) / dblRevisedEffort)); else dblPercentCompleteEffortRevised = ((dblCalculatedEffort * 100) / dblRevisedEffort); } else { dblPercentCompleteEffortRevised = 100; } drnew["% Revised"] = dblPercentCompleteEffortRevised.ToString("F"); drnew["% Overall"] = PercentOverallComplete; decimal totResourceCost = TypeConvert.IsNullDecimal(dr["ResourceCostOffshore"].ToString(), 0) + TypeConvert.IsNullDecimal(dr["ResourceCostOnSite"].ToString(), 0); decimal vmsCost = TypeConvert.IsNullDecimal(dr["OutSourcingCost"].ToString(), 0) + TypeConvert.IsNullDecimal(dr["DirectCost"].ToString(), 0); decimal grandTotalCogs = totResourceCost + vmsCost; if ((TypeConvert.IsNullDecimal(dr["ProjectCost"].ToString(), 0)).ToString("0.00") == "0.00") { drnew["Profitibility Number"] = "0.00%"; } else { decimal currentCOGS = (((grandTotalCogs) / (TypeConvert.IsNullDecimal(dr["ProjectCost"].ToString(), 0))) * 100); decimal percentComplete = TypeConvert.IsNullDecimal(PercentOverallComplete, 0); drnew["Profitibility Number"] = ((percentComplete > 0) ? currentCOGS * ((Convert.ToDecimal(100)) - percentComplete) / percentComplete + currentCOGS : 0).ToString("0.00") + "%"; } dt3.Rows.Add(drnew); } string attachment = "attachment; filename=ProjectInHandDetailsList_" + DateTime.Now.ToString("dd MMM yyyy") + ".xls"; Response.ClearContent(); Response.AddHeader("content-disposition", attachment); Response.ContentType = "application/vnd.ms-excel"; string tab = ""; foreach (DataColumn dc in dt3.Columns) { Response.Write(tab + dc.ColumnName); tab = "\t"; } Response.Write("\n"); int i; foreach (DataRow dr in dt3.Rows) { tab = ""; for (i = 0; i < dt3.Columns.Count; i++) { Response.Write(tab + dr[i].ToString()); tab = "\t"; } Response.Write("\n"); } Response.End(); //END INS1-219 }
<c#><asp.net>
2016-07-20 06:55:30
LQ_EDIT
38,474,992
How to make a Calendar with notification system by using Swift?
<p>My project is about a calendar system. When the manager writes his worker's off days. The app will show all workers's off days on the Calendar and has to remind the manager 2 weeks before off day. And all infos will be on database. I am pretty new to swift and ios. SQLite, NSCalendar..? Dont sure how to start. Some help would be great. </p>
<ios><swift><notifications><calendar>
2016-07-20 07:31:12
LQ_CLOSE
38,475,376
CSS selector inside a specific class
<p>Hi I wonder if I can select a class specifically by its parents.</p> <pre><code> &lt;div class="naomi"&gt; &lt;div class="pic01"&gt; &lt;div class="pic02"&gt; &lt;div class="pic05"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="teddy"&gt; &lt;div class="pic01"&gt; &lt;div class="pic05"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>is there a way to select class "pic05" only from class "naomi" without going in order inside like this .naomi .pic01 pic02 .pic05 </p> <p>Thank you</p>
<css><selector>
2016-07-20 07:49:34
LQ_CLOSE
38,475,614
How to convert a list into json structure
I have a list like a=[('policy', 871), ('insurance', 382), ('life', 357), ('request', 270), ('call', 260)] Now, I want to convert it as [{'call': 260},{'insurance': 382},{'life': 357}, {'policy': 871}, {'request': 270}] Thanks
<python><list>
2016-07-20 08:00:58
LQ_EDIT
38,476,918
How primary memory is organised in a microcontroller?
<p>My query is :How the memory is organized and managed in the microcontroller? (It doesn't have any OS i.e no presence of MMU).</p> <p>I am working over zynq 7000 (ZC702) FPGA,It has seperate arm core and seperate DDR memory connected together with axi interconnects.</p> <p>I wrote 11 1111 1111 in decimal to DDR(10 1's),it is giving me same after reading. when i write 111 1111 1111 in decimal to DDR(11 1's),it gives me -1.</p> <p>here the whole physical memory is consumed.This will not be the case when i use any microcontroller. Who will manage the memory in microcontroller?</p>
<c><memory><microcontroller><memory-address>
2016-07-20 09:07:04
LQ_CLOSE
38,478,777
How to print CHEQUE without background in wpf C#
<p>i would like to print the cheque so i am taking one background image to put the textblocks on correct place so that the text should be on correct place my requirement is i have to put the cheque in the printer and i have to show the values on cheque so my intention is after printing it should not show the image on cheque <a href="http://i.stack.imgur.com/6sZKo.jpg" rel="nofollow">cheque</a></p> <pre><code>private void Button_Click_1(object sender, RoutedEventArgs e) { PrintDialog dialog = new PrintDialog(); if (dialog.ShowDialog() == true) { dialog.PrintVisual(stackPrinting, "stackPrinting"); } } </code></pre>
<c#><wpf><devexpress-wpf>
2016-07-20 10:28:33
LQ_CLOSE
38,479,421
Xcode Swift run app in background forever
I am testing my app and this will never be submitted to the iOS store. What is the best way to get the app to run forever in the background? I have set the Required Background Modes item 0 to voip but it still closes after sometime. Any help is greatly appreciated.
<ios>
2016-07-20 11:00:12
LQ_EDIT
38,482,270
how to perform regex for password validation without special character?
<p>Regex for password of minimum length-7 without special characters , atleast one uppercase and one number .</p> <p>In my case, regex which satisfies:</p> <p><strong>Killer1 - atleast one uppercase (K), atleast one number (1) , minumum length - 7</strong></p> <p><strong>Melbourne123- valid</strong></p> <p><strong>London24 - valid</strong></p> <p>Thanks in advance.</p>
<regex>
2016-07-20 13:10:38
LQ_CLOSE
38,483,141
How to delete part of string indicated after a character?
<p>This is what I need.</p> <p>var str = "This is an |#|example text!"</p> <p>After deleting:</p> <p>str = "This is an "</p>
<swift><string>
2016-07-20 13:47:53
LQ_CLOSE
38,484,164
IOS locked screen notification with three buttons
Is it possible to get notified with three action yes or no or cancel in iphone when the screen is locked
<ios><objective-c><ios8><swift2><apple-push-notifications>
2016-07-20 14:32:15
LQ_EDIT
38,484,823
Are there any large Python libraries that avoid OOP?
<p>I'm a developer working at a company that primarily uses Python. I have a <em>strong</em> dislike of OOP; I feel it is almost always the wrong tool for the job and quickly makes code unmanageable. In our code base, I would like to avoid using objects / classes / inheritance, etc as much as possible.</p> <p>I know how to write good functional code in "functional" languages like SML (I use the scare quotes because it is difficult to define what a functional language is). I would ideally like to do the same in Python. Python doesn't force OOP; it has modules, and first-class functions, etc, but it seems like all the Python code I see makes heavy use of classes, and often inheritance as well (even multiple inheritance!). This is both true of the code I work with as well as third-party libraries I've seen.</p> <p>Are there good examples of large Python libraries that are written in a more functional style that I could learn from? Or has anyone had success in their own private code with this? I don't just want to start writing all my code in a functional style only to run into some pitfalls later down the line.</p>
<python><oop><functional-programming>
2016-07-20 15:33:38
LQ_CLOSE
38,486,509
Adding strings generated by function into an array
<p>I am trying to create a string array to hold the strings generated by a void function. I am very confused about if or how I can do this. The below code is giving me an error about "no suitable constructor."</p> <pre><code>getWords("theFile.dat"); // Function to extract list of strings from file string wordsList[] = {getWords("theFile.dat")}; // Add strings from function to array </code></pre>
<c++><arrays>
2016-07-20 16:57:30
LQ_CLOSE
38,487,542
Notepad breaking lines up when opening it using ReadAllLines() c#
I've created a program to make bug templates and am having a problem with notepad not saving correctly. I have a text file called TemplateTexts that holds all the text for each template, a template looks like this - REQUIREMENTS - Example ADDITIONAL REQUIREMENTS - Example - Example -----COPY BELOW THIS LINE----- When the program closes it copies all of that into 1 line of a notepad.(looks like this) REQUIREMENTS- Example ADDITIONAL REQUIREMENTS- Example - Example-----COPY BELOW THIS LINE----- The notepad contains 20 lines of templates. The template is saved as 1 line of text into the notepad, but when I go to open the program again, it turns that 1 line of text into multiple lines of text like how it is displayed in the first example. Any idea why this might be happening? or is there a better way to save each template into a notepad, possibly by separating it with flags or something?
<c#><notepad>
2016-07-20 17:54:06
LQ_EDIT
38,487,624
How do i convert a memory address 0x8134597 to "\x97\x45\x13\x08"
Hi I'm going through the PWK course where this springs up in the notes: 0x08134597 - > \x97\x45\x13\x08 what is the conversion between the two. The left being hex and the right being whatever that is.
<hex><endianness>
2016-07-20 17:58:29
LQ_EDIT
38,489,855
View function prototypes in C
<p>Often during programming contests I forget which library contains which function. Hence I require some C code which can print the available functions with a specific library. eg. usage:</p> <p><code>showAvailFunctions("stdlib.h")</code></p> <p>and it would print all the available functions with <code>stdlib.h</code> library</p>
<c>
2016-07-20 20:04:17
LQ_CLOSE
38,491,526
Call metatable methods inside metatable itself
<p>Is there a way to call metatable methods inside the metatable itself? For example</p> <pre><code>local t = {} local mt = { __index = { dog = function() print("bark") end, sound = function() t:dog() end } } setmetatable(t,mt) t:Sound() </code></pre> <p>raises this error:</p> <p><em>attempt to call method 'Sound' (a nil value)</em></p>
<lua><metatable>
2016-07-20 21:57:07
LQ_CLOSE
38,492,290
Line counting in Python
<p>I am a beginner in Python self studying Python 2.7. May I ask one question I got in line counting codes in Python? How do I intuitively understand why the below works, especially how I can understand what the for loop is doing with the file handle? </p> <p>Many thanks all</p> <pre><code>fhand=open('test.txt') count=0 for line in fhand: count=count+1 print count </code></pre>
<python><python-2.7>
2016-07-20 23:06:44
LQ_CLOSE
38,494,347
Spring framework ERROR 10904
<p>I was trying to build an application using the Spring framework but I got the following errors and am not sure why. Whenever I try to run the application I get the bellow errors. I did set up my Maven in C drive and my application in D drive due to space. Can that be an issue? </p> <p>What is causing the errors and how should I go about them?</p> <p><strong>ERROR 10904</strong> --- [ main] o.a.coyote.http11.Http11NioProtocol : Failed to start end point associated with ProtocolHandler ["http-nio-8080"]</p> <p><strong>ERROR 10904</strong> --- [ main] o.apache.catalina.core.StandardService : Failed to start connector [Connector[HTTP/1.1-8080]]</p> <p><strong>ERROR 10904</strong> --- [ main] o.s.boot.SpringApplication : Application startup failed</p> <p><strong>INFO 10904</strong> --- [ main] .b.l.ClasspathLoggingApplicationListener : Application failed to start with classpath: [file:/D:/GITHUB/webappaws/target/classes/, file:/C:/Users/codeLearner/.m2/repository/org/springframework/boot/spring-boot-starter-thymeleaf/1.3.6.RELEASE/spring-boot-starter-thymeleaf-1.3.6.RELEASE.jar, file:/C:/Users/codeLearner/.m2/repository/org/springframework/boot/spring-boot-starter/1.3.6.RELEASE/spring-boot-starter-1.3.6.RELEASE.jar, file:/C:/Users/codeLearner/.m2/repository/org/springframework/boot/spring-boot/1.3.6.RELEASE/spring-boot-1.3.6.RELEASE.jar, file:/C:/Users/codeLearner/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/1.3.6.RELEASE/spring-boot-autoconfigure-1.3.6.RELEASE.jar, file:/C:/Users/codeLearner/.m2/repository/org/springframework/boot/spring-boot-starter-logging/1.3.6.RELEASE/spring-boot-starter-logging-1.3.6.RELEASE.jar, file:/C:/Users/codeLearner/.m2/repository/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar, file:/C:/Users/codeLearner/.m2/repository/ch/qos/logback/logback-core/1.1.7/logback-core-1.1.7.jar, ...</p>
<java><windows><spring><maven>
2016-07-21 03:22:13
LQ_CLOSE
38,494,420
How can I parse the xml?
<p>In my project, the url return the xml data,and How can I parse the xml? <a href="https://i.stack.imgur.com/TlxzU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TlxzU.png" alt="enter image description here"></a></p>
<android><xml-parsing>
2016-07-21 03:30:19
LQ_CLOSE
38,494,983
How to not allow variables to be negitive (Batch game)
(Note: I am most likely overthinking this) I decided to mess around and make a batch game and I am using money as a currency, and I have a shop. It currently lets you buy the items without out having said money, but it makes it into the negatives. Example: Sword 30$, You 0$ (buy item) You -30$ this is what I am using set /a money=%money% -30
<batch-file>
2016-07-21 04:38:42
LQ_EDIT
38,495,161
Display specific data from sql database
I have a database called 'members' with a table called 'users'. The users table has an 'id' column that auto-increments every time a new user is added. I want to fetch the id of the logged in user and display that singular row of data. This is my login code: <?php session_start(); // Connect to server and select databse. mysql_connect("localhost", "root", "")or die("cannot connect"); mysql_select_db("members")or die("cannot select DB"); // username and password sent from form $prepreemail=$_POST['email']; $prepremypassword=$_POST['mypassword']; $preemail = stripslashes($prepreemail); $premypassword = stripslashes($prepremypassword); $email = mysql_real_escape_string($preemail); $mypassword = mysql_real_escape_string($premypassword); $sql="SELECT * FROM users WHERE email='$email' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" header ("location:home.html"); } else { header ("location:sign_in.php"); } ?> This is my sign up code <?php session_start(); $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("members", $con); $sql="INSERT INTO users (name, email, address, dob, password) VALUES ('$_POST[name]','$_POST[email]','$_POST[address]','$_POST[dob]','$_POST[mypassword]')"; if (!mysql_query($sql,$con)) die('Error: ' . mysql_error()); $_SESSION['userID'] = "SELECT id from users"; { header ("Location: sign_in.php"); exit; } mysql_close($con) ?> And this is my display user details code: <?php session_start(); // Create connection $conn = new mysqli("localhost", "root", "", "members"); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } $userID = $_SESSION['userID']; $sql = "SELECT name, email, address, dob FROM users WHERE `users`.`id`=$userID"; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "<table><tr><th>Name</th><th>Email</th><th>Address</th><th>DOB</th></tr>"; // output data of each row while($row = $result->fetch_assoc()) { echo "<tr><td>".$row["name"]."</td><td>".$row["email"]."</td><td>".$row["address"]."</td><td>".$row["dob"]."</td></tr>"; } echo "</table>"; } else { echo "<p>No Details</p><style>p{color: #336699; font-size: 20pt; font-family: Gulim; font-weight: bold; align: center; padding: 10px; position: absolute; top: 250; left: 600; z-index: 2; border-spacing: 0px;}</style> "; } $conn->close(); ?> For some reason it is not working, someone please help!
<php><mysql><select><html-table>
2016-07-21 04:55:14
LQ_EDIT
38,495,667
Cannot connect to remote sql server on laptop
When trying to connect to Remote SQL server 2012 database from management studio 2012 on my laptop I am getting below error: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error:53). the network path was not found. I hosted my website on Host Gator hosting provider and I have created a database on their hosting server with user details. I am trying to connect to the remote database using my laptop. I have windows 10 operating system on my laptop. Below are the steps I have followed: 1.Make sure that the TCP/IP and Named Pipes protocols are enabled in the Sql Configuration Manager 2. Make sure that the SQL Server Browser and the SQL Server is up and running on my machine 3. Make sure that the TCP/IP protocol with port number:1433 is added to inbound rules in the firewall. 4.Make sure that TCP/IP protocol is enabled through CLIConfg
<sql-server-2012><remote-connection>
2016-07-21 05:38:23
LQ_EDIT
38,496,715
Algorithm to find winner of tic tac toe
<p>What is the best optimal way to find out the winner in 3x3 Tic tac toe game where board is represented by a matrix ? Suggestions please</p>
<java><algorithm><data-structures>
2016-07-21 06:39:25
LQ_CLOSE
38,496,784
Java Language | Error :- non-static variable scan cannot be referenced from a static context
<pre><code>import java.util.Scanner; class Program { public static void main(String[] args) { Customer customer = new Customer(); Customer.method(); } } class Customer { **Scanner scan = new Scanner(System.in);** public static void method() { System.out.print("Name : "); // error **non-static variable scan cannot be referenced from a static context** String name = scan.nextLine(); } } </code></pre> <p><strong>Question :-</strong> while creating an Scanner class object outside the method() there is an compilation error :- <strong>non-static variable scan cannot be referenced from a static context</strong> but when i define it inside the method() it is working without error Why ?</p> <p><strong>Question :-</strong> How to create Scanner class Object that every class can use that single object which is defined at one place in a program. Is this possible ?</p>
<java>
2016-07-21 06:43:16
LQ_CLOSE
38,497,364
WebView loading blank screen in devices but working fine in emulator
<p>Enabled these two options for mywebview,</p> <pre><code>webV.getSettings().setJavaScriptEnabled(true); webV.getSettings().setDomStorageEnabled(true); </code></pre>
<android><webview>
2016-07-21 07:12:29
LQ_CLOSE
38,497,571
How to call/use a function inside an object? Javascript
I want to call a function or even create one in an object map-area. How does it properly work ? This is what I got. Doesn't work though... var _images = { test: { path:'test.jpg', areas: [{ coords:'211,38,238,60', text: 'let me test it', //onclick: .... ? obj = function(){ this.hello = function hello (){ } alert("Hello"); } } ] }, } var asdf = new obj(); asdf.cancel();
<javascript>
2016-07-21 07:21:29
LQ_EDIT
38,503,487
What is the purpose of :after ?
I have seen lately many :after in front-end css and to me it seems like : hover but there's must be a differnce so I want to understand exactly how it works/applies. Thanks very much.
<html><css>
2016-07-21 11:49:13
LQ_EDIT
38,503,827
Google "auto answers" what are they called and is there an API?
<p>When you query google for information, google itself usually offers an answer before you click on any site.</p> <p>For example "Who is the richest person in the world"</p> <p>Google : "Bill gates". I am wondering A: what this service's name is. And B: if there is an API we can use</p>
<python><api><search>
2016-07-21 12:05:18
LQ_CLOSE
38,504,363
Im a bit of noob, i want to change the title text to an image
I need some help. i want to change the following text logo into a logo, currently used by a theme on wordpress It looks like this now:[header image on website][1] any suggestions, my logo is currently on the server at: content/uploads/2016/07/cropped-Site_Logo-1.png `<div id="ribbon" class="span12 center none"> <div class="navbar navbar-inverse navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <h1 class="text_logo"><a href="/wp-content/uploads/2016/07/cropped-Site_Logo-1.png">StrtUp</a></h1> <a class="btn btn-navbar" data-toggle="collapse" data-target="#mobile_menu"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <div class="clear"></div>` [1]: http://i.stack.imgur.com/2Xi1G.png
<html><css><wordpress>
2016-07-21 12:30:05
LQ_EDIT
38,504,379
Which is the best free data warehouse products
<p>I am developing a system which constains a lot of olap work. According to my research, column based data warehouse is the best choice. But I am puzzled to choose a good data warehouse product. </p> <ol> <li><p>All the data warehouse comparison article I see is befor 2012,and there seems little article about it. Is data warehouse out-of-date? Hadoop HBase is better?</p></li> <li><p>As far as I know, InfiniDB is a high performance open source data warehouse product, but it has not been maintained for 2 years <a href="https://github.com/infinidb/infinidb" rel="nofollow">https://github.com/infinidb/infinidb</a>. And there is little document about InfiniDB . Has InfiniDB been abundanted by developers ?</p></li> <li><p>Which is the best data warehouse product by now?</p></li> <li><p>How do I incrementally move my Business data stored in the Mysql database to data warehouse ?</p></li> </ol> <p>Thank you for your answer!</p>
<warehouse>
2016-07-21 12:30:40
LQ_CLOSE
38,507,193
What other ways to initialize(allocate memory) data members of class in c++ other than constructors?
<p>Suppose i don't have constructors what are the other way to initialize data members of class?? _init() methods? considering we have to allocate memory for data members. </p>
<c++><constructor><initialization><data-members>
2016-07-21 14:37:22
LQ_CLOSE
38,508,781
I wanna make smth like this :( if time " now " = 5:50 pm) do // Somthing Android Studio
<p>I wanna do just like Alarm in time , but as I said in the question I wanna make smth like this :( if time " now " = 5:50 pm) do // Something i tried this but it's take all my battery life time : what I've Done is Set int Hours and int minutes and then </p> <pre><code>enter code here while (true){ if (Hours==x &amp;minutes==y ) //do somethin } so any better way ? </code></pre>
<android><android-studio>
2016-07-21 15:48:55
LQ_CLOSE
38,510,289
Python - What's wrong with my code
Python beginner here! I am trying to execute the following: print("Are you old enough to vote? Please enter your age below:") input() age = 18 if age < 18: print('You must be 18 to vote.') elif age >= 18: print ('You are of voting age.') When I run it, the program prints "You are of voting age" no matter how low the number input is... can someone help me? I'm sure this is really basic, but I'm stuck! Thanks!
<python-3.x>
2016-07-21 17:04:09
LQ_EDIT
38,510,462
Why are block level elements in this page displaying inline?
<p>I have met my wit's end. If anyone can tell me why the block level elements (h3 and p tags) are displaying inline in this page, you will be my hero: <a href="http://www.emc2017.emcss.org/committee-members" rel="nofollow">http://www.emc2017.emcss.org/committee-members</a></p>
<html><css><block>
2016-07-21 17:14:06
LQ_CLOSE
38,511,495
How can we open and enter a software installed on my desktop through java
<p>I have a application installed on my desktop.On clicking it asks for a username ,password and RSA token(which is a randomly generated number). How can i open this application through java . ....Need help on this </p> <p>I have tried with Robot class but did not succeed.Need Help </p>
<java>
2016-07-21 18:12:40
LQ_CLOSE
38,512,105
Sorting alphabetically in ruby on rails
<p>How do i make ActiveRecord to sort my movies title alphabetically when i click on a link in ruby on rails? Movies contains title with alphabets and others numbers. Thanks</p>
<ruby-on-rails><ruby>
2016-07-21 18:46:03
LQ_CLOSE
38,513,420
Unable to reset element to a vlaue of 0
<p>I have the following function here that I am using to reset the value attribute of some buttons to 0:</p> <pre><code>function resetAll() { var getAllButttons = document.getElementsByClassName("click-button"); for (i = 0; i &lt; getAllButtons.length; i++) { getAllButtons[i].value == 0; } } </code></pre> <p>The function is not doing what I want it to and i'm a bit stuck as to where i've gone wrong.. </p>
<javascript>
2016-07-21 20:06:23
LQ_CLOSE
38,515,183
Batch Rename Images - but keep original file, always
<p>Usually, I open cmd and use</p> <pre><code>ren oldname.jpg newname.jpg </code></pre> <p>and that works fine, but now I have an issue where I have to rename the same file into 50 or 100 different names.</p> <p>How can I rename these, but keep the original file (so that I can continue saving it as a different name).</p> <p>Thanks!</p>
<batch-file><cmd><batch-processing>
2016-07-21 22:11:14
LQ_CLOSE
38,515,345
What is the downside of using one-line if statements?
<p>I see most code-bases using bracketed if-statements in all cases including cases in which only one statement needs to be executed after the if.</p> <p>Are there any clear benefits to always using bracketed if-statements or has it just become a standard over time?</p> <p>What is the general consensus on this, would it be a big mistake to allow one-line ifs through our linter?</p>
<javascript><syntax><code-formatting>
2016-07-21 22:25:29
LQ_CLOSE
38,516,071
Video Conferencing in Freeswitch
<p>I am working on Calling Solution which uses FreeSwitch for Audio/Video Calling. I am stuck with Video Conferencing system that will be run by iOS and Andriod client devices.</p> <ul> <li>When I create a Video Conference Call, every user can see Video of only one user.</li> <li>Then I added some canvas variables for Video Conferencing but all in vain.</li> <li>I have also enabled WebRTC port in FreeSwitch.</li> </ul> <p>I need an open source Video Conferencing Solution developed under Freeswitch and WebRTC and will be compatible to develop in Andriod and iOS platforms.</p> <p>Does OpenVCS or telepresence Server can do trick or not? Any other solution for this problem? </p>
<android><ios><webrtc><freeswitch><video-conferencing>
2016-07-21 23:46:21
LQ_CLOSE
38,516,138
Python - Having user sort list smallest to biggest
So I'm making a code where it asks the user to to swap two places on the list until the list is from smallest to biggest. So it should look like this: Hello: Your current list is [6, 7, 8, 2 , 9, 10, 12, 15, 16, 17] Please pick your first location -> 4 Please pick your second location -> 2 Your new list is [6, 2, 8, 7 , 9, 10, 12, 15, 16, 17] I've gotten to this part but I am currently unable to figure out how to get the USER to do the sorting and not the code. Your list is not sorted: Please continue Please pick your first location -> 1 Please pick your second location -> 2 Your new list is [2, 6, 8, 7 , 9, 10, 12, 15, 16, 17] Please pick your first location -> 3 Please pick your second location -> 4 Your new list is [2, 6, 7, 8 , 9, 10, 12, 15, 16, 17] Great job, thank you for sorting my list. Here is my code: list = [4,2,5,5,6,4,7,6,9,5] print("Heres your current list", list) print("Pick a location between 1 and 10") num = int(input()) if num <= 10 and num >= 1: print("Please pick another location between 1 and 10") num1 = int(input()) tempBox1 = list[num-1] tempBox2 = list[num1-1] list[num-1] = tempBox2 list[num1-1] = tempBox1 print("Your new list is", list) Any help would be appreciated, thank you.
<python><python-3.x>
2016-07-21 23:54:38
LQ_EDIT
38,516,230
Helpp! New to programming (loops are my nightmare) ! Working with arrays? Bubble sorting?
I'm doing this assignment where by using the Bubble Sort Algorithm, create a program that asks a user for a number of integers. The program will then ask the user to input as many integers as the user requested and fill the values of the arrays into it. Afterwards, the program user output the following: a. Show Number List from File (Unsorted) b. Show Sorted List c. Show Greatest number d. Show Smallest Number e. Show the Median Value f. Show the Average Value So far I have this : import java.util.Scanner; public class Bubbles { public static void main(String[] args) { //Declare Variables String strUser; int intSize; int[] intNum; //Input Scanner scn=new Scanner(System.in); //Process/Output System.out.println("Please enter the number of values you would like to enter:"); strUser=scn.nextLine(); intSize=Integer.parseInt(strUser); intNum=new int [intSize]; for(int i=0; i < intNum.length; i++) { System.out.println("Please enter for index value of "+i+":"); intNum[i]=scn.nextInt(); } } } which outputs this (for example): Please enter the number of values you would like to enter: 3 Please enter for index value of 0: 47 Please enter for index value of 1: 89 Please enter for index value of 2: 42 BUILD SUCCESSFUL (total time: 13 seconds) Now how do I get all these inputed numbers into an array so I can be them in a list, and then use the bubble sorting to order them, and so on.. Like this: Unsorted order: 47,89,42 Sorted order: 42, 47, 89 I'm so lost, I know.
<java><arrays><algorithm><sorting>
2016-07-22 00:06:33
LQ_EDIT
38,518,853
Getting 404 error in browser console when using iframes?
>I'm using iframe with angularjs,but getting 404 error in browser console? >Please help..
<javascript><angularjs>
2016-07-22 05:31:04
LQ_EDIT
38,520,047
please help me anyone to create gmail account. i am facing trouble with month and country drop downs
I want to select gmail month and country drop downs using select class but it is showing the error like Element should have been "select" but was "div" i handled with actions class but not with select class. i tried with x path, id and class but i didn't get. i am new to selenium. i am frustrated with this error.. so please help me out. here is my code. d.get("https://accounts.google.com/SignUp?continue=https%3A%2F%2Faccounts.google.com%2FManageAccount"); d.manage().window().maximize(); Select s=new Select(d.findElement(By.id("BirthMonth"))); s.selectByIndex(5); System.out.println("may slected...");
<selenium-webdriver>
2016-07-22 06:56:09
LQ_EDIT
38,520,480
i want to send some command from my android app to android terminal emulator
public void onClick(View p1) { // TODO: Implement this method Intent i=new Intent(Intent.ACTION_SEND); i.setType("*/*"); i.setPackage("jackpal.androidterm"); i.putExtra(Intent.EXTRA_TEXT,"date"); startActivity(i); }
<android>
2016-07-22 07:21:18
LQ_EDIT
38,520,900
How to take arbitrary number of pranthesis from user for add function
add(5)(10)(20) i.e. one should be able to supply arbitrary number of parenthesis.Any help?
<python>
2016-07-22 07:43:20
LQ_EDIT
38,521,346
how to Import Excel sheet in datagridview in C#
while i am trying to import data from excel some data of my excel sheet is missing in datagridviewa [excel sheet][1] [Data GridView][2] [1]: http://i.stack.imgur.com/ero7B.png [2]: http://i.stack.imgur.com/99G1X.png
<c#><.net>
2016-07-22 08:07:55
LQ_EDIT
38,521,457
java regex split multiple separators
I have a string that contains urls separate by | like this: (http://...|http://...|http://...) but inside some urls I may have the caracheter **|**, so I could split it with .split("|http://") but the problem is that inside some urls contains another urls like this (http://...|http://..=http://...=http://...|http://...=http%25253A%25252F%25252F...). So how can I split by ( |http:// or =http:// or =http%25253A%25252F%25252F) using regex? Thanks Jon
<java><regex>
2016-07-22 08:14:35
LQ_EDIT
38,522,974
Serialization of an object in Java
<p>we have an object as following,</p> <p>[user_id,name,email,password]</p> <p>1- How can we serialize this object?<br> 2- How can we serialize user_id,name,email part only?<br> That means I dnt want serialize password field.</p>
<java><hadoop><serialization><mapreduce>
2016-07-22 09:31:33
LQ_CLOSE
38,523,269
Related to ArrayList And Hashtable
<p>I have created one Hashtable and an arraylist.In arrayList I have values from which some are present in hashtable as key of hashtable. I am trying to check how many entry of elements stored in arraylist are there in Hashtable.</p>
<java>
2016-07-22 09:46:05
LQ_CLOSE
38,525,329
how can i set error info for my home page. here is my code
if($evaluation_sheet_t3 == 0) { $error_eval = $error_eval.'Term 3,'; $error_eval = substr($error_eval,0,strlen($error_eval)-1); $error_info = "The ".$error_eval." evaluations are not completed."; $this->session->set_flashdata('error_info',$error_info); redirect(base_url().'teacher_manager/term_wise_sheet_data/'.$term_value.'/'.$class_name1.'/'.$subject_id,'refresh'); } above is my controller. plz help someone
<php>
2016-07-22 11:28:53
LQ_EDIT
38,525,480
Merge two JSON object based on common value in javascript?
I have the following situation with two object that I have to merge based on value1 and i know the property is key1= namekey1 : obja = [{ key1: value1; a : 1 ; b : 2}] objb = [ {namekey1: value1; d : 3 ; c : 4}] Desired result objc = [ key1: value1; a : 1 ; b : 2 ;d : 3 ; c : 4] Is there a way I can do this? Thanks
<javascript><object>
2016-07-22 11:36:43
LQ_EDIT
38,525,755
Websocket communication in a symfony project
<p>I want to send notification from server to browsers in a php symfony project. Is there a simple way to do this in symfony ?</p>
<websocket><symfony>
2016-07-22 11:50:56
LQ_CLOSE
38,525,969
how to retrive array values into individual varriables
i have an api which returns a response in form of an array. i want to extract the elements in this array and save them in my database. can any one help.i have tried the explode function but seems am missing something. below is an exact sample response from the api Array ( [Response] => Array ( [external_reference] => bablaba [withdraw_request_id] => babalalal [amount] => bababababa [status] => ababababab [message] => ababababa. [new_balance] => babababa [amount_sent] => ababababa [currency_sent] => ababababa [charge_amount] => ababababa [charge_currency] => babababa [currency] => abababaab ) )
<php><arrays>
2016-07-22 12:03:19
LQ_EDIT
38,527,991
Can't access A Path on powershell
so i follow [this][1] guide to delete steam cloud profile, and i have to clc a folder [Steam\userdata\95925904\381210\remote], and whenever i try to clc i get an access denied error, picture of the errror - https://gyazo.com/cbab29f1daa2506b474683af42696ec1. i follow this i tried to open the powershell as administrator and it didnt help, also i couldnt find solutions on google so i decided to open a new thread
<powershell><steam>
2016-07-22 13:40:53
LQ_EDIT
38,528,466
Why is this c program NOT causing a segmentation fault with alphanumeric values?
In its simplest form the program is int main(){ int x; scanf("%d",x); } when we give this program any numeric value as input it fails by producing a segfault signal which is what we should expect. But if we instead give it any alphanumeric value it DOES NOT fails !!! what is going on in the scanf that produces this behavior ? This is the backtrace from gdb when running it with a numeric value (gdb) bt #0 0x00000034e7456ed0 in _IO_vfscanf_internal () from /lib64/libc.so.6 #1 0x00000034e74646cd in __isoc99_scanf () from /lib64/libc.so.6 #2 0x0000000000400553 in main () So why is it NOT failing for any alphanumeric value like 'a' or 'dfgb'?
<c><debugging><gdb><internal>
2016-07-22 14:04:18
LQ_EDIT
38,529,115
usage of grep -v unix command
i have not used -v option before with grep. The description in help says "Invert the sense of matching, to select non-matching lines." what does the command `grep -v '^$' file.txt` does?
<regex><linux><unix><grep>
2016-07-22 14:34:55
LQ_EDIT
38,530,096
@Html.TextBoxFor with default help text
<p>How can I get a Default help text ("Type your name here" ) in @Html.TextBoxFor/@Html.Editorfor</p> <p>When a user clicks the box for typing , then the text will disappear.</p>
<c#><asp.net-mvc><model-view-controller>
2016-07-22 15:20:47
LQ_CLOSE
38,530,556
What is the minimum configuration(include haxm) to run android studio on computer smoothly ?? please help me
I'm interested in developing android apps.But I struggled a lot to install the android studio on my computer.I end up with an error that my windows can't find haxm. Please help me what I need to do?? My RAM is just 2GB.Is there any need to extend my RAM?? [enter image description here][1] [1]: http://i.stack.imgur.com/0DypJ.png
<android><installation><developer-tools>
2016-07-22 15:44:18
LQ_EDIT
38,530,709
R - calculating mean of every 3 values in array using a for loop
<p>Very new to programming - I have an array with dimension 821 and I would like to take the average of every 3 values. Each line represents monthly data and I need the quarterly averages (so every 3 months). I want to do it using for loops for practice but I cannot figure it out. </p>
<arrays><r><for-loop>
2016-07-22 15:52:55
LQ_CLOSE
38,532,452
run batch code in vba to open a specific access file in runtime
How would I run the following in a shell statement in ms access? "C:\Program Files (x86)\Microsoft Office\Office14\msaccess.exe" "http://stoneplastics/Departments/Quality/Databases/LabelsNewRelease.accdb" /runtime It works fine in a batch file. I have tried for 3 hours to get this to work and I am having trouble
<batch-file><ms-access><vba>
2016-07-22 17:42:53
LQ_EDIT
38,532,596
I am a begineer, unable to run a very simple android app on emulator
I am new to Android app development. I created a new a project on Android Studio, which can run on Ice cream sandwich and later versions. Just added one activity : "Basic activiy" from the list of activities. Then tried to run the app on emulator Nexus 5x. But the app did not run, and the gradle build shows 61 errors. I am listing some of the errors below: Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0 Error: at java.lang.ClassLoader.defineClass1(Native Method) Error:java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0 Error: at java.lang.ClassLoader.defineClass(ClassLoader.java:800) Error: at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) Error: at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) Error: at java.net.URLClassLoader.access$100(URLClassLoader.java:71) Error: at java.net.URLClassLoader$1.run(URLClassLoader.java:361) Error: at java.net.URLClassLoader$1.run(URLClassLoader.java:355) Error: at java.security.AccessController.doPrivileged(Native Method) Error: at java.net.URLClassLoader.findClass(URLClassLoader.java:354) Error: at java.lang.ClassLoader.loadClass(ClassLoader.java:425) Error: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) Error: at java.lang.ClassLoader.loadClass(ClassLoader.java:358) Error: at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) Error:Exception in thread "main" Error: at java.lang.ClassLoader.defineClass1(Native Method) Error: at java.lang.ClassLoader.defineClass(ClassLoader.java:800) Error: at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) Error: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) Error: at java.lang.ClassLoader.loadClass(ClassLoader.java:358) Error: at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) Error:Exception in thread "main" Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 1 I don't understand what these errors mean. Would be grateful if someone can help me out.
<android><android-emulator><android-gradle-plugin>
2016-07-22 17:52:08
LQ_EDIT
38,533,670
Font Color Isn't Changing
<p>I know this is a rookie question, but why isn't my font colour changing?</p> <p>My HTML:</p> <pre><code>&lt;h1 class="InternetTitle"&gt;Internet Services&lt;/h1&gt; </code></pre> <p>My CSS:</p> <pre><code>.InternetTitle { color: 2777fd; text-align: center; } </code></pre> <p>It aligns my text vertically, but it doesn't change my color. And I can't figure out why.</p> <p>I've also tried: </p> <pre><code>&lt;h1&gt;Internet Services&lt;/h1&gt; h1 { color: 2777fd; text-align: center; } </code></pre>
<html><css>
2016-07-22 19:04:52
LQ_CLOSE
38,535,904
Store serialized arrays or individual columns?
<p>I'm in need of advice. I have a large table that a user will fill out (roughly 150+ fields), many of which are (bool) check boxes, and a few text inputs. I know that if I store the tables as serialized arrays, it would dramatically affect searching and exporting the database into another usable format (like a .csv).</p> <p>Would I be better off storing each field individually and creating a massive table, store it serialized anyway, or is there some other way to achieve this with a happy middle?</p>
<php><mysql>
2016-07-22 22:05:18
LQ_CLOSE
38,536,488
Link does not work without http:// protocols (php)
I use php and I have an input that the user types in a link to his website and the link should appear for others to view it or open it. I'm testing the input and the problem is the link does not work unless I types either http:// or https:// before the mentioned URL and I think some one might just write www.foo.com without writing the hhtp:// . The link automatically substitutes the http:// or https://with the root of my website ( or at least that's what I guess ), because I'm working with XAMP and the URL appears as so : localhost/MyFooProjectFile/www.foo.com . How to make links work without the protocols or substitute the none mentioned protocol with the right one before my user's link ? Note : I know the question might seem stupid (cause who is the idiot who thinks a link could work without protocol), but what makes me wonder is I write in the address bar of my browser www.foo.co and it would take me there, without me menthionioning the protocols. PLease note that I do not have the code in the time of writing the question. Do not downvote just comment if code is crucial, Thanks.
<php>
2016-07-22 23:15:23
LQ_EDIT
38,536,609
Should Node.js apps be published to npm?
<p>I am making a Node.js server application. It is hosted on GitHub and I thought that I would publish it to npm to make it easier to install for users.</p> <p>The problem is, when I run npm install my-app, it installs it to the node_modules directory. I would like it to be installed into the current directory, kind of like a git clone would do.</p> <p>Is this a valid use case for npm publish? Or should I just stick with the git clone, npm install, npm start flow?</p>
<node.js><git><npm>
2016-07-22 23:31:29
LQ_CLOSE
38,537,036
MySQLSyntaxErrorException: WHERE Clause
<p>I'm trying to retrieve data from my database. However, it gives me an error of:</p> <pre><code>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE FORMID = 120002013 AND CLASSIFICATION = 'Private'' at line 1 </code></pre> <p>Below is my code for retrieving data: </p> <pre><code>try (Connection conn = myFactory.getConnection()) { PreparedStatement pstmt = conn.prepareStatement("SELECT CENSUSYEAR, SCHOOLID, CLASSIFICATION, SCHOOLNAME" + "FROM DIRECTORY_SCHOOL WHERE FORMID = ? AND CLASSIFICATION = ?"); pstmt.setInt(1, formID); pstmt.setString(2, classification); ResultSet rs = pstmt.executeQuery(); </code></pre> <p>What seems to be the problem? Thanks!</p>
<java><mysql><database><jdbc>
2016-07-23 00:41:00
LQ_CLOSE
38,537,348
How to plot a function $f:D\subset\mathbb{R^2}\to\mathbb{R}$?
I'm new to Matlab and I have a function $f(x,\,y)=\sqrt{x^2+y^2}$ and $D=\{(x,\,y)\in\mathbb{R^2}:1\leq{x^2+y^2}\}$.
<matlab><matlab-figure>
2016-07-23 01:41:20
LQ_EDIT
38,539,853
How to process html user input Django?
<p>I want to process html form user input using Django. This I can do with Django form method but I want to do this with html form .</p> <p>In short I want to take user input from html search box and in back-end Django will give related information from LDAP. LDAP part I have done but getting user input and passing values to LDAP search is making problem for me.</p> <p>Please help.</p>
<python><html><django><forms><search>
2016-07-23 08:39:19
LQ_CLOSE
38,540,314
java pattern ....code for the pattern
1 1 2 1 1 3 3 1 n lines the logic i made import java.io.*; class pat { public static void main(String[] args)throws IOException { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); int n,p=0; System.out.println("Enter value of n"); n=Integer .parseInt(in.readLine()); for(int i=0;i<n;i++) { for(int j=0;j<n-i;j++) { System.out.print(" "); } for(int k=0;k<=i;k++) { System.out.print((int)Math.pow(11,p)); } System.out.println(); p++; } } }
<java>
2016-07-23 09:38:47
LQ_EDIT
38,541,355
jquery datepicker default value in html input filed
Jqeury datepicker default (today) in input field [enter image description here][1] [1]: http://i.stack.imgur.com/3hGnE.png
<javascript><jquery><datepicker>
2016-07-23 11:38:48
LQ_EDIT
38,542,050
Flexbox Header Footer Sidebar
<p>How can we make something like this using flexbox? <a href="https://i.stack.imgur.com/svF1J.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/svF1J.png" alt="enter image description here"></a></p>
<css><flexbox>
2016-07-23 12:57:23
LQ_CLOSE
38,542,571
C# computer owner name
<p>I have one problem.. I have image converting program so if one user converting image file then his computer name going into file name.'</p> <p>Something like this I need: <code>John-Doe.23-07-2016.JPG</code></p> <p>But at the moment taking computer name like this: <code>John-Doe/John-Doe.23-07-2016.JPG</code></p> <p>My code:</p> <pre><code>string user = File.GetAccessControl(textBox1.Text).GetOwner(typeof(NTAccount)).ToString(); </code></pre> <p>textBox1.Text is place where program choosing folder where is image files.</p>
<c#>
2016-07-23 13:57:21
LQ_CLOSE
38,543,385
how i add "read more" to my blog
i have HTML template then i convert my tamplet to wordpress theme, but i can't add "read more" to home page. i use this code in functions.php: function the_content_limit($max_char, $more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { $content = get_the_content($more_link_text, $stripteaser, $more_file); $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]&gt;', $content); $content = strip_tags($content); if (strlen($_GET['p']) > 0) { echo "<p>"; echo $content; echo "</p>"; } else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) { $content = substr($content, 0, $espacio); $content = $content; echo "<p>"; echo $content; echo "..."; echo "</p>"; } else { echo "<p>"; echo $content; echo "</p>"; } } and i use this code in index.php <div class="text_home"><?php the_content_limit(300); ?></div> please, help me ..
<php><html><wordpress>
2016-07-23 15:27:21
LQ_EDIT
38,543,884
VB .NET regular expression
I want the regular expression in vb .net that match any occurrence of three or more plus signs +++ in any string like: Hello John +++++ I liked your post +++ it is great ++++++++ thank you
<regex><vb.net>
2016-07-23 16:19:54
LQ_EDIT
38,545,225
Need help in code to calculate alphabet repetition in string
i have a string say "**AAABBCCCDAAT**" so output for the following should be **A3B2C3D1A2T1**. Thanks
<python><python-3.x>
2016-07-23 18:35:44
LQ_EDIT
38,545,848
Extract only numbers from a string with punctuation and spaces in R?
<p>How would I extract only the numbers using a regular expression from the following string:</p> <pre><code>+1 Ab_Cd- 001 234.txt` </code></pre> <p>Such that I return:</p> <pre><code>1001234 </code></pre> <p>I have a data frame with a vector of such strings. I'm trying to do the above in both R and Python. I'm more familiar with R's <code>stringr</code> and <code>gsub()</code> from <code>base</code>. I've tried multiple expressions but can't get anything that works well.</p>
<python><regex><r>
2016-07-23 19:50:20
LQ_CLOSE
38,546,482
What is wrong with this post?
Is there any typo error? I cannot find any! It is a simple crud application with slim framework I am using mysql database... slim version is 2.6.2 Image of postman: [![enter image description here][1]][1] // Adds a customer function addCustomer() { //$request = Slim::getInstance()->request(); $request = \Slim\Slim::getInstance()->request(); $cus = json_decode($request->getBody()); $sql = "INSERT INTO customers (Username,First_Name,Last_Name,Email,Phone,Password,Type,Status) VALUES (:username, :firstname, :lastname, :email, :phone, :password, :type, :status)"; try { $db = DB_Connection(); $stmt = $db->prepare($sql); $stmt->bindParam("username", $cus->Username); $stmt->bindParam("firstname", $cus->First_Name); $stmt->bindParam("lastname", $cus->Last_Name); $stmt->bindParam("email", $cus->Email); $stmt->bindParam("phone", $cus->Phone); $stmt->bindParam("password", $cus->Password); $stmt->bindParam("type", $cus->Type); $stmt->bindParam("status", $cus->Status); $stmt->execute(); $cus->id = $db->lastInsertId(); $db = null; echo json_encode($cus); } catch(PDOException $e) { echo '{"error":{"text":'. $e->getMessage() .'}}'; } } [![enter image description here][2]][2] [1]: http://i.stack.imgur.com/9zOAA.png [2]: http://i.stack.imgur.com/fckFM.png
<php><sql><post><slim>
2016-07-23 21:14:17
LQ_EDIT
38,546,545
I do not understand the error code CS0120 for this specific program in C#
I am new to C# and need a little help. I am having one error and have searched for answers in my book and watched tutorials for this particular subject. The error is in bold. Any help will be appreciated! The large gap is to indicate another class I added called Point ~Thank you class Program { private static Point another; static void Main(string[] args) { Point origin = new Point(1366, 768); Point bottomRight = another; double distance = origin.DistanceTo(bottomRight); Console.WriteLine("Distance is: {0}", distance); Console.WriteLine("Number of Point objects: {0}", Point.ObjectCount()); { private int x, y; private int objectCount = 0; public Point() { this.x = -1; this.y = -1; objectCount++; } public Point(int x, int y) { this.x = x; this.y = y; objectCount++; } public double DistanceTo(Point other) { int xDiff = this.x - other.x; int yDiff = this.y - other.y; double distance= Math.Sqrt((xDiff * xDiff) + (yDiff * yDiff)); return distance; } public static int ObjectCount() { ***return objectCount;*** } } }
<c#>
2016-07-23 21:23:25
LQ_EDIT
38,546,596
how to prevent threads from exist
i have 10 threads working together,after starting the threads 15s later all threads Exists only one thread remains, my code: procedure TForm1.Button2Click(Sender: TObject); begin AA; BB; CC; DD; EE; FF; GG; HH; II; JJ; end; procedure TForm1.AA; //same procedure for BB,CC,DD,EE.FF,JJ,HH,II,JJ var lHTTP: TIdHTTP; begin lHTTP := TIdHTTP.Create(nil); TTask.Create(Procedure //HTTP operations end).Start; end;
<multithreading><delphi><delphi-10-seattle>
2016-07-23 21:30:33
LQ_EDIT
38,546,910
uploading an image into a database php
Am trying to insert a data into a database.This is the code that am using. It inserts all the data except the image(Pic) any help? public function insert($hey){ try { $hey = $this->db->query("INSERT INTO addmember(Pic,Firstname,Lastname,Age,Gender,Phonenumber,Location,Member,Department) VALUES('".$hey['pic']."','".$hey['fname']."','".$hey['lname']."','".$hey['age']."','".$hey['gender']."','".$hey['phone']."','".$hey['loc']."','".$hey['group']."','".$hey['department']."')"); } catch (PDOException $e) { echo $e->getMessage(); } }
<php><mysql>
2016-07-23 22:20:39
LQ_EDIT
38,547,307
Accessing Perl array in bash
<p>I have a perl code where I execute some bash commands using backticks. I want to read a perl array in that bash command. My array has some strings and I want to read them in a for loop of bash.</p> <pre><code>my @aArray = (1,2,3,4); my $command = 'for i in $@aArray; do xxxxx $i; done;'; `$command` </code></pre> <p>I also want to catch error if any part of the loop fails. Thanks</p>
<linux><bash><perl>
2016-07-23 23:28:53
LQ_CLOSE
38,547,503
convert text-string of hours + mins to rounded decimal hours in PHP
<p>I have a text-string <code>1 hour 43 mins</code></p> <p>How can I convert this to output <code>1.75</code> using PHP? </p> <p><em>(and this be true for all other possibilities, rounding to nearest .25 hours)</em></p>
<php><datetime>
2016-07-24 00:08:38
LQ_CLOSE
38,547,738
Java program prints too many times
import java.io.*; import java.util.*; public class Bowling7 { public static void main(String[] args) throws FileNotFoundException { Scanner fin = new Scanner(new FileReader("bowling.txt")); String Team, Member; int teamw, teamb, Score; String [] blue_members = new String[3]; String [] white_members = new String[3]; int [] blue_scores = new int[3]; int [] white_scores = new int[3]; int b = 0; int w = 0; System.out.println( "This program reads the lines from the file bowling.txt to determine\n" + "the winner of a bowling match. The winning team, members and scores\n" + "are displayed on the monitor.\n"); while (fin.hasNext()) { Member = fin.next(); Team = fin.next(); Score = fin.nextInt(); if (Team.equals("Blue")) { blue_members[b] = Member; blue_scores[b] = Score; b++; } else { white_members[w] = Member; white_scores[w] = Score; w++; } } if(sumArray(blue_scores)>sumArray(white_scores)) { printArray("Blue", blue_members, blue_scores); } else { printArray("White", white_members, blue_scores); } fin.close(); } public static int sumArray(int[] Score) { int sum = 0; for (int i = 0; i < Score.length; i++) sum += Score[i]; return sum; } public static void printArray(String Team, String[] Member, int[] Score) { for (int i = 0; i < Member.length; i++) { System.out.printf("Winning team:"+Team+"\n"+Member[i]+":"+Score[i]); { Hello! My program keeps outputting: This program reads the lines from the file bowling.txt to determine the winner of a bowling match. The winning team, members and scores are displayed on the monitor. Winning team: Blue Fred:20 Winning team: Blue Hilda: 24 Winning team: Blue Pat: 51 I need it to output: This program reads the lines from the file bowling.txt to determine the winner of a bowling match. The winning team, members and scores are displayed on the monitor. Winning Team: Blue Player Score Fred 20 Hilda 24 Pat 51 Any help at all would be greatly appreciated I am a newbie to java programming!
<java><programming-languages>
2016-07-24 00:54:02
LQ_EDIT
38,548,549
How to get data of an specefic row or column in sql
<p>Example</p> <pre><code>id name surname 0 Alex A 1 Mark B 2 Bill C </code></pre> <p>Let's suppose that I want to get the name and surname where id equals 1 in Java, how can I get the values of each column</p>
<java><mysql><sql><netbeans>
2016-07-24 03:47:36
LQ_CLOSE
38,549,564
C++, memset a double array failed
I am new to C, and I want to declare a doube type array dynamicly, so here is my code void function(int length, ...) { [snippet] double * a = (double *)malloc(sizeof(double) * length); memset(a, 1, sizeof(double) * length); for (int i = 0; i < length; i ++) { cout << a[i] << endl; } [snippet] } When I set the length to 2 and the code did not print all 1s. It just print the following outputs. 7.7486e-304 7.7486e-304 So, what should I do to fix it? Thank you!
<c><memset>
2016-07-24 07:03:18
LQ_EDIT
38,550,753
What does the following Python code do?
<p>I'm not sure, especially, what the last line does. I saw it in a Python book.</p> <pre><code>from random import randint random_bits = 0 for i in range(64): if randint(0, 1): random_bits |= 1 &lt;&lt; i </code></pre>
<python>
2016-07-24 09:53:04
LQ_CLOSE
38,553,348
I am a newbie in programming specifically C#.. Need help in solving some programming puzzles
I am trying to get the output like this: 4 then 5 then 6 then 7 then 8 then 9 then 10 then 11 then 12 then 13. The biggest challenge I'm facing is to make sure the word "then" doesn't appear after the last number(13). Below is my code class Program { static void Main(string[] args) { int start; for(start = 4; start<=13; start++) Console.Write(start +" then " ); Console.ReadKey(); } }
<c#>
2016-07-24 14:52:59
LQ_EDIT
38,553,874
How to grab data from selected checkbox
I currently have a number of items each with a list of data inside. What I'm trying to achieve is, when i select a checkbox that has the same matching attribute of "itemName", the matching div that contains the additional data is appended to a container. I have written some code up here: [http://codepen.io/anon/pen/OXkgdk?editors=1010][1] [1]: http://codepen.io/anon/pen/OXkgdk?editors=1010 <div class="item" itemName="itemOne"> <h2> Item One </h2> <ul> <li> Data 1 </li> <li> Data 2 </li> <li> Data 3 </li> </ul> </div> <div class="item" itemName="itemTwo"> <h2> Item Two </h2> <ul> <li> Data 1 </li> <li> Data 2 </li> <li> Data 3 </li> </ul> </div> <ul class="itemSelection"> <li itemName="itemOne"><label><input type="checkbox"/>Item One</label></li> <li itemName="itemTwo"><label><input type="checkbox"/>Item Two</label></li> </ul> <div id="container"></div> Any help would be greatly appreciated.
<javascript><jquery><html><checkbox><clone>
2016-07-24 15:49:47
LQ_EDIT
38,554,676
Deploy .Net Solution with multiple project
I Have a solution that contains multiple projets -SOLUTION: 1- ASP MVC Project 2- web api project 3 BLL project (class library) 4 DAL project (class library) the web api project dependes on the BLL and DAL project the ASP MVC Project has no dependence , it consums only service from web api project I went to deploy my solution: I start by deploying web api project in IIS 7(by right click and choose publish in the contextual menu) , when deployement is finished i receive an error message : the library BLL and BAL was not recognized I can not identify the source of this problem can someone help please ?
<c#><asp.net-mvc><asp.net-web-api><dll>
2016-07-24 17:18:00
LQ_EDIT
38,554,814
How to resolve 'A get or set accessor expected' compile error C#
Hi I'm trying to write some code that will set a countdown timer in C# but I'm getting a compile error A get or set accessor expected Looking around it seems that I'm missing some () somewhere, but I'm not really sure where the issue is. Here's the code that I'm having trouble with, any help or advice would be appreciated. public static class TimeController { static DateTime TimeStarted; static DateTime TotalTime; public static void StartCountDown(TimeSpan totalTime) { TimeStarted = DateTime.UtcNow; TotalTime = totalTime; } public static TimeLeft get { var result = DateTime.UtcNow - TimeStarted; //THIS IS THE LINE THAT HAS THR ERROR if (result.TotalSeconds <= 0) return TimeSpan.Zero; return result; } }
<c#><compiler-errors><countdowntimer>
2016-07-24 17:32:58
LQ_EDIT
38,555,435
Dispaly a grid in html
I am a social sciences researchers and I am trying to create a task for an online study. The task is the following: a grid with shaded and white squares will be displayed and the task consist in counting the nb of shaded squares (as in the example). Different grids, with varying number of shaded squares will be shown to the participants in the study. I have the program that randomly generates an array of 0s and 1s in javascript and stores the number of 1s (answer for the problem=nb of coloured squares). What I need is to be able to display the array of numbers in a grid in html. Any ideas would be very welcome and extremely helpful. [enter image description here][1] [1]: http://i.stack.imgur.com/3F9IJ.jpg In any case, thanks a lot! Juliana
<javascript><gridster>
2016-07-24 18:35:48
LQ_EDIT