Questions Tagged with #Gumstix

Gumstix is an American multinational company headquartered in Portola Valley, California that develops and manufactures small computers-on-module (COMs), compatible expansion boards and single-board computers.

Best way to stress test a website

This may be the wrong question to ask but, what's the best way to replicate a large load on an asp.net web application? Is there an easy way to simulate many requests on particular pages? Or is the be..

More than one file was found with OS independent path 'META-INF/LICENSE'

When I build my app, I get the following error: Error: Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. More than one file was found with OS independent path 'META-IN..

Convert a 1D array to a 2D array in numpy

I want to convert a 1-dimensional array into a 2-dimensional array by specifying the number of columns in the 2D array. Something that would work like this: > import numpy as np > A = np.array(..

Passing parameters to click() & bind() event in jquery?

I want to pass few parameters to Click() event in jquery, I tried following but its not working, commentbtn.click(function(id, name){ alert(id); }); And also if we use bind then how we'll do t..

What's the best way to build a string of delimited items in Java?

While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could..

windows batch file rename

I have some file such as AAA_a001.jpg, BBB_a002.jpg, CCC_a003.jpg in Windows 7 and I'm trying to use batch to rename these file to a001_AAA.jpg, a002_BBB.jpg, a003_CCC.jpg. Just to swap the content b..

Injecting Mockito mocks into a Spring bean

I would like to inject a Mockito mock object into a Spring (3+) bean for the purposes of unit testing with JUnit. My bean dependencies are currently injected by using the @Autowired annotation on priv..

Add property to an array of objects

I have an array of objects as shown below Object {Results:Array[2]} Results:Array[2] [0-1] 0:Object id=1 name: "Rick" 1:Object id=2 name:'david' I want to..

MySql with JAVA error. The last packet sent successfully to the server was 0 milliseconds ago

I have read about this exception a lot, but I can't solve my. Mysql server is working. I can connect to it from NetBeans, but I can't connect to it from java code. Exception in thread "main" com.m..

Plotting time-series with Date labels on x-axis

I know that this question might be a cliche, but I'm having hard time doing it. I've data set in the following format: Date Visits 11/1/2010 696537 11/2/2010 718..

What is the best IDE for PHP?

I'm a PHP developer and now I use Notepad++ for code editing, but lately I've been searching for an IDE to ease my work. I've looked into Eclipse, Aptana Studio and several others, but I'm not really..

How to get the focused element with jQuery?

Using jQuery, how can I get the input element that has the caret's (cursor's) focus? Or in other words, how to determine if an input has the caret's focus?..

Android Calling JavaScript functions in WebView

I am trying to call some javascript functions sitting in an html page running inside an android webview. Pretty simple what the code tries to do below - from the android app, call a javascript functi..

Confused about Service vs Factory

As I understand it, when inside a factory I return an object that gets injected into a controller. When inside a service I am dealing with the object using this and not returning anything. I was und..

Create database from command line

I´m trying to create a data base from command line. My OS is centos and postgres version is 10.9. sudo -u postgres psql createdb test Password for user test: Why asking me by user?..

JavaScript seconds to time string with format hh:mm:ss

I want to convert a duration of time, i.e., number of seconds to colon-separated time string (hh:mm:ss) I found some useful answers here but they all talk about converting to x hours and x minutes fo..

How can I create an utility class?

I want to create a class with utility methods, for example public class Util { public static void f (int i) {...} public static int g (int i, int j) {...} } Which is the best method to cre..

How to plot a histogram using Matplotlib in Python with a list of data?

