Questions Tagged with #Signaturetool

Get request URL in JSP which is forwarded by Servlet

How can I get request URL in JSP which is forwarded by Servlet? If I run following code in JSP, System.out.println("servlet path= " + request.getServletPath()); System.out.println("request URL= " + ..

Null or empty check for a string variable

if((isnull(@value,''))='') I want to know whether the above piece of code works in checking if the variable is null or empty. ..

How to get the file extension in PHP?

I wish to get the file extension of an image I am uploading, but I just get an array back. $userfile_name = $_FILES['image']['name']; $userfile_extn = explode(".", strtolower($_FILES['image']['name'..

How can I display my windows user name in excel spread sheet using macros?

I am trying to display the windows user name in a excel cell. How can I do this?..

ElasticSearch, Sphinx, Lucene, Solr, Xapian. Which fits for which usage?

I'm currently looking at other search methods rather than having a huge SQL query. I saw elasticsearch recently and played with whoosh (a Python implementation of a search engine). Can you give reaso..

Whether a variable is undefined

How do I find if a variable is undefined? I currently have: var page_name = $("#pageToEdit :selected").text(); var table_name = $("#pageToEdit :selected").val(); var optionResult = $("#pageToEditOpt..

Java best way for string find and replace?

I'm looking for the best approach for string find and replace in Java. This is a sentence: "My name is Milan, people know me as Milan Vasic". I want to replace the string Milan with Milan Vasic, bu..

Best practices for API versioning?

Are there any known how-tos or best practices for web service REST API versioning? I have noticed that AWS does versioning by the URL of the endpoint. Is this the only way or are there other ways to ..

C compile error: Id returned 1 exit status

For some reason, when I try compiling a program, the compiler says permission denied and Id returned 1 exit status. Could anyone tell me what that means? Thank you #include <stdio.h> ..

How to rebase local branch onto remote master

I have a cloned project from a master branch from remote repository remote_repo. I create a new branch and I commit to that branch. Other programmers pushed to remote_repo to the master branch. I need..

Enable 'xp_cmdshell' SQL Server

I want to execute EXEC master..xp_cmdshell @bcpquery But I am getting the following error: SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this compon..

How do I delete NuGet packages that are not referenced by any project in my solution?

Somehow during the upgrade to VS2012 and .NET 4.5, I've managed to get NuGet confused. There are packages that appear in the package manager (and the packages folder) that I cannot delete (I believe ..

What is the native keyword in Java for?

While playing this puzzle (It's a Java keyword trivia game), I came across the native keyword. What is the native keyword in Java used for?..

Clear listview content?

I have a little problem with ListView. How do I clear a ListView content, knowing that it has a custom adapter? edit - the custom adapter class extends BaseAdapter, it looks like this: import androi..

Capture iOS Simulator video for App Preview

Okay, so we can now submit video previews of our apps on the App Store. According to Apple we should do so with an iOS8 device and OSX 10.10. The problem is you have to have all the different devices ..

How to Run Terminal as Administrator on Mac Pro

I am using a Mac for the first time and need to run Terminal as an admin. I have installed NodeJs and Git and want to download Phone Gap/Corova but when I try to install Cordova, it comes back with an..

Android ListView Selector Color

Hi All, I have 2 questions regarding a ListView in Android: How can I get the color of the listview's focused row ? I tried to use the ListView.getSelector() method, which according to its document..

How to remove from a map while iterating it?

How do I remove from a map while iterating it? like: std::map<K, V> map; for(auto i : map) if(needs_removing(i)) // remove it from the map If I use map.erase it will invalidate th..

C++ sorting and keeping track of indexes

Using C++, and hopefully the standard library, I want to sort a sequence of samples in ascending order, but I also want to remember the original indexes of the new samples. For example, I have a set, ..

Automatic confirmation of deletion in powershell

I'm running the following command: get-childitem C:\temp\ -exclude *.svn-base,".svn" -recurse | foreach ($_) {remove-item $_.fullname} Which prompts me very frequently like this: Confirm The item ..

jQuery - replace all instances of a character in a string

This does not work and I need it badly $('some+multi+word+string').replace('+', ' ' ); always gets some multi+word+string it's always replacing for the first instance only, but I need it to work..

Android ADB doesn't see device

I'm trying to run my applications on OMEGA T107 tablet. But adb doesn't see my device. I tried almost everything...

Intercept and override HTTP requests from WebView

I have a WebView in my application in which some site is opened (always the same, it is my own page). The site has some JS code that loads some images from the remote host. I want to intercept request..

CSS for grabbing cursors (drag & drop)

I have a JavaScript webapp where the user needs to grab the background to move the whole screen around. So I want the cursor to change when they're hovering over the background. The -moz-grab and -m..

Getting error: ISO C++ forbids declaration of with no type

I'm getting the following errors: ISO C++ forbids declaration of ttTreeInsert with no type ISO C++ forbids declaration of ttTreeDelete with no type ISO C++ forbids declaration of ttTreePrint with no ..

Sort an Array by keys based on another Array?

Is it possible in PHP to do something like this? How would you go about writing a function? Here is an example. The order is the most important thing. $customer['address'] = '123 fake st'; $customer[..

How to find item with max value using linq?

Have a look at the below table: Item Value A 10 b 50 c 90 I want to find the item with maximum value. I can get that by using group by or order..

How to count rows with SELECT COUNT(*) with SQLAlchemy?

I'd like to know if it's possible to generate a SELECT COUNT(*) FROM TABLE statement in SQLAlchemy without explicitly asking for it with execute(). If I use: session.query(table).count() then it gen..

Oracle TNS names not showing when adding new connection to SQL Developer

I'm trying to connect to an oracle database with SQL Developer. I've installed the .Net oracle drivers and placed the tnsnames.ora file at C:\Oracle\product\11.1.0\client_1\Network\Admin I'm using ..

.war vs .ear file

What is the difference between a .war and .ear file?..

iOS Safari – How to disable overscroll but allow scrollable divs to scroll normally?

I'm working on an iPad-based web app, and need to prevent overscrolling so that it seems less like a web page. I'm currently using this to freeze the viewport and disable overscroll:

How create table only using <div> tag and Css

I want to create table only using <div> tag and CSS. This is my sample table. <body> <form id="form1"> <div class="divTable"> <div class="headRow">..

How to detect the screen resolution with JavaScript?

Is there a way that works for all browsers?..

Jenkins - how to build a specific branch

This isn't as simple as just doing a parametrized build. I've already got a specific build process that will build and deploy whenever any of these branches are pushed to GitHub: So if I've just pu..

How do you make an array of structs in C?

I'm trying to make an array of structs where each struct represents a celestial body. I don't have that much experience with structs, which is why I decided to try to use them instead of a whole bunc..

Endless loop in C/C++

There are several possibilities to do an endless loop, here are a few I would choose: for(;;) {} while(1) {} / while(true) {} do {} while(1) / do {} while(true) Is there a certain form which one s..

byte array to pdf

I am trying to convert content of a file stored in a sql column to a pdf. I use the following piece of code: byte[] bytes; BinaryFormatter bf = new BinaryFormatter(); MemoryStream ms = new MemoryStr..

Use of True, False, and None as return values in Python functions

I think that I fully understand this, but I just want to make sure since I keep seeing people say to never ever test against True, False, or None. They suggest that routines should raise an error rat..

How to convert JSON object to JavaScript array?

I need to convert JSON object string to a JavaScript array. This my JSON object: {"2013-01-21":1,"2013-01-22":7} And I want to have: var data = new google.visualization.DataTable(); data.addColum..

How do you change the text in the Titlebar in Windows Forms?

I am trying to set a condition that would change the writing inside the title bar... But how do I change the title bar text?..

Where can I find MySQL logs in phpMyAdmin?

Where can I find the MySQL's logs (errors, queries, etc.) in the phpMyAdmin interface?..

ASP.NET custom error page - Server.GetLastError() is null

I have a custom error page set up for my application: <customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx" /> In Global.asax, Application_Error(), the following code works to ..

Not Able To Debug App In Android Studio

I am making an app in Android Studio, now trying to debug it through adb. When I click on the word Android and the logo on the bottom bar, logcat comes up and recognizes my device. Then I see this: ..

Sort collection by multiple fields in Kotlin

Let's say I have a list of People which I need to sort by Age first and then by Name. Coming from a C#-background, I can easily achieve this in said language by using LINQ: var list=new List<Per..

I have Python on my Ubuntu system, but gcc can't find Python.h

I am on a school computer, so I can't install anything. I am trying to create C code which can be run in Python. It seems all the articles I am finding on it require you to use #include <Python...

Undo a Git merge that hasn't been pushed yet

Within my master branch, I did a git merge some-other-branch locally, but never pushed the changes to origin master. I didn't mean to merge, so I'd like to undo it. When doing a git status after my me..

Printing *s as triangles in Java?

My assignment in my Java course is to make 3 triangles. One left aligned, one right aligned, and one centered. I have to make a menu for what type of triangle and then input how many rows is wanted. T..

How to get substring of NSString?

If I want to get a value from the NSString @"value:hello World:value", what should I use? The return value I want is @"hello World"...

How do I get a Date without time in Java?

Continuing from Stack Overflow question Java program to get the current date without timestamp: What is the most efficient way to get a Date object without the time? Is there any other way than these..

What is <=> (the 'Spaceship' Operator) in PHP 7?

PHP 7, which will come out in November this year will introduce the Spaceship (<=>) operator. What is it and how does it work? This question already has an answer in our general reference question..

Jquery/Ajax call with timer

I have a php page that echos out rows from a database. I want to call it via jquery/ajax every 30 seconds. But I also want to be able to call the page at any time so that if I add a record via the for..

Static linking vs dynamic linking

Are there any compelling performance reasons to choose static linking over dynamic linking or vice versa in certain situations? I've heard or read the following, but I don't know enough on the subject..

Has been blocked by CORS policy: Response to preflight request doesn’t pass access control check

I have created trip server. It works fine and we are able to make POST request by Insomnia but when we make POST request by axios on our front-end, it sends an error: has been blocked by CORS policy:..

Scala Doubles, and Precision

Is there a function that can truncate or round a Double? At one point in my code I would like a number like: 1.23456789 to be rounded to 1.23..

How to duplicate a git repository? (without forking)

I have two repositories, and I need to copy whole of one onto the other empty one which has different access levels from the first one. The copy and the mother repository should not be linked together..

When should I use Async Controllers in ASP.NET MVC?

I have some concerns using async actions in ASP.NET MVC. When does it improve performance of my apps, and when does it not? Is it good to use async action everywhere in ASP.NET MVC? Regarding awaita..

How to mount a single file in a volume

I am trying to dockerize a PHP application. In the dockerfile, I download the archive, extract it, etc. Everything works fine. However, if a new version gets released and I update the dockerfile, I ha..

How to update a git clone --mirror?

I have created a git repository to mirror a live site (which is a non-bare git repository): git clone --mirror ssh://[email protected]/path/to/repo Now, to keep this mirror clone updated with all ch..

Disable automatic sorting on the first column when using jQuery DataTables

I'm using jQuery DataTables and I would like to know if there's possible to disable automatic sorting on the first column of the table? My code looks like this: /* Default class modification..

Maven: The packaging for this project did not assign a file to the build artifact

I'm using Maven 3.0.3 on Mac 10.6.6. I have a JAR project and when I run the command "mvn clean install:install", I'm getting the error, [ERROR] Failed to execute goal org.apache.maven.plugins:mave..

Including JavaScript class definition from another file in Node.js

I'm writing a simple server for Node.js and I'm using my own class called User which looks like: function User(socket) { this.socket = socket; this.nickname = null; /* ... just the typic..

Spring Hibernate - Could not obtain transaction-synchronized Session for current thread

I created an application with spring + hibernate, but I always get this error. This is my first application with hibernate, I read some guides but I can not solve this problem. Where am I doing wrong?..

@UniqueConstraint annotation in Java

I have a Java bean. Now, I want to be sure that the field should be unique. I am using the following code: @UniqueConstraint(columnNames={"username"}) public String username; But I'm getting some ..

In MVC, how do I return a string result?

In my AJAX call, I want to return a string value back to the calling page. Should I use ActionResult or just return a string? ..

nginx server_name wildcard or catch-all

I have an instance of nginx running which serves several websites. The first is a status message on the server's IP address. The second is an admin console on These work great. Now I..

How to iterate for loop in reverse order in swift?

When I use the for loop in Playground, everything worked fine, until I changed the first parameter of for loop to be the highest value. (iterated in descending order) Is this a bug? Did any one else ..

How to use ArrayList's get() method

I'm new to java (& to OOP too) and I'm trying to understand about the class ArrayList but I don't understand how to use the get(). I tried searching in net, but couldn't find anything helpful...

Git for beginners: The definitive practical guide

Ok, after seeing this post by PJ Hyett, I have decided to skip to the end and go with Git. So what I need is a beginner's practical guide to Git. "Beginner" being defined as someone who knows how to..

Why use @Scripts.Render("~/bundles/jquery")

How does @Scripts.Render("~/bundles/jquery") differ from just referencing the script from html like this <script src="~/bundles/jquery.js" type="text/javascript"></script> Are the..

How to change the text of a button in jQuery?

How do you change the text value of a button in jQuery? Currently, my button has 'Add' as its text value, and upon being clicked I want it to change to 'Save'. I have tried this method below, but so f..

What is the correct XPath for choosing attributes that contain "foo"?

Given this XML, what XPath returns all elements whose prop attribute contains Foo (the first three nodes): <bla> <a prop="Foo1"/> <a prop="Foo2"/> <a prop="3Foo"/> <a p..

How to open every file in a folder

I have a python script, which in the script open a file, say file1, and then do something maybe print out the total number of characters. filename = 'file1' f = open(filename, 'r') content ..

When should I really use noexcept?

The noexcept keyword can be appropriately applied to many function signatures, but I am unsure as to when I should consider using it in practice. Based on what I have read so far, the last-minute addi..

'foo' was not declared in this scope c++

I'm just learning c++ (first day looking at it since I took a 1 week summer camp years ago) I was converting a program I'm working on in Java to C++: #ifndef ADD_H #define ADD_H #define _USE_MATH_DE..

Filezilla FTP Server Fails to Retrieve Directory Listing

I'm running Filezilla Server 0.9.45 beta to manage my server remotely. After setting it up, I tested connecting to it using the IP, and it worked successfully. However, to connect to the ser..

Wait 5 seconds before executing next line

This function below doesn’t work like I want it to; being a JS novice I can’t figure out why. I need it to wait 5 seconds before checking whether the newState is -1. Currently, it doesn’t wait..

Adding HTML entities using CSS content

How do you use the CSS content property to add HTML entities? Using something like this just prints &nbsp; to the screen instead of the non-breaking space: .breadcrumbs a:before { content: '..

Using Cookie in Asp.Net Mvc 4

I have web application in Asp.Net MVC4 and I want to use cookie for user's login and logout. So my actions as follows: Login Action [HttpPost] public ActionResult Login(string username, stri..

How to edit/save a file through Ubuntu Terminal

This is quite a simple question: I just need to open a file (this filename is galfit.feedme). I can view the file with view galfit.feedme when I'm in the directory, but I do not know how to edit thi..

Can you issue pull requests from the command line on GitHub?

It seems like you have to interact with to initiate a pull request. Is this so?..

iPhone App Development on Ubuntu

Possible Duplicate: Starting iPhone app development in Linux? Is there a way to use Ubuntu Linux for developing iPhone applications destined to be listed on Apples app store ?..

How can I trigger an onchange event manually?

I'm setting a date-time textfield value via a calendar widget. Obviously, the calendar widget does something like this : document.getElementById('datetimetext').value = date_value; What I want is :..

Is there a way I can retrieve sa password in sql server 2005

I just forgot the password. Can anyone help me how to get back the password...

Fatal error: unexpectedly found nil while unwrapping an Optional values

I was using an UICollectionView in Swift but I get when I try to change the text of the cell's label. func collectionView(collectionView: UICollectionView!, numberOfItemsInSection section: Int)..

Error when checking model input: expected convolution2d_input_1 to have 4 dimensions, but got array with shape (32, 32, 3)

I want to train a deep network starting with the following layer: model = Sequential() model.add(Conv2D(32, 3, 3, input_shape=(32, 32, 3))) using history = model.fit_generator(get_training_data()..

Using ng-if as a switch inside ng-repeat?

I am working on Angular app. I tried to use ng-if and switch inside ng-repeat but didn't succeed. I have data like: **[{"_id":"52fb84fac6b93c152d8b4569", "post_id":"52fb84fac6b93c152d8b4567..

How to import a class from default package

Possible Duplicate: How to access java-classes in the default-package? I am using Eclipse 3.5 and I have created a project with some package structure along with the default package. I have one..

Why does z-index not work?

So if I understand z-index correctly, it would be perfect in this situation: I want to place the bottom image (the tag/card) below the div above it. So you can't see the sharp edges. How do I do t..

Copy all values from fields in one class to another through reflection

I have a class which is basically a copy of another class. public class A { int a; String b; } public class CopyA { int a; String b; } What I am doing is putting values from class A into C..

Nested lists python

Can anyone tell me how can I call for indexes in a nested list? Generally I just write: for i in range (list) but what if I have a list with nested lists as below: Nlist = [[2,2,2],[3,3,3],[4,4,..

convert date string to mysql datetime field

I have a bunch of records with dates formatted as a string such as '04/17/2009' I want to convert them to a mysql datetime field I plan to use a foreach loop to read the old date value and insert th..

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 list files in an android directory?

Here's my code so far: String path = Environment.getExternalStorageDirectory().toString()+"/Pictures"; AssetManager mgr = getAssets(); try { String list[] = mgr.list(pa..

ImportError: No module named google.protobuf

I am following this guide ( and using the exact sample of addressbook.proto. Post the content of compiler generated addressbook_pb2...

Position an element relative to its container

I'm trying to create a horizontal 100% stacked bar graph using HTML and CSS. I'd like to create the bars using DIVs with background colors and percentage widths depending on the values I want to graph..

Creating a singleton in Python

This question is not for the discussion of whether or not the singleton design pattern is desirable, is an anti-pattern, or for any religious wars, but to discuss how this pattern is best implemented ..

How can I send large messages with Kafka (over 15MB)?

I send String-messages to Kafka V. 0.8 with the Java Producer API. If the message size is about 15 MB I get a MessageSizeTooLargeException. I have tried to set message.max.bytesto 40 MB, but I still ..

html select option SELECTED

I have in my php $sel = " <option> one </option> <option> two </option> <option> thre </option> <option> four </option> "; let say I ..

".addEventListener is not a function" why does this error occur?

I’m getting an ".addEventListener is not a function" error. I am stuck on this: var comment = document.getElementsByClassName("button"); function showComment() { var place = document.getElementBy..

UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2

I am creating XML file in Python and there's a field on my XML that I put the contents of a text file. I do it by f = open ('myText.txt',"r") data = f.close() root = ET.Element("add") doc =..

Homebrew: Could not symlink, /usr/local/bin is not writable

While installing tig, HomeBrew is displaying the following issues while installing a dependency: Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into..

How to set the max value and min value of <input> in html5 by javascript or jquery?

I am trying to find out how to set the max value and min value of html5 type input by javascript or jquery. <input type="number" max="???" min="???" step="0.5"/> Would someone please guide..

How to know the git username and email saved during configuration?

While configuring git I ran these two commands: git config --global "My Name" git config --global "[email protected]" However, I doubt whether I made a typo or not. So, is t..

What are the most widely used C++ vector/matrix math/linear algebra libraries, and their cost and benefit tradeoffs?

It seems that many projects slowly come upon a need to do matrix math, and fall into the trap of first building some vector classes and slowly adding in functionality until they get caught building a ..

How do I grant read access for a user to a database in SQL Server?

I want to grant access to a user to a specific database with read and write access. The user is already available in the domain but not in the DB. So, how can I give them that access with creating a ..

How to store array or multiple values in one column

Running Postgres 7.4 (Yeah we are in the midst of upgrading) I need to store from 1 to 100 selected items into one field in a database. 98% of the time it's just going to be 1 item entered, and 2% of..

Writing File to Temp Folder

I want to use StreamWriter to write a file to the temp folder. It might be a different path on each PC, so I tried using %temp%\SaveFile.txt but it didn't work. How can I save to the temp folder, us..

Run a command shell in jenkins

I'm trying to execute a command shell in Jenkins, I'm working on Windows 7. In the console output I have this: Building in workspace C:\Program Files (x86)\Jenkins\workspace\test [test] $ sh -xe C:\W..

Scale image to fit a bounding box

Is there a css-only solution to scale an image into a bounding box (keeping aspect-ratio)? This works if the image is bigger than the container: img { max-width: 100%; max-height: 100%; } Examp..

The type must be a reference type in order to use it as parameter 'T' in the generic type or method

I'm getting deeper into generics and now have a situation I need help with. I get a compile error on the 'Derived' class below as shown in the subject title. I see many other posts similar to this one..

X-Frame-Options on apache

I am trying to allow some particular domain to access my site via iframe Header set X-Frame-Options ALLOW-FROM I know this could be done by add the line above to the conf..

Drawing a simple line graph in Java

In my program I want to draw a simple score line graph. I have a text file and on each line is an integer score, which I read in and want to pass as argument to my graph class. I'm having some trouble..

Using HeapDumpOnOutOfMemoryError parameter for heap dump for JBoss

I was told I can add the -XX:+HeapDumpOnOutOfMemoryError parameter to my JVM start up options to my JBoss start up script to get a heap dump when we get an out of memory error in our application. I w..

After Spring Boot 2.0 migration: jdbcUrl is required with driverClassName

SOLVED: My solution: I delete dataSource() method from Then, the application was started successfully :) I've just updated my Spring Boot project from 1.5.x to 2.0.0. Before the ..

How to access Session variables and set them in javascript?

In code-behind I set Session with some data. Session["usedData"] = "sample data"; And the question is how can I get the Session value(in my example; "sample data") in javascript and set Session["us..

Rails update_attributes without save?

Is there an alternative to update_attributes that does not save the record? So I could do something like: @car = => 'GMC') #other processing @car.update_attributes(:model => 'Sie..

Creating multiple objects with different names in a loop to store in an array list

I am trying to create mutliple objects of a type of class I made. I then want to transfer these values into the array list. How can I create objects using a while loop that have different names. For e..

What is difference between INNER join and OUTER join

Difference between inner and outer join. i am using two table and want to fetch data from both table so which type join we should use owning of that we can solve our problem ..

Best way to check function arguments?

I'm looking for an efficient way to check variables of a Python function. For example, I'd like to check arguments type and value. Is there a module for this? Or should I use something like decorators..

Oracle PL/SQL - Are NO_DATA_FOUND Exceptions bad for stored procedure performance?

I'm writing a stored procedure that needs to have a lot of conditioning in it. With the general knowledge from C#.NET coding that exceptions can hurt performance, I've always avoided using them in PL..

How can I convert this one line of ActionScript to C#?

I would like to convert this one line of code to C# code within a void: param1:Function=null I am aware that in the void, it would be like "thing here" param1, but I dont know what "thing here" wou..

Easy way to concatenate two byte arrays

What is the easy way to concatenate two byte arrays? Say, byte a[]; byte b[]; How do I concatenate two byte arrays and store it in another byte array?..

Android Studio installation on Windows 7 fails, no JDK found

I downloaded Android Studio and attempted to launch the program. This is running on Windows 7 64-bit with Java 1.7. During the installation my Java 1.7 is detected, and the rest of the installation g..

Hibernate Criteria Join with 3 Tables

I am looking for a hibernate criteria to get following: Dokument.class is mapped to Role roleId Role.class has a ContactPerson contactId Contact.class FirstName LastName I want to search for First..

Parse a URI String into Name-Value Collection

I've got the URI like this: I need a coll..

What's the difference between a POST and a PUT HTTP REQUEST?

They both seem to be sending data to the server inside the body, so what makes them different?..

The default for KeyValuePair

I have an object of the type IEnumerable<KeyValuePair<T,U>> keyValueList, I am using var getResult= keyValueList.SingleOrDefault(); if(getResult==/*default */) { } else { } How..

How to host a Node.Js application in shared hosting

How to host a Node.Js application in a shared hosting I want to host a node.js application in shared hosting. Does anyone have any reference or documentation to refer to?..

PowerShell: Create Local User Account

I need to create a new local user account, and then add them to the local Administrators group. Can this be done in PowerShell? EDIT: # Create new local Admin user for script purposes $Computer = [..

system("pause"); - Why is it wrong?

Here's a question that I don't quite understand: The command, system("pause"); is taught to new programmers as a way to pause a program and wait for a keyboard input to continue. However, it seems to..

How to add a WiX custom action that happens only on uninstall (via MSI)?

I would like to modify an MSI installer (created through WiX) to delete an entire directory on uninstall. I understand the RemoveFile and RemoveFolder options in WiX, but these are not robust enough ..

How to save a data.frame in R?

I made a data.frame in R that is not very big, but it takes quite some time to build. I would to save it as a file, which I can than again open in R?..

Ansible: filter a list by its attributes

I have variable named "network" registered in Ansible: { "addresses": { "private_ext": [ { "type": "fixed", "addr": "" ..

Difference between left join and right join in SQL Server

I know about joins in SQL Server. For example. There are two tables Table1, Table2. Their table structures are the following. create table Table1 (id int, Name varchar (10)) create table Table2 (..

What's the best way to share data between activities?

I have one activity which is the main activity used throughout the app and it has a number of variables. I have two other activities which I would like to be able to use the data from the first activi..

"element.dispatchEvent is not a function" js error caught in firebug of FF3.0

i am getting the following error while loading my index page in FF3.0. Sorry, i am unable to paste the script here as it is 2030 lines of code. element.dispatchEvent is not a function On expansi..

Get the difference between dates in terms of weeks, months, quarters, and years

I have two dates let´s say 14.01.2013 and 26.03.2014. I would like to get the difference between those two dates in terms of weeks(?), months(in the example 14), quarters(4) and years(1). Do you kn..

PKIX path building failed: unable to find valid certification path to requested target

I am calling some HTTPS web service which the following Client: import; import; import; import; import ja..

What is the recommended way to make a numeric TextField in JavaFX?

I need to restrict input into a TextField to integers. Any advice?..

Unmarshaling nested JSON objects

There are a few questions on the topic but none of them seem to cover my case, thus I'm creating a new one. I have JSON like the following: {"foo":{ "bar": "1", "baz": "2" }, "more": "text"} Is th..

How to Refresh a Component in Angular

I am working on an Angular project. I'm struggling with refresh action in a component. I would like to refresh the router's components on button click. I have refresh button when I click on it the co..

Spring Boot not serving static content

I can't get my Spring-boot project to serve static content. I've placed a folder named static under src/main/resources. Inside it I have a folder named images. When I package the app and run it, it c..

using favicon with css

I want to set the favicon for a fairly large number of pages. But, instead of using the HTML <head> tag <link rel="shortcut icon" href="favicon.ico">, I'd like to set it in the CSS file. I..

Sorting a Dictionary in place with respect to keys

I have a dictionary in C# like Dictionary<Person, int> and I want to sort that dictionary in place with respect to keys (a field in class Person). How can I do it? Every available help on the..

Difference between multitasking, multithreading and multiprocessing?

Whats the difference between multitasking, multiprogramming & multiprocessing This comes regularly for my university OS exams and I can't find a good answer. I know quite a bit about multitasking..

how can get index & count in vuejs

I have code like this (JSFiddle) <li v-for="(itemObjKey, catalog) in catalogs">this index : {{itemObjKey}}</li> Output: this index: 0 this index: 1 My question is: How can I get va..

Fetch: reject promise and catch the error if status is not OK?

Here's what I have going: import 'whatwg-fetch'; function fetchVehicle(id) { return dispatch => { return dispatch({ type: 'FETCH_VEHICLE', payload: fetch(`http..

The Response content must be a string or object implementing __toString(), "boolean" given after move to psql

As soon as I move my Laravel App from MySQL to pSQL. I kept getting this error. The Response content must be a string or object implementing __toString(), "boolean" given. I have an API that su..

Render Content Dynamically from an array map function in React Native

I'm trying to get data from an array and using map function to render content. Look at **{this.lapsList()}** and the associated **lapsList()** function to understand what I'm trying to do. T..

What is the difference between a Shared Project and a Class Library in Visual Studio 2015?

I was looking at the new features for Visual Studio 2015 and Shared Project came up a lot but I don't understand how it is different to using a Class Library or a Portable Class Library. Can anyone ex..

Add image in pdf using jspdf

I am using jspdf to convert an image into a PDF. I have converted the image into a URI using base64encode. But the problem is that there are no errors or warnings shown in the console. A PDF is gen..

How to toggle (hide / show) sidebar div using jQuery

I have 2 <div>s with ids A and B. div A has a fixed width, which is taken as a sidebar. The layout looks like diagram below: The styling is like below: html, body { margin: 0; padding: ..

LaTeX: remove blank page after a \part or \chapter

How to remove a blank page that gets added automatically after \part{} or \chapter{} in a book document class? I need to add some short text describing the \part. Adding some text after the part comm..

How do I remove objects from a JavaScript associative array?

Suppose I have this code: var myArray = new Object(); myArray["firstname"] = "Bob"; myArray["lastname"] = "Smith"; myArray["age"] = 25; Now if I want..

display html page with node.js

This is my first time with node.js. I get it to display the index.html, but it doesn't display the images on the site or anything else, it ONLY shows the basic html stuff. Here's how I set it up. Ther..

How do I improve ASP.NET MVC application performance?

How do you improve your ASP.NET MVC application performance?..

Best way to iterate through a Perl array

Which is the best implementation(in terms of speed and memory usage) for iterating through a Perl array? Is there any better way? (@Array need not be retained). Implementation 1 foreach (@Array) { ..

Volatile Vs Atomic

I read somewhere below line. Java volatile keyword doesn't means atomic, its common misconception that after declaring volatile, ++ operation will be atomic, to make the operation atomic you s..

Capturing "Delete" Keypress with jQuery

When using the example code from the jQuery documentation for the keypress event handler, I'm unable to capture the Delete key. The snippet below is going to log 0 when the Delete key is pressed in Fi..

Calling functions in a DLL from C++

I have a solution in VS 2008 with 2 projects in it. One is a DLL written in C++ and the other is a simple C++ console application created from a blank project. I would like know how to call the functi..

iptables v1.4.14: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)

I'm trying to set iptable rules, and I got following error message when I use iptable : iptables v1.4.14: can't initialize iptables table `nat': Table does not exist (do you need to insmod?) Perhaps ..

Create a hexadecimal colour based on a string with JavaScript

I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000 and #FFFFFF, so I can use it as a colour ..

How do I remove a property from a JavaScript object?

Say I create an object as follows: let myObject = { "ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*" }; What is the b..

How to pass multiple parameters from ajax to mvc controller?

Controller [HttpPost] public ActionResult Save(string StrContactDetails, bool IsPrimary) { } $.ajax({ async: true, type: "POST", url: @url.Action("Helper","Save"), data: { StrContactDeta..

Download a file by jQuery.Ajax

I have a Struts2 action in the server side for file downloading. <action name="download" class=""> <result name="success" type="stream"> <param name="cont..

Postgres: How to convert a json string to text?

Json value may consist of a string value. eg.: postgres=# SELECT to_json('Some "text"'::TEXT); to_json ----------------- "Some \"text\"" How can I extract that string as a postgres text value..

React / JSX Dynamic Component Name

I am trying to dynamically render components based on their type. For example: var type = "Example"; var ComponentName = type + "Component"; return <ComponentName />; // Returns <ex..

Remove old Fragment from fragment manager

I'm trying to learn how to use Fragments in android. I'm trying to remove old fragment when new fragment is calling in android...

Explanation on Integer.MAX_VALUE and Integer.MIN_VALUE to find min and max value in an array

I don't seem to understand how Integer.MAX_VALUE and Integer.MIN_VALUE help in finding the min and max value in an array. I understand how this method (pseudocode below) works when finding the min an..

How to use an existing database with an Android application

I have already created an SQLite database. I want to use this database file with my Android project. I want to bundle this database with my application. Instead of creating a new database, how can t..

Postgres could not connect to server

After I did brew update and brew upgrade, my postgres got some problem. I tried to uninstall postgres and install again, but it didn't work as well. This is the error message.(I also got this error ..

Check if any type of files exist in a directory using BATCH script

Hello I'm looking to write a batch file to check to see if there are any files of any type inside a given folder. So far I've tried the following if EXIST FOLDERNAME\\*.* ( echo Files Exist ) ELSE (..

How to have a a razor action link open in a new tab?

I trying to get my link to open in a new tab (it must be in razor format): <a href="@Url.Action("RunReport", "Performance", new { reportView = Model.ReportView.ToString() }, new { target = "_b..

How to convert existing non-empty directory into a Git working directory and push files to a remote repository

I have a non-empty directory (eg /etc/something) with files that cannot be renamed, moved, or deleted. I want to check this directory into git in place. I want to be able to push the state of this re..

Is there such a thing as min-font-size and max-font-size?

I'm trying to make a font in a div responsive to the browser window. So far, it has worked perfectly, but the parent div has a max-width of 525px. Resizing the browser further will not make the font s..

Update a column value, replacing part of a string

I have a table with the following columns in a MySQL database [id, url] And the urls are like: I want to update all the urls to another domain http://doma..

Can't draw Histogram, 'x' must be numeric

I have a data file with this format: Weight Industry Type 251,787 Kellogg h 253,9601 Kellogg a 256,0758 Kellogg h .... I read the data and try to draw an histogram with this comma..

Read from file or stdin

I am writing a utility which accepts either a filename, or reads from stdin. I would like to know the most robust / fastest way of checking to see if stdin exists (data is being piped to the program)..

How to save and extract session data in codeigniter

I save some data in session on my verify controller then I extract this session data into user_activity model and insert session data into activity table. My problem is only username data saved in ses..

Moving Average Pandas

I would like to add a moving average calculation to my exchange time series. Original data from Quandl Exchange = Quandl.get("BUNDESBANK/BBEX3_D_SEK_USD_CA_AC_000", authtoken="..

Can I write a CSS selector selecting elements NOT having a certain class or attribute?

I would like to write a CSS selector rule that selects all elements that don't have a certain class. For example, given the following HTML: <html class="printable"> <body class="printabl..

When using Trusted_Connection=true and SQL Server authentication, will this affect performance?

If a connection string specifies Trusted_Connection=true with SQL Server authentication mode, will performance of my web application be impacted? ..

How do I cast a JSON Object to a TypeScript class?

I read a JSON object from a remote REST server. This JSON object has all the properties of a typescript class (by design). How do I cast that received JSON object to a type var? I don't want to popul..

What is the difference between syntax and semantics in programming languages?

What is the difference between syntax and semantics in programming languages (like C, C++)? ..

Launch Pycharm from command line (terminal)

I want to try out PyCharm for sage mathematics development. Normally I run eclipse to do sage development, but now I want to try it with PyCharm. To launch eclipse with sage environment variables, i..

HTML input time in 24 format

I am using below HTML tag: <input type="time" /> In Chrome, Its showing PM/AM format, can we restrict to display 24 format always. I dont want to use HTML5 tag ..

How do I generate a SALT in Java for Salted-Hash?

I've been looking around and the closest answer is : How to generate a random alpha-numeric string? I want to follow this workflow according to this CrackStation tutorial: To Store a Password Genera..

Chrome / Safari not filling 100% height of flex parent

I want to have a vertical menu with a specific height. Each child must fill the height of the parent and have middle-aligned text. The number of children is random, so I have to work with dynamic va..

Outline radius?

Is there anyway of getting rounded corners on the outline of a div element, similar to border-radius?..

How to print variables without spaces between values

I would like to know how to remove additional spaces when I print something. Like when I do: print 'Value is "', value, '"' The output will be: Value is " 42 " But I want: Value is "42" Is t..

Excel formula is only showing the formula rather than the value within the cell in Office 2010

I've written a formula within an Excel Cell, in Office 2010, and I expect the cell to show its value, but it still shows the formula. How do I get the cell to show the value rather than the formula?..

How do I check whether a file exists without exceptions?

How do I check if a file exists or not, without using the try statement?..

Javascript Array of Functions

var array_of_functions = [ first_function('a string'), second_function('a string'), third_function('a string'), forth_function('a string') ] array_of_functions[0]; That does not wor..

Android Viewpager as Image Slide Gallery

I am using Jake's ViewPageIndicator and want to display Images like a swipe gallery. Any refernce link where i can get started. I have implemented the basic viewpager and now want to implement image v..

How to stick text to the bottom of the page?

I would like to put a line "All Rights Reserved..." at the bottom of the page. I tried to use absolute positioning, but this does not work as expected when the window resized to smaller height. How c..

What is the iOS 6 user agent string?

What is the iOS 6.0 user agent string? Previous user-agent strings: iOS 5.1 - What is the iOS 5.1 user agent string? iOS 5.0 - What is the iOS 5.0 user agent string? iOS 4.0 - What is the iPhone ..

Automatic date update in a cell when another cell's value changes (as calculated by a formula)

I have a formula in C2, say =A2+B2. Whenever C2 changes value (actual value, not formula) I want to have the present date and time updated in D2. I have tried a lot of VBA codes and tricks and none o..

Path to MSBuild

How can I programatically get the path to MSBuild from a machine where my .exe is running? I can get the .NET version from the Environment but is there a way of getting the correct folder for a .NET ..

How to create a density plot in matplotlib?

In R I can create the desired output by doing: data = c(rep(1.5, 7), rep(2.5, 2), rep(3.5, 8), rep(4.5, 3), rep(5.5, 1), rep(6.5, 8)) plot(density(data, bw=0.5)) In python (with matplot..

how to use ng-option to set default value of select element

I've seen the documentation of the Angular select directive here: I can't figure how to set the default value. This is confusing: select as lab..