Questions Tagged with #Jupload

0

Angular2 - Radio Button Binding

I want to use radio button in a form using Angular 2 Options : <br/> 1 : <input name="options" ng-control="options" type="radio" value="1" [(ng-model)]="model.options" ><br/> 2 ..

Django development IDE

I have done a little Django development, but it has all been in a text editor. I was curious what more advanced development tools others are using in their Django development. I am used to using Visu..

Difference between Hashing a Password and Encrypting it

The current top-voted to this question states: Another one that's not so much a security issue, although it is security-related, is complete and abject failure to grok the difference between hashi..

How to set some xlim and ylim in Seaborn lmplot facetgrid

I'm using Seaborn's lmplot to plot a linear regression, dividing my dataset into two groups with a categorical variable. For both x and y, I'd like to manually set the lower bound on both plots, but ..

To get total number of columns in a table in sql

I need a query in sql to get total columns in a table.Can anybody help?..

Recursive query in SQL Server

I have a table with following structure Table name: matches That basically stores which product is matching which product. I need to process this table And store in a groups table like below. Tab..

Why use Gradle instead of Ant or Maven?

What does another build tool targeted at Java really get me? If you use Gradle over another tool, why?..

Count cells that contain any text

I want to count the cells that contain anything within a range. Any cell that contain text, or numbers or something else should do a plus one in my result-cell. I found this function, countif(range;..

How to determine whether a given Linux is 32 bit or 64 bit?

When I type uname -a, it gives the following output. Linux mars 2.6.9-67.0.15.ELsmp #1 SMP Tue Apr 22 13:50:33 EDT 2008 i686 i686 i386 GNU/Linux How can I know from this that the given OS is 32 or ..

How to get the number of characters in a std::string?

How should I get the number of characters in a string in C++?..

When running WebDriver with Chrome browser, getting message, "Only local connections are allowed" even though browser launches properly

When I run Chrome browser using WebDriver, I am getting following message on console. Please let me know how to resolve it. "Starting ChromeDriver (v2.10.267521) on port 22582 " "Only local con..

Can I grep only the first n lines of a file?

I have very long log files, is it possible to ask grep to only search the first 10 lines?..

Multiple argument IF statement - T-SQL

How do I write an IF statement with multiple arguments in T-SQL? Current source error: DECLARE @StartDate AS DATETIME DECLARE @EndDate AS DATETIME SET @StartDate = NULL SET @EndDate = NULL IF (@St..

Creating custom function in React component

I have a React component export default class Archive extends React.Component { ... } componentDidMount and onClick methods partially use the same code, except for slight change in parameters. ..

Download files in laravel using Response::download

In Laravel application I'm trying to achieve a button inside view that can allow user to download file without navigating to any other view or route Now I have two issues: (1) below function throwing..

Error: vector does not name a type

I'm having lots of errors in my final project (a poker and black jack sim). I'm using a vector to implement the "hands" in the blackJack class, and I'm using a structured data type declared in another..

Laravel migration table field's type change

Following is my file 2015_09_14_051851_create_orders_table.php. And I want to change $table->integer('category_id'); as a string with new migration. <?php use Illuminate\Database\Schema\Bluepr..

Number to String in a formula field

I am using a formula field to concatonate 2 decimal values separated by a dash. However, I want the result to trim all unneccesary trailing zeros and decimal points for both values. For example, I wa..

How do you sort a dictionary by value?

I often have to sort a dictionary, consisting of keys & values, by value. For example, I have a hash of words and respective frequencies, that I want to order by frequency. There is a SortedList ..

How do I use valgrind to find memory leaks?

How do I use valgrind to find the memory leaks in a program? Please someone help me and describe the steps to carryout the procedure? I am using Ubuntu 10.04 and I have a program a.c, please help me..

Is it possible to use a div as content for Twitter's Popover

I am using twitter's bootstrap's popover here. Right now, when i scroll over the popover text a popover appears with just text from the <a>'s data-content attribute. I was wondering if there w..

MySQL: #126 - Incorrect key file for table

I got the following error from a MySQL query. #126 - Incorrect key file for table I have not even declared a key for this table, but I do have indices. Does anyone know what could be the problem?..

UILabel font size?

I can't seem to modify the font size of a UILabel with the following code: itemTitle.font = [UIFont systemFontOfSize:25]; As i increase the number 25 to something greater, it seems to only add a to..

Keylistener in Javascript

I'm looking for a KeyListener for a game I'm developing in JavaScript. I have no idea how this would work in real code but it would be something like this: if(keyPress == upKey) { playerSpriteX ..

JavaScript module pattern with example

I can't find any accessible examples showing how two (or more) different modules are connected to work together. So, I'd like to ask whether anyone has time to write an example explaining how modules..

Node.js - get raw request body using Express

When I use Express, and my code is: app.use(express.bodyParser()); How would I get the raw request body?..

How to get the azure account tenant Id?

My question is: Is it possible to get the azure active directory tenant id without using powershell command? I found this two blogs and with this help, I'm already able to get the tenant ID and subsc..

Angular 5, HTML, boolean on checkbox is checked

Angular 5, Typescript 2.7.1 I can't seem to get the checkbox to be checked when returning a boolean, I've tried, item.check returns either true or false. <tr class="even" *ngFor="let item of rows..

What is the use of BindingResult interface in spring MVC?

Is BindingResult useful to bind just exceptions with view, or something else? what is the exact use of BindingResult? Or is it useful in binding model attribute with view...

select count(*) from table of mysql in php

I am able to get both the value and row of the mysql query result. But I am struggling to get the single output of a query. e.g.: $result = mysql_query("SELECT COUNT(*) FROM Students;"); I need th..

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..

How to get the exact local time of client?

What is the best method to get the clients local time irrespective of the time zone of clients system? I am creating an application and i need to first of all get the exact time and date of the place ..

convert a char* to std::string

I need to use an std::string to store data retrieved by fgets(). To do this I need to convert the char* return value from fgets() into an std::string to store in an array. How can this be done?..

Setting up JUnit with IntelliJ IDEA

Familiar with Java but unfamiliar with IntelliJ, how does one "get started" with JUnit integration? Inspired by Looking for a tutorial on using JUnit with Intellij IDEA 9.x which didn't answer my que..

Difference between int32, int, int32_t, int8 and int8_t

I came across the data type int32_t in a C program recently. I know that it stores 32 bits, but don't int and int32 do the same? Also, I want to use char in a program. Can I use int8_t instead? Wha..

How can I fix WebStorm warning "Unresolved function or method" for "require" (Firefox Add-on SDK)

I'm using WebStorm 7 for Firefox Add-on SDK development. WebStorm shows a warning: "Unresolved function or method" for require(). I want to get rid of the warning. var pageMod = require("sdk/page-m..

Bootstrap Navbar toggle button not working

When I shrink the window and click the button it doesn't work. Button doesn't respond. What seems to be the problem here could anyone tell me please? <button type="button" class="navbar-t..

Enum String Name from Value

I have an enum construct like this: public enum EnumDisplayStatus { None = 1, Visible = 2, Hidden = 3, MarkedForDeletion = 4 } In my database, the enumerations are referenced by..

How do I pass multiple ints into a vector at once?

Currently when I have to use vector.push_back() multiple times. The code I'm currently using is std::vector<int> TestVector; TestVector.push_back(2); TestVector.push_back(5); TestVec..

word-wrap break-word does not work in this example

I cannot get word-wrap to work with this example... <html> <head></head> <body> <table style="table-layout:fixed;"> <tr> <td style="word-wrap: break-word; widt..

How to create a link for all mobile devices that opens google maps with a route starting at the current location, destinating a given place?

I rather thought this would not be so hard to find out but appearantly it is not easy to find an awesome cross device article, like you'd expect. I want to create a link which opens either the mobile..

Bootstrap modal - close modal when "call to action" button is clicked

I have a external link inside my modal, and I want the modal to hide after the user has clicked on the link. How do I do that? Here is my code: <div class="modal hide fade" id="modal..

MySQL ORDER BY multiple column ASC and DESC

I have 2 MYSQL tables, users and scores. Detail: users table: scores table: My intention is get 20 users list that have point field sort DESC (descending) combine avg_time field sort ASC (a..

Spring @Transactional read-only propagation

I'm experimenting with using the command pattern to allow my web layer to work with Hibernate entities within the context of a single transaction (thus avoiding lazy loading exceptions). I am, however..

How to get all the AD groups for a particular user?

I checked this post already. But it doesn't answer my question. I want to get all the active directory groups in which a particular user is a member. I've written the following code. But I'm not able..

Can't find System.Windows.Media namespace?

I'm using an object from a 3rd party API that has a property of type System.Windows.Media.ImageSource, yet I can't seem to find the System.Windows.Media namespace anywhere. If I try to add a reference..

Getting user input

I am running this: import csv import sys reader = csv.reader(open(sys.argv[0], "rb")) for row in reader: print row And I get this in response: ['import csv'] ['import sys'] ['reader = csv.read..

NullPointerException: Attempt to invoke virtual method 'int java.util.ArrayList.size()' on a null object reference

I'm a newbie to Fragments and custom ListView adapters. Can anyone give me a hand please? I've got my Fragment where I have my ListView public class RecordingListFragment extends Fragment implements..

Command line input in Python

Is it possible to run first the program then wait for the input of the user in command line. e.g. Run... Process... Input from the user(in command line form)... Process... ..

How to call a function in shell Scripting?

I have a shell script which conditionally calls a function. For Example:- if [ "$choice" = "true" ] then process_install elif [ "$choice" = "false" ] then process_exit fi process_install() { ..

Regex for checking if a string is strictly alphanumeric

How can I check if a string contains only numbers and alphabets ie. is alphanumeric?..

Android get image path from drawable as string

Is there any way that I can get the image path from drawable folder in android as String. I need this because I implement my own viewflow where I'm showing the images by using their path on sd card, b..

How to return temporary table from stored procedure

CREATE PROCEDURE [test].[proc] @ConfiguredContentId int, @NumberOfGames int AS BEGIN SET NOCOUNT ON RETURN @WunNumbers TABLE (WinNumb int) INSERT INTO @WunNumbers (WinNumb) SELECT TOP (@Numb..

installing cPickle with python 3.5

This might be silly but I am unable to install cPickle with python 3.5 docker image Dockerfile FROM python:3.5-onbuild requirements.txt cpickle When I try to build the image $ docker build -t ..

Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JDBC_DBO]]

I get this Tomcat Error: Sep 09, 2012 4:16:54 PM org.apache.catalina.core.AprLifecycleListener init Information: The APR based Apache Tomcat Native library which allows optimal performance in product..

String to date in Oracle with milliseconds

I want to convert the follow string to date: 2004-09-30 23:53:48,140000000 I tried: to_date('#', 'YYYY-MM-DD HH24:MI:SS,FF9') But PL/SQL keep throwing this error: ORA-01821: date format not rec..

How to clear input buffer in C?

I have the following program: int main(int argc, char *argv[]) { char ch1, ch2; printf("Input the first character:"); // Line 1 scanf("%c", &ch1); printf("Input the second character:"); ..

Cannot connect to Database server (mysql workbench)

Could you help me solve this problem ? When I try to click "query database" under database menu in Mysql workbench. it gives me an error: Cannot Connect to Database Server Your connection attempt f..

Load HTML page dynamically into div with jQuery

I'm trying to make it so when I click on a link in a HTML page, it dynamically loads the requested page into a div with jQuery. How can I do that? <html> <head> <script type="text/jav..

Mail multipart/alternative vs multipart/mixed

When creating email messages you are supposed to set the Content-Type to multipart/alternative when sending HTML and TEXT or multipart/mixed when sending TEXT and attachments. So what do you do if yo..

Input group - two inputs close to each other

How can I make input group involves two inputs? <div class="input-group"> <input type="text" class="form-control" placeholder="MinVal"> <input type="text" class="form-control" ..

Apache Maven install "'mvn' not recognized as an internal or external command" after setting OS environmental variables?

I've followed the official installation instructions here for Windows XP. But sometimes when I execute mvn --version, I receive the error message, 'mvn' not recognized as an internal or external c..

Best way to format multiple 'or' conditions in an if statement (Java)

A simple question but Google hasn't been helping much. I have an if statement with many conditions (have to check for 10 or 15 constants to see if any of them are present.) Instead of writing someth..

How do I get the month and day with leading 0's in SQL? (e.g. 9 => 09)

DECLARE @day CHAR(2) SET @day = DATEPART(DAY, GETDATE()) PRINT @day If today was the 9th of December, the above would print "9". I want to print "09". How do I go about doing this?..

How to display the current time and date in C#

How do you display the current date and time in a label in c#..

Hide horizontal scrollbar on an iframe?

I need to hide the horizontal scollbar on an iframe using css, jquery or js...

Why do we need C Unions?

When should unions be used? Why do we need them?..

Reading the selected value from asp:RadioButtonList using jQuery

I've got code similar to the following... <p><label>Do you have buffet facilities?</label> <asp:RadioButtonList ID="blnBuffetMealFacilities:chk" runat="server"> <asp:..

Catching FULL exception message

Consider: Invoke-WebRequest $sumoApiURL -Headers @{"Content-Type"= "application/json"} -Credential $cred -WebSession $webRequestSession -Method post -Body $sumojson -ErrorAction Stop This throws th..

jQuery: print_r() display equivalent?

Possible Duplicate: JavaScript data formatting/pretty printer I am getting a bit tired of looking at unformatted json blobs in FireBug. Does anyone know an equivalent to PHP's print_r() f..

Send password when using scp to copy files from one server to another

using scp to copy files from 1 unix server to another regularly and performing certain actions. to do this quickly I wish to use a unix script which does the scp and inputs the password required to co..

How do I share a global variable between c files?

If i define a global variable in a .c file, how can i use the value of the same variable in another .c file? file1.c #include<stdio.h> int i=10; int main() { printf("%d",i); return 0; } f..

Create empty file using python

I'd like to create a file with path x using python. I've been using os.system(y) where y = 'touch %s' % (x). I've looked for a non-directory version of os.mkdir, but I haven't been able to find anythi..

QR Code encoding and decoding using zxing

Okay, so I'm going to take the off chance that someone here has used zxing before. I'm developing a Java application, and one of the things it needs to do is encode a byte array of data into a QR Code..

iOS 7: UITableView shows under status bar

The first screen of my application is a UITableViewController without a navigation bar, which means that the content flows under the status bar so there's a lot of text collisions. I've adjusted both ..

Ripple effect on Android Lollipop CardView

I'm trying to get a CardView to display the ripple effect when touched by setting the android:backgound attribute in the activity XML file as described here on the Android Developers page, but it isn'..

Tuples( or arrays ) as Dictionary keys in C#

I am trying to make a Dictionary lookup table in C#. I need to resolve a 3-tuple of values to one string. I tried using arrays as keys, but that did not work, and I don't know what else to do. At t..

Display alert message and redirect after click on accept

Well, I have a page with links to reports. Whenever somebody clicks on one report, they can download the excel file. However, sometimes there are no fields to make a report; in that case, I want to di..

Put text at bottom of div

I have 4 DIV's right next to each other, and they're all centered in the middle of the screen. I have 2 words in each div, but I don't want them at the top, I want them to appear in the bottom right h..

Javascript validation: Block special characters

How can I restrict users from entering special characters in the text box. I want only numbers and alphabets to be entered ( Typed / Pasted ). Any samples?..

How do I create documentation with Pydoc?

I'm trying to create a document out of my module. I used pydoc from the command-line in Windows 7 using Python 3.2.3: python "<path_to_pydoc_>\pydoc.py" -w myModule This led to my shell bein..

How to programmatically take a screenshot on Android?

How can I take a screenshot of a selected area of phone-screen not by any program but from code?..

Why do Twitter Bootstrap tables always have 100% width?

Suppose this markup: <table class="table table-bordered" align="center"> No mather how many cells I have, the table is always 100% width. Why's that? ..

Python Pandas merge only certain columns

Is it possible to only merge some columns? I have a DataFrame df1 with columns x, y, z, and df2 with columns x, a ,b, c, d, e, f, etc. I want to merge the two DataFrames on x, but I only want to merg..

Index of duplicates items in a python list

Does anyone know how I can get the index position of duplicate items in a python list? I have tried doing this and it keeps giving me only the index of the 1st occurrence of the of the item in the lis..

How to measure elapsed time in Python?

What I want is to start counting time somewhere in my code and then get the passed time, to measure the time it took to execute few function. I think I'm using the timeit module wrong, but the docs ar..

TSQL CASE with if comparison in SELECT statement

I would like to use CASE statement in SELECT. I select from user table, and (as one attribute) I also use nested SQL: SELECT registrationDate, (SELECT COUNT(*) FROM Articles WHERE userId = U..

How do you push a tag to a remote repository using Git?

I have cloned a remote Git repository to my laptop, then I wanted to add a tag so I ran git tag mytag master When I run git tag on my laptop the tag mytag is shown. I then want to push this to the ..

How can I tail a log file in Python?

I'd like to make the output of tail -F or something similar available to me in Python without blocking or locking. I've found some really old code to do that here, but I'm thinking there must be a bet..

Insert into a MySQL table or update if exists

I want to add a row to a database table, but if a row exists with the same unique key I want to update the row. For example: INSERT INTO table_name (ID, NAME, AGE) VALUES(1, "A", 19); Let�..

How to parse unix timestamp to time.Time

I'm trying to parse an Unix timestamp but I get out of range error. That doesn't really makes sense to me, because the layout is correct (as in the Go docs): package main import "fmt" import "time" ..

Find the line number where a specific word appears with "grep"

Is grep capable of providing the line number on which the specified word appears? Also, is possible to use grep to search for a word starting from some certain line downward?..

How can I include all JavaScript files in a directory via JavaScript file?

I have a bunch of JavaScript files that I would like to include in the page, but I don't want to have to keep writing <script type="text/javascript" src="js/file.js"></script> So is th..

How do I return clean JSON from a WCF Service?

I am trying to return some JSON from a WCF service. This service simply returns some content from my database. I can get the data. However, I am concerned about the format of my JSON. Currently, the ..

How can I add new item to the String array?

Possible Duplicate: how to add new elements to a String[] array? How can I add new item to the String array ? I am trying to add item to the initially empty String. Example : String a []..

Reset local repository branch to be just like remote repository HEAD

How do I reset my local branch to be just like the branch on the remote repository? I did: git reset --hard HEAD But when I run a git status, On branch master Changes to be committed: (use "git..

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

I am getting the Error System.IO.FileLoadException : Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its depende..

Oracle: SQL select date with timestamp

I have the following data: SQL> select * from booking_session; BK_ID|BK_DATE -----|------------------------- 1|18-MAR-12 10.00.00.000000 2|18-MAR-12 10.25.00.000000 3|18-MAR-12 10.30...

Foreign key constraints: When to use ON UPDATE and ON DELETE

I'm designing my database schema using MySQL Workbench, which is pretty cool because you can do diagrams and it converts them :P Anyways, I've decided to use InnoDB because of it's Foreign Key suppor..

How do I properly 'printf' an integer and a string in C?

I have the following code: char *s1, *s2; char str[10]; printf("Type a string: "); scanf("%s", str); s1 = &str[0]; s2 = &str[2]; printf("%s\n", s1); printf("%s\n", s2); When I run the co..

Equivalent of jQuery .hide() to set visibility: hidden

In jQuery, there are .hide() and .show() methods which sets the CSS display: none setting. Is there an equivalent function which would set the visibility: hidden setting? I know I can use .css() b..

How do I get the absolute directory of a file in bash?

I have written a bash script that takes an input file as an argument and reads it. This file contains some paths (relative to its location) to additional files used. I would like the script to go to..

The entity name must immediately follow the '&' in the entity reference

I want to put a packman game on my *.xhtml page.(I am using jsf 2 and primefaces 3.5) However, when I "translated" the html page in xhtml I get an error at this script: <script> var ..

Exponentiation in Python - should I prefer ** operator instead of math.pow and math.sqrt?

In my field it's very common to square some numbers, operate them together, and take the square root of the result. This is done in pythagorean theorem, and the RMS calculation, for example. In numpy..

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 can I use the MS JDBC driver with MS SQL Server 2008 Express?

My configuration: windows XP SP3 JDBC 2005 MS SQL Server 2008 Express, exposed via tcp/ip on port 1433 sqljdbc.jar in class path I tried: try { Class.forName("com.microsoft.sqlserver.jdbc...

How to print current date on python3?

From what I gather, here (for example), this should print the current year in two digits print (datetime.strftime("%y")) However, I get this error TypeError: descriptor 'strftime' requires a 'dat..

Could not load file or assembly 'System.Data.SQLite'

I've installed ELMAH 1.1 .Net 3.5 x64 in my ASP.NET project and now I'm getting this error (whenever I try to see any page): Could not load file or assembly 'System.Data.SQLite, Version=1.0.61.0..

How can I convert string to datetime with format specification in JavaScript?

How can I convert a string to a date time object in javascript by specifying a format string? I am looking for something like: var dateTime = convertToDateTime("23.11.2009 12:34:56", "dd.MM.yyyy HH:..

What's the difference between ASCII and Unicode?

What's the exact difference between Unicode and ASCII? ASCII has a total of 128 characters (256 in the extended set). Is there any size specification for Unicode characters?..

Get environment value in controller

In my .env file I have the following: IMAP_HOSTNAME_TEST=imap.gmail.com [email protected] IMAP_PASSWORD_TEST=mypw Now I would like to use them in my controller. I've tried this, ..

Setting a system environment variable from a Windows batch file?

Is it possible to set a environment variable at the system level from a command prompt in Windows 7 (or even XP for that matter). I am running from an elevated command prompt. When I use the set comm..

What are some reasons for jquery .focus() not working?

Some thoughts are that the ELEMENT_ID.focus() is inside divs that are hidden at certain times. This should be an easy problem to solve -- but I'm struggling :( ***code works fine -- the text field ..

How to change the color of text in javafx TextField?

I want to change font color in TextField .I found -fx-background-color , -fx-border-color for changing the color of background and border but nothing for text . any ideas? thanks in advamce..

How to log out user from web site using BASIC authentication?

Is it possible to log out user from a web site if he is using basic authentication? Killing session is not enough, since, once user is authenticated, each request contains login info, so user is auto..

AngularJS - difference between pristine/dirty and touched/untouched

AngularJS Developer Guide - Forms tell there are many styles and directives regarding forms and fields. For each one, a CSS class: ng-valid ng-invalid ng-pristine ng-dirty ng-touched ng-untouched W..

Difference between maven scope compile and provided for JAR packaging

What is the difference between the maven scope compile and provided when artifact is built as a JAR? If it was WAR, I'd understand - the artifact would be included or not in WEB-INF/lib. But in case o..

How to pass objects to functions in C++?

I am new to C++ programming, but I have experience in Java. I need guidance on how to pass objects to functions in C++. Do I need to pass pointers, references, or non-pointer and non-reference values..

Could not load file or assembly System.Web.Http.WebHost after published to Azure web site

I created a web project and it runs well in Visual studio. However, I got the following error after published it to azurewebsites. What can cause the issue? Could not load file or assembly 'System..

Search all the occurrences of a string in the entire project in Android Studio

I've just started using Android Studio (IntelliJ), and I now look for the feature to find the occurrence of a string in any of the files in my project. For example: I want to find all the files that c..

How to automatically convert strongly typed enum into int?

#include <iostream> struct a { enum LOCAL_A { A1, A2 }; }; enum class b { B1, B2 }; int foo(int input) { return input; } int main(void) { std::cout << foo(a::A1) << std::endl;..

Install npm (Node.js Package Manager) on Windows (w/o using Node.js MSI)

The problem: while using nvm to install Node.js I was able to install the version of Node.js I need, but nvm does not install npm automatically. NPM's page provides no information about installing it...

How to make certain text not selectable with CSS

The header for my page has some centered text, but I do not want the user to be able to select it. Is there a way to do this with CSS?..

How to initialize a struct in accordance with C programming language standards

I want to initialize a struct element, split in declaration and initialization. This is what I have: typedef struct MY_TYPE { bool flag; short int value; double stuff; } MY_TYPE; void function..

Delete all SYSTEM V shared memory and semaphores on UNIX-like systems

How can I delete all not used semaphores and shared memory with a single command on a UNIX-like system, e.g., Ubuntu? ..

The executable was signed with invalid entitlements

I am having a problem with ad-hoc distribution on my iPhone. I have developed an application with SDK 3.0. I have a developer's license. I have added certificates and provisioning profiles in my proje..

What are the differences between 'call-template' and 'apply-templates' in XSL?

I am new in XSLT so I'm little bit confused about the two tags, <xsl:apply-templates name="nodes"> and <xsl:call-template select="nodes"> So can you list out the difference between..

Laravel Controller Subfolder routing

I'm new to Laravel. To try and keep my app organized I would like to put my controllers into subfolders of the controller folder. controllers\ ---- folder1 ---- folder2 I tried to route to a contro..

Recursive mkdir() system call on Unix

After reading the mkdir(2) man page for the Unix system call with that name, it appears that the call doesn't create intermediate directories in a path, only the last directory in the path. Is there a..

Remove blank values from array using C#

How can I remove blank values from an array? For example: string[] test={"1","","2","","3"}; in this case, is there any method available to remove bl..

Mask output of `The following objects are masked from....:` after calling attach() function

I wonder if there is a way to mask the long list output of The following objects are masked from XXX(position 11): every time I call attach() function? ..

Creating a new DOM element from an HTML string using built-in DOM methods or Prototype

I have an HTML string representing an element: '<li>text</li>'. I'd like to append it to an element in the DOM (a ul in my case). How can I do this with Prototype or with DOM methods? (I ..

How to add a 'or' condition in #ifdef

How can I add a 'or' condition in #ifdef ? I have tried: #ifdef CONDITION1 || CONDITION2 #endif This does not work...

UIView touch event in controller

How can I add UIView touchbegin action or touchend action programmatically as Xcode is not providing from Main.storyboard?..

Create Word Document using PHP in Linux

Whats the available solutions for PHP to create word document in linux environment?..

SqlBulkCopy - The given value of type String from the data source cannot be converted to type money of the specified target column

I'm getting this exception when trying to do an SqlBulkCopy from a DataTable. Error Message: The given value of type String from the data source cannot be converted to type money of the specified tar..

Adding a rule in iptables in debian to open a new port

I am trying to open port 3306 in iptables in my Debian System to allow access to MySQL server. For which I entered this command: root@debian:/# sudo iptables -A INPUT -p tcp --dport 3306 ACCEPT root@..

Select Top and Last rows in a table (SQL server)

I'm using this statement in SQLServer and it works fine: SELECT TOP 1000 * FROM [SomeTable] It gives me the TOP 1000 records from SomeTable, now which keyword should I use instead of Top if I..

Can I make 'git diff' only the line numbers AND changed file names?

This question calls for "line numbers", if you do not care about line numbers in the output see this question and answer. Basically, I don't want to see the changed content, just the file names and..

Removing multiple keys from a dictionary safely

I know how to remove an entry, 'key' from my dictionary d, safely. You do: if d.has_key('key'): del d['key'] However, I need to remove multiple entries from a dictionary safely. I was thinking o..

Show/Hide the console window of a C# console application

I googled around for information on how to hide one’s own console window. Amazingly, the only solutions I could find were hacky solutions that involved FindWindow() to find the console window by its..

Improve SQL Server query performance on large tables

I have a relatively large table (currently 2 million records) and would like to know if it's possible to improve performance for ad-hoc queries. The word ad-hoc being key here. Adding indexs is not an..

Ansible: how to get output to display

I have the following playbook, Playbook with output There are currently no errors and it runs fine. However, it does not display the output to the console. I have come across this with other playbook..

Regex: Remove lines containing "help", etc

I have a long document of commands. Using Notepad++ or regex, I want to delete all lines containing "help" including keyboard_help, etc. How can this be done?..

HTML form readonly SELECT tag/input

According to HTML specs, the select tag in HTML doesn't have a readonly attribute, only a disabled attribute. So if you want to keep the user from changing the dropdown, you have to use disabled. The..

Can I use an image from my local file system as background in HTML?

I've got an HTML document hosted on a remote web server. I'm trying to have one of the elements on the web page use an image file from my local file system as its background image. No luck with Chrome..

Get the date (a day before current time) in Bash

How can I print the date which is a day before current time in Bash?..

How to import and export components using React + ES6 + webpack?

I'm playing around with React and ES6 using babel and webpack. I want to build several components in different files, import in a single file and bundle them up with webpack Let's say I have a few co..

Failed linking file resources

This is the java file that is giving the error package com.example.daksh.timetable; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import androi..

mappedBy reference an unknown target entity property

I am having an issue in setting up a one to many relationship in my annotated object. I have the following: @MappedSuperclass public abstract class MappedModel { @Id @GeneratedValue(strategy..

How do I clear inner HTML

I've been fiddling with this for a while but it won't work and I can't figure out why. Please help. Here is what I have: <html> <head> <title>lala</title> </head> &l..

Copy array by value

When copying an array in JavaScript to another array: var arr1 = ['a','b','c']; var arr2 = arr1; arr2.push('d'); //Now, arr1 = ['a','b','c','d'] I realized that arr2 refers to the same array as ar..

Enable tcp\ip remote connections to sql server express already installed database with code or script(query)

I am deploying sql express with my application. I will like that database engine to accept remote connections. I know how to configure that manual by launching the sql server configuration manager, en..

why should I make a copy of a data frame in pandas

When selecting a sub dataframe from a parent dataframe, I noticed that some programmers make a copy of the data frame using the .copy() method. For example, X = my_dataframe[features_list].copy() .....

Is there a way to check for both `null` and `undefined`?

Since TypeScript is strongly-typed, simply using if () {} to check for null and undefined doesn't sound right. Does TypeScript have any dedicated function or syntax sugar for this?..

Reactjs setState() with a dynamic key name?

EDIT: this is a duplicate, see here I can't find any examples of using a dynamic key name when setting the state. This is what I want to do: inputChangeHandler : function (event) { this.se..

Can anybody tell me details about hs_err_pid.log file generated when Tomcat crashes?

Can anybody tell me details about the hs_err_pid.log file generated when Tomcat crashes? Are any specific settings required on the Java tab of Tomcat configuration tool in order to generate a hs_err_..

Mean of a column in a data frame, given the column's name

I'm inside a big function I have to write. In the last part I have to calculate the mean of a column in a data frame. The name of the column I am operating on is given as an argument to the function...

A fast way to delete all rows of a datatable at once

I want to delete all rows in a datatable. I use something like this: foreach (DataRow row in dt.Rows) { row.Delete(); } TableAdapter.Update(dt); It works good but it takes lots of time if I have ..

Parse JSON object with string and value only

I have problem when trying to parse with minimum value to map in Android. There some sample JSON format with more information ex: [{id:"1", name:"sql"},{id:"2",name:"android"},{id:"3",name:"mvc"}] ..

What is the maximum length of a Push Notification alert text?

What is the maximum length of the alert text of an iOS push notification? The documentation states that the notification payload has to be under 256 bytes in total, but surely there must be a specifi..

What's the difference between git reset --mixed, --soft, and --hard?

I'm looking to split a commit up and not sure which reset option to use. I was looking at the page In plain English, what does "git reset" do?, but I realized I don't really understand what..

Compare two Timestamp in java

How can I compare if mytime is between fromtime and totime: Timestamp fromtime; Timestamp totime; Timestamp mytime; ..

Copying a local file from Windows to a remote server using scp

So, I'm attempting to simply transfer folder of files from my local computer to a server via ssh and scp. After sudoing I'm using the command as follows: scp -r C:/desktop/myfolder/deployments/ user..

Removing an element from an Array (Java)

Is there any fast (and nice looking) way to remove an element from an array in Java?..

Getting raw SQL query string from PDO prepared statements

Is there a way to get the raw SQL string executed when calling PDOStatement::execute() on a prepared statement? For debugging purposes this would be extremely useful...

Making a cURL call in C#

I want to make the following curl call in my C# console application: curl -d "text=This is a block of text" \ http://api.repustate.com/v2/demokey/score.json I tried to do like the question po..

onKeyDown event not working on divs in React

I want to use a keyDown event on a div in React. I do: componentWillMount() { document.addEventListener("keydown", this.onKeyPressed.bind(this)); } componentWillUnmount() { documen..

Modifying a file inside a jar

I would like to modify a file inside my jar. Is it possible to do this without extracting and re jarring, from within my application? File i want to modify are configuration files, mostly xml based. ..

What is the difference between HTML tags and elements?

I notice that most people use the words HTML tags and HTML elements interchangeably. But what is the difference between them? The way I see it is that tags are in the source code and elements are ..

How to get first record in each group using Linq

Considering the following records: Id F1 F2 F3 ------------------------------------------------- 1 Nima 1990 10 2 Nim..

Facebook development in localhost

Just wanted to know if there is any way I could develop Facebook applications in localhost. ..

How to check if two arrays are equal with JavaScript?

var a = [1, 2, 3]; var b = [3, 2, 1]; var c = new Array(1, 2, 3); alert(a == b + "|" + b == c); demo How can I check these array for equality and get a method which returns true if they are equal?..

PowerShell script to check the status of a URL

Similar to this question here I am trying to monitor if a set of website links are up and running or not responding. I have found the same PowerShell script over the Internet. However, instead of dir..

How to configure Spring Security to allow Swagger URL to be accessed without authentication

My project has Spring Security. Main issue: Not able to access swagger URL at http://localhost:8080/api/v2/api-docs. It says Missing or invalid Authorization header. Screenshot of the browser window..

'Found the synthetic property @panelState. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.'

I upgraded an Angular 4 project using angular-seed and now get the error Found the synthetic property @panelState. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your..

Arithmetic overflow error converting numeric to data type numeric

I keep getting this error message everytime I run this query: Msg 8115, Level 16, State 8, Line 33 Arithmetic overflow error converting numeric to data type numeric. The statement has been terminated..

Converting Hexadecimal String to Decimal Integer

I wrote some code to convert my hexadecimal display string to decimal integer. However, when input is something like 100a or 625b( something with letter) I got an error like this: java.lang..

How to install an APK file on an Android phone?

I have a simple "Hello Android" application on my computer (Eclipse environment), and I have built an APK file. How do I transfer the APK file to my Android phone for testing? My phone is Ideos runni..

Find which version of package is installed with pip

Using pip, is it possible to figure out which version of a package is currently installed? I know about pip install XYZ --upgrade but I am wondering if there is anything like pip info XYZ. If not wh..

Detecting Back Button/Hash Change in URL

I just set up my new homepage at http://ritter.vg. I'm using jQuery, but very minimally. It loads all the pages using AJAX - I have it set up to allow bookmarking by detecting the hash in the URL. ..

When do I need to use AtomicBoolean in Java?

How I can use AtomicBoolean and what is that class for?..

"Are you missing an assembly reference?" compile error - Visual Studio

I am currently working on a server control for other applications in our company to interface with a WCF service. Every time I make a change code change and recompile the control, I increment the th..

Regex empty string or email

I found a lot of Regex email validation in SO but I did not find any that will accept an empty string. Is this possible through Regex only? Accepting either empty string or email only? I want to hav..

Convert datetime to valid JavaScript date

I have a datetime string being provided to me in the following format: yyyy-MM-dd HH:mm:ss 2011-07-14 11:23:00 When attempting to parse it into a JavaScript date() object it fails. What is the best..

How can I convert a hex string to a byte array?

Can we convert a hex string to a byte array using a built-in function in C# or do I have to make a custom method for this?..

Selenium WebDriver How to Resolve Stale Element Reference Exception?

I have the following code in a Selenium 2 Web Driver test which works when I am debugging but most of the time fails when I run it in the build. I know it must be something to do with the way the page..

Writing a dict to txt file and reading it back?

I am trying to write a dictionary to a txt file. Then read the dict values by typing the keys with raw_input. I feel like I am just missing one step but I have been looking for a while now. I get thi..

how to pass list as parameter in function

I have taken a list and insert some value in it public List<DateTime> dates = new List<DateTime>(); DateTime dt1 = DateTime.Parse(12/1/2012); DateTime dt2 = DateTime.Parse(12/6/2..

Write and read a list from file

This is a slightly weird request but I am looking for a way to write a list to file and then read it back some other time. I have no way to remake the lists so that they are correctly formed/formatte..

SQL Server CTE and recursion example

I never use CTE with recursion. I was just reading an article on it. This article shows employee info with the help of Sql server CTE and recursion. It is basically showing employees and their manager..

Pandas: Creating DataFrame from Series

My current code is shown below - I'm importing a MAT file and trying to create a DataFrame from variables within it: mat = loadmat(file_path) # load mat-file Variables = mat.keys() # identify var..

Maven error "Failure to transfer..."

I am trying to set up a project using Maven (m2eclipse), but I get this error in Eclipse: Description Resource Path Location Type Could not calculate build plan: Failure to transfer ..

ERROR 1130 (HY000): Host '' is not allowed to connect to this MySQL server

Why oh why can I not connect to mysql? mysql -u root -ptest101 -h xxx.xxx.xxx.xxx ERROR 1130 (HY000): Host 'xxx.xxx.xxx.xxx' is not allowed to connect to this MySQL server In my.cnf I have the belo..

Getting content/message from HttpResponseMessage

I'm trying to get content of HttpResponseMessage. It should be: {"message":"Action '' does not exist!","success":false}, but I don't know, how to get it out of HttpResponseMessage. HttpClient httpCli..

How to remove a virtualenv created by "pipenv run"

I am learning Python virtual environment. In one of my small projects I ran pipenv run python myproject.py and it created a virtualenv for me in C:\Users\USERNAME\.virtualenvs I found it also created..

enabling cross-origin resource sharing on IIS7

I recently ran into with posting Javascript requests to another domain. By default XHR posting to other domains is not allowed. Following the instructions from http://enable-cors.org/, I enabled th..

How to add a border just on the top side of a UIView

My question is on the title. I don't know how to add a border in a specific side, top or bottom, any side... layer.border draws the border for the whole view.....

A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations

What is wrong with this statement? ALTER Function [InvestmentReturn].[getSecurityMinLowForPeriod](@securityid int, @start datetime, @end datetime) returns xml begin declare @results varchar(..

Way to insert text having ' (apostrophe) into a SQL table

While I was trying the following SQL command , I got sql error. INSERT INTO exampleTbl VALUES('he doesn't work for me') where doesn't contain the apostrophe. What is the way to insert text having ..