Questions Tagged with #Web frameworks

A web application framework is a software framework that is designed to support the development of dynamic websites, web applications and web services. The framework aims to alleviate the overhead associated with common activities performed in Web development.

What Scala web-frameworks are available?

I've just started learning Scala, and the first thing I'm going to implement is a tiny web application. I've been using Erlang for the last year to implement server-side software, but I've never wrote..

Can anyone recommend a simple Java web-app framework?

I'm trying to get started on what I'm hoping will be a relatively quick web application in Java, yet most of the frameworks I've tried (Apache Wicket, Liftweb) require so much set-up, configuration, a..

T-SQL: Deleting all duplicate rows but keeping one

I have a table with a very large amount of rows. Duplicates are not allowed but due to a problem with how the rows were created I know there are some duplicates in this table. I need to eliminate the ..

Clearing my form inputs after submission

I've tried it a few different ways based on searches I've done on the subject and for some reason I can't get it to work. I just want my text inputs and textarea to clear after I hit the submit button..

How do you do a deep copy of an object in .NET?

I want a true deep copy. In Java, this was easy, but how do you do it in C#?..

convert string to char*

Possible Duplicate: Convert std::string to const char* or char* Probably a & or something similar missing (I am noob at cpp). I have string R = "somthing"; char* S; How would I co..

Laravel Eloquent: Ordering results of all()

I'm stuck on a simple task. I just need to order results coming from this call $results = Project::all(); Where Project is a model. I've tried this $results = Project::all()->orderBy("name");..

How to use S_ISREG() and S_ISDIR() POSIX Macros?

This is a C program I wrote to recursively navigate and output directories and regular files. It compiles and runs fine on my Linux machine. But on Solaris, the dit->d_type == 8 check and the othe..

Correct use for angular-translate in controllers

I'm using angular-translate for i18n in an AngularJS application. For every application view, there is a dedicated controller. In the controllers below, I set the value to be shown as the page title...

Linux command for extracting war file?

How can I extract a .war file with Linux command prompt?..

How does one add keyboard languages and switch between them in Linux Mint 16?

I've added languages in Language Support but I do not see the language icon in the panel tray, nor can I switch between languages...

How to detect browser using angularjs?

