Questions Tagged with #Textboxextender

Explicit Return Type of Lambda

When I try and compile this code (VS2010) I am getting the following error: error C3499: a lambda that has been specified to have a void return type cannot return a value void DataFile::removeComment..


I'm trying to implement a client for National Rail Enquiries' SOAP Service ( I stick the WSDL ( into ht..

CSS3 animate border color

I want to animate borders of an element using CSS3, whether it's in hover state or normal state. Can someone provide me a code snippet for this or can guide? I can do this using jQuery but looking fo..

Oracle PL/SQL : remove "space characters" from a string

In my Oracle 10g database I would like to remove "space characters" (spaces, tabs, carriage returns...) from the values of a table field. Is TRANSLATE() the way to go ? For example something like: M..

Convert array of strings into a string in Java

I want the Java code for converting an array of strings into an string...

How to display a Yes/No dialog box on Android?

Yes, I know there's AlertDialog.Builder, but I'm shocked to know how difficult (well, at least not programmer-friendly) to display a dialog in Android. I used to be a .NET developer, and I'm wonderin..

Extract first and last row of a dataframe in pandas

How can I extract the first and last rows of a given dataframe as a new dataframe in pandas? I've tried to use iloc to select the desired rows and then concat as in: df=pd.DataFrame({'a':range(1,5),..

Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git

I'm not sure why I'm unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkout): ramon@ramon-desktop:~/source/unstilted$ git branch -a * deve..

Changing text color of menu item in navigation drawer

I'm trying to add a night theme for my app and I've wasted nearly three hours just trying to make the text and icons in my navigation drawer turn white along with the dark background. Here is the way ..

When should I use h:outputLink instead of h:commandLink?

When should I use an <h:outputLink> instead of an <h:commandLink>? I understand that a commandLink generates an HTTP post; I'm guessing that outputLink will generate HTTP gets. That said,..

Show compose SMS view in Android

I want to send a sms with Android. What is the intent for SMS sending? I want to show the compose sms view with my pre-define text passing over in message field...

Overlapping Views in Android

Is it possible to have overlapping views in Android? I would like to have an ImageView with a transparent png in the front and another view in the background. edit: This is what I have at the moment..

how to add value to a tuple?

I'm working on a script where I have a list of tuples like ('1','2','3','4'). e.g.: list = [('1','2','3','4'), ('2','3','4','5'), ('3','4','5','6'), ('4','5','6','7')] Now I..

Load resources from relative path using local html in uiwebview

I have a very simple iOS app with a uiwebview loading a very simple test page (test.html): <html> <body> <img src="img/myimage.png" /> </body> </html> I load this test..

How to Find App Pool Recycles in Event Log

I have configured an app pool in IIS 7.5 to recycle when the memory usage goes above a certain level. I have also configured it to log this information. Where in the event log should I look for this?..

Examples of GoF Design Patterns in Java's core libraries

I am learning GoF Java Design Patterns and I want to see some real life examples of them. What are some good examples of these Design Patterns in Java's core libraries?..

CSS content property: is it possible to insert HTML instead of Text?

Just wondering if it's possible somehow to make the CSS content property insert html code instead string on :before or :after an element like: .header:before{ content: '<a href="#top">Back<..

Hive External Table Skip First Row

I am using Cloudera's version of Hive and trying to create an external table over a csv file that contains the column names in the first column. Here is the code that I am using to do that. CREATE E..

Why is the Visual Studio 2015/2017/2019 Test Runner not discovering my xUnit v2 tests

UPDATE: Adding a 2019; the discovery/runner integration mechanism is same as per 2017 & 2015, so the key things that can go wrong are the same. I've read Why is the xUnit runner not finding my ..

How can I view all historical changes to a file in SVN

I know that I can svn diff -r a:b repo to view the changes between the two specified revisions. What I'd like is a diff for every revision that changed the file. Is such a command available?..

Check if item is in an array / list

If I've got an array of strings, can I check to see if a string is in the array without doing a for loop? Specifically, I'm looking for a way to do it within an if statement, so something like this: ..

JavaFX Location is not set error message

I have problem when trying to close current scene and open up another scene when menuItem is selected. My main stage is coded as below: public void start(Stage primaryStage) throws Exception { pr..

How do I show a console output/window in a forms application?

To get stuck in straight away, a very basic example: using System; using System.Windows.Forms; class test { static void Main() { Console.WriteLine("test"); MessageBox.Show(..

Synchronizing a local Git repository with a remote one

I want to synchronize my local repository with a remote one so that my local repository becomes a 100% copy of the remote one - meaning that if certain files differ in these repositories, we override ..

Java error: Implicit super constructor is undefined for default constructor

I have a some simple Java code that looks similar to this in its structure: abstract public class BaseClass { String someString; public BaseClass(String someString) { this.someString ..

How to retrieve the LoaderException property?

I get a error message while updating my service reference: Custom tool warning: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. How ca..

Remove scrollbars from textarea

Following up to my previous question (Add a scrollbar to a <textarea>) on how to always see the scrollbar in a <textarea>, I am now wondering how you would set it so that there is no scrol..

Inverse of a matrix using numpy

I'd like to use numpy to calculate the inverse. But I'm getting an error: 'numpy.ndarry' object has no attribute I To calculate inverse of a matrix in numpy, say matrix M, it should be simply: pr..

How do you generate a random double uniformly distributed between 0 and 1 from C++?

How do you generate a random double uniformly distributed between 0 and 1 from C++? Of course I can think of some answers, but I'd like to know what the standard practice is, to have: Good standard..

Permission denied on CopyFile in VBS

I'm trying to automate pushing a file into my users' home directories, but am stuck on a "Permission Denied" error — is thrown on line 6 here, with the CopyFile call. There are other parts of the s..

c++ array assignment of multiple values

so when you initialize an array, you can assign multiple values to it in one spot: int array [] = {1,3,34,5,6} but what if the array is already initialized and I want to completely replace the valu..

GitHub "fatal: remote origin already exists"

I am trying to follow along Michael Hartl's Rails tutorial but I've run across an error. I signed up on Github and issued a new SSH key and made a new repository. But when I enter the next line into..

How do I run SSH commands on remote system using Java?

I am new to this kind of Java application and looking for some sample code on how to connect to a remote server using SSH , execute commands, and get output back using Java as programming language...

Regex: Use start of line/end of line signs (^ or $) in different context

While doing some small regex task I came upon this problem. I have a string that is a list of tags that looks e.g like this: foo,bar,qux,garp,wobble,thud What I needed to do was to check if a cer..

Create an array of strings

Is it possibe to create an array of strings in MATLAB within a for loop? For example, for i=1:10 Names(i)='Sample Text'; end I don't seem to be able to do it this way...

Best way to check if object exists in Entity Framework?

What is the best way to check if an object exists in the database from a performance point of view? I'm using Entity Framework 1.0 (ASP.NET 3.5 SP1)...

Valid characters of a hostname?

What are the valid characters of a hostname? This would be something like a networked computer or a web domain. To put it in context, I am writing a PC game which connects to a remote server; so I ha..

Command Prompt Error 'C:\Program' is not recognized as an internal or external command, operable program or batch file

I am trying to run the following batch command. The command has been extracted from the IDE so is confirmed working. Getting the error mentioned below. I have tried a few variations with double quote..

How do you set your pythonpath in an already-created virtualenv?

What file do I edit, and how? I created a virtual environment...

How to download and save an image in Android

How do you download and save an image from a given url in Android?..

How do I pre-populate a jQuery Datepicker textbox with today's date?

I have a very simple jQuery Datepicker calendar: $(document).ready(function(){ $("#date_pretty").datepicker({ }); }); and of course in the HTML... <input type="text" size="10" value=""..

Jquery .on('scroll') not firing the event while scrolling

Scroll event is not firing while scrolling the ul. I'm using jQuery version 1.10.2. As I'm loading the ul from an ajax page, I couldn't use $('ulId').on('scroll', function() {}); or other live methods..

Getting a count of rows in a datatable that meet certain criteria

I have a datatable, dtFoo, and would like to get a count of the rows that meet a certain criteria. EDIT: This data is not stored in a database, so using SQL is not an option. In the past, I've used ..

Using CSS for a fade-in effect on page load

Can CSS transitions be used to allow a text paragraph to fade-in on page load? I really like how it looked on and would love to use a similar effect using CSS. The domain has s..

How to cast/convert pointer to reference in C++

How can I pass a pointer (Object *ob) to a function which prototype is void foo(Object &) ?..

How can I inject a property value into a Spring Bean which was configured using annotations?

I have a bunch of Spring beans which are picked up from the classpath via annotations, e.g. @Repository("personDao") public class PersonDaoImpl extends AbstractDaoImpl implements PersonDao { // I..

How to kill MySQL connections

I'm building a website with MySQL. I'm using TOAD for MySQL and suddenly I can't connect to the database as I'm getting an error: "Too many connections" Is there any way in Toad for MySQL to vi..

What is the difference between hg forget and hg remove?

I want mercurial to remove several files from the current state of the repository. However, I want the files to exist in prior history. How do forget and remove differ, and can they do what I want?..

Declare Variable for a Query String

I was wondering if there was a way to do this in MS SQL Server 2005: DECLARE @theDate varchar(60) SET @theDate = '''2010-01-01'' AND ''2010-08-31 23:59:59''' SELECT AdministratorCode, ..

Best practice for instantiating a new Android Fragment

I have seen two general practices to instantiate a new Fragment in an application: Fragment newFragment = new MyFragment(); and Fragment newFragment = MyFragment.newInstance(); The second option..

jQuery - getting custom attribute from selected option

Given the following: <select id="location"> <option value="a" myTag="123">My option</option> <option value="b" myTag="456">My other option</option> </select&g..

Convert YYYYMMDD string date to a datetime value

Possible Duplicate: Convert string to DateTime in c# A question I got a string value that actually get from directoryInfo. What i wanted to accomplish is to convert the string value to a d..

How to parse my json string in C#(4.0)using Newtonsoft.Json package?

I am new to JSON.In my application i want to parse the json string.So, i have used Newtonsoft.Json package for reading and writing json data.Now, i can able to parse the simple json data.But n..

jQuery AJAX cross domain

Here are two pages, test.php and testserver.php. test.php <script src="scripts/jq.js" type="text/javascript"></script> <script> $(function() { $.ajax({url:"testserver.p..

E11000 duplicate key error index in mongodb mongoose

Following is my user schema in user.js model - var userSchema = new mongoose.Schema({ local: { name: { type: String }, email : { type: String, require: true, unique: true }, ..

Find empty or NaN entry in Pandas Dataframe

I am trying to search through a Pandas Dataframe to find where it has a missing entry or a NaN entry. Here is a dataframe that I am working with: cl_id a c d e ..

How to lowercase a pandas dataframe string column if it has missing values?

The following code does not work. import pandas as pd import numpy as np df=pd.DataFrame(['ONE','Two', np.nan],columns=['x']) xLower = df["x"].map(lambda x: x.lower()) How should I tweak it to ge..

How to select label for="XYZ" in CSS?

HTML: <label for="email">{t _your_email}:</label> CSS: label { display: block; width: 156px; cursor: pointer; padding-right: 6px; padding-bottom: 1px; } I wish to sel..

ORA-01438: value larger than specified precision allows for this column

We get sometimes the following error from our partner's database: <i>ORA-01438: value larger than specified precision allows for this column</i> The full response looks like the followi..

Clicking submit button of an HTML form by a Javascript code

I don't know much about WEB probramming, so feel free to ask if I'm missing any details. There is a certain website which I'm visiting very frequently, and it requires users to log in every time they..

Using LIMIT within GROUP BY to get N results per group?

The following query: SELECT year, id, rate FROM h WHERE year BETWEEN 2000 AND 2009 AND id IN (SELECT rid FROM table2) GROUP BY id, year ORDER BY id, rate DESC yields: year id rate 2006 p01 ..

How does Git handle symbolic links?

If I have a file or directory that is a symbolic link and I commit it to a Git repository, what happens to it? I would assume that it leaves it as a symbolic link until the file is deleted and then i..

How to escape braces (curly brackets) in a format string in .NET

How can brackets be escaped in using string.Format. For example: String val = "1,2,3" String.Format(" foo {{0}}", val); This example doesn't throw an exception, but outputs the string foo {0}. ..

How to delete directory content in Java?

After enumerating a directory, I now need to delete all the files. I used: final File[] files = outputFolder.listFiles(); files.delete(); But this hasn't deleted the directory. ..

How do I make a relative reference to another workbook in Excel?

I am producing a sheet to calculate prices. The sheet has to have a reference to several other workbooks to get the prices for different components. This works fine on my computer but when I move them..

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

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

SQL Server dynamic PIVOT query?

I've been tasked with coming up with a means of translating the following data: date category amount 1/1/2012 ABC 1000.00 2/1/2012 DEF 500.00 2/1/2012 G..

How to redirect siteA to siteB with A or CNAME records

I have 2 hosts and I would like to point a subdomain on host one to a subdomain on host two: --> I added a CNAME record to host one that points to sub..

How can I find where Python is installed on Windows?

I want to find out my Python installation path on Windows. For example: C:\Python25 How can I find where Python is installed?..

What is the easiest/best/most correct way to iterate through the characters of a string in Java?

StringTokenizer? Convert the String to a char[] and iterate over that? Something else?..

Modify property value of the objects in list using Java 8 streams

I have a list of Fruit objects in ArrayList and I want to modify fruitName to its plural name. Refer the example: @Data @AllArgsConstructor @ToString class Fruit { long id; String name; ..

Cannot implicitly convert type 'System.DateTime?' to 'System.DateTime'. An explicit conversion exists

I am trying to convert datetime? todatetime but I get this Error: Error 7 Cannot implicitly convert type 'System.DateTime?' to 'System.DateTime'. An explicit conversion exists Here is my cod..

How to save and load cookies using Python + Selenium WebDriver

How can I save all cookies in Python's Selenium WebDriver to a .txt file, and then load them later? The documentation doesn't say much of anything about the getCookies function...

Python: Assign print output to a variable

I would like to know how to assign the output of the print function (or any function) to a variable. To give an example: import eyeD3 tag = eyeD3.Tag()"/some/file.mp3") print tag.getArtist(..

How and when to use ‘async’ and ‘await’

From my understanding one of the main things that async and await do is to make code easy to write and read - but is using them equal to spawning background threads to perform long duration logic? I'..

What are good grep tools for Windows?

Any recommendations on grep tools for Windows? Ideally ones that could leverage 64-bit OS. I'm aware of Cygwin, of course, and have also found PowerGREP, but I'm wondering if there are any hidden gem..

How do you auto format code in Visual Studio?

I know Visual Studio can auto format to make my methods and loops indented properly, but I cannot find the setting...

Executing multi-line statements in the one-line command-line?

I'm using Python with -c to execute a one-liner loop, i.e.: $ python -c "for r in range(10): print 'rob'" This works fine. However, if I import a module before the for loop, I get a syntax error: ..

Replacing a char at a given index in string?

String does not have ReplaceAt(), and I'm tumbling a bit on how to make a decent function that does what I need. I suppose the CPU cost is high, but the string sizes are small so it's all ok..

How to increase font size in the Xcode editor?

To increase font-size in Xcode is a pain...

How do I combine two data-frames based on two columns?

I know I can use the plyr and its friends to combine dataframes, and merge as well, but so far I don't know how to merge two dataframes with multiple columns based on 2 columns?..

Apache default VirtualHost

How can I set a default VirtualHost in Apache? Preferably, I want the default host not to be the same as the IP address host. Now I have something like this: NameVirtualHost * <VirtualHost *> ..

Python, compute list difference

In Python, what is the best way to compute the difference between two lists? example A = [1,2,3,4] B = [2,5] A - B = [1,3,4] B - A = [5] ..

django MultiValueDictKeyError error, how do I deal with it

I'm trying to save a object to my database, but it's throwing a MultiValueDictKeyError error. The problems lies within the form, the is_private is represented by a checkbox. If the check box is NOT s..

AWS S3: how do I see how much disk space is using

I have AWS account. I'm using S3 to store backups from different servers. The question is there any information in the AWS console about how much disk space is in use in my S3 cloud?..

The ScriptManager must appear before any controls that need it

I have created a new ASP.NET Web Application, and after debugging i got Server Error The control with ID 'WaitingPopup1' requires a ScriptManager on the page. The ScriptManager must appear before ..

Procedure or function !!! has too many arguments specified

I am developing my very first stored procedure in SQL Server 2008 and need advice concerning the errors message. Procedure or function xxx too many arguments specified which I get after executi..

Can we instantiate an abstract class?

During one of my interview, I was asked "If we can instantiate an abstract class?" My reply was "No. we can't". But, interviewer told me "Wrong, we can." I argued a bit on this. Then he told me to ..

How to cast an Object to an int

How can I cast an Object to an int in java?..

Iterate through object properties

_x000D_ _x000D_ var obj = {_x000D_ name: "Simon",_x000D_ age: "20",_x000D_ clothing: {_x000D_ style: "simple",_x000D_ hipster: false_x000D_ }_x000D_ }_x000D_ _x000D_ fo..

How to keep the local file or the remote file during merge using Git and the command line?

I know how to merge modification using vimdiff, but, assuming I just know that the entire file is good to keep or to throw away, how do I do that? I don't want to open vimdiff for each of them, I ch..

Getting year in moment.js

What is the differenct between those two: var year = moment().format('YYYY'); var year = moment().year(); Is it just type of or anything else? I am just curious...

How do I create a timeline chart which shows multiple events? Eg. Metallica Band members timeline on wiki

How do I create a timeline chart which shows multiple events? Eg. Metallica Band members timeline on wiki ? where it shows the multiple band members and their durations. Technologies to be used : Mi..

How to make a link open multiple pages when clicked

I have two (or more) links. For example: and How can I make them both open when I click on a single link? For example, a link entitled "click here" which, when cl..

Angular2 *ngFor in select list, set active based on string from object

I'm trying using the ngFor on my select DropDownList. Have loaded in the options which should be in the dropdown. The code you see here: <div class="column small-12 large-2"> <label cl..

Check if one date is between two dates

I need to check if a date - a string in dd/mm/yyyy format - falls between two other dates having the same format dd/mm/yyyy I tried this, but it doesn't work: var dateFrom = "02/05/2013"; var dateTo..

Convert HTML to NSAttributedString in iOS

I am using a instance of UIWebView to process some text and color it correctly, it gives the result as HTML but rather than displaying it in the UIWebView I want to display it using Core Text with a N..

Table with fixed header and fixed column on pure css

I need to create a html table (or something similar looking) with a fixed header and a fixed first column. Every solution I've seen so far uses Javascript or jQuery to set scrollTop/scrollLeft, but ..

Generate Json schema from XML schema (XSD)

Does anybody know how to generate a JSON schema from a existing XML schema (XSD file)? Are there any tools available for this?..

Import PEM into Java Key Store

I am trying to connect to an SSL server which requires me to authenticate myself. In order to use SSL over Apache MINA I need a suitable JKS file. However, I have only been given a .PEM file. How wo..

Catch a thread's exception in the caller thread in Python

I'm very new to Python and multithreaded programming in general. Basically, I have a script that will copy files to another location. I would like this to be placed in another thread so I can output..

Counting inversions in an array

I'm designing an algorithm to do the following: Given array A[1... n], for every i < j, find all inversion pairs such that A[i] > A[j]. I'm using merge sort and copying array A to array B and th..

PHP call Class method / function

How can I call following Class method or function? Let say I have this params get from url: $var = filter($_GET['params']); Class: class Functions{ public function filter($data){ $da..

sscanf in Python

I'm looking for an equivalent to sscanf() in Python. I want to parse /proc/net/* files, in C I could do something like this: int matches = sscanf( buffer, "%*d: %64[0-9A-Fa-f]:%X %64[..

PHP check if date between two dates

I got this code from Stackoverflow and changed it slightly to work with today's date. I want to check if today fits between two dates. But this is not working. What am I missing? $paymentDate = date..

cURL equivalent in Node.js?

I'm looking to use information from an HTTP request using Node.js (i.e. call a remote web service and echo the response to the client). In PHP I would have used cURL to do this. What is the best pra..

Generate HTML table from 2D JavaScript array

In JavaScript, is it possible to generate an HTML table from a 2D array? The syntax for writing HTML tables tends to be very verbose, so I want to generate an HTML table from a 2D JavaScript array, as..

Jquery: How to check if the element has certain css class/style

I have a div: <div class="test" id="someElement" style="position: absolute"></div> Is there any way to check if the certain element: $("#someElement") has a particular class (in my ..

Install a Python package into a different directory using pip?

I know the obvious answer is to use virtualenv and virtualenvwrapper, but for various reasons I can't/don't want to do that. So how do I modify the command pip install package_name to make pip ins..

How to cut a string after a specific character in unix

So I have this string: [email protected]:/home/some/directory/file I just want to extract the directory address meaning I only want the bit after the ":" character and get: /home/some/dir..

How to do jquery code AFTER page loading?

If you want an event to work on your page, you should call it inside the $(document).ready() function. Everything inside it will load as soon as the DOM is loaded and before the page cont..

Copy / Put text on the clipboard with FireFox, Safari and Chrome

In Internet Explorer I can use the clipboardData object to access the clipboard. How can I do that in FireFox, Safari and/or Chrome?..

Spring configure @ResponseBody JSON format

Imagine I have this annotated method in a Spring 3 @Controller @RequestMapping("") public @ResponseBody MyObject index(@RequestBody OtherObject obj) { MyObject result = ...; return result; } ..

Define static method in source-file with declaration in header-file in C++

I am having a little trouble working with static methods in C++ Example .h: class IC_Utility { public: IC_Utility(); ~IC_Utility(); std::string CP_PStringToString( const unsigned char *..

failed to resolve and

I installed ALL Extra and SDK API 21-22 including changed compileSdkVersion 22 to 21 and buildToolsVersion '22.0.1' to 21.1.2. I'm having Rendering Problems for API 22. I have tried changing the versi..

How to alert using jQuery

This works: $('.overdue').addClass('alert'); But this doesn't: $('.overdue').alert('Your book is overdue.'); What is the correct jQuery syntax for: FOR EACH CLASS="overdue" alert('Your boo..

What is the difference between JAX-RS and JAX-WS?

After reading a few articles about JAX-RS and JAX-WS, I had a few questions that I want to confirm? Can JAX-RS do Asynchronous Request like JAX-WS? Can JAX-RS access a web service that is not runnin..

"insufficient memory for the Java Runtime Environment " message in eclipse

When I run my Java code in Eclipse, I get the following message: There is insufficient memory for the Java Runtime Environment to continue. Native memory allocation (malloc) failed to allocate 4088 b..

How to validate phone number in laravel 5.2?

I want to validate user input phone number where number should be exactly 11 and started with 01 and value field should be number only. How do I do it using Laravel validation? Here is my controller:..

Difference between try-catch and throw in java

What is the difference between try-catch and throw clause. When to use these? Please let me know ...

Why does instanceof return false for some literals?

"foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=> false false instanceof Boolean //=..

How do I "Add Existing Item" an entire directory structure in Visual Studio?

I have a free standing set of files not affiliated with any C# project at all that reside in a complicated nested directory structure. I want to add them in that format to a different directory in an..

How to get input field value using PHP

I have a input field as follows: <input type="text" name="subject" id="subject" value="Car Loan"> I would like to get the input fields value Car Loan and assign it to a session. How do I do t..

Getting attributes of Enum's value

I would like to know if it is possible to get attributes of the enum values and not of the enum itself? For example, suppose I have the following enum: using System.ComponentModel; // for Description..

Handle JSON Decode Error when nothing returned

I am parsing json data. I don't have an issue with parsing and I am using simplejson module. But some api requests returns empty value. Here is my example: { "all" : { "count" : 0, "question..

SQL Server 2008 R2 can't connect to local database in Management Studio

I am using SQL Server 2008 R2 Express. I first installed SQL Server 2008 R2 Express Management Studio and then I installed SQL Server 2008 R2 Express. I have the instance SQLEXPRESS running and it is..

Class extending more than one class Java?

I know that a class can implement more than one interface, but is it possible to extend more than one class? For example I want my class to extend both TransformGroup and a class I created. Is this po..

AngularJS - Find Element with attribute

I'm new to AngularJS. I've learned that I can find elements in the DOM using queries like the following: var e = angular.element(document.querySelector('#id')); var e = angular.element(elem.querySele..

Convert a CERT/PEM certificate to a PFX certificate

I've seen a couple questions about how to convert a PFX to a cert file, but I need to go the other way. I have two files: bob_cert.cert bob_key.pem I'd like to convert them to a single .pfx file. I..

How to split a string of space separated numbers into integers?

I have a string "42 0" (for example) and need to get an array of the two integers. Can I do a .split on a space?..

How to git-cherry-pick only changes to certain files?

If I want to merge into a Git branch the changes made only to some of the files changed in a particular commit which includes changes to multiple files, how can this be achieved? Suppose the Git comm..

VBA general way for pulling data out of SAP

Does anyone know how to use VBA to pull data from SAP Netweaver? I have a number of daily reports that require exporting data from SAP to Excel and formatting it into a report. I have already written..

Flexbox Not Centering Vertically in IE

I have a simple web page with some Lipsum content that is centered on the page. The page works fine in Chrome and Firefox. If I reduce the size of the window, the content fills the window until it can..

Class Not Found: Empty Test Suite in IntelliJ

I'm just starting the computer science program at my college, and I'm having some issues with IntelliJ. When I try to run unit tests, I get the message Process finished with exit code 1 Class not fou..

SQLite3 database or disk is full / the database disk image is malformed

My database is about 25 MB, and I've verified that the username accessing it, as well as the file permissions haven't changed in months. I'm having a problem where queries are failing due to a "databa..

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

Unable to call the built in mb_internal_encoding method?

I'm trying to install indefero on a CentOS 5.3 VMware 'box' and I ran into a problem. Quite early in the installation I get an error that I've been able to narrow down to this: [root@code /var/www/ht..

Transaction isolation levels relation with locks on table

I have read about 4 levels of isolation: Isolation Level Dirty Read Nonrepeatable Read Phantom Read READ UNCOMMITTED Permitted Permitted Permitted READ COMMITTED ..

proper name for python * operator?

What is the correct name for operator *, as in function(*args)? unpack, unzip, something else?..

Adding a column after another column within SQL

How do I add a column after another column within MS SQL by using SQL query? TempTable ID int, Type nvarchar(20), Active bit NewTable ID int, Type nvarchar(20), Description text, ..

Can't create a docker image for COPY failed: stat /var/lib/docker/tmp/docker-builder error

I want to create a docker image. This is my work directory: test.json And this is my Dockerfile: COPY ./test.json /home/test.json COPY ./ /home/ RUN python t..

Float a div in top right corner without overlapping sibling header

Having a div and a h1 inside a section, how do i float the div in the top right corner without overlapping the text of the header ? The HTML code is the following: <section> <h1>some l..

Verify object attribute value with mockito

I have a method call which I want to mock with mockito. To start with I have created and injected an instance of an object on which the method will be called. My aim is to verify one of the object in ..

How do I loop through a list by twos?

I want to loop through a Python list and process 2 list items at a time. Something like this in another language: for(int i = 0; i < list.length(); i+=2) { // do something with list[i] and list..

How do I return JSON without using a template in Django?

This is related to this question: Django return json and html depending on client python I have a command line Python API for a Django app. When I access the app through the API it should return JS..

Altering a column to be nullable

I want to alter a table column to be nullable. I have used: ALTER TABLE Merchant_Pending_Functions Modify NumberOfLocations NULL This gives an error at Modify. What is the correct syntax?..

Change default timeout for mocha

If we have a unit test file my-spec.js and running with mocha: mocha my-spec.js The default timeout will be 2000 ms. It can be overwritten for partial test with a command line parameter: mocha m..

Sending JSON to PHP using ajax

I want to send some data in json format to php and do some operation in php. My problem is i can't send json data via ajax to my php file.Please help me how can i do that. I have tried this way.. <..

Use VBA to Clear Immediate Window?

Does anyone know how to clear the immediate window using VBA? While I can always clear it myself manually, I am curious if there is a way to do this programmatically...

paint() and repaint() in Java

I've spent maybe the last two hours browsing and reading up on these methods and the Graphics class, and maybe I'm stupid, haha, but I'm just not understanding them. What are they for? I understand th..

Parsing CSV files in C#, with header

Is there a default/official/recommended way to parse CSV files in C#? I don't want to roll my own parser. Also, I've seen instances of people using ODBC/OLE DB to read CSV via the Text driver, and a ..

How to pretty-print a numpy.array without scientific notation and with given precision?

I'm curious, whether there is any way to print formatted numpy.arrays, e.g., in a way similar to this: x = 1.23456 print '%.3f' % x If I want to print the numpy.array of floats, it prints several d..

Dynamically add data to a javascript map

Is there a way I can dynamically add data to a map in javascript. A map.put(key,value)? I am using the yui libraries for javascript, but didn't see anything there to support this. ..

POST request with JSON body

I would like to add a post to a Blogger blog via PHP. Google provided the example below. How to use that with PHP? You can add a post for a blog by sending a POST request to the post collection ..

How to remove last n characters from a string in Bash?

I have a variable var in a Bash script holding a string, like: echo $var "some string.rtf" I want to remove the last 4 characters of this string and assign the result to a new variable var2, so tha..

Dart: mapping a list (

I have a list of Strings, e.g., var moviesTitles = ['Inception', 'Heat', 'Spider Man']; and wanted to use to convert them to a list of Tab Widgets in Flutter...

How can I do time/hours arithmetic in Google Spreadsheet?

How do I do time/hour arithmetic in a Google spreadsheet? I have a value that is time (e.g., 36:00:00) and I want to divide it by another time (e.g., 3:00:00) and get 12. If I divide just one by the..

How do I convert a dictionary to a JSON String in C#?

I want to convert my Dictionary<int,List<int>> to JSON string. Does anyone know how to achieve this in C#?..

Check orientation on Android phone

How can I check if the Android phone is in Landscape or Portrait? ..

How to set the Android progressbar's height?

My activity_main.xml is below, as you see, the height is set 40 dip. And in MyEclipse, it looks like below: But when I run it on my phone, it looks like below: So my question is why the re..

what is the size of an enum type data in C++?

This is a C++ interview test question not homework. #include <iostream> using namespace std; enum months_t { january, february, march, april, may, june, july, august, september, october,..

How can I format a list to print each element on a separate line in python?

How can I format a list to print each element on a separate line? For example I have: mylist = ['10', '12', '14'] and I wish to format the list so it prints like this: 10 12 14 so the \n, bracke..

http://localhost:8080/ Access Error: 404 -- Not Found Cannot locate document: /

I'm really very new to this Tomcat stuff. I downloaded Tomcat 7.0 windows installer and installed it using the default configuration. After installing, I typed localhost:8080 in my browser to see if T..

How does the enhanced for statement work for arrays, and how to get an iterator for an array?

Given the following code snippet: int[] arr = {1, 2, 3}; for (int i : arr) System.out.println(i); I have the following questions: How does the above for-each loop work? How do I get an iterat..

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver

I'm running an AWS EC2 g2.2xlarge instance with Ubuntu 14.04 LTS. I'd like to observe the GPU utilization while training my TensorFlow models. I get an error trying to run 'nvidia-smi'. ubuntu@ip-10-..

Invalid CSRF Token 'null' was found on the request parameter '_csrf' or header 'X-CSRF-TOKEN'

After configuring Spring Security 3.2, _csrf.token is not bound to a request or a session object. This is the spring security config: <http pattern="/login.jsp" security="none"/> <http>..

Html.Raw() in ASP.NET MVC Razor view

@{int count = 0;} @foreach (var item in Model.Resources) { @(count <= 3 ? Html.Raw("<div class=\"resource-row\">").ToString() : Html.Raw("")) // some co..

Getting only Month and Year from SQL DATE

I need to access only Month.Year from Date field in SQL Server...

How to manage local vs production settings in Django?

What is the recommended way of handling settings for local development and the production server? Some of them (like constants, etc) can be changed/accessed in both, but some of them (like paths to st..

How to print a specific row of a pandas DataFrame?

I have a massive dataframe, and I'm getting the error: TypeError: ("Empty 'DataFrame': no numeric data to plot", 'occurred at index 159220') I've already dropped nulls, and checked dtypes for the Da..

Why should a Java class implement comparable?

Why is Java Comparable used? Why would someone implement Comparable in a class? What is a real life example where you need to implement comparable?..

Using jQuery To Get Size of Viewport

How do I use jQuery to determine the size of the browser viewport, and to redetect this if the page is resized? I need to make an IFRAME size into this space (coming in a little on each margin). For ..

Changing CSS Values with Javascript

It's easy to set inline CSS values with javascript. If I want to change the width and I have html like this: <div style="width: 10px"></div> All I need to do is: document.getElementByI..

SQL Inner Join On Null Values

I have a Join SELECT * FROM Y INNER JOIN X ON ISNULL(X.QID, 0) = ISNULL(y.QID, 0) Isnull in a Join like this makes it slow. It's like having a conditional Join. Is there any work around to somet..

TypeError: 'undefined' is not an object

I have a currently fairly dysfunctional Javascript program that's been causing me problems. However, it throws one error that I just don't understand: TypeError: 'undefined' is not an object (evaluat..

Error: [ng:areq] from angular controller

This is a long shot, but has anyone seen this error before? I am trying to add 'Transporters' using express, angular and mongoDB. I get this error whenever I access a page ruled by the transporters co..

PHP7 : install ext-dom issue

I'm running laravel 5.4 on Ubuntu 16.04 server with PHP7. trying to install cviebrock/eloquent-sluggable package throw some error: pish@let:/home/sherk/ftp/www$ sudo composer require cviebrock/eloque..

Unix - create path of folders and file

I know you can do mkdir to create a directory and touch to create a file, but is there no way to do both operations in one go? i.e. if I want to do the below when the folder other does not exist: cp..

How to access property of anonymous type in C#?

I have this: List<object> nodes = new List<object>(); nodes.Add( new { Checked = false, depth = 1, id = "div_" + d.Id }); ... and I'm wondering if I can..

cpp / c++ get pointer value or depointerize pointer

I was wondering if it's possible to make a pointer not a pointer.. The problem is I have a function that accepts a pointer for an paramater for me to easily get a value to that pointer. It's a simple..

PHP Converting Integer to Date, reverse of strtotime

<?php echo strtotime("2014-01-01 00:00:01")."<hr>"; // output is 1388516401 ?> I am surprised if it can be reverse. I mean can I convert 1388516401 to 2014-01-01 00:00:01. What I actuall..

How to select option in drop down protractorjs e2e tests

I am trying to select an option from a drop down for the angular e2e tests using protractor. Here is the code snippet of the select option: <select id="locregion" class="create_select ng-pristine..

Google Maps API throws "Uncaught ReferenceError: google is not defined" only when using AJAX

I have a page that uses the Google Maps API to display a map. When I load the page directly, the map appears. However, when I try to load the page using AJAX, I get the error: Uncaught ReferenceErro..

Sending JWT token in the headers with Postman

I'm testing an implementation of JWT Token based security based off the following article. I have successfully received a token from the test server. I can't figure out how to have the Chrome POSTMAN ..

MVC 3: How to render a view without its layout page when loaded via ajax?

I am learning about Progressive Enhancement and I have a question about AJAXifying views. In my MVC 3 project I have a layout page, a viewstart page, and two plain views. The viewstart page is in the..

How do I get the key at a specific index from a Dictionary in Swift?

I have a Dictionary in Swift and I would like to get a key at a specific index. var myDict : Dictionary<String,MyClass> = Dictionary<String,MyClass>() I know that I can iterate over th..

How do I expand the output display to see more columns of a pandas DataFrame?

Is there a way to widen the display of output in either interactive or script-execution mode? Specifically, I am using the describe() function on a pandas DataFrame. When the DataFrame is 5 columns ..

How can I uninstall Ruby on ubuntu?

How can I uninstall Ruby 1.9.2dev (2010-07-02) [i486-linux] on ubuntu? Need to reinstall - please help..

How many values can be represented with n bits?

For example, if n=9, then how many different values can be represented in 9 binary digits (bits)? My thinking is that if I set each of those 9 bits to 1, I will make the highest number possible that ..

How to find event listeners on a DOM node when debugging or from the JavaScript code?

I have a page where some event listeners are attached to input boxes and select boxes. Is there a way to find out which event listeners are observing a particular DOM node and for what event? Events ..

How to draw border around a UILabel?

Is there a way for UILabel to draw a border around itself? This is useful for me to debug the text placement and to see the placement and how big the label actually is...

How to connect to mysql with laravel?

This is such a simple basic question I don't think there is much people asking this but simply how do I connect to mySql through localhost phpmyadmin with laravel (I've searched, there is some stuff, ..

What difference is there between WebClient and HTTPWebRequest classes in .NET?

What difference is there between the WebClient and the HttpWebRequest classes in .NET? They both do very similar things. In fact, why weren't they merged into one class (too many methods/variables etc..

Writing to an Excel spreadsheet

I am new to Python. I need to write some data from my program to a spreadsheet. I've searched online and there seem to be many packages available (xlwt, XlsXcessive, openpyxl). Others suggest to write..


Does anybody know what the following Chrome error is? Failed to load resource: net::ERR_CACHE_MISS I have had a look online, but have not found a good answer yet. Somebody said it might be related ..

How many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?

In Firefox 3, the answer is 6 per domain: as soon as a 7th XmlHttpRequest (on any tab) to the same domain is fired, it is queued until one of the other 6 finish. What are the numbers for the other ma..

PHP JSON String, escape Double Quotes for JS output

I'm creating a JSON string from a PHP array. I've encoded it using json_encode(). $data = array( 'title' => 'Example string\'s with "special" characters' ); $data = json_encode( $data ); $d..

javascript how to create a validation error message without using alert

I am looking to make a simple form validation error message that displays under the username field. I cannot seem to figure it out. <form name ="myform" onsubmit="validation()"> Username..

Using Apache httpclient for https

I have enabled https in tomcat and have a self-signed certificate for server auth. I have created an http client using Apache httpClient. I have set a trust manager loading the server certificate. The..

Get the Query Executed in Laravel 3/4

How can I retrieve the raw executed SQL query in Laravel 3/4 using Laravel Query Builder or Eloquent ORM? For example, something like this: DB::table('users')->where_status(1)->get(); Or: (..