I am trying to plot a histogram using the matplotlib.hist() function but I am not sure how to do it. I have a list probability = [0.3602150537634409, 0.42028985507246375, 0.373117033603708, 0.36..

How can I use a C++ library from node.js?

How can I use a C++ library from node.js?..

Changing the CommandTimeout in SQL Management studio

How can I change the CommandTimeout in SQL Management Studio?..

Creating SVG graphics using Javascript?

How can I create SVG graphics using JavaScript? Do all browsers support SVG?..

jQuery Mobile - back button

I am developing the application using jQuery Mobile 4.1. In my app, I have two html pages like login.html and home.html. In the home.html have 3 pages. () like menupage, searchpage, resultpage. The..

How to select top 10 in Access query?

My Access database table has 2 columns: name and price. I want to do a query that select the top 10 highest prices. How to do this? Thanks...

jQuery UI " $("#datepicker").datepicker is not a function"

When i use DatePicker, jQuery's UI plugin, in an existing .aspx page I get errors that: $("#datepicker").datepicker is not a function However, when I copy and paste the same code that creates and u..

Check if an element's content is overflowing?

What's the easiest way to detect if an element has been overflowed? My use case is, I want to limit a certain content box to have a height of 300px. If the inner content is taller than that, I cut it..

Markdown to create pages and table of contents?

I started to use markdown to take notes. I use marked to view my markdown notes and its beautiful. But as my notes get longer I find it difficult to find what I want. I know markdown can create tab..

How to upload file using Selenium WebDriver in Java

Can anyone let me know how to upload a file using Selenium by Java code? When I click on button in the application it gets open in the new window what I can use to select upload file. The browse butt..

Reset Windows Activation/Remove license key

I'm having a hard time finding and answer to this. If I had to hypotheitcally remove the Windows license key from a VM that's been specifically setup for a partner, and it needs to be removed before t..

Adding a background image to a <div> element

Is it possible to make a <div> element contain a background image, and if so, how would I go about doing this?..

How to decrypt a password from SQL server?

I have this query in sql server 2000: select pwdencrypt('AAAA') which outputs an encrypted string of 'AAAA': 0x0100CF465B7B12625EF019E157120D58DD46569AC7BF4118455D12625EF019E157120D58DD46569AC7BF..

Why does using an Underscore character in a LIKE filter give me all the results?

I wrote the below SQL query with a LIKE condition: SELECT * FROM Manager WHERE managerid LIKE '_%' AND managername LIKE '%_%' In the LIKE I want to search for any underscores %_%, but I know that m..

Delete item from array and shrink array

How can I delete an item from an array, and then resize the array to the smaller size? Likewise, how can I increase the capacity if I need to add another item?..

Error message 'java.net.SocketException: socket failed: EACCES (Permission denied)'

I get the error message java.net.SocketException: socket failed: EACCES (Permission denied) when I try to apply the code below. This is the function I call and gives me this exception. public v..

How do I modify a MySQL column to allow NULL?

MySQL 5.0.45 What is the syntax to alter a table to allow a column to be null, alternately what's wrong with this: ALTER mytable MODIFY mycolumn varchar(255) null; I interpreted the manual as jus..

Maven project.build.directory

In Maven, what does the project.build.directory refer to? I am a bit confused, does it reference the source code directory or the target directory in the Maven project?..

How do I use 'git reset --hard HEAD' to revert to a previous commit?

I know that Git tracks changes I make to my application, and it holds on to them until I commit the changes, but here's where I'm hung up: When I want to revert to a previous commit I use: git rese..

Rails Root directory path?

How do I get my Rails app's root directory path?..

How to use timeit module

I understand the concept of what timeit does but I am not sure how to implement it in my code. How can I compare two functions, say insertion_sort and tim_sort, with timeit?..

Variable number of arguments in C++?

How can I write a function that accepts a variable number of arguments? Is this possible, how?..

What does <> mean?

I have seen this before in SQL and VB, I am now reverse engineering an Excel speadsheet and have come across the following formula: =IF(D23<>0,"Insufficent",0) I am converting it to ActionSc..

How to check a string for specific characters?

How can I check if a string has several specific characters in it using Python 2? For example, given the following string: The criminals stole $1,000,000 in jewels. How do I detect if it has do..

iOS: Modal ViewController with transparent background

I'm trying to present a view controller modally, with a transparent background. My goal is to let both the presenting and presented view controllers's view to be displayed at the same time. The proble..

How to get a list of column names

Is it possible to get a row with all column names of a table like this? |id|foo|bar|age|street|address| I don't like to use Pragma table_info(bla)...

.NET data structures: ArrayList, List, HashTable, Dictionary, SortedList, SortedDictionary -- Speed, memory, and when to use each?

.NET has a lot of complex data structures. Unfortunately, some of them are quite similar, and I'm not always sure when to use one and when to use another. Most of my C# and Visual Basic books talk abo..

Proper way to exit command line program?

I'm using mac/linux and I know that ctrl-z stops the currently running command in terminal, but I frequently see the process is still running when i check the system monitor. What is the right way to ..

Resync git repo with new .gitignore file

Is it possible to "refresh" a git repository after updating the gitignore file? I just added more ignorations(?) to my gitignore and would like to remove stuff already in the repo matching the new fi..

Testing if value is a function

I need to test whether the value of a form's onsubmit is a function. The format is typically onsubmit="return valid();". Is there a way to tell if this is a function, and if it's callable? Using ty..

Why does this SQL code give error 1066 (Not unique table/alias: 'user')?

This is my table structure: The error message is: #1066 - Not unique table/alias: 'user' The following is my code. SELECT article.* , section.title, category.title, user.name, user.name FR..

Graph implementation C++

I was wondering about a quick to write implementation of a graph in c++. I need the data structure to be easy to manipulate and use graph algorithms(such as BFS,DFS, Kruskal, Dijkstra...). I need this..

How to install JRE 1.7 on Mac OS X and use it with Eclipse?

I want to use the JRE 1.7 that I downloaded from Oracle website. So I correctly install the .pkg file, and when I try /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -versi..

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128)

I am parsing an xsl file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values are unicode. I can print m..

How to Exit a Method without Exiting the Program?

I am still pretty new to C# and am having a difficult time getting used to it compared to C/CPP. How do you exit a function on C# without exiting the program like this function would? if (textBox1...

How do I compile with -Xlint:unchecked?

