Questions Tagged with #Function exit

Configuration with name 'default' not found. Android Studio

I have an Android Studio app. It has a library dependency (Android-Bootstrap), when I try to sync gradle, it gives me an error: Configuration with name 'default' not found. My structure is: -FT..

Create GUI using Eclipse (Java)

Possible Duplicate: Best GUI designer for eclipse? Is there any Eclipse Plugin tool(s) who can help to create Graphical User Interface for (swing, awt or swt), because I'm tired of writing ..

Error 500: Premature end of script headers

I get a "Premature end of script headers: contactform.cgi" error message when running the below script. What frustrates me is that I ran this as a .php on another server and it worked. However, I ha..

Understanding SQL Server LOCKS on SELECT queries

I'm wondering what is the benefit to use SELECT WITH (NOLOCK) on a table if the only other queries affecting that table are SELECT queries. How is that handled by SQL Server? Would a SELECT query blo..

How do you display code snippets in MS Word preserving format and syntax highlighting?

Does anyone know a way to display code in Microsoft Word documents that preserves coloring and formatting? Preferably, the method would also be unobtrusive and easy to update. I have tried to include..

Get file from project folder java

I want to get File from project folder by using "File class" , How I can Do that ? File file=new File("x1.txt"); ..

Disable webkit's spin buttons on input type="number"?

I have a site which is primarily for mobile users but desktop too. On Mobile Safari, using <input type="number"> works great because it brings up the numerical keyboard on input fields which sh..

Matplotlib make tick labels font size smaller

In a matplotlib figure, how can I make the font size for the tick labels using ax1.set_xticklabels() smaller? Further, how can one rotate it from horizontal to vertical?..

cc1plus: error: unrecognized command line option "-std=c++11" with g++

I'm trying to compile using g++ and either the -std=c++11 or c++0x flags. However, I get this error cc1plus: error: unrecognized command line option "-std=c++11" g++ --version g++ (GCC) 4.1.2 20..

Passing parameters from jsp to Spring Controller method

I am working in a Spring MVC application which uses Hibernate. In the JSP page I have a function which lists the values stored in the database(currently all the value). I have written a method, wh..

Best way to find os name and version in Unix/Linux platform

I need to find the OS name and version on Unix/Linux platform. For this I tried following: lsb_release utility /etc/redhat-release or specific file But it does not seem to be best solution as LSB_..

Asynchronously wait for Task<T> to complete with timeout

I want to wait for a Task<T> to complete with some special rules: If it hasn't completed after X milliseconds, I want to display a message to the user. And if it hasn't completed after..

Gradle: Could not determine java version from '11.0.2'

I ran the following comment: ./gradlew app:installDebug only to be met with the log: FAILURE: Build failed with an exception. * What went wrong: Could not determine java version from '11.0.2'. ..

What are the safe characters for making URLs?

I am making a website with articles, and I need the articles to have "friendly" URLs, based on the title. For example, if the title of my article is "Article Test", I would like th..

In Ruby on Rails, what's the difference between DateTime, Timestamp, Time and Date?

In my experience, getting dates/times right when programming is always fraught with danger and difficulity. Ruby and Rails have always eluded me on this one, if only due to the overwhelming number o..

Good way of getting the user's location in Android

The problem: Getting the user's current location within a threshold ASAP and at the same time conserve battery. Why the problem is a problem: First off, android has two providers; network and GPS. ..

Difference between \n and \r?

What’s the difference between \n (newline) and \r (carriage return)? In particular, are there any practical differences between \n and \r? Are there places where one should be used instead of the o..

jQuery Force set src attribute for iframe

I have a main page (actually a JSP) with an iframe inside it as; <iframe name="abc_frame" id="abc_frame" src="about:blank" frameborder="0" scrolling="no"></iframe> Now there are multipl..

SQL Error with Order By in Subquery

I'm working with SQL Server 2005. My query is: SELECT ( SELECT COUNT(1) FROM Seanslar WHERE MONTH(tarihi) = 4 GROUP BY refKlinik_id ORDER BY refKlinik_id ) as dorduncuay And the error: ..

Convert XmlDocument to String

Here is how I'm currently converting XMLDocument to String StringWriter stringWriter = new StringWriter(); XmlTextWriter xmlTextWriter = new XmlTextWriter(stringWriter); xmlDoc.WriteTo(xmlTextWriter..

How do you get total amount of RAM the computer has?

Using C#, I want to get the total amount of RAM that my computer has. With the PerformanceCounter I can get the amount of Available ram, by setting: counter.CategoryName = "Memory"; counter.Counterna..

Can I remove the URL from my print css, so the web address doesn't print?

I have written some stylesheets - including a print.css - and it's working fine. I'd like to remove the URL from printing out on each of the pages. I am beginning to wonder if it is impossible. Is t..

How do I create a URL shortener?

I want to create a URL shortener service where you can write a long URL into an input field and the service shortens the URL to "". Instead of "abcdef" there can be any o..

