I have an application in C++ and OpenCV which tries to use the classification model realized with SVMLight in order to add the weight values which can be use for HOG Calssificator under OpenCV.
The p..
For example, the result of this:
df.filter("project = 'en'").select("title","count").groupBy("title").sum()
would return an Array.
How to save a spark DataFrame as a csv file on disk ?..
I have a table called tblAccounts whose contents will come from an excel spreadsheet.
I am using MS SQL Server 2008 (x64) on a Windows 8.1 (x64)
I tried using the SQL Server Import/Export Wizard but..
I need to set the value of one column based on the value of another in a Pandas dataframe. This is the logic:
if df['c1'] == 'Value':
df['c2'] = 10
else:
df['c2'] = df['c3']
I am unable to ..
I found, that there is related question, about how to find if at least one item exists in a list:
How to check if one of the following items is in a list?
But what is the best and pythonic way to fin..
I’ve been trying to install Ms SQL Server 2005 for over two weeks now, and I’ve finally gotten to the point where the prerequisites all seem to be in place. Unfortunately, every time I try to inst..
I know it's an easy way of doing it but i didn't find it neither here nor on google.
So i was curious if there is a way to install multiple packages using pip.
Something like:
pip install progra1..
I am hiding a bunch of textboxes and it works fine, the problem is, the textboxes are in a table, so I also need to hide the corresponding labels.
the structure is something like this
<tr>
<..
I have come across CORS issues multiple times and can usually fix it but I want to really understand by seeing this from a MEAN stack paradigm.
Before I simply added middleware in my express server ..
This Java code:
public class XYZ {
public static void main(){
int toyNumber = 5;
XYZ temp = new XYZ();
temp.play(toyNumber);
System.out.println("Toy nu..
I want to build a web-based knowledge base system for our call center. To save some development time, I am looking for a open source. Does anybody know any good one out there?..
I have a large report I am running on sql server. It takes several minutes to run. I don't want users clicking run twice. Since i wrap the whole procedure in a transaction, how do I check to see if th..
How can I use ClassLoader.getResources() to find recursivly resources from my classpath?
E.g.
finding all resources in the META-INF "directory":
Imagine something like
getClass().getClassLoader(..
For a website with authentication in Angular2, I want to use a component of the authentication submodule in the main app component. However, I keep getting the following error:
app/app.component.ts(..
I'm reading an excel-file (file extension xlsx) using org.apache.poi 3.15.
This is my code:
try (FileInputStream fileInputStream = new FileInputStream(file); XSSFWorkbook workbook = new XSSFWorkboo..
In my application's architecture I usually send the object or list of objects from the data access layer to the web layer via the service layer, in which these objects get transformed from a DAO objec..
I have this multidimensional array. I need to search it and return only the key that matches the value of the "slug". I know there are other threads about searching multidimensional arrays, but I'm no..
I'm currently using a single query in two places to get a row from a database.
BlogPost post = (from p in dc.BlogPosts
where p.BlogPostID == ID
select p).Single();
..
Is there any way to have a regex in JavaScript that validates dates of multiple formats, like: DD-MM-YYYY or DD.MM.YYYY or DD/MM/YYYY etc? I need all these in one regex and I'm not really good with it..
In my Android app, I have this layout:
<?xml version="1.0" encoding="utf-8" ?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_pa..
When testing for equality of String's in Java I have always used equals() because to me this seems to be the most natural method for it. After all, its name already says what it is intended to do. How..
input type="submit" and button tag are they interchangeable? or if there is any difference then When to use input type="submit" and when button ?
And if there is no difference then why we have 2 tags..
There are two not equals operator - != and <>.
What's the difference between them? I heard that != is more efficient than other for comparing strings. Could anyone give a qualitative comment o..
I need to add the current year as a variable in an SQL statement, how can I retrieve the current year using SQL?
i.e.
BETWEEN
TO_DATE('01/01/**currentYear** 00:00:00', 'DD/MM/YYYY HH24:MI:SS..
A colleague at work made some changes to one of our macro workbooks and now on my PC only I receive the dreaded Run-time Error '32809' when I attempt to run it. This latest version runs fine on his PC..
I read in a string from a GUI textbox entered by the user and process it through pandoc. The string contains latex directives for math which have backslash characters. I want to send in the string as ..
Is there a set of preferred naming conventions for MongoDB entitites such as databases, collections, field names?
I was thinking along these lines:
Databases: consist of the purpose (word in singul..
What is correct syntax for an ALTER statement to add a default value to an existing column?
I can add new column with no errors:
ALTER TABLE tb_TableName ADD Record_Status varchar(20)
But If I try..
I am rarely getting this error while making an API call.
java.lang.IllegalStateException: Fragment not attached to Activity
I tried putting the code inside isAdded() method to check whether fragm..
I can't believe that I'm asking an obvious question, but I still get the error in console log.
Console says that it can't find the module in the directory, but I've checked at least 10 times for typo..
I am trying to call getCallCapablePhoneAccounts() method of android.telecom.TelecomManager class. Though i have added required user-permission, i am getting Security exception.
Here is the line of co..
I have a header on my page which is just over 100px (111px to be exact)
The div below it needs to extend to the bottom of the viewport, as if i had set the bottom to 0px. The problem lies in the fact ..
Is it possible to run a web application using Tomcat Server in Intellij Idea Community Edition?
I tried to find some information about it but haven't achived any success...
I need to click on the below href element,which is present among similar href elements.
<a id="oldcontent" href="listDetails.do?camp=1865"><u>Re-Call</u></a>
Can anyone prov..
I am using the tooltip. But I want that on image tag, like when I mouseover the image then the tooltip should work. I have tried but not working for me on image tag...
I cannot for the life of me attach the java source code to eclipse so I can see the inner workings of the language. Not even something as simple as the String Class.
when I run java -version this is ..
The best way I can describe what I'm looking for is to show you the failed code I've tried thus far:
case car
when ['honda', 'acura'].include?(car)
# code
when 'toyota' || 'lexus'
# code
..
I have this program that calculates the time taken to answer a specific question, and quits out of the while loop when answer is incorrect, but i want to delete the last calculation, so i can call min..
I have a big CLOB (more than 32kB) that I want to read to a String, using StringBuilder. How do I do this in the most efficient way? I can not use the "int length" constructor for StringBuilder since ..
i want to seting paper size in fpdf to a half of letter size, it's approximately 8.5x5.5 inc. How can i do that?
My fpdf function in php language is
$pdf = new FPDF('P','mm','?????');
is..
Using npm, I followed the getting started directions on the Angular CLI quick start page.
Angular CLI Quickstart
Running ng serve --open after creating and going into my new project "frontend" gave..
I'm converting an app to use fragments using the compatibility library.
Now currently I have a number of activities (A B C D) which chain onto one another, D has a button 'OK' which when pressed calls..
How can I remove last character from String variable using Swift? Can't find it in documentation.
Here is full example:
var expression = "45+22"
expression = expression.substringToIndex(countElement..
This is my python code:
import subprocess
subprocess.check_output("ls",shell=True,stderr=subprocess.STDOUT)
import subprocess
subprocess.check_output("yum",shell=True,stderr=subprocess.STDOUT)
The..
I had a plugin installed in Visual Studio 2008, and it created some extra dockable windows. I have uninstalled it, and I can't get rid of the windows it created - I close them, but they always come b..
In Objective C, one could do the following to check for strings:
if ([myString isEqualToString:@""]) {
NSLog(@"myString IS empty!");
} else {
NSLog(@"myString IS NOT empty, it is: %@", myStri..
How can I use more than @font-face rule in my CSS?
I've inserted this into my stylesheet:
body {
background: #fff url(../images/body-bg-corporate.gif) repeat-x;
padding-bottom: 10px;
fon..
I am writing a PowerShell script to create several directories if they do not exist.
The filesystem looks similar to this
D:\
D:\TopDirec\SubDirec\Project1\Revision1\Reports\
D:\TopDirec\SubDirec\Pr..
What would be a nice way to go from {2:3, 1:89, 4:5, 3:0} to {1:89, 2:3, 3:0, 4:5}?
I checked some posts but they all use the "sorted" operator that returns tuples. ..
I have the following php script to read the request in URL :
$id = '/' != ($_SERVER['REQUEST_URI']) ?
str_replace('/?id=' ,"", $_SERVER['REQUEST_URI']) : 0;
It was used when the URL is http://..
I'm dynamically adding rows to a table using jQuery.
The table is inside a div which has overflow:auto thus causing a vertical scrollbar.
I now want to autoscroll my container div to the last row. Wh..
Let's say I have the following string:
something1: +12.0 (some unnecessary trailing data (this must go))
something2: +15.5 (some more unnecessary trailing data)
something4: +9.0 (some ..
I wonder why git tells me this?
$ git diff MyFile.txt
diff --git a/MyFile.txt b/MyFile.txt
index d41a4f3..15dcfa2 100644
Binary files a/MyFile.txt and b/MyFile.txt differ
Aren't they text files?
I ha..
I want to create a div that can change its width/height as the window's width changes.
Are there any CSS3 rules that would allow the height to change according to the width, while maintaining its asp..
I have this error since a long time but can't figure it out :
Caught TypeError while rendering: coercing to Unicode: need string or buffer, NoneType found
It happens in admin when I try to add or mo..
I have a python web form with two options - File upload and textarea. I need to take the values from each and pass them to another command-line program. I can easily pass the file name with file uploa..
I need to add an element to Array specifying position and value.
For example, I have Array
int []a = {1, 2, 3, 4, 5, 6};
after applying addPos(int 4, int 87) it should be
int []a = {1, 2, 3, 4, 87..
I see that within MySQL there are Cast() and Convert() functions to create integers from values, but is there any way to check to see if a value is an integer? Something like is_int() in PHP is what ..
I staged a lot of files using git add, now I want to see all the files I have staged, without untracked files or changed but unstaged files.
How do I do that? When using git diff --cached I can see t..
I am migrating from Spring 2.5 to Spring 3.
They have introduced <mvc:annotation-driven /> which does some black magic. This is expected to be declared in servlet configuration file only.
In ..
How can I retrieve the value of specified column of the selected row in a multicolumn listbox?
I populate the listbox by setting the RowSource property with a SQL string. BoundColumn set to value 1.
..
I haven't used C in over 3 years, I'm pretty rusty on a lot of things.
I know this may seem stupid but I cannot return a string from a function at the moment. Please assume that: I cannot use string...
I want to have a unique constraint on a column which I am going to populate with GUIDs. However, my data contains null values for this columns. How do I create the constraint that allows multiple null..
I have two queries which return separate result sets, and the queries are returning the correct output.
How can I combine these two queries into one so that I can get one single result set with each ..
I ran git cherry-pick <hash> and had merge conflicts. I don't want to resolve the conflicts, I just want to abort the cherry-pick. When doing an actual merge (with git merge) there's the handy g..
I want to know how to get remainder and quotient in single value in Java.
Example:
3/2 I should get value as 1.5.
If I use the / operator I get only the quotient. If I user the % operator I ..
I've just switch to Android Studio 0.5.1, and the things going so slow here, because nothing works in the regular way...
How do I import the necessary classes with shortcut?
I mean like this ones?
..
I know it's possible to match a word and then reverse the matches using other tools (e.g. grep -v). However, is it possible to match lines that do not contain a specific word, e.g. hede, using a regul..
How to make a record into the logfile the contents of the HTTP request header (all) as received by apache?
Currently my apache combined log format configuration is:
LogFormat "%h %l %u %t \"%r\" %&g..
I'm trying to select the first h1 inside a div with a class called detail_container. It works if h1 is the first element within this div, but if it comes after this ul it won't work.
<style type="..
<button id="'+item['id']+'" class="btnDeactivateKeyInChildPremiumCustomer waves-effect waves-light">ok</button>
I used above code for generating button inside of jquer..
I am trying to get the number of occurrences of a certain character such as & in the following string.
string test = "key1=value1&key2=value2&key3=value3";
How do I determine that there..
I'm trying to load up image in my Image Folder, but it's not working.
Upon debugging, I see this error:
Failed to load resource: the server responded with a status of 404 (Not Found)
My image..
I'm trying to make a presentation using the Beamer class. I want to show a simple list of images, one by one in one frame, just like when you use itemize<+->.
I have no problem showing the images ..
I am using Oracle 10.2.
I am working in some scripts to move some ORACLE Objects from one SCHEMA (S1) to another (S2).
I am creating the functions with DBA role.
When moved, one of my functions beco..
This is the problem:
Given the following program in Python, suppose that the user enters the number 4 from the keyboard. What will be the value returned?
N = int(input("enter a positive integer:"))
..
Is there a tutorial or code example of using Ajax.BeginForm within Asp.net MVC 3 where unobtrusive validation and Ajax exist?
This is an elusive topic for MVC 3, and I cannot seem to get my form to w..
I am getting the following error while trying to import from sklearn:
>>> from sklearn import svm
Traceback (most recent call last):
File "<pyshell#17>", line 1, in <module>
..
Is there a Python method to create directories recursively? I have this path:
/home/dail/
I would like to create
/home/dail/first/second/third
Can I do it recursively or I have to create one dir..
I would like to use conditions in my CSS.
The idea is that I have a variable that I replace when the site is run to generate the right style-sheet.
I want it so that according to this variable the s..
I am trying to include some dependencies in my Maven project. These dependencies are not available in the default Maven 2 repository http://repo1.maven.org/maven2/.
They are available at http://mvnrep..
So the following code is in Angular 4 and I can't figure out why it doesn't work the way as expected.
Here is a snippet of my handler:
onUpdatingServerName(event: Event) {
console.log(event);
th..
I am sure making a silly mistake but I can't figure what:
In SQL Server 2005 I am trying select all customers except those who have made a reservation before 2 AM.
When I run this query:
SELECT idC..
Question is simple. How to add column x to table y, but only when x column doesn't exist ? I found only solution here how to check if column exists.
SELECT column_name
FROM information_schema.colum..
I have a couple of questions actually.
I have a class Dog with the following instance fields:
private int id;
private int id_mother;
private int id_father;
private String name="";
private String own..
What is the quickest way to read a text file into a string variable?
I understand it can be done in several ways, such as read individual bytes and then convert those to string. I was looking for a m..
I have a simple script where the first argument is reserved for the filename, and all other optional arguments should be passed to other parts of the script.
Using Google I found this wiki, but it pr..
I have managed to corrupt my npm install, and whenever I try to install packages using npm install, I receive error messages along these lines:
Unhandled rejection Error: EACCES: permission denied..
I know that in sql server we cannot use Group_concat function but here is one issue i have in which i need to Group_Concat my query.I google it found some logic but not able to correct it.My sql query..
My simple goal is to fade animate hiding and showing functions.
Button.hidden = YES;
Simple enough. However, is it possible to have it fade out rather than just disappearing? It looks rather unprof..
Following is my code snippet. I want to validate my dropdown using angular.
<td align="left" width="52%">
<span class="requiredSmall">*</span>
<select class="Sitedropdow..
I am trying to configure hibernate orm mapping tool to my java class and using PostgreSQL as my database and configured the password as "password". When I tried to run the application, I hav..
This seems a common error but while I've found a work-around (see below) I can't pin down the reason I'm getting it in the first place.
I am writing SMTP functionality into our application and I'm at..
I was using this in my iPhone app
if (title == nil) {
// do something
}
but it throws some exception, and the console shows that the title is "(null)".
So I'm using this now:
if (title == nil..
I have a mavenized codebased configured Spring 3.2.4 web app.
When I build the app with Maven/pom.xml first I got an error that web.xml is missing.
first I tried to create an empty web.xml. this was..
I have a table called patient_address, which reference a PK key in patient table. But if i try to run one of the following statements :
update patient set id_no='7008255601088' where id_no='800825560..
Recently I have installed the last version of Android Studio (Android Studio 2.1), keeping the old 1.2 version previously installed. Now i have Android Studio 2.1 and Android Studio 1.2. In Android S..
I had a feature branch of my trunk and was merging changes from my trunk into my branch periodically and everything was working fine. Today I went to merge the branch back down into the trunk and any ..
I am getting a RuntimeException on Android 2.3.5 but I am using Theme.AppCompat (res/values/themes.xml). This is the phone: http://www.gsmarena.com/samsung_galaxy_y_s5360-4117.php
<!-- res/values..
Ok, so I have the following query:
SELECT MIN(`date`), `player_name`
FROM `player_playtime`
GROUP BY `player_name`
I then need to use this result inside the following query:
SELECT DATE(`date`) , ..
Possible Duplicates:
What’s the use of do while(0) when we define a macro?
Why are there sometimes meaningless do/while and if/else statements in C/C++ macros?
do { … } while (0..
When starting the jboss server, it giving an error Failed to start service jboss.deployment.unit."jbpm-console.war". But when i'm running jbpm6 demo using start.demo its working fine.
23:43:41,042 ER..
I am having trouble getting the contents of JSON object from a JQery.ajax call. My call:
$('#Search').click(function () {
var query = $('#query').valueOf();
$.ajax({
url: '/Products/S..
I just encountered a problem when merging a branch into master in git. First, I got the branch name by running git ls-remote. Let's call that branch "branch-name". I then ran git merge branch-name com..
I'm trying to extract the parameters of my URL, something like this.
/Administration/Customer/Edit/1
extract: 1
/Administration/Product/Edit/18?allowed=true
extract: 18?allowed=true
/Administrati..
I need to sign Android application (.apk).
I have .pfx file. I converted it to .cer file via Internet Explorer and then converted .cer to .keystore using keytool. Then I've tried to sign .apk with jar..
I want to represent an empty character in Java as "" in String...
Like that char ch = an empty character;
Actually I want to replace a character without leaving space.
I think it might be suffici..
I want the jar file for org.apache.http package but I am not able to find it,can anyone let me know from where can I download it?
I was not able to find the jar even in Apache site as well findjar.co ..
I have a problem. I have found the HTML code for the downwards arrow, ↓ (↓)
Cool. Now I need to use it in CSS like so:
nav a:hover {content:"&darr";}
That obviously won't work si..
I have several places with their latitude and longitude. I want to display them in google map. Thats ok, what i can't is to display the marker at the specific lat,long position.
e.g. if i've the foll..
Hey, I need to delete all images from a string and I just can't find the right way to do it.
Here is what I tryed, but it doesn't work:
preg_replace("/<img[^>]+\>/i", "(image) ", $content);..
In Laravel, if I perform a query:
$foods = Food::where(...)->get();
...then $foods is an Illuminate Collection of Food model objects. (Essentially an array of models.)
However, the keys of thi..
I've created an application in Angular JS for downloading an Excel workbook through $http post.
In the below code I'm passing the information in the form of JSON , and send it to the server REST web ..
I'm just wondering why we usually use logical OR || between two booleans not bitwise OR |, though they are both working well.
I mean, look at the following:
if(true | true) // pass
if(true | fals..
I have found a myriad of libraries in order to use svg in Android and avoid the frustrating creation of different resolutions and dropping files for each resolution, this becomes very annoying when th..
Possible Duplicate:
Extending JavaScript's Date.parse to allow for DD/MM/YYYY (non-US formatted dates)?
Convert dd-mm-yyyy string to date
Entered a date in textbox, for example: 05/09..
Given an XML structure like so:
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<title lang="eng">Harry Potter</title>
<price>29.99</price&..
def shuffle(self, x, random=None, int=int):
"""x, random=random.random -> shuffle list x in place; return None.
Optional arg random is a 0-argument function returning a random
float in..
Howdy, I'm having a bit of an issue runnning a NAnt script that used to properly build my .Net 2.0 based website, when compiling with VS2008 and it's associated tools. I've recently upgraded all the ..
I have some HTML with two divs:
<div>
<div id="backdrop"><img alt="" src='/backdrop.png' /></div>
<div id="curtain" style="background-image:url(/curtain.png);background..
I need to display a tooltip on a disabled button and remove it on an enabled button. Currently, it works in reverse.
What is the best way to invert this behaviour?
_x000D_
_x000D_
$('[rel=tooltip]')..
I was trying to work out with multiple layout using some online tutorials. The thing is my program was building and compiling correctly as long as there was only one XML file. When I added multiple XM..
I downloaded the driver and I gave the exact path in my code but when I ran the code it shows me error
my code with java is as below:
System.out.println("Internet Explorer is selected");
System.setP..
I am writing a bash shell script to display if a process is running or not.
So far, I got this:
printf "%-50s %s\n" $PROC_NAME [UP]
The code gives me this output:
JBoss ..
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..
I am trying to run the SQL Select query in my C# code. But I always get the -1 output on
int result = command.ExecuteNonQuery();
However, the same table if I use for delete or insert works...
Co..
I am trying to reverse engineer an ancient program written using VBA in excel and formulas in cells.
There are many cells with values scattered across everywhere. Is there a fast way to check if a cel..
I am trying to set up my database in MySQL using XAMPP. I am doing this via phpMyAdmin on localhost(Apache is running). The only action on my part is typing in a new, unused, name for a database, clic..
var arr = [1,2,3,5,6];
Remove the first element
I want to remove the first element of the array so that it becomes:
var arr = [2,3,5,6];
Remove the second element
To extend this question, what ..
I need to find the most recently modified file in a directory.
I know I can loop through every file in a folder and compare File.GetLastWriteTime, but is there a better way to do this without loopin..
I installed PostgreSQL on my local server (Ubuntu) with IP 192.168.1.10. Now, I'm trying to access the database from my client machine (Ubuntu) with IP 192.168.1.11 with pgAdmin.
I know I have to ma..
I have 3 repos. A bare repo which I use as a master repo, a dev repo in which I make and test changes, and prod repo from which scripts are executed in the prod environment.
After I have tested chang..
Trying to install Composer dependency management tool on Win7/64 + WampServer 2.2 via the Setup Installer and I am getting the following message:
The openssl extension is missing, which will reduc..
I have the below global jQuery function stored, but on page load, I want to execute it after a 1000 delay. Is there something wrong with my syntax? I know the delay always goes before the function. It..
I have an amazon s3 bucket that has tens of thousands of filenames in it. What's the easiest way to get a text file that lists all the filenames in the bucket?..
My situation:
var id_tag = [1,2,3,78,5,6,7,8,47,34,90];
I would like to delete where id_tag = 90 and to return:
var id_tag = [1,2,3,78,5,6,7,8,47,34];
How can I do that?..
It seems to be a lame question, but I cannot to figure it out. How to import popper.js which comes toghether with Bootstrap 4 beta?
I use bower and I've installed Bootstrap 4 beta. Now in bower_compo..
How can the following be accomplished in Magento?
Display a "Hello World" message using a controller/view/model approach. So, if I went to http://example.com/myController it would show the string 'H..
Okay, this is really confusing me. I have some content inside of a div like so:
<div style="background-color: green; width: 200px; height: 300px;">
Thisisatest.Thisisatest.Thisisatest.Thisisat..
How can several tags be attached to one Docker image? Is it possible to create multiple tags using one Dockerfile?
It is possible, somehow; for example docker pull ubuntu will get several images, some..
I have a GridView which is databound, on button_click I want to read the GridView row by row each column and read the value of each cell in a row and update a table in database? I also know how to che..
Is there any way in android to adjust the textsize in a textview to fit the space it occupies?
E.g. I'm using a TableLayout and adding several TextViews to each row. Since I don't want the TextViews ..
I'm using mongodb and I store datetime in my database in this way
for a date "17-11-2011 18:00" I store:
date = datetime.datetime(2011, 11, 17, 18, 0)
db.mydatabase.mycollection.insert({"date" : dat..
I'm pretty new to the Spring Framework, I've been playing around with it and putting a few samples apps together for the purposes of evaluating Spring MVC for use in an upcoming company project. So fa..
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..
Most of the examples shows how to read text file from exact location (f.e. "C:\Users\Owner\Documents\test1.txt"). But, how to read text files without writing full path, so my code would work when copi..
Is there a way to pass more data into a callback function in jQuery?
I have two functions and I want the callback to the $.post, for example, to pass in both the resulting data of the AJAX call, as w..
So I have this slider component that use materializecss javascript. So after it's rendered, I need to execute
$(document).ready(function(){
$('body').on('Slider-Loaded',function(){
consol..
Let's say I have a serializable class AppMessage.
I would like to transmit it as byte[] over sockets to another machine where it is rebuilt from the bytes received.
How could I achieve this?..
I have float left and float right <div> nested within a light blue box div as shown in the image below. I can't figure out how to insert a vertical line between them as shown in this image:
..
When I can call the 3rd party api and get back a single class worth of data everything deserialises fine using this code
TheUser me = jsonSerializer.Deserialize(response, typeof(TheUser)) as TheUser..
In the Windows command prompt, I can type notepad helloworld.cpp which will then create a .cpp file with the name helloworld and open up Notepad for me.
Is there a similar function for Mac Terminal, ..
Converting a C++ string to a char array is pretty straightorward using the c_str function of string and then doing strcpy. However, how to do the opposite?
I have a char array like: char arr[ ] = "Th..
If I'm using terminal and typing in a line of text for a command, is there a hotkey or any way to clear/delete that line?
For example, if my current line/command is something really long like:
> ..
What do all of the X11/w3c color codes look like in the format of an Android XML resource file?
I know this looks a tad ridiculous as a question, but given the votes apparently it's useful and sin..
I need to get the names of all the Excel files in a folder and then make changes to each file. I've gotten the "make changes" part sorted out. Is there a way to get a list of the .xlsx files in one fo..
I am working on an a PHP web application and i need to perform some network operations in the request like fetching someone from remote server based on user's request.
Is it possible to simulate asyn..
I have two constructors which feed values to readonly fields.
public class Sample
{
public Sample(string theIntAsString)
{
int i = int.Parse(theIntAsString);
_intField = i;
..
Given a jenkins build pipeline, jenkins injects a variable env into the node{}. Variable env holds environment variables and values.
For example, environment variable BRANCH_NAME can be accessed with
..
I'm using the DataType.Date attribute on my model and an EditorFor in my view. This is working fine in Internet Explorer 8 and Internet Explorer 9, but in Google Chrome it is showi..
I want to grant access to a user to a specific database with read and write access. The user is already available in the domain but not in the DB.
So, how can I give them that access with creating a ..
I have a very simple question. I need to have a second x-axis on my plot and I want that this axis has a certain number of tics that correspond to certain position of the first axis.
Let's try with a..
I was surprised to find that the following example code only updates a single document:
> db.test.save({"_id":1, "foo":"bar"});
> db.test.save({"_id":2, "foo":"bar"});
> db.test.update({"fo..
I have the following dictionary in python:
d = {'1': 'one', '3': 'three', '2': 'two', '5': 'five', '4': 'four'}
I need a way to find if a value such as "one" or "two" exists in this dictionary.
F..
I'm trying to write the following in order to get a running total of distinct NumUsers, like so:
NumUsers = COUNT(DISTINCT [UserAccountKey]) OVER (PARTITION BY [Mth])
Management studio doesn't seem..
I am trying to convert a char[] in ASCII to char[] in hexadecimal.
Something like this:
hello --> 68656C6C6F
I want to read by keyboard the string. It has to be 16 characters long.
This is my code..
I have a table Orders with the following fields:
Id | SubTotal | Tax | Shipping | DateCreated
The Id column is set to autoincrement(1,1).
This is to be used in an E-commerce storefront. Sometim..
I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the correct syntax for the SQ..
I find %~dp0 very useful, and I use it a lot to make my batch files more portable.
But the label itself seems very cryptic to me... What is the ~ doing? Does dp mean drive and path? Does the 0 refer ..
I developed an application to display some text at defined intervals in the Android emulator screen. I am using the Handler class. Here is a snippet from my code:
handler = new Handler();
Runnable r ..
Alright, I've dabbled in JavaScript before, but the most useful thing I've written is a CSS style-switcher. So I'm somewhat new to this. Let's say I have HTML code like this:
<div id="foo"..
I have multiple property files that I want to load from classpath. There is one default set under /src/main/resources which is part of myapp.jar. My springcontext expects files to be on the classpath...
Yes, I know this subject has been covered before (here, here, here, here), but as far as I know, all solutions, except for one, fail on a list like this:
L = [[[1, 2, 3], [4, 5]], 6]
Where the desi..
I've created a new C++ project in Visual Studio 2008. No code has been written yet; Only project settings have been changed.
When I compile the project, I receive the following fatal error:
fat..
I'm using php 5.3 on my local machine. On our webserver we have php 4.8. Our server is a shared server. So I want to change the php version on our server via .htaccess file. Is it possible to do it? I..
I want to create a new column in a pandas data frame by applying a function to two existing columns. Following this answer I've been able to create a new column when I only need one column as an argum..