I'm getting a message when I compile my code: Note: H:\Project2\MyGui2.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. How do I recompile with -Xlint:un..

How to name an object within a PowerPoint slide?

So I know how to name a textbox, or a like object in PowerPoint with VB, but I was wondering if there was a way to name objects through the Ribbon (PowerPoint 2007). For instance, if I add a text box ..

filtering a list using LINQ

i have a list of project objects: IEnumerable<Project> projects a Project class as a property called Tags. this is a int[] i have a variable called filteredTags which is also a int[]. So..

Java synchronized method lock on object, or method?

If I have 2 synchronized methods in the same class, but each accessing different variables, can 2 threads access those 2 methods at the same time? Does the lock occur on the object, or does it get as ..

Why doesn't C++ have a garbage collector?

I'm not asking this question because of the merits of garbage collection first of all. My main reason for asking this is that I do know that Bjarne Stroustrup has said that C++ will have a garbage co..

How to remove rows with any zero value

I have a problem to solve how to remove rows with a Zero value in R. In others hand, I can use na.omit() to delete all the NA values or use complete.cases() to delete rows that contains NA values. Is..

How do I find the MySQL my.cnf location

Is there a MySQL command to locate the my.cnf configuration file, similar to how PHP's phpinfo() locates its php.ini?..

BULK INSERT with identity (auto-increment) column