mysql said: Cannot connect: invalid settings. xampp

I changed the root password to test and now I cannot login in phpMyAdmin page in XAMPP. I looked for help here and here which basically says changed file in XAMPP\PHPMYADMIN folder. /*..

What is the default Jenkins password?

I'm using a EC2 server instance. Used the following to install Jenkins: wget -q -O - | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins-c..

Iterating through struct fieldnames in MATLAB

My question is easily summarized as: "Why does the following not work?" teststruct = struct('a',3,'b',5,'c',9) fields = fieldnames(teststruct) for i=1:numel(fields) fields(i) teststruct.(fields..

Good tool for testing socket connections?

I'm writing a tcp/ip client and I would need a "test server" to be able to test easily. It should listen on a configurable port, show me when a client connects and what the client sent, allow me to ma..

How to get everything after a certain character?

I've got a string and I'd like to get everything after a certain value. The string always starts off with a set of numbers and then an underscore. I'd like to get the rest of the string after the unde..

How to get the caret column (not pixels) position in a textarea, in characters, from the start?

How do you get the caret position in a <textarea> using JavaScript? For example: This is| a text This should return 7. How would you get it to return the strings surrounding the cursor / sele..

Unable to negotiate with XX.XXX.XX.XX: no matching host key type found. Their offer: ssh-dss

I am trying to create a git repository on my web host and clone it on my computer. Here's what I did: I created a repository on the remote server. I generated a key pair: ssh-keygen -t dsa. I added ..

How do I hide the status bar in a Swift iOS app?

I'd like to remove the status bar at the top of the screen. This does not work: func application (application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {..

Oracle - How to generate script from sql developer

How to take script for schema of the tables, stored procedures of Oracle through SQL Developer tool (SQLPLUS command line interface)?..

Bundler: Command not found

I am hosting on a vps, ubuntu 10.04, rails 3, ruby and mysql installed correctly by following some tutorials. If I run bundle check or bundle install I get the error '-bash: bundle: command not found'..

SQL Query Where Field DOES NOT Contain $x

I want to find an SQL query to find rows where field1 does not contain $x. How can I do this?..

Update rows in one table with data from another table based on one column in each being equal

Update many rows into one table from another table based on one column in each being equal (user_id). both tables have a user_id column. Need to insert data from t2 into t1 when the user_id column a..

Issue with parsing the content from json file with Jackson & message- JsonMappingException -Cannot deserialize as out of START_ARRAY token

Given the following .json file: [ { "name" : "New York", "number" : "732921", "center" : [ "latitude" : 38.895111, "longitude" : -77.03666..

Background position, margin-top?

I currently have my background set to top right as: #thedivstatus { background-image: url("imagestatus.gif"); background-position: right top; background-repeat: no-repeat; } BUT! I need..

How can I replace text with CSS?

How can I replace text with CSS using a method like this: .pvw-title img[src*="IKON.img"] { visibility:hidden; } Instead of ( img[src*="IKON.img"] ), I need to use something that can replace tex..

C++ Fatal Error LNK1120: 1 unresolved externals

What is causing this error? I google'd it and first few solutions I found were that something was wrong with the library and the main function but both seem to be fine in my problem, I even retyped bo..

HTTP error 403 in Python 3 Web Scraping

I was trying to scrap a website for practice, but I kept on getting the HTTP Error 403 (does it think I'm a bot)? Here is my code: #import requests import urllib.request from bs4 import BeautifulSou..

Read CSV file column by column

I want to read specific columns from a multi column csv file and print those columns in other csv file using Java. Any help please? Following is my code to print each token line by line..But I am look..

Getting datarow values into a string?

I have a dataset called "results" with several rows of data. I'd like to get this data into a string, but I can't quite figure out how to do it. I'm using the below code: string output = ""; foreac..

How to get a complete list of object's methods and attributes?

dir(re.compile(pattern)) does not return pattern as one of the lists's elements. Namely it returns: ['__copy__', '__deepcopy__', 'findall', 'finditer', 'match', 'scanner', 'search', 'split', 'sub'..

Print an ArrayList with a for-each loop

Given the following exists in a class, how do I write a for-each that prints each item in the list? private ArrayList<String> list; list = new ArrayList<String>(); I have: for (String ..

How to auto-format code in Eclipse?

How do you auto-format code in Eclipse?..

Numpy - Replace a number with NaN

I am looking to replace a number with NaN in numpy and am looking for a function like numpy.nan_to_num, except in reverse. The number is likely to change as different arrays are processed because eac..

How to get host name with port from a http or https request

I have two applications deployed in jboss container(same unix box). If i get a request from app1, i need to frame a corresponding request for app2. eg: if app1 request is:

How to get access to job parameters from ItemReader, in Spring Batch?

This is part of my job.xml: <job id="foo" job-repository="job-repository"> <step id="bar"> <tasklet transaction-manager="transaction-manager"> <chunk commit-interval=..

Inserting a string into a list without getting split into characters

I'm new to Python and can't find a way to insert a string into a list without it getting split into individual characters: >>> list=['hello','world'] >>> list ['hello', 'world'] >..

How to check if a div is visible state or not?

I have tabs like this. <li id="singlechatpanel-1" style="visibility: hidden;"> //content </li> Trying to check it like this: $(".subpanel a").click(function() { var ..

Using Python, how can I access a shared folder on windows network?

I have a file that I would like to copy from a shared folder which is in a shared folder on a different system, but on the same network. How can I access the folder/file? The usual open() method does ..

Send form data with jquery ajax json

I'm new in PHP/jquery I would like to ask how to send json data from a form field like (name, age, etc) with ajax in a json format. Sadly I can't found any relevant information about this it's even po..

Array or List in Java. Which is faster?

I have to keep thousands of strings in memory to be accessed serially in Java. Should I store them in an array or should I use some kind of List ? Since arrays keep all the data in a contiguous chunk..

Find rows that have the same value on a column in MySQL

In a [member] table, some rows have the same value for the email column. login_id | email ---------|--------------------- john | [email protected] peter | [email protected] johnny | john1..

Getting a slice of keys from a map

Is there any simpler/nicer way of getting a slice of keys from a map in Go? Currently I am iterating over the map and copying the keys to a slice: i := 0 keys := make([]int, len(mymap)) for k := ran..

Your project path contains non-ASCII characters android studio

I was installing android studio, but I have this problem when the program is starting: Error:(1, 0) Your project path contains non-ASCII characters. This will most likely cause the build to fail..

Does bootstrap have builtin padding and margin classes?

Does Bootstrap have built-in padding and margin classes like pad-10, mar-left-10 or I have to add my own custom classes? For example, similar to the ones here at padding and margin tabs...

Specifying onClick event type with Typescript and React.Konva

I'm trying to get rid of my tslint error Type declaration of 'any' loses type-safety. but I'm struggling to figure out what the correct type would be for the Event. I'm working through the Lynda "Bu..

Accessing Websites through a Different Port?

I am wanting to access a website from a different port than 80 or 8080. Is this possible? I just want to view the website but through a different port. I do not have a router. I know this can be done ..

MySQL How do you INSERT INTO a table with a SELECT subquery returning multiple rows?

MySQL How do you INSERT INTO a table with a SELECT subquery returning multiple rows? INSERT INTO Results ( People, names, ) VALUES ( ( SELECT FROM ..

How to overcome "datetime.datetime not JSON serializable"?

I have a basic dict as follows: sample = {} sample['title'] = "String" sample['somedate'] = somedatetimehere When I try to do jsonify(sample) I get: TypeError: datetime.datetime(2012, 8, 8, 21, 46..

How to convert POJO to JSON and vice versa?

I want to know if there is any Java API available to convert a POJO object to a JSON object and vice versa...

How can I delete multiple lines in vi?

I have tried to follow the following: How to delete selected text in VI editor but 5dd gives E492: Not an editor command: 5dd I then tried: 5d Which only deletes a single line. How can ..

What are the differences between struct and class in C++?

This question was already asked in the context of C#/.Net. Now I'd like to learn the differences between a struct and a class in C++. Please discuss the technical differences as well as reasons for c..

How do I drag and drop files into an application?

I've seen this done in Borland's Turbo C++ environment, but I'm not sure how to go about it for a C# application I'm working on. Are there best practices or gotchas to look out for?..

Is unsigned integer subtraction defined behavior?

I have come across code from someone who appears to believe there is a problem subtracting an unsigned integer from another integer of the same type when the result would be negative. So that code lik..

AngularJS sorting rows by table header

I have four table headers: $scope.headers = ["Header1", "Header2", "Header3", "Header4"]; And I want to be able to sort my table by clicking on the header. So if my table looks like this H1 | H2 ..

Concatenate a vector of strings/character

If I have a vector of type character, how can I concatenate the values into string? Here's how I would do it with paste(): sdata = c('a', 'b', 'c') paste(sdata[1], sdata[2], sdata[3], sep ='') yiel..

How to open a link in new tab (chrome) using Selenium WebDriver?

System.setProperty("", "D:\\softwares\\chromedriver_win32\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SEC..

SQL Server Jobs with SSIS packages - Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B

i have a SQL server job that runs a SSIS package. This job has 9 steps and in each step it extracts data from a different database. the connections strings are defined as parameters in each step. im..

How can I create a small color box using html and css?

I have a picture on a html file/site and I want to add the list of available colors for that picture. I want to create very small boxes or dots, a small box for every color. How can I do this? Thank..

How to set a default Value of a UIPickerView

I have a problem with my UIPickerView. I have 3 values in it EU AP and NA. When I start the app EU seems to be selected but when I make a NSLog(@"%@", [regions objectAtIndex:row]); I only get back (nu..

How to annotate MYSQL autoincrement field with JPA annotations

Straight to the point, problem is saving the object Operator into MySQL DB. Prior to save, I try to select from this table and it works, so is connection to db. Here is my Operator object: @Entity p..

How to make div's percentage width relative to parent div and not viewport

Here is the HTML I am working with. _x000D_ _x000D_ <div id="outer" style="min-width: 2000px; min-height: 1000px; background: #3e3e3e;">_x000D_ <div id="inner" style="left: 1%; top: 45px; ..

MVC razor form with multiple different submit buttons?

A Razor view has 3 buttons inside a form. All button's actions will need form values which are basically values coming input fields. Every time I click any of buttons it redirected me to default acti..

How to setup Tomcat server in Netbeans?

I googled a bit and found that it can be done by services--->servers--->add new, but when I try to add new Tomcat server this way, it doesn't appear in the list. Actually nothing is displayed to sele..

XML serialization in Java?

What is the Java analogue of .NET's XML serialization?..

How do I set up access control in SVN?

I have set up a repository using SVN and uploaded projects. There are multiple users working on these projects. But, not everyone requires access to all projects. I want to set up user permissions for..

How do I search for names with apostrophe in SQL Server?

SELECT * FROM Header WHERE (userID LIKE [%'%]) ..

Java and SSL -

I've built a Java program as a front end for a database on a server, and I'm trying to use SSL to encrypt traffic between clients and the server. Here is the command I issued to create the server cer..

CSS Always On Top

I have a website with a fixed image at the top of my screen. When I scroll down my page the image stays at the top like it should. However, all content below overlaps my image and it is then covered. ..

CSS vertical alignment of inline/inline-block elements

I'm trying to get several inline and inline-block components aligned vertically in a div. How come the span in this example insists on being pushed down? I've tried both vertical-align:middle; and ver..

How to display 3 buttons on the same line in css

I want to display 3 buttons on the same line in html. I tried two options: This one: <div style="width:500px;"> <div style="float: left; width: 130px"><button type="submi..

How do I parse command line arguments in Java?

What is a good way of parsing command line arguments in Java?..

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

MySQL - SELECT WHERE field IN (subquery) - Extremely slow why?

I've got a couple of duplicates in a database that I want to inspect, so what I did to see which are duplicates, I did this: SELECT relevant_field FROM some_table GROUP BY relevant_field HAVING COUNT..

Check to see if cURL is installed locally?

How do I check if cURL is installed on my local server instance? Does it matter what type of server I'm running to check it? Is it different if it's a PHP server or a CF server? ..

How do I reference a cell range from one worksheet to another using excel formulas?

I have a single worksheet with sheets Sheet1 and Sheet2 and I am trying to reference a range of cells from Sheet2 to Sheet1 I know how to reference worksheet cells such as =Sheet2!A1 but how can I d..

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

Landscape printing from HTML

I have a HTML report, which needs to be printed landscape because of the many columns. It there a way to do this, without the user having to change the document settings? And what are the options amo..

Create a branch in Git from another branch

I have two branches: master and dev I want to create a "feature branch" from the dev branch. Currently on the branch dev, I do: $ git checkout -b myfeature dev ... (some work) $ git commit -am "..

Playing mp3 song on python

I want to play my song (mp3) from python, can you give me a simplest command to do that? This is not correct: import wave w ="e:/LOCAL/Betrayer/Metalik Klinik1-Anak Sekolah.mp3","r") ..

Numpy isnan() fails on an array of floats (from pandas dataframe apply)

I have an array of floats (some normal numbers, some nans) that is coming out of an apply on a pandas dataframe. For some reason, numpy.isnan is failing on this array, however as shown below, each el..

javascript return true or return false when and how to use it?

So I see a lot of JavaScript code (have written some myself) that does something like <script> function CallSomeFunction() { //function body } $(document).ready(function () { callSomeFunct..

How do I call a SQL Server stored procedure from PowerShell?

I have a large CSV file and I want to execute a stored procedure for each line. What is the best way to execute a stored procedure from PowerShell?..

What is the total amount of public IPv4 addresses?

Yes, I am needing to know what the total number possible IPs in the public IPv4 space. I'm not sure where to even get a neat list of all the IP address ranges, so could someone point me to a resourc..

How do I check out a remote Git branch?

Somebody pushed a branch called test with git push origin test to a shared repository. I can see the branch with git branch -r. Now I'm trying to check out the remote test branch. I've tried: git ..

How do I select an element with its name attribute in jQuery?

How to get an element with its name attribute with jQuery? Is there anything (like # for id and . for class) for name in jQuery?..

Model summary in pytorch

Is there any way, I can print the summary of a model in PyTorch like model.summary() method does in Keras as follows? Model Summary: __________________________________________________________________..

Node.js Write a line into a .txt file

I want to create a simple Log System, which prints a line before the past line into a txt file by using Node.js, but i dont know how the File System from Node.js works. Can someone explain it ?..

How to convert a string to ASCII

How do I convert each letter in a string to its ASCII character value?..

IntelliJ cannot find any declarations

I completely uninstalled IntelliJ and have now reinstalled and imported my project. I imported using gradle and can see all of the files in my project present. However, when I open a file I can't find..

Normal arguments vs. keyword arguments

How are "keyword arguments" different from regular arguments? Can't all arguments be passed as name=value instead of using positional syntax?..

Spring Boot Rest Controller how to return different HTTP status codes?

I am using Spring Boot for a simple REST API and would like to return a correct HTTP statuscode if something fails. @RequestMapping(value="/rawdata/", method = RequestMethod.PUT) @ResponseBody @R..

How to bind to a PasswordBox in MVVM

I have come across a problem with binding to a PasswordBox. It seems it's a security risk but I am using the MVVM pattern so I wish to bypass this. I found some interesting code here (has anyone used ..

How to reload the current state?

I'm using Angular UI Router and would like to reload the current state and refresh all data / re-run the controllers for the current state and it's parent. I have 3 state levels: directory.organisati..

Changing the CommandTimeout in SQL Management studio

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

How to convert text to binary code in JavaScript?

Text to Binary Code I want JavaScript to translate text in a textarea into binary code. For example, if a user types in "TEST" into the textarea, the value "01010100 01000101 01010011 0..

Query grants for a table in postgres

How can I query all GRANTS granted to an object in postgres? For example I have table "mytable": GRANT SELECT, INSERT ON mytable TO user1 GRANT UPDATE ON mytable TO user2 I need somthing which gi..

Return single column from a multi-dimensional array

I'm a novice at PHP and I need a quick solution to the following problem but can't seem to come up with one: I have a multi-dimensional array like so Array ( [0] => Array ( ..

How do I deploy Node.js applications as a single executable file?

Supposed I have written a Node.js application, and I now would like to distribute it. Of course, I want to make it easy for the user, hence I do not want him to install Node.js, run npm install and th..

How to generate class diagram from project in Visual Studio 2013?

In Visual Studio 2010 I can generate class diagram from my project with 2 clicks. But now in Visual Studio 2013 I don't see the option "View Class Diagram" in project menu. Where did this item disappe..

Cannot find runtime 'node' on PATH - Visual Studio Code and Node.js

With a downloaded and installed version of Visual Studio Code 1.2.1, and a 64bit version of node.exe msi placed in my working directory (I am assuming that is correct), how do we add node and npm comm..

How to change a package name in Eclipse?

In Eclipse I have a simple Java project that contains a package named (default package) and inside this package I have a class. I want to rename this package into something like: com.myCompany.execut..

Bootstrap trying to load map file. How to disable it? Do I need to do it?

I'm recently playing with bootsrap3. I compiled it from sources and included distr js and css to my project. The thing is, I see in GH dev tools, that it's trying to get .map.css file. Why does it wan..

How to export data to an excel file using PHPExcel

I have taken the source code from limesurvey and have added the PHPExcel library to my limesurvey code to export data to an excel file after you click a link. Currently the excel file opens with some ..

docker: Error response from daemon: Get Service Unavailable. IN DOCKER , MAC

I am having this issue in my Mac system 10.11.6 system3:postgres saurabh-gupta2$ docker build -t postgres . Sending build context to Docker daemon 38.91kB Step 1/51 : FROM

Could not create SSL/TLS secure channel, despite setting ServerCertificateValidationCallback

I'm trying to establish SSL/TLS connection to test server with self-signed certificate. Communication through unsecure channel worked without issues. Here is my sample code, which I've written based ..

Why am I getting the message, "fatal: This operation must be run in a work tree?"

Just installed git on Windows. I set the GIT_DIR variable to be c:\git\ and verified that this environment variable is maintained by cygwin (i.e. echo $GIT_DIR is what it should be). I went to the fo..

How to position one element relative to another with jQuery?

I have a hidden DIV which contains a toolbar-like menu. I have a number of DIVs which are enabled to show the menu DIV when the mouse hovers over them. Is there a built-in function which will move t..

Is it possible to format an HTML tooltip (title attribute)?

Is it possible to format an HTML tooltip? E.g. I have a DIV with attribute title="foo!". When I have text-size of my browser zoomed in or out in, the text size of the tooltip remains unchanged. Is ..

I can't install intel HAXM

I installed Android Studio and I had no problems with that. However, when I tried to run the emulator, it said that Intel HAXM was not installed. So I found the installer, ran it, and it even though ..

Python convert object to float

I read some weather data from a csv file as a dataframe named "weather". The problem is that one of the columns' data type is an object. this is weird beacuse it indicates temperature... anyway, how t..

Floating point comparison functions for C#

Can someone point towards (or show) some good general floating point comparison functions in C# for comparing floating point values? I want to implement functions for IsEqual, IsGreater an IsLess. I a..

What is an uber jar?

I am reading Maven documentation and came across the name 'uber-jar'. What does an uber-jar mean and what are its features/advantages? ..

How to match letters only using java regex, matches method?

import java.util.regex.Pattern; class HowEasy { public boolean matches(String regex) { System.out.println(Pattern.matches(regex, "abcABC ")); return Pattern.matches(regex, "abcA..

How to get css background color on <tr> tag to span entire row

I have tried everything I can think of in css in order to get a background color to span an entire table row (<tr> tag) But I keep getting a white border around each cell. CSS (excerpt): /*al..

wamp server does not start: Windows 7, 64Bit

I am trying to install wamp server (following is the exact setup name) on windows 7, 64Bit OS. But it never starts, icon stays in orange color meaning some services did not start. wampserver2.2e-php5..

What is web.xml file and what are all things can I do with it?

The web.xml Deployment Descriptor Elements in Oracle's BEA WebLogic Server 8.1 Documentation pretty much sums up each element in a web.xml file. But I am also curious about points below: Is there an..

cannot download, $GOPATH not set

I want to install json2csv using go get but I receive this error: package cannot download, $GOPATH not set. For more details see: go help go pat..

How to create number input field in Flutter?

I'm unable to find a way to create an input field in Flutter that would open up a numeric keyboard. Is this possible with Flutter material widgets? Some github discussions seem to indicate this is a s..

What is the alternative for ~ (user's home directory) on Windows command prompt?

I'm trying to use the command prompt to move some files, I am used to the linux terminal where I use ~ to specify the my home directory I've looked everywhere but I couldn't seem to find it for window..

Field 'id' doesn't have a default value?

I am new to this SQL; I have seen similar question with much bigger programs, which I can't understand at the moment. I am making a database for games of cards to use in my homepage. I am using MySQ..

C# JSON Serialization of Dictionary into {key:value, ...} instead of {key:key, value:value, ...}

Is it possible to serialize a .Net Dictionary<Key,Value> into JSON with DataContractJsonSerializer that is of the format: { key0:value0, key1:value1, ... } I use Dictionary <K,V>,..

How to implement "Access-Control-Allow-Origin" header in

Is it possible to implement "Access-Control-Allow-Origin" header in

Use 'import module' or 'from module import'?

I've tried to find a comprehensive guide on whether it is best to use import module or from module import. I've just started with Python and I'm trying to start off with best practices in mind. Basica..

SQL Server - How to lock a table until a stored procedure finishes

I want to do this: create procedure A as lock table a -- do some stuff unrelated to a to prepare to update a -- update a unlock table a return table b Is something like that possible? ..

ImportError: No module named pip

OS: Mac OS X 10.7.5 Python Ver: 2.7.5 I have installed setuptools 1.0 with from Then I download pip.1.4.1 pkg from

If statement within Where clause

I am working with a query which contains "IF" statements within a "WHERE" clause. But PL\SQL Developer is giving some errors while executing it. Can anyone please help me with the correct query? Here ..

Is 'bool' a basic datatype in C++?

I got this doubt while writing some code. Is 'bool' a basic datatype defined in the C++ standard or is it some sort of extension provided by the compiler ? I got this doubt because Win32 has 'BOOL' wh..

Why plt.imshow() doesn't display the image?

I am a newbie to keras, and when I tried to run my first keras program on my linux, something just didn't go as I wish. Here is my python code: import numpy as np np.random.seed(123) from keras.model..

How to change string into QString?

What is the most basic way to do it?..

How to export a mysql database using Command Prompt?

I have a database that is quite large so I want to export it using Command Prompt but I don't know how to. I am using WAMP...

Programmatically center TextView text

I beg some leniency here, I'm just starting with the Android SDK tutorials and I'm attempting something out of interest that's not in the tutorial itself, but I would hope would be easy. I am trying ..

How to select option in drop down using Capybara

I'm trying to select an item from a drop down menu using Capybara (2.1.0). I want to select by number (meaning select the second, third, etc option). I've Googled like crazy trying all sorts of thin..

C++ - How to append a char to char*?

I've tried so may ways on the Internet to append a character to a char* but none of them seems to work. Here is one of my incomplete solution: char* appendCharToCharArray(char * array, char a) { ..

How to get client IP address in Laravel 5+

I am trying to get the client's IP address in Laravel. It is easy to get a client's IP in PHP by using $_SERVER["REMOTE_ADDR"]. It is working fine in core PHP, but when I use the same thing in Larav..

How do I get some variable from another class in Java?

I am "playing around" with Java, watching tutorials and trying to get the hang of it. For this question, I'm trying to figure out how I can take a variable from another class and use it in my main one..

How does DateTime.Now.Ticks exactly work?

In my application I generate files at random opportunities. To ensure a unique naming, I tried to use the nano seconds since 1.1.1970: long time = DateTime.Now.Ticks; String fileName = Convert.ToStri..

How to center icon and text in a android button with width set to "fill parent"

I want to have an Android Button with icon+text centered inside it. I'm using the drawableLeft attribute to set the image, this works well if the button has a width of "wrap_content" but I need to str..

Checking if a file is a directory or just a file

I'm writing a program to check if something is a file or is a directory. Is there a better way to do it than this? #include <stdio.h> #include <sys/types.h> #include <dirent.h> #in..

How can I read the contents of an URL with Python?

The following works when I paste it on the browser: But when I try reading the URL with Python nothing happens: link = '

javascript set cookie with expire time

I am setting a cookie by Javascript and it is working fine but it is not taking the expire time I am giving. It keeps on taking session value regardless of what I give, below is the code which I took ..

yii2 redirect in controller action does not work?

I am posting a form to /user/save in order to save user data. The problem occurs when i try to redirect the user if the $_SERVER['REQUEST_METHOD'] is NOT 'post'. My user controller code namespace ap..

ImportError: No module named sqlalchemy

I'm unable to find a module in python ,though easy_install says its already installed. Any idea how to resolve this isseue? $ python -c "from flaskext.sqlalchemy import SQLAlchemy" Traceback (most r..

Using partial views in MVC 4

I have recently started playing around with MVC (4), but I can't wrap my head around this one issue I'm having. I'm sure it's easy when you know it. I'm essentially trying to do the the follo..

Put content in HttpResponseMessage object?

Several months ago, Microsoft decided to change up the HttpResponseMessage class. Before, you could simply pass a data type into the constructor, and then return the message with that data, but not an..

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

Execute PHP function with onclick

I am searching for a simple solution to call a PHP function only when a-tag is clicked. PHP: function removeday() { ... } HTML: <a href="" onclick="removeday()" class="deletebtn">Delete<..

How to empty a redis database?

I've been playing with redis (and add some fun with it) during the last fews days and I'd like to know if there is a way to empty the db (remove the sets, the existing key....) easily. During my tests..

Call multiple functions onClick ReactJS

I know in vanilla js, we can do onclick="f1();f2()" What would be the equivalent for making two function calls onClick in ReactJS? I know calling one function is like this: onClick={f1} ..

Convert nested Python dict to object?

I'm searching for an elegant way to get data using attribute access on a dict with some nested dicts and lists (i.e. javascript-style object syntax). For example: >>> d = {'a': 1, 'b': {'c'..

How do I set <table> border width with CSS?

Why does this work? <table border=1> And this doesn't? <table style="border-width:1px;border-color:black"> I get the same result in Chrome and in IE9...

jquery change style of a div on click

I have a div, with a specific style(let's say a certain background). What I want is, when one clicks on a list element having that div applied another specific style (another background type) to be a..

window.print() not working in IE

I am doing something like this in javascript to print a section of my page on click of a link function printDiv() { var divToPrint = document.getElementById('printArea'); var newWin =

How can I wait In Node.js (JavaScript)? l need to pause for a period of time

I'm developing a console script for personal needs. I need to be able to pause for an extended amount of time, but, from my research, Node.js has no way to stop as required. It’s getting hard to rea..

Difference between two dates in years, months, days in JavaScript

I've been searching for 4 hours now, and have not found a solution to get the difference between two dates in years, months, and days in JavaScript, like: 10th of April 2010 was 3 years, x month and y..

Javascript sleep/delay/wait function

Sorry if this question has already been asked here before, I could not find a suitable answer. I am wanting to create a JavaScript sleep/delay/wait function that I can call anywhere in the script, li..

What does the 'standalone' directive mean in XML?

What does the 'standalone' directive mean in an XML document?..

no overload for matches delegate 'system.eventhandler'

As I'm pretty new to C#, I struggle with the following piece of code. When I click to button 'knop', the method 'klik' has to be executed. The method has to draw the Bitmap 'b', generated by 'DrawMand..

How to install xgboost in Anaconda Python (Windows platform)?

I am a new Python user. I downloaded the latest Anaconda 3 2.4.1 (Python 3.5) from the below link: My PC Configurations are: Windows 10, 64 bit, 4GB RAM I have spe..

How to position a DIV in a specific coordinates?

I want to position a DIV in a specific coordinates ? How can I do that using Javascript ?..

How to convert .pem into .key?

I already have purchased SSL certificate and i have received certificate and a .pem file as a private key? from the supplier; now i need to convert this .pem key into .key for bitnami Redmine Apache w..

How to get the day name from a selected date?

I have this : Datetime.Now(); or 23/10/2009 I want this : Friday For local date-time (GMT-5) and using Gregorian calendar...

Create a dropdown component

I want to create a dropdown menu using Angular 2, but I'm not sure how to do it in the "Angular 2 way". I could create a dropdown component that is used like this: <dropdown> <li (click..

Using python map and other functional tools

This is quite n00bish, but I'm trying to learn/understand functional programming in python. The following code: foos = [1.0,2.0,3.0,4.0,5.0] bars = [1,2,3] def maptest(foo, bar): print foo, bar ..

Could not complete the operation due to error 80020101. IE

Possible Duplicate: Ajax request problem: error 80020101 I am using JQuery-1.64 and this is my code to reset timer var message="Logged in"; var myTimeout = setTimeout("timerDone()",1000 * ..

How to define Gradle's home in IDEA?

I am trying to import a Gradle project into IntelliJ, and when I get to the Gradle Home textbox, it is not automatically populated, nor will typing in the path of Gradle Home result in a valid locatio..

build maven project with propriatery libraries included

How to create maven pom, which will make project buildable, can I include propriatery jars with my project directly without having to take them from repository? anyone did this before ? EDIT : I do..

How to prevent the "Confirm Form Resubmission" dialog?

How do I clean information in a form after submit so that it does not show this error after a page refresh? See image (from chrome): The dialog has the text: The page that you're looking for u..

Keyboard shortcut to "untab" (move a block of code to the left) in eclipse / aptana?

Well, hopefully the question is self-explanatory. It's so easy to select a block of code and tab out, but how about the reverse? Currently, I just search & replace for whitespace at the beginnin..

typedef fixed length array

I have to define a 24-bit data type.I am using char[3] to represent the type. Can I typedef char[3] to type24? I tried it in a code sample. I put typedef char[3] type24; in my header file. The compile..

Xlib: extension "RANDR" missing on display ":21". - Trying to run headless Google Chrome

I'm trying to run some Webdriver Maven tests on a headless server via xvfb using Chrome (Firefox also didn't work) but I'm getting this error message: Xlib: extension "RANDR" missing on display ":21..

Remove an entire column from a data.frame in R

Does anyone know how to remove an entire column from a data.frame in R? For example if I am given this data.frame: > head(data) chr genome region 1 chr1 hg19_refGene CDS 2 chr1 hg19_re..

Nuget connection attempt failed "Unable to load the service index for source"

While trying to connect to Nuget, I'm getting the error below, and then I am unable to connect: [] Unable to load the service index for source An error o..

java : non-static variable cannot be referenced from a static context Error

The following code is generating an error on the variable con2 saying "non-static variable con2 cannot be referenced from a static context Error." I Googled for a resolution and they are suggesting t..

Disable Chrome strict MIME type checking

Is there any way to disable strict MIME type checking in Chrome. Actually I'm making a JSONP request on cross domain. Its working fine on Firefox but, while using chrome its giving some error in cons..

Retrieve the maximum length of a VARCHAR column in SQL Server

I want to find the longest VARCHAR in a specific column of a SQL Server table. Here's an example: ID = INT IDENTITY DESC = VARCHAR(5000) ID | Desc ---|----- 1 | a 2 | aaa 3 | aa What's the SQL..

Customize Bootstrap checkboxes

I'm using Bootstrap in my Angular application and all other styles are working like they should, but checkbox style doesn't. It just look like plain old checkbox. _x000D_ _x000D_ <link rel="styles..

What is declarative programming?

I keep hearing this term tossed around in several different contexts. What is it?..

How to store Node.js deployment settings/configuration files?

I have been working on a few Node apps, and I've been looking for a good pattern of storing deployment-related settings. In the Django world (where I come from), the common practise would be to have a..

How to upgrade pip3?

I want to use python3.5 to develop basically, but many times when I install the module for the python 3.5, it always failed. And the terminal told me that higher version is available, it did not work ..

Select * from subquery

I'd like to get sum of column1, sum of column2 and total sum. In Postgres I can do it this way: (notice the star) SELECT *, a+b AS total_sum FROM ( SELECT SUM(column1) AS a, SUM(column2) AS b F..

How to schedule a periodic task in Java?

I need to schedule a task to run in at fixed interval of time. How can I do this with support of long intervals (for example on each 8 hours)? I'm currently using java.util.Timer.scheduleAtFixedRate...

python dict to numpy structured array

I have a dictionary that I need to convert to a NumPy structured array. I'm using the arcpy function NumPyArraytoTable, so a NumPy structured array is the only data format that will work. Based on..

How to get summary statistics by group

I'm trying to get multiple summary statistics in R/S-PLUS grouped by categorical column in one shot. I found couple of functions, but all of them do one statistic per call, like `aggregate(). data &l..

Find what 2 numbers add to something and multiply to something

Hey so I'm making a factoring program and I'm wondering if anyone can give me any ideas on an efficient way to find what two numbers multiple to a specified number, and also add to a specified number...

iOS 7.0 No code signing identities found

certificate is valid xcode 5 iOS 7 Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile sp..

c++ and opencv get and set pixel color to Mat

I'm trying to set a new color value to some pixel into a cv::Mat image my code is below: Mat image = img; for(int y=0;y<img.rows;y++) { for(int x=0;x<img.cols;x++) {..

How do I install the OpenSSL libraries on Ubuntu?

I'm trying to build some code on Ubuntu 10.04 LTS that uses OpenSSL 1.0.0. When I run make, it invokes g++ with the "-lssl" option. The source includes: #include <openssl/bio.h> #include <..