I am new to angularjs. How can I detect userAgent in angularjs. Is it possible to use that in controller? Tried something like below but no luck! var browserVersion = int((/msie (\d+)/.exec(lowerca..

Does Python SciPy need BLAS?

numpy.distutils.system_info.BlasNotFoundError: Blas (http://www.netlib.org/blas/) libraries not found. Directories to search for the libraries can be specified in the numpy/distutils/site..

What is the difference between HTTP 1.1 and HTTP 2.0?

HTTP/1.1 has served the Web well for more than fifteen years, but its age is starting to show. Can anybody explain what is the main difference between HTTP 1.1 and 2.0? Is there any change in ..

Need to remove href values when printing in Chrome

I'm attempting to customize the print CSS, and finding that it prints links out with the href value as well as the link. This is in Chrome. For this HTML: <a href="http://www.google.com">Goog..

Error: cannot open display: localhost:0.0 - trying to open Firefox from CentOS 6.2 64bit and display on Win7

I am on a Windows7 machine and I'm trying to get firefox to open on the centOS machine, but be displayed on my current screen. When typing firefox in terminal, I am getting the following error: Erro..

phpMyAdmin access denied for user 'root'@'localhost' (using password: NO)

I am unable to connect to my MySQL in xampp I have this error: MySQL said: Documentation 1045 - Access denied for user 'root'@'localhost' (using password: NO) mysqli_real_connect(): (HY0..

MySQL foreach alternative for procedure

My problem is fairly simple. I have table sets that store product sets (more products looking like one on the outside - computer, mouse and keyboard for ex.) it's connected M:N using sets_products tab..

Delete commit on gitlab

How can I delete a commit that I made on GitLab? This commit that I made is not the HEAD now. If I can't delete it, can I edit? When it was the HEAD, I tried: git reset --soft HEAD git reset -..

How to add an event after close the modal window?

I have code modal: <-- Button to trigger modal --> <div id="result"></div> <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a> &l..

How to install pip3 on Windows?

I use python 2.7, 3.5.2 and 3.6. Normally pip3 is installed with python3.x. But ... The code: where pip3 gives me: INFO: Could not find files for the given pattern(s). How can I fix this?..

Convert a String In C++ To Upper Case

How could one convert a string to upper case. The examples I have found from googling only have to deal with chars...

What happened to console.log in IE8?

According to this post it was in the beta, but it's not in the release?..

jquery : focus to div is not working

After the ajax function is over. in success messages I'm focusing to the specific div. But it's not working. My code is here. $j.ajax({ url:"<?php echo admin_url( 'admin-ajax.php' ); ?>", ..

React-router urls don't work when refreshing or writing manually

I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my webpage it does not load what I want. For instance, I am in localhost/joblist and everything is fine..

Dynamic SQL results into temp table in SQL Stored procedure

The code is as follows: ALTER PROCEDURE dbo.pdpd_DynamicCall @SQLString varchar(4096) = null AS Begin create TABLE #T1 ( column_1 varchar(10) , column_2 varchar(100) ) insert into #T1 ..

How do I ignore files in a directory in Git?

What is the proper syntax for the .gitignore file to ignore files in a directory? Would it be config/databases.yml cache/* log/* data/sql/* lib/filter/base/* lib/form/base/* lib/model/map/* lib/mode..

Does the join order matter in SQL?

Disregarding performance, will I get the same result from query A and B below? How about C and D? -- A select * from a left join b on <blahblah> left join c on &l..

How to store an output of shell script to a variable in Unix?

i have a shell script "script.sh" which gives output as "success" or "Failed" when i execute in unix window. Now i want to store the output of script.sh into a unix command variable. say $a = {output ..

How do I extract specific 'n' bits of a 32-bit unsigned integer in C?

Could anyone tell me as to how to extract 'n' specific bits from a 32-bit unsigned integer in C. For example, say I want the first 17 bits of the 32-bit value; what is it that I should do? I presu..

Get a timestamp in C in microseconds?

How do I get a microseconds timestamp in C? I'm trying to do: struct timeval tv; gettimeofday(&tv,NULL); return tv.tv_usec; But this returns some nonsense value that if I get two timestamps, t..

React.js, wait for setState to finish before triggering a function?

Here's my situation: on this.handleFormSubmit() I am executing this.setState() inside this.handleFormSubmit(), I am calling this.findRoutes(); - which depends on the successful completion of this.se..

Error sending json in POST to web API service

I'm creating a web service using Web API. I implemented a simple class public class ActivityResult { public String code; public int indexValue; public int primaryCodeReference; } And th..

Get key from a HashMap using the value

I want to get the key of a HashMap using the value. hashmap = new HashMap<String, Object>(); haspmap.put("one", 100); haspmap.put("two", 200); Which means i want a function that will take th..

PHP case-insensitive in_array function

Is it possible to do case-insensitive comparison when using the in_array function? So with a source array like this: $a= array( 'one', 'two', 'three', 'four' ); The following lookups would all..

update one table with data from another

Table 1: id name desc ----------------------- 1 a abc 2 b def 3 c adf Table 2: id name desc ----------------------- 1 x 123 2 y 345 ..

currently unable to handle this request HTTP ERROR 500

I have transferred my shopping cart files from local to live. The shopping cart which i am using is Interspire. When I load the page, it shows me this error currently unable to handle this reque..

using jquery $.ajax to call a PHP function

This may be a simple answer, but I'm using jQuery's $.ajax to call a PHP script. What I want to do is basically put that PHP script inside a function and call the PHP function from javascript. <?..

Select all where [first letter starts with B]

This is a follow up question to my previous one. I want to write a MYSQL statement that echoes every entry that starts with letter B. Function.php function getCategory() { $query = mysql_query("SEL..

How to set top position using jquery

I am creating custom div scroller and want to set top position of content div. My jquery code is as below: containerOuterHeight=$("#messagePopUpContainer").outerHeight(); contentOuterHeig..

How to add "active" class to Html.ActionLink in ASP.NET MVC

I'm trying to add an"active" class to my bootstrap navbar in MVC, but the following doesn't show the active class when written like this: <ul class="nav navbar-nav"> <li>@Html.ActionLin..

Rubymine: How to make Git ignore .idea files created by Rubymine

I use Rubymine for Rails projects. Very often, Rubymine makes changes in .idea/* files that I don't care about. But it keeps preventing me from checking out new branches, and makes my version of .idea..

Difference between Git and GitHub

I have recently added a new project to Git using Eclipse, but do not see the project appear in my GitHub account. Why do they have the same account information and different repositories? Isn't Git ..

What is the use of the @Temporal annotation in Hibernate?

The Hibernate Documentation has the information below for the @Temporal annotation: In plain Java APIs, the temporal precision of time is not defined. When dealing with temporal data you might w..

How can I view the source code for a function?

I want to look at the source code for a function to see how it works. I know I can print a function by typing its name at the prompt: > t function (x) UseMethod("t") <bytecode: 0x2332948> &..

How to format DateTime to 24 hours time?

I need string from datetime to display time in 24 hours format. .. var curr = DateTime.Now; string s = ???; Console.WriteLine(s); .. The output result have to be: "16:38" Thank you...

How to implement Android Pull-to-Refresh

In Android applications such as Twitter (official app), when you encounter a ListView, you can pull it down (and it will bounce back when released) to refresh the content. I wonder what is the best w..

How to solve java.lang.OutOfMemoryError trouble in Android

Altough I have very small size image in drawable folder, I am getting this error from users. And I am not using any bitmap function in code. At least intentionally :) java.lang.OutOfMemoryError a..

How to remove youtube branding after embedding video in web page?

I am using <iframe width="550" height="314" src="https://www.youtube.com/embed/vidid?modestbranding=1&amp;rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe> This r..

Plot smooth line with PyPlot

I've got the following simple script that plots a graph: import matplotlib.pyplot as plt import numpy as np T = np.array([6, 7, 8, 9, 10, 11, 12]) power = np.array([1.53E+03, 5.92E+02, 2.04E+02, 7.2..

Array of arrays (Python/NumPy)

I am using Python/NumPy, and I have two arrays like the following: array1 = [1 2 3] array2 = [4 5 6] And I would like to create a new array: array3 = [[1 2 3], [4 5 6]] and append items to it. S..

Dynamic LINQ OrderBy on IEnumerable<T> / IQueryable<T>

I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a sql-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQue..

SQL Error: ORA-00933: SQL command not properly ended

I am trying to update a record in oracle SQL developer by using Joins. Following is my query- UPDATE system_info set field_value = 'NewValue' FROM system_users users JOIN system_info info ON users...

IIS: Display all sites and bindings in PowerShell

I am documenting all the sites and binding related to the site from the IIS. Is there an easy way to get this list through a PowerShell script rather than manually typing looking at IIS? I want the o..

Create a button with rounded border

How would you make a FlatButton into a button with a rounded border? I have the rounded border shape using RoundedRectangleBorder but somehow need to color the border. new FlatButton( child: new Te..

Object spread vs. Object.assign

Let’s say I have an options variable and I want to set some default value. What’s is the benefit / drawback of these two alternatives? Using object spread options = {...optionsDefault, ...optio..

How to implement debounce in Vue2?

I have a simple input box in a Vue template and I would like to use debounce more or less like this: <input type="text" v-model="filterKey" debounce="500"> However the debounce property has b..

Notice: Trying to get property of non-object error

i am trying to get data from: http://api.convoytrucking.net/api.php?api_key=public&show=player&player_name=Mick_Gibson but if i want to get player_name variable with this code: <? $js ..

Maven skip tests

I am using Maven 2.2.1 and to build my project I used this command mvn clean install -Dmaven.test.skip=true However, the build failed saying it couldn't find one of the artifact. However, when I us..

Why use ICollection and not IEnumerable or List<T> on many-many/one-many relationships?

I see this a lot in tutorials, with navigation properties as ICollection<T>. Is this a mandatory requirement for Entity Framework? Can I use IEnumerable? What's the main purpose of using IColl..

How do I compare strings in Java?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug. Is == bad? When should it ..

Get the length of a String

How do you get the length of a String? For example, I have a variable defined like: var test1: String = "Scott" However, I can't seem to find a length method on the string...

How to create a testflight invitation code?

I am a registered iOS developer and a developer friend of mine is trying to send me a testflight version. For some reason he can't sent me an invitation - I believe this is because I am registered as..

Webview load html from assets directory

I'm trying to load a html page from the assets directory. I tried this, but it fails. public class ViewWeb extends Activity { @Override public void onCreate(Bundle savedInstanceState) { ..

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive

I just installed vs 2010, followed by IIS in window 7. when building a website in .net framework 4.0 and convert this into application in IIS then its shows this error If i remove the targetFramew..

How to multiply duration by integer?

To test concurrent goroutines, I added a line to a function to make it take a random time to return (up to one second) time.Sleep(rand.Int31n(1000) * time.Millisecond) However when I compiled, I go..

.datepicker('setdate') issues, in jQuery

I have a function that executes a query to get some data based on a certain date range which is selected using .datepicker(). I am trying to set the datepicker's that are in the response data back to..

Getting all selected checkboxes in an array

So I have these checkboxes: <input type="checkbox" name="type" value="4" /> <input type="checkbox" name="type" value="3" /> <input type="checkbox" name="type" value="1" /> <input..

How to program a fractal?

I do not have any experience with programming fractals. Of course I've seen the famous Mandelbrot images and such. Can you provide me with simple algorithms for fractals. Programming language doesn'..

Strange PostgreSQL "value too long for type character varying(500)"

I have a Postgres schema which looks like: The problem is that whenever I save text longer than 500 characters in the description column I get the error: value too long for type character varying(..

How to split the filename from a full path in batch?

How do I split the filename out of a full path in batch scripting?..

Lining up labels with radio buttons in bootstrap

I have a Bootstrap form with some inline radio buttons and a label. I'd like to keep the label on the same line as the buttons, but I can't seem to make that happen. Here's my approach: <form> ..

DB query builder toArray() laravel 4

I'm trying to convert a query to an array with the method toArray() but it doesn't work for the query builder. Any ideas for convert it? Example DB::table('user')->where('name',=,'Jhon')->get(..

Trying to get property of non-object - Laravel 5

I'm trying to echo out the name of the user in my article and I'm getting the ErrorException: Trying to get property of non-object. My codes: Models 1. News class News extends Model { ..

ldconfig error: is not a symbolic link

When running: sudo /sbin/ldconfig the following error appears: /sbin/ldconfig: /usr/local/lib/ is not a symbolic link When I run file: file /usr/local/lib/ /usr/local/lib/: dire..

How to find index of all occurrences of element in array?

I am trying to find the index of all the instances of an element, say, "Nano", in a JavaScript array. var Cars = ["Nano", "Volvo", "BMW", "Nano", "VW", "Nano"]; I tried jQuery.inArray, or similarly..

How to query GROUP BY Month in a Year

I am using Oracle SQL Developer. I essentially have a table of pictures that holds the columns: [DATE_CREATED(date), NUM_of_PICTURES(int)] and if I do a select *, I would get an output similar to: ..

How can you speed up Eclipse?

How can you make the experience with Eclipse faster? For instance: I disable all the plugins I don't need (Mylyn, Subclipse, …). Instead of using a plugin for Mercurial, I configure Tortois..

Convert String (UTF-16) to UTF-8 in C#

I need to convert a string to UTF-8 in C#. I've already try many ways but none works as I wanted. I converted my string into a byte array and then to try to write it to an XML file (which encoding is ..

How to force a web browser NOT to cache images

Background I am writing and using a very simple CGI-based (Perl) content management tool for two pro-bono websites. It provides the website administrator with HTML forms for events where they fill th..

How do I add space between two variables after a print in Python

I'm fairly new to Python, so I'm trying my hand at some simple code. However, in one of the practices my code is supposed to display some numbers in inches on the left and the conversion of the number..

How to set URL query params in Vue with Vue-Router

I am trying to set query params with Vue-router when changing input fields, I don't want to navigate to some other page but just want to modify url query params on the same page, I am doing like this:..

UTF-8: General? Bin? Unicode?

I'm trying to figure out what collation I should be using for various types of data. 100% of the content I will be storing is user-submitted. My understanding is that I should be using UTF-8 General ..

pull out p-values and r-squared from a linear regression

How do you pull out the p-value (for the significance of the coefficient of the single explanatory variable being non-zero) and R-squared value from a simple linear regression model? For example... x..

Add legend to ggplot2 line plot

I have a question about legends in ggplot2. I managed to plot three lines in the same graph and want to add a legend with the three colors used. This is the code used library(ggplot2) require(RCu..

Toggle display:none style with JavaScript

I want to change the style (second line below) to remove the display: none; part when the user clicks on the "Show All Tags" link. If the user clicks the "Show All Tags" link again, I need the display..

CSS Cell Margin

In my HTML document, I have a table with two columns and multiple rows. How can I increase the space in between the first and second column with css? I've tried applying "margin-right: 10px;" to each ..

How can I parse a string with a comma thousand separator to a number?

I have 2,299.00 as a string and I am trying to parse it to a number. I tried using parseFloat, which results in 2. I guess the comma is the problem, but how would I solve this issue the right way? Jus..

Should methods in a Java interface be declared with or without a public access modifier?

Should methods in a Java interface be declared with or without the public access modifier? Technically it doesn't matter, of course. A class method that implements an interface is always public. But ..

How can I change the user on Git Bash?

I want to sign out an actual user so I can sign in with another user. What I see in Git bash is: MINGW64 ~/Documents/NetBeansProjects/ConstructorJava (master) git push -u origin/master remote: Pe..

Submitting a form by pressing enter without a submit button

Well I am trying to submit a form by pressing enter but not displaying a submit button. I don't want to get into JavaScript if possible since I want everything to work on all browsers (the only JS way..

Is there any publicly accessible JSON data source to test with real world data?

I'm working on a JavaScript dynamically loaded tree view user control. I'd like to test it with real world data. Does anybody know any public service with an API that provides access to hierarchical ..

Customize list item bullets using CSS

Is it possible to change the size of an <li> element's bullet? Take a look at the code below: li { list-style: square; // I want to change the size of this squared bullet. } I can't see..

Permission denied error on Github Push

Recently, I'm added as a member/contributor for Github project. I have cloned that project on local machine. I have made some changes and committed locally and now trying to Push changes to original ..

Cannot find name 'require' after upgrading to Angular4

I want to use Chart.js within my Angular project. In previous Angular2 versions, I have been doing this well by using a 'chart.loader.ts' which has: export const { Chart } = require('chart.js'); Th..

Access index of the parent ng-repeat from child ng-repeat

I want to use the index of the parent list (foos) as an argument to a function call in the child list (foos.bars). I found a post where someone recommends using $parent.$index, but $index is not a pr..

Importing the private-key/public-certificate pair in the Java KeyStore

I used the following steps to create a new Java keystore with a pair of private/public key to be used by a Java (internal) server with TLS. Please notice that the certificate is selfsigned: 1) Genera..

Iterate over values of object

I want to iterate over all values of a map. I know it's possible to iterate over all keys. But is it possible to iterate directly over the values? var map = { key1 : 'value1', key2 : 'value2' } for..

Error : No resource found that matches the given name (at 'icon' with value '@drawable/icon')

Error : No resource found that matches the given name (at 'icon' with value '@drawable/icon'). This is my manifest... I'm extremely new to this, just started this morning and have no previous program..

How to check internet access on Android? InetAddress never times out

I got a AsyncTask that is supposed to check the network access to a host name. But the doInBackground() is never timed out. Anyone have a clue? public class HostAvailabilityTask extends AsyncTask<..

AFNetworking Post Request

I'm a newbie in obj-c and have been using asihttp for some of my projects. When doing a post request in asihttp its done this way. ASIFormDataRequest *request = [ASIFormDataRequest requestWithUR..

iOS 9 not opening Instagram app with URL SCHEME

The following URL opens on iOS 8.3 and lower, but it does not work and iOS 9 let instagramURL = NSURL(string: "instagram://app") Why won't the URL open?..

How can I use jQuery to move a div across the screen

I need to make multiple divs move from right to left across the screen and stop when it gets to the edge. I have been playing with jQuery lately, and it seem like what I want can be done using that. ..

How to develop a soft keyboard for Android?

I would like to play around with some ideas and develop a soft keyboard for Android to replace the default one. Is there any general information about soft keyboard development for Android out there..

Find the last time table was updated

I want to retrieve the last time table was updated(insert,delete,update). I tried this query. SELECT last_user_update FROM sys.dm_db_index_usage_stats WHERE object_id=object_id('T') but the data t..

Function to clear the console in R and RStudio

I am wondering if there is a function to clear the console in R and, in particular, RStudio I am looking for a function that I can type into the console, and not a keyboard shortcut. Someone has alre..

How do you copy a record in a SQL table but swap out the unique id of the new row?

This question comes close to what I need, but my scenario is slightly different. The source table and destination table are the same and the primary key is a uniqueidentifier (guid). When I try this: ..

How can I test if a letter in a string is uppercase or lowercase using JavaScript?

How can I test if a letter in a string is uppercase or lowercase using JavaScript?..

How do I set up a private Git repository on GitHub? Is it even possible?

I intend to share my source code on an invite-only basis to a few dozen users maybe. The source code itself should not be public. Participants are allowed and encouraged to submit their changes. So I ..

JS regex: replace all digits in string

I need to replace all digits. My function only replaces the first digit. var s = "04.07.2012"; alert(s.replace(new RegExp("[0-9]"), "X")); // returns "X4.07.2012" ..

Get current NSDate in timestamp format

I have a basic method which gets the current time and sets it in a string. However, how can I get it to format the current date & time in a UNIX since-1970 timestamp format? Here is my code: NSD..

Empty responseText from XMLHttpRequest

I have written an XMLHttpRequest which runs fine but returns an empty responseText. The javascript is as follows: var anUrl = "http://api.xxx.com/rates/csv/rates.txt"; var myRequest = new XMLHtt..

How to decompile to java files intellij idea

IDEA has a great built-in feature - decompiler. It works great.I can copy source code, but I cannot find option to extract all decompiled java classes to java files. This project has a lot of java cla..

Changing an AIX password via script?

I am trying to change a password of a user via script. I cannot use sudo as there is a feature that requires the user to change the password again if another user changes their password. AIX is runni..

Matplotlib color according to class labels

I have two vectors, one with values and one with class labels like 1,2,3 etc. I would like to plot all the points that belong to class 1 in red, to class 2 in blue, to class 3 in green etc. How can ..

Execute a large SQL script (with GO commands)

I need to execute a large set of SQL statements (creating a bunch of tables, views and stored procedures) from within a C# program. These statements need to be separated by GO statements, but SqlComm..

Recommended way to get hostname in Java

Which of the following is the best and most portable way to get the hostname of the current computer in Java? Runtime.getRuntime().exec("hostname") vs InetAddress.getLocalHost().getHostName()..

Streaming via RTSP or RTP in HTML5

I'm building a web app that should play back an RTSP/RTP stream from a server http://lscube.org/projects/feng. Does the HTML5 video/audio tag support the rtsp or rtp? If not, what would the easiest s..

Escape quote in web.config connection string

I have a connection string in my web config: <add name="MyConString" connectionString="Server=dbsrv;User ID=myDbUser;Password=somepass"word" providerName="System.Data.SqlClient" /> As you see..

How to output only captured groups with sed?

Is there any way to tell sed to output only captured groups? For example given the input: This is a sample 123 text and some 987 numbers and pattern: /([\d]+)/ Could I get only 123 and 987 outpu..

Rollback to an old Git commit in a public repo

How can I go about rolling back to a specific commit in git? The best answer someone could give me was to use git revert X times until I reach the desired commit. So let's say I want to revert bac..

Scala vs. Groovy vs. Clojure

Can someone please explain the major differences between Scala, Groovy and Clojure. I know each of these compiles to run on the JVM but I'd like a simple comparison between them...

How to trust a apt repository : Debian apt-get update error public key is not available: NO_PUBKEY <id>

Trying to update some repositories on Debian Etch installation and getting the following errors from running "apt-get update" W: GPG error: http://www.debian-multimedia.org etch Release: The followin..

How to change the style of a DatePicker in android?

I want to change the default color of the date/time picker dialog in Android, so that it should match my app's theme. I searched for the solution on Google, but I couldn't find a solution. What I was..

Can you append strings to variables in PHP?

Why does the following code output 0? It works with numbers instead of strings just fine. I have similar code in JavaScript that also works. Does PHP not like += with strings? <?php $selectBo..

How can I login to a website with Python?

How can I do it? I was trying to enter some specified link (with urllib), but to do it, I need to log in. I have this source from the site: <form id="login-form" action="auth/login" method="post..

Unable to start the mysql server in ubuntu

After running the command mysql -v in Ubuntu, I am getting the following error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) ..

Mysql SELECT CASE WHEN something then return field

I have two field nnmu and nnmi , if nnmu is equal to 1, I need to return naziv_mesta from **mesto_istovara**, else if it's =0 I need to return naziv_mesta from mesto_utovara table and reverse, if ..

#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation

Hello, I am currently having an issue with MySQL! What's going wrong here? I am a cPanel user, and yes I have searched this and found no definitive answers. It appears this is more specific than othe..

Sorting a list with stream.sorted() in Java

I'm interested in sorting a list from a stream. This is the code I'm using: list.stream() .sorted((o1, o2)->o1.getItem().getValue().compareTo(o2.getItem().getValue())) .collect(Collectors...

jQuery multiple events to trigger the same function

Is there a way to have keyup, keypress, blur, and change events call the same function in one line or do I have to do them separately? The problem I have is that I need to validate some data with a d..

jQuery: load txt file and insert into div

I want to load a *.txt file and insert the content into a div. Here my code: js: $(document).ready(function() { $("#lesen").click(function() { $.ajax({ url : "helloworld.txt"..

How to open an elevated cmd using command line for Windows?

How do I open a elevated command prompt using command lines on a normal cmd? For example, I use runas /username:admin cmd but the cmd that was opened does not seem to be elevated! Any solutions?..

Is this very likely to create a memory leak in Tomcat?

I configured tomcat to work with a different external open source. However, after the tomcat is running for a few minutes I get: SEVERE: The web application [/MyProject] created a ThreadLocal wit..

Command line: search and replace in all filenames matched by grep

I'm trying to search and replace a string in all files matched by grep: grep -n 'foo' * will give me output in the form: [filename]:[line number]:[text] For each file returned by grep, I'd like to mo..

setting JAVA_HOME & CLASSPATH in CentOS 6

I have unpacked my jdk in /usr/java/. and I put CLASSPATH, PATH, JAVA_HOME into /etc/profile like below. export JAVA_HOME=/usr/java/jdk1.7.0_21 export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=$JAV..

Disabled form inputs do not appear in the request

I have some disabled inputs in a form and I want to send them to a server, but Chrome excludes them from the request. Is there any workaround for this without adding a hidden field? <form actio..

Python: count repeated elements in the list

I am new to Python. I am trying to find a simple way of getting a count of the number of elements repeated in a list e.g. MyList = ["a", "b", "a", "c", "c", "a", "c"] Output: a: 3 b: 1 c: 3 ..

Android Studio: /dev/kvm device permission denied

When I try to run my Android app on an emulator I get this error: /dev/kvm permission denied. I checked the permissions and added the user I am currently logged in with to the kvm group. What ..

How to clear an ImageView in Android?

I am reusing ImageViews for my displays, but at some point I don't have values to put it. So how to clear an ImageView in Android? I've tried: mPhotoView.invalidate(); mPhotoView.setImageBitmap(nul..

How to change max_allowed_packet size

I am having a problem with BLOB fields in my MySQL database - when uploading files larger than approx 1MB I get an error Packets larger than max_allowed_packet are not allowed. Here is what i've trie..

How to get memory usage at runtime using C++?

I need to get the mem usage VIRT and RES at run time of my program and display them. What i tried so far: getrusage (http://linux.die.net/man/2/getrusage) int who = RUSAGE_SELF; struct rusage usag..

HTML - Alert Box when loading page

i'm using HTML code and i wan't to show un Alert Message or alert box, i don't know what it is called, but a message with a "OK" button. i want to show this alert when the page is loaded. How do i d..

Loading .sql files from within PHP

I'm creating an installation script for an application that I'm developing and need to create databases dynamically from within PHP. I've got it to create the database but now I need to load in severa..

Removing double quotes from a string in Java

How would I remove double quotes from a String? For example: I would expect "abd to produce abd, without the double quote. Here's the code I've tried: line1 = line1.replaceAll("\"(\\b[^\"]+|\\s+)?..

Timer function to provide time in nano seconds using C++

I wish to calculate the time it took for an API to return a value. The time taken for such an action is in the space of nano seconds. As the API is a C++ class/function, I am using the timer.h to cacu..

Generic deep diff between two objects

I have two objects: oldObj and newObj. The data in oldObj was used to populate a form and newObj is the result of the user changing data in this form and submitting it. Both objects are deep, ie. they..

Get age from Birthdate

Possible Duplicate: Calculate age in JavaScript In some point of my JS code I have jquery date object which is person's birth date. I want to calculate person's age based on his birth date...

How to have Android Service communicate with Activity

I'm writing my first Android application and trying to get my head around communication between services and activities. I have a Service that will run in the background and do some gps and time based..

Xampp localhost/dashboard

I downloaded the recent version of xampp and I installed it and everything but when i type "localhost" in the browser it redirects me to localhost/dashboard is there a way to type localhost and see th..

nginx - nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

All of a sudden I am getting the below nginx error * Restarting nginx * Stopping nginx nginx ...done. * Starting nginx nginx nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)..

How to access Spring context in jUnit tests annotated with @RunWith and @ContextConfiguration?

I have following test class @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"/services-test-config.xml"}) public class MySericeTest { @Autowired MyService service; .....

Oracle date "Between" Query

I am using oracle database. i want to execute one query to check the data between two dates. NAME START_DATE ------------- ------------- Small Widget 15-JAN-10 04.25.32.00..

Using switch statement with a range of value in each case?

In Java, is it possible to write a switch statement where each case contains more than one value? For example (though clearly the following code won't work): switch (num) { case 1 .. 5: S..

Regex date format validation on Java

I'm just wondering if there is a way (maybe with regex) to validate that an input on a Java desktop app is exactly an string formated as: "YYYY-MM-DD". I've searched but with no success. Thank you..

How to get element by innerText

How to get tag in html page, if I know what text tag contains. E.g.: <a ...>SearchingText</a> ..

Iterate through <select> options

I have a <select> element in HTML. This element represents a drop down list. I'm trying to understand how to iterate through the options in the <select> element via JQuery. How do I use J..

Is there a MessageBox equivalent in WPF?

Is there a standard message box in WPF, like WinForms' System.Windows.Forms.MessageBox.Show(), or should I use the WinForms message box?..

Permission is only granted to system app

I have a System app that uses system permissions and I have those permissions listed in the manifest. Eclipse gives the following error when I try to make a build(command line build works): Permis..

makefiles - compile all c files at once

I want to experiment with GCC whole program optimizations. To do so I have to pass all C-files at once to the compiler frontend. However, I use makefiles to automate my build process, and I'm not an e..

How to enumerate an enum with String type?

enum Suit: String { case spades = "?" case hearts = "?" case diamonds = "?" case clubs = "?" } For example, how can I do something like: for suit in Suit { // do something with ..

Bootstrap Dropdown menu is not working

I am having trouble getting my dropdowns to work. I can get the navbar to show up perfectly, but when I click on "Dropdown" (either of them) it does not display the dropdown menu. I have tried looking..

Grouping switch statement cases together?

I may be over looking something but is there a simple way in C++ to group cases together instead of writing them out individually? I remember in basic I could just do: SELECT CASE Answer CASE 1, 2, 3..

Last Run Date on a Stored Procedure in SQL Server

We starting to get a lot of stored procedures in our application. Many of them are for custom reports many of which are no longer used. Does anyone know of a query we could run on the system views in ..

Where does linux store my syslog?

I wrote a simple test application to log something in a log file. I am using linux mint and after the application executes I try to view the log using this command: tail -n 100 /var/log/messages b..

WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding

I've got a WCF Service running on my local IIS server. I've added it as a service reference to a C# Website Project and it adds fine and generates the proxy classes automatically. However, when I try..

How do I find a stored procedure containing <text>?

I need to search a SQL server 2008 for stored procedures containing where maybe the name of a database field or variable name. ..

Spring RequestMapping for controllers that produce and consume JSON

With multiple Spring controllers that consume and produce application/json, my code is littered with long annotations like: @RequestMapping(value = "/foo", method = RequestMethod.POST, ..

Resource interpreted as Document but transferred with MIME type application/json warning in Chrome Developer Tools

I have the following snippet, which uses the jQuery Form plugin to post a form to the server (in ajax). var options = { dataType: "json", success: function(data) { alert("success");..

How to change the plot line color from blue to black?

I am stuck when I have generated a set of data and tried to color the plot line in python. For example I would like to change the line color from blue to black here. This is what I have and returns..

How to enter a multi-line command

Is it possible to split a PowerShell command line over multiple lines? In Visual Basic I can use the underscore (_) to continue the command in the next line...

Rotating x axis labels in R for barplot

I am trying to get the x axis labels to be rotated 45 degrees on a barplot with no luck. This is the code I have below: barplot(((data1[,1] - average)/average) * 100, srt = 45, ..

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.

I have been trying from a couple of days to resolve the following error but I am unable to resolve it :( My module's pom.xml file is: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xs..

Set default value of an integer column SQLite

I am creating an SQLite database in android. db.execSQL("CREATE TABLE " + DATABASE_TABLE + " (" + KEY_ROWID + " INTEGER PRIMARY KEY AUTOINCREMENT, " + KEY_NAME + " TEXT NOT NULL, " + K..

Android Studio and Gradle build error

I've been using the new preview of android studio and really like it. But recently my project won't build. I get the following error: Gradle: FAILURE: Build failed with an exception. * What went wr..

How to give a time delay of less than one second in excel vba?

i want to repeat an event after a certain duration that is less than 1 second. I tried using the following code Application.wait Now + TimeValue ("00:00:01") But here the minimum delay time is one ..

Could not resolve placeholder in string value

I am trying to use properties from a .properties file, but it doesn't seem to work. Here is my code: @Service("ServiceFTP") @Transactional public class ServiceFTPImpl implements ServiceFTP { @Value..

How to set background color of a button in Java GUI?

Below is the code which creates 9 buttons in gridlayout form on a specific pannel3. What i want is to make the background of each button black with grey text over it. Can anyone help please? for(in..

Is there a C++ decompiler?

I have a program in which I've lost the C++ source code. Are there any good C++ decompilers out there? I've already ran across Boomerang...

Align div with fixed position on the right side

I want to show a div which is always visible even as the user scrolls the page. I have used the CSS position: fixed; for that. Now I also want to show the div at the right hand corner of the parent d..

What is the right way to populate a DropDownList from a database?

I am populating a DropDownList from a SQL Server database as shown below. It works fine, but I'm not sure it's a good way. Can someone shed some light on this method, and give some improvements? priv..

curl : (1) Protocol https not supported or disabled in libcurl

I'm trying to install the Rails environments on Ubuntu 11.04. When I launch the command rvm install 1.9.2 --with-openssl-dir=/usr/local the following error is received: curl : (1) Protocol https not ..

LINQ: combining join and group by

I have a query that combines a join and a group, but I have a problem. The query is like: var result = from p in Products join bp in BaseProducts on p.BaseProductId equals b..

Navigation Drawer (Google+ vs. YouTube)

Does anyone know how to implement a sliding menu like some of the top apps of today? Other Stack Overflow questions haven't had any answers on how to do this, so I'm trying to gather as much info to..

Dynamically create and submit form

Is there a way in jQuery to create and submit a form on the fly. Something like below. <html> <head> <title> Title Text Goes Here </title> <script src="http://..

What is useState() in React?

I am currently learning hooks concept in React and trying to understand below example. import { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call &qu..

Embedding Windows Media Player for all browsers

Edit: This question was written in 2008, which was like 3 internet ages ago. If this question is still relevant to your environment, please accept my condolences. Everyone else should convert into a f..

How to use lodash to find and return an object from Array?

My objects: [ { description: 'object1', id: 1 }, { description: 'object2', id: 2 } { description: 'object3', id: 3 } { description: 'objec..

Linq to SQL how to do "where [column] in (list of values)"

I have a function where I get a list of ids, and I need to return the a list matching a description that is associated with the id. E.g.: public class CodeData { string CodeId {get; set;} str..

How to enable bulk permission in SQL Server

I am trying to insert images using "bulk" into SQL Server 2012. But, am ending up with the error message stating tha: Msg 4834, Level 16, State 1, Line 2 You do not have permission to use the bu..

Cannot construct instance of - Jackson

I am using Jackson and I'm having problems, when I try to deserialize an Object I get the following error: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of net...

Get startup type of Windows service using PowerShell

How can I get the Windows service startup type using PowerShell and not using WMI? I looked inside the Get-Service command, and it does not provide something to display the "startup type"...

Passing a callback function to another class

I'm basically trying to pass a method to another class to be called later, but can't quite figure this out in C# (I'm still too used to Objective-C). public class Class1{ private void btn_click(..

How to remove text from a string?

I've got a data-123 string. How can I remove data- from the string while leaving the 123?..

How can I get the "network" time, (from the "Automatic" setting called "Use network-provided values"), NOT the time on the phone?

I would like in my application to find a way to synch the date and time with something given by an external source. I don't want to use the phone time because I might get a difference of maybe 5 minu..

Tool to Unminify / Decompress JavaScript

Are there any command line scripts and/or online tools that can reverse the effects of minification similar to how Tidy can clean up horrific HTML? (I'm specifically looking to unminify a minified Ja..

How can I avoid Java code in JSP files, using JSP 2?

I'm new to Java EE and I know that something like the following three lines <%= x+1 %> <%= request.getParameter("name") %> <%! counter++; %> is an old school way of coding..

How to make inline plots in Jupyter Notebook larger?

I have made my plots inline on my Ipython Notebook with "%matplotlib inline." Now, the plot appears. However, it is very small. Is there a way to make it appear larger using either notebook setting..

Create an empty data.frame

I'm trying to initialize a data.frame without any rows. Basically, I want to specify the data types for each column and name them, but not have any rows created as a result. The best I've been able t..

Does C# have extension properties?

Does C# have extension properties? For example, can I add an extension property to DateTimeFormatInfo called ShortDateLongTimeFormat which would return ShortDatePattern + " " + LongTimePattern?..

How do I explicitly specify a Model's table-name mapping in Rails?

I have a Model class called Countries and I want it to map to a DB table called 'cc'. How is that done in Rails?..

What is a lambda (function)?

For a person without a comp-sci background, what is a lambda in the world of Computer Science?..