I am trying to add bulk data in database from CSV file. Employee table has a column ID (PK) auto-incremented. CREATE TABLE [dbo].[Employee]( [id] [int] IDENTITY(1,1) NOT NULL, [Name] [varchar](50)..

UnicodeDecodeError, invalid continuation byte

Why is the below item failing? Why does it succeed with "latin-1" codec? o = "a test of \xe9 char" #I want this to remain a string as this is what I am receiving v = o.decode("..

How to unzip files programmatically in Android?

I need a small code snippet which unzips a few files from a given .zip file and gives the separate files according to the format they were in the zipped file. Please post your knowledge and help me ou..

Get img thumbnails from Vimeo?

I want to get a thumbnail image for videos from Vimeo. When getting images from Youtube I just do like this: http://img.youtube.com/vi/HwP5NG-3e8I/2.jpg Any idea how to do for Vimeo? Here is same..

Clear the cache in JavaScript

How do I clear a browsers cache with JavaScript? We deployed the latest JavaScript code but we are unable to get the latest JavaScript code. Editorial Note: This question is semi-duplicated in the f..

Keyboard shortcut to comment lines in Sublime Text 2

In Sublime Text 2, how do I enclose a selection in a comment? Is there a keyboard shortcut for this action?..

getElementById returns null?

document.getElementById('id of div that definately exists') returns null. I originally loaded the javascript last in order to make sure I wouldn't need to worry about the onload event. I also tried u..

Error: Cannot access file bin/Debug/... because it is being used by another process

When I debug my project, I get following error: "Unable to copy file "obj\Debug\My Dream.exe" to "bin\Debug\My Dream.exe". The process cannot access the file 'bin\Debug\My Dream.exe' because it is..

How to force an entire layout View refresh?

I want to force the main layout resource view to redraw / refresh, in say the Activity.onResume() method. How can I do this ? By main layout view, I mean the one ('R.layout.mainscreen' below) that i..

PHP script to loop through all of the files in a directory?

I'm looking for a PHP script that loops through all of the files in a directory so I can do things with the filename, such as format, print or add it to a link. I'd like to be able to sort the files b..

Output first 100 characters in a string

Can seem to find a substring function in python. Say I want to output the first 100 characters in a string, how can I do this? I want to do it safely also, meaing if the string is 50 characters it ..

jQuery $.cookie is not a function

I am trying to set a cookie using jQuery: $.cookie("testCookie", "hello"); alert($.cookie("testCookie")); But when I load my page, I receive the error "$.cookie is not a function". Here is what I k..

what's data-reactid attribute in html?

While I was going through the HTML of some pages, I noticed that some of them use this attribute "data-reactid" like : <a data-reactid="......" ></a> What is that attribute and what i..

Use Awk to extract substring

Given a hostname in format of aaa0.bbb.ccc, I want to extract the first substring before ., that is, aaa0 in this case. I use following awk script to do so, echo aaa0.bbb.ccc | awk '{if (match($0, /\..

How to find the process id of a running Java process on Windows? And how to kill the process alone?

I want to kill the particular Java process in Windows, like in Linux (ps -aux to get processid and then kill processid to kill the process)...

How to change the URL from "localhost" to something else, on a local system using wampserver?

On a Windows machine, there's a system running on the local wampserver, but while the application is running on localhost, the URL says otherwise. While I would expect the URL to be like this based o..

How to use PowerShell select-string to find more than one pattern in a file?

I would like to search for more than one string in the files in a directory, however using "select-string -pattern" didn't help. Could anyone show me how to do it? Example: Search all files in C:\Log..

Alternating Row Colors in Bootstrap 3 - No Table

I am looking for a way to do alternating row colors in a responsive layout in Bootstrap 3. I cannot figure out how to do it without a LOT of extensive, confusing CSS and was hoping that someone had a ..

How do I get the Session Object in Spring?

I am relatively new to Spring and Spring security. I was attempting to write a program where I needed to authenticate a user at the server end using Spring security, I came up with the following: p..

How can I get the class name from a C++ object?

Is it possible to get the object name too? #include<cstdio> class one { public: int no_of_students; one() { no_of_students = 0; } void new_admission() { no_of_students++; } }; int..

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

How to determine if a number is positive or negative?

I was asked in an interview, how to determine whether a number is positive or negative. The rules are that we should not use relational operators such as <, and >, built in java functions (like ..

R - do I need to add explicit new line character with print()?

How do I use the new line character in R? myStringVariable <- "Very Nice ! I like"; myStringVariabel <- paste(myStringVariable, "\n", sep=""); The above code DOESN'T work P.S There's signi..

Parsing XML with namespace in Python via 'ElementTree'

I have the following XML which I want to parse using Python's ElementTree: <rdf:RDF xml:base="http://dbpedia.org/ontology/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ow..

Android Crop Center of Bitmap

I have bitmaps which are squares or rectangles. I take the shortest side and do something like this: int value = 0; if (bitmap.getHeight() <= bitmap.getWidth()) { value = bitmap.getHeight(); }..

Reversing an Array in Java

If I have an array like this: 1 4 9 16 9 7 4 9 11 What is the best way to reverse the array so that it looks like this: 11 9 4 7 9 16 9 4 1 I have the code below, but I feel it is a little ted..

ExecutorService, how to wait for all tasks to finish

What is the simplest way to to wait for all tasks of ExecutorService to finish? My task is primarily computational, so I just want to run a large number of jobs - one on each core. Right now my setup..

Java JRE 64-bit download for Windows?

I'm working on a web site project with a Java component and am currently testing for cross-browser compatibility. Most is fine but the Java part won't load on 64-bit browsers. Looks like I need a 64-b..

How to specify jdk path in eclipse.ini on windows 8 when path contains space

This doesn't work -vm %JAVA_HOME%/bin/javaw.exe How can I replace %JAVA_HOME% with full path on Windows 8 when path contains space ("Program Files" directory)..

How can I order a List<string>?

I have this List<string>: IList<string> ListaServizi = new List<string>(); How can I order it alphabetically and ascending?..

How to handle onchange event on input type=file in jQuery?

The code is: <input ID="fileUpload1" runat="server" type="file" The following works fine: <input onchange="javascript:alert('hola');" ID="fileUpload1" runat="server" type="file" I'd like ..

How to get the row number from a datatable?

I am looping through every row in a datatable: foreach (DataRow row in dt.Rows) {} I would like to get the index of the current row within the dt datatable. for example: int index = dt.Rows[curren..

Bootstrap row class contains margin-left and margin-right which creates problems

I am using Bootstrap 'row' class to align divs one on top of another, which works fine but .row { margin-left: -15px; margin-right: -15px; } What I noticed is that it specifies margin-left ..

PL/SQL print out ref cursor returned by a stored procedure

How can I fetch from a ref cursor that is returned from a stored procedure (OUT variable) and print the resulting rows to STDOUT in SQL*PLUS? ORACLE stored procedure: PROCEDURE GetGrantListByPI(p_fi..

PHP If Statement with Multiple Conditions

I have a variable$var. I want echo "true" if $var is equal to any of the following values abc, def, hij, klm, or nop. Is there a way to do this with a single statement like &&??..

Build Step Progress Bar (css and jquery)

You've seen iterations of this type of progress bar on sites like paypal. How does one go about setting this up using CSS and jquery? I have 4 pages and each page is a step... so 4 steps...

Docker error cannot delete docker container, conflict: unable to remove repository reference

I want to remove the container at Docker, but an error occurs when you want to delete My next step before removing the container, see the list of existing container sts@Yudi:~/docker$ sudo docker ps..

How do I activate a Spring Boot profile when running from IntelliJ?

I have 5 environments: - local (my development machine) - dev - qc - uat - live - staging I want different application properties to be used for each environment, so I have the following prop..

Disable mouse scroll wheel zoom on embedded Google Maps

I am working on a WordPress site where the authors usually embed Google Maps using iFrames in most posts. Is there a way to disable the zoom via mouse scroll wheel on all of them using Javascript?..

What is a NullPointerException, and how do I fix it?

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program t..

Convert the first element of an array to a string in PHP

I have a PHP array and want to convert it to a string. I know I can use join or implode, but in my case array has only one item. Why do I have to use combine values in an array with only one item? ..

How to add a button programmatically in VBA next to some sheet cell data?

I have a function that generates data for say 100 rows (and 2 columns). For each row (in the 3rd column) I need to add a button which, when clicked, brings up a custom modal dialog box giving the user..

ToggleButton in C# WinForms

Is it possible to create a toggle button in C# WinForms? I know that you can use a CheckBox control and set it's Appearance property to "Button", but it doesn't look right. I want it to appear sunken,..

Content Security Policy "data" not working for base64 Images in Chrome 28

In this simple example, I'm trying to set a CSP header with the meta http-equiv header. I included a base64 image and I'm trying to make Chrome load the image. I thought the data keyword should do th..

How to get a random number between a float range?

randrange(start, stop) only takes integer arguments. So how would I get a random number between two float values?..

VS2010 command prompt gives error: Cannot determine the location of the VS Common Tools folder

I have installed VS2010. The installation creates the shortcut for VS2010 command prompt but when I open up the command prompt I get the error: Cannot determine the location of the VS Common Tools..

javascript code to check special characters

I have JavaScript code to check if special characters are in a string. The code works fine in Firefox, but not in Chrome. In Chrome, even if the string does not contain special characters, it says it ..

Getting list of files in documents folder

What is wrong with my code for getting the filenames in the document folder? func listFilesFromDocumentsFolder() -> [NSString]?{ var theError = NSErrorPointer() let dirs = NSSearchPathForD..

Parsing JSON in Excel VBA

I have the same issue as in Excel VBA: Parsed JSON Object Loop but cannot find any solution. My JSON has nested objects so suggested solution like VBJSON and vba-json do not work for me. I also fixed ..

Get properties of a class

Is there a way to get properties names of class in TypeScript? In the example, I would like to 'describe' the class A or any class and get an array of its properties (maybe only public ones?), is it ..

Pandas sort by group aggregate and column

Given the following dataframe In [31]: rand = np.random.RandomState(1) df = pd.DataFrame({'A': ['foo', 'bar', 'baz'] * 2, 'B': rand.randn(6), ..

How to clear a textbox once a button is clicked in WPF?

How can I clear a textbox once a button is clicked in the WPF application, I know I have to do it in click method of the button but what code should I use for the mentioned purpose?..

Express-js wildcard routing to cover everything under and including a path

I'm trying to have one route cover everything under /foo including /foo itself. I've tried using /foo* which work for everything except it doesn't match /foo. Observe: var express = require("express"..

In SQL how to compare date values?

Using MySQL syntax and having a table with a row like: mydate DATETIME NULL, Is there a way to do something like: ... WHERE mydate<='2008-11-25'; I'm trying but not really getting it to work...

static const vs #define

Is it better to use static const vars than #define preprocessor? Or maybe it depends on the context? What are advantages/disadvantages for each method?..

Convert string[] to int[] in one line of code using LINQ

I have an array of integers in string form: var arr = new string[] { "1", "2", "3", "4" }; I need to an array of 'real' integers to push it further: void Foo(int[] arr) { .. } I tried to cast in..

drop down list value in asp.net

I want to add a value to the drop down list that cannot be selected, like a title. Ex: I have a month drop down list. The very first item should be "select month" this should not be selected. And next..

Run Python script at startup in Ubuntu

I have a short Python script that needs to run at startup - Ubuntu 13.10. I have tried everything I can think of but can't get it to run. The script: #!/usr/bin/python import time with open("/home/us..

SVG Positioning

I'm having a play with SVG and am having a few problems with positioning. I have a series of shapes which are contained in the g group tag. I was hoping to use it like a container, so I could set its ..

Password encryption at client side

Possible Duplicate: About password hashing system on client side I have to secure the passwords of my web site users. What I did was use MD5 encryption hashing in server side. But the prob..

Open Google Chrome from VBA/Excel

I'm trying to open a Chrome browser from VBA. I understand Chrome does not support ActiveX settings so I'm curious if theres any work-arounds? Dim ie As Object Set ie = CreateObject("ChromeTab.Chrom..

How to get an HTML element's style values in javascript?

I am looking for a way to retrieve the style from an element that has a style set upon it by the style tag. <style> #box {width: 100px;} </style> In the body <div id="box"><..

symfony2 : failed to write cache directory

I have had to use the app/console cache:clear command to solve a problem when generating an entity. I am now unable to load my homepage on : http://localhost/projet_etienne/web/app_dev.php ..

How to fix System.NullReferenceException: Object reference not set to an instance of an object

EDIT: This issue is resolved, good thanks to Reniuz for his 5 hours of work and research of this issue, thank's everyone. NullReferenceException: Object reference not set to an instance of an object...

Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.`

EDIT: After I modified the web.config and I don't get error that's good.... then I add a new page (html) and write this small code to consume the service like this: $("#btn12").click(function (even..

Git: How to squash all commits on branch

I make new branch from master with: git checkout -b testbranch I make 20 commits into it. Now I want to squash those 20 commits. I do that with: git rebase -i HEAD~20 What about if I don't kno..

How to import Swagger APIs into Postman?

Recently I wrote restful APIs with SpringMvc and swagger-ui(v2). I noticed the Import function in Postman: So my question is how to create the file which Postman needed? I am not familiar with Swa..

Handling null values in Freemarker

How to handle null values in Freemarker? I get some exceptions in the template when null values are present in data...

How to decompile a whole Jar file?

Does anyone know of a free decompiler that can decompile an entire Jar file instead of a single class? I have a problem with sub classes like name$1.class name$2.class name.class..

Use multiple @font-face rules in CSS

How can I use more than @font-face rule in my CSS? I've inserted this into my stylesheet: body { background: #fff url(../images/body-bg-corporate.gif) repeat-x; padding-bottom: 10px; fon..

Error while sending QUERY packet

i was trying to insert some data into the database but i got this error "Error while sending QUERY packet" $insertDeta = $conPat->prepare("insert into table1(data) VALUES(:data)"); $insertDeta-&..

How to update a claim in ASP.NET Identity?

I'm using OWIN authentication for my MVC5 project. This is my SignInAsync private async Task SignInAsync(ApplicationUser user, bool isPersistent) { var AccountNo = "101"; ..

MVC4 StyleBundle not resolving images

My question is similar to this: ASP.NET MVC 4 Minification & Background Images Except that I want to stick with MVC's own bundling if I can. I'm having a brain crash trying to figure out wha..

No input file specified

I'm running Anchor CMS and I just upgraded to version 0.8. When I try and run the installer I get a 'No input file specified' error. I believe it's more than likely a .htaccess problem but I'm not sur..

What are the differences between json and simplejson Python modules?

I have seen many projects using simplejson module instead of json module from the Standard Library. Also, there are many different simplejson modules. Why would use these alternatives, instead of the ..

DirectorySearcher Filter

When I run this query // Next row is used to login to AD DirectoryEntry entry = GetEntry(domain, adminUser, adminPassword); // Here starts the query DirectorySearcher search = new DirectorySearcher(e..

add new element in laravel collection object

I want to add new element in $items array, I don't want to use joins for certain reasons. $items = DB::select(DB::raw('SELECT * FROM items WHERE items.id = '.$id.' ;')); foreach($items as $i..

Auto-scaling input[type=text] to width of value?

Is there a way to scale the width of an <input type="text"> to the width of the actual value? _x000D_ _x000D_ input {_x000D_ display: block;_x000D_ margin: 20px;_x000D_ width: auto;_x000D..

gpg decryption fails with no secret key error

I have a gpg .key file that is used as passphrase for decrypting a .dat.pgp file. The encrypted .data.pgp file gets successfully decrypted on one server with same .key file using following command ca..

Stop Visual Studio from mixing line endings in files

When opening a text based file in Visual Studio 2010 it will then write my edits with CRLF instead of the line ending format of the original file. How can I stop VS from doing this? Any half decent ed..

jQuery UI accordion that keeps multiple sections open?

I may be an idiot, but how do you keep multiple sections in jQuery UI's accordion open? The demos all have only one open at a time... I'm looking for a collapseable menu type system...

AngularJS custom filter function

Inside my controller, I would like to filter an array of objects. Each of these objects is a map which can contain strings as well as lists I tried using $filter('filter')(array, function) format but..

notifyDataSetChanged example

I'm trying to use in my Android Application the notifyDataSetChanged() method for an ArrayAdapter but it doesn't work for me. I found as answer here, that notifyDataSetChanged() should run in the ma..

How to enable mod_rewrite for Apache 2.2

I've got fresh install of Apache 2.2 on my Vista machine, everything works fine, except mod rewrite. I've uncommented LoadModule rewrite_module modules/mod_rewrite.s but none of my rewrite rules ..

How to get a MemoryStream from a Stream in .NET?

I have the following constructor method which opens a MemoryStream from a file path: MemoryStream _ms; public MyClass(string filePath) { byte[] docBytes = File.ReadAllBytes(filePath); _ms = ..

Displaying Total in Footer of GridView and also Add Sum of columns(row vise) in last Column

In my Asp.net App, i have a GridView and i generate the data of column[6] by myself using code behind. by looking at the code below, i have a footer for my gridview. and the problem is my text for co..

Install Chrome extension form outside the Chrome Web Store

I have developed a Chrome extension and I have packed it. I sent my extension to some people to try it, but Chrome started to block extensions that it does not find in the store. Is there any way to ..

anaconda - path environment variable in windows

I am trying to run python from the windows command prompt (windows 10). So the result is the typical one when the path environment variable is not configured c:\windows\system32>python 'python' i..

How to create a shared library with cmake?

I have written a library that I used to compile using a self-written Makefile, but now I want to switch to cmake. The tree looks like this (I removed all the irrelevant files): . +-- include ¦   +..

Get folder name of the file in Python

In Python what command should I use to get the name of the folder which contains the file I'm working with? "C:\folder1\folder2\filename.xml" Here "folder2" is what I want to get. ..

Preloading CSS Images

I have a hidden contact form which is deployed clicking on a button. Its fields are set as CSS background images, and they always appears a bit later than the div that have been toggled. I was using ..

How can I exclude $(this) from a jQuery selector?

I have something like this: <div class="content"> <a href="#">A</a> </div> <div class="content"> <a href="#">B</a> </div> <div class="conten..

Linker error: "linker input file unused because linking not done", undefined reference to a function in that file

I'm having trouble with the linking of my files. Basically, my program consists of: The main program, gen1. gen1 - receives input sends to str2value for processing, outputs results str2value, break..

Is there an equivalent of 'which' on the Windows command line?

As I sometimes have path problems, where one of my own cmd scripts is hidden (shadowed) by another program (earlier on the path), I would like to be able to find the full path to a program on the Wind..

What does \d+ mean in regular expression terms?

I'm new to regular expressions and came accros the following \d+ . I do not exactly know what this means, please point me in the right direction...

Query to search all packages for table and/or column

Is there a query I can run to search all packages to see if a particular table and/or column is used in the package? There are too many packages to open each one and do a find on the value(s) I'm look..

How do I restore a dump file from mysqldump?

I was given a MySQL database file that I need to restore as a database on my Windows Server 2008 machine. I tried using MySQL Administrator, but I got the following error: The selected file was g..

Is there a better way to iterate over two lists, getting one element from each list for each iteration?

I have a list of Latitudes and one of Longitudes and need to iterate over the latitude and longitude pairs. Is it better to: A. Assume that the lists are of equal lengths: for i in range(len(Latit..

Try reinstalling `node-sass` on node 0.12?

I would like to use google web starter kit. I installed node.js v0.12.0, node-sass & gulp. And then ran: $ sudo npm install When I typed gulp serve then got this error: Using gulpfile ~/web-s..

Can I save input from form to .txt in HTML, using JAVASCRIPT/jQuery, and then use it?

Is it possible to save textinput (locally) from a form to a textfile, and then open that document to use it later on? Just using HTML, javascript and jQuery. No databases or php. /W..

Correct way to select from two tables in SQL Server with no common field to join on

Back in the old days, I used to write select statements like this: SELECT table1.columnA, table2.columnA FROM table1, table2 WHERE table1.columnA = 'Some value' However I was told that having co..

How to find the length of an array in shell?

How do I find the length of an array in shell? For example: arr=(1 2 3 4 5) And I want to get its length, which is 5 in this case...

Removing character in list of strings

If I have a list of strings such as: [("aaaa8"),("bb8"),("ccc8"),("dddddd8")...] What should I do in order to get rid of all the 8s in each string? I tried using strip or replace in a for loop but ..

Is there a way to link someone to a YouTube Video in HD 1080p quality?

Is there a way to link someone to a YouTube Video in HD 1080p quality? As of right now, when linking someone to a youtube URL, the video defaults to 360p...

Convert time in HH:MM:SS format to seconds only?

How to turn time in format HH:MM:SS into a flat seconds number? P.S. Time could be sometimes in format MM:SS only...

What is the best way to use a HashMap in C++?

I know that STL has a HashMap API, but I cannot find any good and thorough documentation with good examples regarding this. Any good examples will be appreciated...

MySQL - How to parse a string value to DATETIME format inside an INSERT statement?

I have a MySQL database, with a column that is date type DATETIME. I am getting a string value for a date / time from an external application. That string value looks like this: '5/15/2012 8:06:26..

Laravel 5 Class 'form' not found

I have added "illuminate/html": "5.*" to composer.json and ran "composer update". - Installing illuminate/html (v5.0.0) Loading from cache I ran this command in the root of the website. I mod..

Getting activity from context in android

This one has me stumped. I need to call an activity method from within a custom layout class. The problem with this is that I don't know how to access the activity from within the layout. ProfileVie..

How to color the Git console?

I recently saw that the git console in Windows is colored, e.g. Green for additions, red for deletions, etc. How do I color my git console like that? To install it, I used the command: $ sudo apt-get..

Using Math.round to round to one decimal place?

I have these two variables double num = 540.512 double sum = 1978.8 Then I did this expression double total = Math.round((num/ sum * 100) * 10) / 10; but I end up with 27.0. In fact I have man..

How to make a vertical line in HTML

How do you make a vertical line using HTML?..

Twitter bootstrap 3 two columns full height

I'm trying to make two-column full-height layout with twitter bootstrap 3. It seems that twitter bootstrap 3 does not support full height layouts. What I want to do: +------------------------------..

Select multiple rows with the same value(s)

I have a table, sort of like this: ID | Chromosome | Locus | Symbol | Dominance | =============================================== 1 | 10 | 2 | A | Full | 2 | 10 ..

Image overlay on responsive sized images bootstrap

I am trying to create a responsive grid of images (with descriptions) that when moused over will have a color overlay (just the image and not the text). Because of the responsive heights of the images..

Free FTP Library

Can you recommend a free FTP library(class) for C#. The class has to be well written, and have good performance...

Unsupported Media Type in postman

I am implementing spring security with oauth2 and jwt. the below is my login function function doLogin(loginData) { $.ajax({ url : back+"/auth/secret", type : "POST", da..

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

RestTemplate: How to send URL and query parameters together

I am trying to pass path param and query params in a URL but I am getting a weird error. below is the code String url = "http://test.com/Services/rest/{id}/Identifier" Map<String, String&g..

selenium get current url after loading a page

I'm using Selenium Webdriver in Java. I want to get the current url after clicking the "next" button to move from page 1 to page 2. Here's the code I have: WebDriver driver = new FirefoxDriver();..

Code signing is required for product type 'Application' in SDK 'iOS 10.0' - StickerPackExtension requires a development team error

I am facing the below issue and am unable to build the application. XXX has conflicting provisioning settings. XXX is automatically provisioned, but provisioning profile WildCard has been manual..

Attach a body onload event with JS

How do I attach a body onload event with JS in a cross browser way? As simple as this? document.body.onload = function(){ alert("LOADED!"); } ..

C++ calling base class constructors

#include <iostream> #include <stdio.h> using namespace std; // Base class class Shape { public: void setWidth(int w) { width = w; } void setHeight(in..

Solving sslv3 alert handshake failure when trying to use a client certificate

I'm trying to connect to a service that requires a certificate for authorization. The process is that I send the service a CSR file. The service signs the CSR and sends me a certificate that I use for..

How to force Hibernate to return dates as java.util.Date instead of Timestamp?

Situation: I have a persistable class with variable of java.util.Date type: import java.util.Date; @Entity @Table(name = "prd_period") @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) ..

Word wrapping in phpstorm

How can I enable Word wraping in phpstorm? I need to enable it only for some of my files (with extension .txt). Is is possible?..

regex error - nothing to repeat

I get an error message when I use this expression: re.sub(r"([^\s\w])(\s*\1)+","\\1","...") I checked the regex at RegExr and it returns . as expected. But when I try it in Python I get this error..

Strict Standards: Only variables should be assigned by reference PHP 5.4

I upgraded my PHP version to 5.4 (XAMPP 1.7.3 to 1.8.0). Now I see Strict Standards error, for myDBconnection: Strict Standards: Only variables should be assigned by reference in C:\xampp\htdocs\alou..

How to import a csv file into MySQL workbench?

I have a CSV file. It contain 1.4 million rows of data, so I am not able to open that csv file in Excel because its limit is about 1 million rows. Therefore, I want to import this file in MySQL work..

What does MissingManifestResourceException mean and how to fix it?

The situation: I have a class library, called RT.Servers, containing a few resources (of type byte[], but I don't think that's important) The same class library contains a method which returns one o..

Removing input background colour for Chrome autocomplete?

On a form I'm working on, Chrome is auto-filling the email and password fields. This is fine, however, Chrome changes the background colour to a pale yellow colour. The design I'm working on is using..

the best way to make codeigniter website multi-language. calling from lang arrays depends on lang session?

I'm researching hours and hours, but I could not find any clear, efficient way to make it :/ I have a codeigniter base website in English and I have to add a Polish language now. What is the best way..

C++ convert from 1 char to string?

I need to cast only 1 char to string. The opposite way is pretty simple like str[0]. The following did not work for me: char c = 34; string(1,c); //this doesn't work, the string is always empty. st..

How to set caret(cursor) position in contenteditable element (div)?

I have this simple HTML as an example: <div id="editable" contenteditable="true"> text text text<br> text text text<br> text text text<br> </div> <button id="bu..

Upgrade to python 3.8 using conda

Python 3.8.0 is out, but I haven't been able to find any post on how to update to python 3.8 using conda - maybe they will wait for the official release? Any suggestions?..

How do I increase the contrast of an image in Python OpenCV

I am new to Python OpenCV. I have read some documents and answers here but I am unable to figure out what the following code means: if (self.array_alpha is None): self.array_alpha = np.array([1.2..

Python: most idiomatic way to convert None to empty string?

What is the most idiomatic way to do the following? def xstr(s): if s is None: return '' else: return s s = xstr(a) + xstr(b) update: I'm incorporating Tryptich's suggestio..

How to remove a variable from a PHP session array

I have PHP code that is used to add variables to a session: <?php session_start(); if(isset($_GET['name'])) { $name = isset($_SESSION['name']) ? $_SESSION['name'] : array(); ..

How to resolve cURL Error (7): couldn't connect to host?

I send an item code to a web service in xml format using cUrl(php). I get the correct response in localhost, but when do it server it shows cURL Error (7): couldn't connect to host And here's m..

How do I convert an array object to a string in PowerShell?

How can I convert an array object to string? I tried: $a = "This", "Is", "a", "cat" [system.String]::Join(" ", $a) with no luck. What are different possibilities in PowerShell?..

How do I get java logging output to appear on a single line?

At the moment a default entry looks something like this: Oct 12, 2008 9:45:18 AM myClassInfoHere INFO: MyLogMessageHere How do I get it to do this? Oct 12, 2008 9:45:18 AM myClassInfoHere - INFO: ..