Questions Tagged with #Vwdexpress

Caesar Cipher Function in Python

I'm trying to create a simple Caesar Cipher function in Python that shifts letters based on input from the user and creates a final, new string at the end. The only problem is that the final cipher te..

Changing image on hover with CSS/HTML

I have this problem where I have set an image to display another image when the mouse hovers over, however the first image still appears and the new one doesn't change height and width and overlaps th..

How do I select between the 1st day of the current month and current day in MySQL?

I need to select data from MySQL database between the 1st day of the current month and current day. select*from table_name where date between "1st day of current month" and "current day" Can someo..

How to retrieve current workspace using Jenkins Pipeline Groovy script?

I am trying to get the current workspace of my Jenkins build using a Groovy pipeline script: node('master') { // PULL IN ENVIRONMENT VARIABLES // Jenkins makes these variables available for e..

Clean out Eclipse workspace metadata

I use multiple workspaces with Eclipse. I recently noticed that some of my workspaces have a lot of cruft in them from software packages that I installed and then later removed. As far as I can tell, ..

How to jump to a particular line in a huge text file?

Are there any alternatives to the code below: startFromLine = 141978 # or whatever line I need to jump to urlsfile = open(filename, "rb", 0) linesCounter = 1 for line in urlsfile: if linesCoun..

DB query builder toArray() laravel 4

I'm trying to convert a query to an array with the method toArray() but it doesn't work for the query builder. Any ideas for convert it? Example DB::table('user')->where('name',=,'Jhon')->get(..

How to install multiple python packages at once using pip

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

Is there an alternative sleep function in C to milliseconds?

I have some source code that was compiled on Windows. I am converting it to run on Red Hat Linux. The source code has included the <windows.h> header file and the programmer has used the Sleep..

close fxml window by code, javafx

I need to close the current fxml window by code in the controller I know stage.close() or stage.hide() do this in fx how to implement this in fxml? I tried private void on_btnClose_clicked(Acti..

Convert character to ASCII code in JavaScript

How can I convert a character to its ASCII code using JavaScript? For example: get 10 from "\n". ..

Could pandas use column as index?

I have a spreadsheet like this: Locality 2005 2006 2007 2008 2009 ABBOTSFORD 427000 448000 602500 600000 638500 ABERFELDIE 534000 600000 735000 710000 775000 AIREYS INLET459..

what innerHTML is doing in javascript?

Can anyone tell me what innerHTML is doing in javascript and give me example how I can use it?..

Python Set Comprehension

So I have these two problems for a homework assignment and I'm stuck on the second one. Use a Python Set Comprehension (Python's equivalent of Set Builder notation) to generate a set of all of the ..

Getting Spring Application Context

Is there a way to statically/globally request a copy of the ApplicationContext in a Spring application? Assuming the main class starts up and initializes the application context, does it need to pass..

Reloading submodules in IPython

Currently I am working on a python project that contains sub modules and uses numpy/scipy. Ipython is used as interactive console. Unfortunately I am not very happy with workflow that I am using right..

How do I save a String to a text file using Java?

In Java, I have text from a text field in a String variable called "text". How can I save the contents of the "text" variable to a file?..

history.replaceState() example?

Can any one give a working example for history.replaceState? This is what says: history . replaceState(data, title [, url ] ) Updates the current entry in the session history to have..

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

What is the difference between map and flatMap and a good use case for each?

Can someone explain to me the difference between map and flatMap and what is a good use case for each? What does "flatten the results" mean? What is it good for?..

How to get parameter on Angular2 route in Angular way?

Route const appRoutes: Routes = [ { path: '', redirectTo: '/companies/unionbank', pathMatch: 'full'}, { path: 'companies/:bank', component: BanksComponent }, { path: '**', redirectTo: '/c..

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

Link to all Visual Studio $ variables

I was having a look at $(Configuration),$(ProjectDir) etc. in Visual Studio 2008 for Prebuild events. Is there a link to all of these variables with a definition for each one of them?..

Animation CSS3: display + opacity

I have got a problem with a CSS3 animation. .child { opacity: 0; display: none; -webkit-transition: opacity 0.5s ease-in-out; -moz-transition: opacity 0.5s ease-in-out; transit..

Conditional formatting based on another cell's value

I'm using Google Sheets for a daily dashboard. What I need is to change the background color of cell B5 based on the value of another cell - C5. If C5 is greater than 80% then the background color i..

What is the JUnit XML format specification that Hudson supports?

I have Hudson as continuous integration server and I want to use option 'Publish JUnit test result report'. But I don't use xUnit tools for testing, instead of that i have shell scripts which run test..

Powershell command to hide user from exchange address lists

I'm trying to write powershell script which hides user from exchange lists. I was able to find following command: Set-Mailbox -Identity [user id here] -HiddenFromAddressListsEnabled $true And it doe..

How can I reference a dll in the GAC from Visual Studio?

This assembly is in the GAC: Microsoft.SqlServer.Management.RegisteredServers.dll How can I add a reference to this assembly in Visual Studio? I can view the file in c:\windows\assembly\..

Where do I find the definition of size_t?

I see variables defined with this type but I don't know where it comes from, nor what is its purpose. Why not use int or unsigned int? (What about other "similar" types? Void_t, etc)...

How to enable mbstring from php.ini?

I have real difficulties with enabling mbstring extension on my localhost. I'm using XAMPP 1.7.4, for Windows, which has PHP 5.3.5, and tried to edit my php.ini file according to the documentation a..

Terminating a script in PowerShell

I've been looking for a way to terminate a PowerShell (PS1) script when an unrecoverable error occurs within a function. For example: function foo() { # Do stuff that causes an error $host.Ex..

How do I use Safe Area Layout programmatically?

Since I don't use storyboards to create my views, I was wondering if there's the "Use Safe Area Guides" option programmatically or something like that. I've tried to anchor my views to view.safeAr..

pull access denied repository does not exist or may require docker login

I am using Laravel 4.2 with docker. I setup it on local. It worked without any problem but when I am trying to setup online using same procedure then I am getting error pull access denied for <pro..

How to run iPhone emulator WITHOUT starting Xcode?

On my old Mac running Snow Leopard, I could type "ios" into spotlight and it would start up the iPhone/iPad emulator by itself. I have since had to get a new machine running Lion. I have installed Xc..

docker build with --build-arg with multiple arguments

According to the documentation, it's possible to define multiple args for the flag --build-arg, but I can't find out how. I tried the following: docker build -t essearch/ess-elasticsearch:1.7.6 --bui..

Search for string and get count in vi editor

I want to search for a string and find the number of occurrences in a file using the vi editor...

Reading PDF content with itextsharp dll in VB.NET or C#

How can I read PDF content with the itextsharp with the Pdfreader class. My PDF may include Plain text or Images of the text...

How do I connect to mongodb with node.js (and authenticate)?

How do I connect to mongodb with node.js? I have the node-mongodb-native driver. There's apparently 0 documentation. Is it something like this? var mongo = require('mongodb/lib/mongodb'); var Db=..

C# SQL Server - Passing a list to a stored procedure

I am calling a SQL Server stored procedure from my C# code: using (SqlConnection conn = new SqlConnection(connstring)) { conn.Open(); using (SqlCommand cmd = new SqlCommand("InsertQuerySPROC", ..

Is it possible to GROUP BY multiple columns using MySQL?

Is it possible to GROUP BY more than one column in a MySQL SELECT query? For example: GROUP BY fV.tier_id AND 'f.form_template_id' ..

What is the C# version of's InputDialog?

What is the C# version of's InputBox?..

Rails.env vs RAILS_ENV

I see both in examples when checking what env one is running in. What's preferred? Are they, for all intents and purposes equal?..

How do I abort the execution of a Python script?

I have a simple Python script that I want to stop executing if a condition is met. For example: done = True if done: # quit/stop/exit else: # do other stuff Essentially, I am looking for s..

Remove json element

I want to remove JSON element or one whole row from JSON. I have following JSON string: { "result":[ { "FirstName": "Test1", "LastName": "User", }, { ..

Google Chrome "" workaround?

I have been working on a web app and for part of it I need to open a new window. I have this working on all browsers, my sticking point is with Google Chrome. Chrome seems to ignore the window featur..

jQuery autoComplete view all on click?

I'm using jQuery's autocomplete in a relatively simple way: $(document).ready(function() { var data = [ {text: "Choice 1"}, {text: "Choice 2"}, {text: "Choice 3"} ] ..

#1064 -You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version

I'm new to PHP and MySQL and ran into a little trouble with a learning project I'm working on. Whenever I try to create a table CREATE TABLE transactions( id int NOT NULL AUTO_INCREMENT, location va..

Call Python function from MATLAB

I need to call a Python function from MATLAB. how can I do this?..

How to split a single column values to multiple column values?

I have a problem splitting single column values to multiple column values. For Example: Name ------------ abcd efgh ijk lmn opq asd j. asdjja asb (asdfas) asd asd and I need the output something l..

Embed image in a <button> element

I'm trying to display a png image on a <button> element in HTML. The button is the same size as the image, and the image is shown but for some reason not in the center - so it's impossible to se..

Get age from Birthdate

Possible Duplicate: Calculate age in JavaScript In some point of my JS code I have jquery date object which is person's birth date. I want to calculate person's age based on his birth date...

Simple two column html layout without using tables

I'm looking for a super easy method to create a two column format to display some data on a webpage. How can i achieve the same format as: <table> <tr> <td>AAA</td&g..

How to force maven update?

I imported my already working project on another computer and it started to download dependencies. Apparently my internet connection crashed and now I get the following: >Build errors for c..

How to use Google fonts in React.js?

I had built a website with React.js and webpack. I want to use Google fonts in the webpage, so I put the link in the section. Google Fonts <link href="

What's the Linq to SQL equivalent to TOP or LIMIT/OFFSET?

How do I do this Select top 10 Foo from MyTable in Linq to SQL?..

setImmediate vs. nextTick

Node.js version 0.10 was released today and introduced setImmediate. The API changes documentation suggests using it when doing recursive nextTick calls. From what MDN says it seems very similar to ..

Calling class staticmethod within the class body?

When I attempt to use a static method from within the body of the class, and define the static method using the built-in staticmethod function as a decorator, like this: class Klass(object): @st..

Reading numbers from a text file into an array in C

I'm a programming noob so please bear with me. I'm trying to read numbers from a text file into an array. The text file, "somenumbers.txt" simply holds 16 numbers as so "5623125698541159". #include ..

How do I navigate to another page when PHP script is done?

I have a simple POST script that I need to return to the page that was doing the Posting. Is there any way to do it like this? if($done) { //go to page } ..

How do I list all tables in a schema in Oracle SQL?

How do i list all tables in a schema in Oracle SQL?..

How to remove specific elements in a numpy array

How can I remove some specific elements from a numpy array? Say I have import numpy as np a = np.array([1,2,3,4,5,6,7,8,9]) I then want to remove 3,4,7 from a. All I know is the index of the value..

Error - trustAnchors parameter must be non-empty

I'm trying to configure my e-mail on Jenkins/Hudson, and I constantly receive the error: the trustAnchors parameter must be non-empty I've seen..

SCRIPT438: Object doesn't support property or method IE

I have an option in my application where users can deactivate their profiles. Only admin can activate them again. I have a class ActivateProfile with two methods userExist(userName) that checks if ..

Undefined Symbols for architecture x86_64: Compiling problems

So I am trying to start an assignment, my professor gives us a Main.cpp, Main.h, Scanner.cpp, Scanner.h, and some other utilities. My job is to create a Similarity class to compare documents using th..

Converting String to Int using try/except in Python

So I'm pretty stumped on how to convert a string into an int using the try/except function. Does anyone know a simple function on how to do this? I feel like I'm still a little hazy on string and ints..

Why I get 'list' object has no attribute 'items'?

Using Python 2.7, I have this list: qs = [{u'a': 15L, u'b': 9L, u'a': 16L}] I'd like to extract values out of it. i.e. [15, 9, 16] So I tried: result_list = [int(v) for k,v in qs.items()] But..

Which @NotNull Java annotation should I use?

I'm looking to make my code more readable as well as use tooling like IDE code inspection and/or static code analysis (FindBugs and Sonar) to avoid NullPointerExceptions. Many of the tools seem incom..

The name does not exist in the namespace error in XAML

Using VS2012 working on a VB.NET WPF application. I have a simple MusicPlayer tutorial app I am using to learn WPF. I am converting a C# version of the tutorial to VB.NET step by step. It has 2 c..

Storing Form Data as a Session Variable

So I was wondering if it would be possible to store data coming in from a form as a session variable. Heres what I have so far, but I don't know what to put for the Form Action. Thanks for looking!..

Set size on background image with CSS?

Is it possible to set the size of the background image with CSS? I want to do something like: background: url('bg.gif') top repeat-y; background-size: 490px; But it seems it's totally wrong to do ..

Angular HttpPromise: difference between `success`/`error` methods and `then`'s arguments

According to AngularJS doc, calls to $http return the following: Returns a promise object with the standard then method and two http specific methods: success and error. The then method takes two ..

Disabling browser caching for all browsers from ASP.NET

I'm after a definitive reference to what ASP.NET code is required to disabled browsers from caching the page. There are many ways to affect the HTTP headers and meta tags and I get the impression diff..

iPad browser WIDTH & HEIGHT standard

Does anyone know the safest width and height for the BODY when viewing any web page on the iPad? I want to avoid the scrollbars as much as possible. Thanks. Erik..

PHP: How to send HTTP response code?

I have a PHP script that needs to make responses with HTTP response codes (status-codes), like HTTP 200 OK, or some 4XX or 5XX code. How can I do this in PHP?..

How do I check (at runtime) if one class is a subclass of another?

Let's say that I have a class Suit and four subclasses of suit: Heart, Spade, Diamond, Club. class Suit: ... class Heart(Suit): ... class Spade(Suit): ... class Diamond(Suit): ... class C..

Access to ES6 array element index inside for-of loop

We can access array elements using a for-of loop: for (const j of [1, 2, 3, 4, 5]) { console.log(j); } How can I modify this code to access the current index too? I want to achieve this using for..

error: expected declaration or statement at end of input in c

void mi_start_curr_serv(void){ #if 0 //stmt #endif } I'm getting an error as "error: expected declaration or statement at end of input" in my compiler. I could not find any error with the above..

What is the best way to conditionally apply a class?

Lets say you have an array that is rendered in a ul with an li for each element and a property on the controller called selectedIndex. What would be the best way to add a class to the li with the inde..

"Initializing" variables in python?

Even though initializing variables in python is not necessary, my professor still wants us to do it for practice. I wrote my program and it worked fine, but after I tried to initialize some of the var..

Add multiple items to a list

static class Program { static void Main(string carMake, string carModel, string carColour, string bikeModel, string bikeMake, string bikeColour, string truckMake, string truckModel, string truckCo..


I would like to embed a SELECT inside a COUNT, but I can't find any examples. #pseudosql SELECT a AS current_a, COUNT(*) AS b, COUNT( SELECT FROM t WHERE a = current_a AND c = 'const' ) as d, f..

How to npm install to a specified directory?

Is it possible to specify a target directory when running npm install <package>?..

Get current date, given a timezone in PHP?

I want to get todays date given a time zone in Paul Eggert format(America/New_York) in PHP? ..

Bootstrap carousel multiple frames at once

This is the effect I'm trying to achieve with Bootstrap 3 carousel Instead of just showing one frame at a time, it displays N frames slide by side. Then when you slide (or when it auto slides), it ..

Scanner is skipping nextLine() after using next() or nextFoo()?

I am using the Scanner methods nextInt() and nextLine() for reading input. It looks like this: System.out.println("Enter numerical value"); int option; option = input.nextInt(); // Read numeric..

How to make div same height as parent (displayed as table-cell)

I got a container div containing three child divs (vary in content) - each as tall as the tallest one. I managed this by setting the container to display:table and the child divs to display:table-cell..

What are all the uses of an underscore in Scala?

I've taken a look at the list of surveys taken on and noticed a curious question: "Can you name all the uses of “_”?". Can you? If yes, please do so here. Explanatory examples are a..

HTTP Basic Authentication credentials passed in URL and encryption

I have a question about HTTPS and HTTP Authentication credentials. Suppose I secure a URL with HTTP Authentication: <Directory /var/www/webcallback> AuthType Basic AuthName "Restricted Area" A..

How can I get a precise time, for example in milliseconds in Objective-C?

Is there an easy way to get a time very precisely? I need to calculate some delays between method calls. More specifically, I want to calculate the speed of scrolling in an UIScrollView...

label or @html.Label MVC 4

Newbie to MVC 4 and trying to make sense of Razor. If I wanted to just display some text in my .cshtml page, can I use <label class="LabelCSSTop">Introduction</label> or shoul..

php how to go one level up on dirname(__FILE__)

I have a folder structure as follows: ->Folder-A ->Folder-B I have a string from Database that is '../Folder-B/image1.jpg', which points to an image in Folder-B. Inside a s..

VS 2012: Scroll Solution Explorer to current file

VS2010 had the feature that viewing a file would automatically cause Solution Explorer to scroll to that file. With VS2012, viewing different files from within the IDE no longer scrolls and select th..

$.ajax( type: "POST" POST method to php

I'm trying to use the POST method in jQuery to make a data request. So this is the code in the html page: <form> Title : <input type="text" size="40" name="title"/> <input type="button..

How to get Maven project version to the bash command line

Previous I issued a question on how to change Maven project vesion from command line which lead me to a new issue. Previously I was able to get the version number since the version was stored as a pro..

Cookies on localhost with explicit domain

I must be missing some basic thing about cookies. On localhost, when I set a cookie on server side and specify the domain explicitly as localhost (or .localhost). the cookie does not seem to be accept..

Upgrade python without breaking yum

I recently installed Python 2.7.3 on a CentOS machine by compiling from source. Python 2.7.3 is installed at /opt/python2.7 and when I installed it I just changed /usr/bin/python to point to the new v..

Fastest way to remove non-numeric characters from a VARCHAR in SQL Server

I'm writing an import utility that is using phone numbers as a unique key within the import. I need to check that the phone number does not already exist in my DB. The problem is that phone numbers..

How to use MySQLdb with Python and Django in OSX 10.6?

This is a much discussed issue for OSX 10.6 users, but I haven't been able to find a solution that works. Here's my setup: Python 2.6.1 64bit Django 1.2.1 MySQL 5.1.47 osx10.6 64bit I create a virtu..

C++ compile time error: expected identifier before numeric constant

I have read other similar posts but I just don't understand what I've done wrong. I think my declaration of the vectors is correct. I even tried to declare without size but even that isn't working.Wha..

How to add a new row to an empty numpy array

Using standard Python arrays, I can do the following: arr = [] arr.append([1,2,3]) arr.append([4,5,6]) # arr is now [[1,2,3],[4,5,6]] However, I cannot do the same thing in numpy. For example: arr..

How do I compare two string variables in an 'if' statement in Bash?

I'm trying to get an if statement to work in Bash (using Ubuntu): #!/bin/bash s1="hi" s2="hi" if ["$s1" == "$s2"] then echo match fi I've tried various forms of the if statement, using [["$s1" ..

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved

org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for o..

How does PHP 'foreach' actually work?

Let me prefix this by saying that I know what foreach is, does and how to use it. This question concerns how it works under the bonnet, and I don't want any answers along the lines of "this is how you..

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

Changing the color of a clicked table row using jQuery

I need your help, How can I, using jQuery, Change the background color of the selected row in my table (for this example, let's use the the css class "highlighted" and if the same row is clicked on..

How do I compare two hashes?

I am trying to compare two Ruby Hashes using the following code: #!/usr/bin/env ruby require "yaml" require "active_support" file1 = YAML::load('./en_20110207.yml')) file2 = YAML::load(Fi..

Can I underline text in an Android layout?

How can I define underlined text in an Android layout xml file?..

Python 3 turn range to a list

I'm trying to make a list with numbers 1-1000 in it. Obviously this would be annoying to write/read, so I'm attempting to make a list with a range in it. In Python 2 it seems that: some_list = range(..

Is there a reason for C#'s reuse of the variable in a foreach?

When using lambda expressions or anonymous methods in C#, we have to be wary of the access to modified closure pitfall. For example: foreach (var s in strings) { query = query.Where(i => i.Prop..

Put search icon near textbox using bootstrap

I am using bootstrap by default textbox taking full width of column and I want to put search icon at the end to textbox. My code is like this: <div class="container"> <div class="row"&..

Restart container within pod

I have a pod test-1495806908-xn5jn with 2 containers. I'd like to restart one of them called container-test. Is it possible to restart a single container within a pod and how? If not, how do I restart..

How to use (install) dblink in PostgreSQL?

I am used to Oracle and to create a dblink in my schema and then access to a remote database like this: mytable@myremotedb, is there anyway do to the same with PostgreSQL? Right now I am using dblink..

Can I create a One-Time-Use Function in a Script or Stored Procedure?

In SQL Server 2005, is there a concept of a one-time-use, or local function declared inside of a SQL script or Stored Procedure? I'd like to abstract away some complexity in a script I'm writing, but ..

How to measure time taken between lines of code in python?

So in Java, we can do How to measure time taken by a function to execute But how is it done in python? To measure the time start and end time between lines of codes? Something that does this: import..

Archive the artifacts in Jenkins

Could someone please explain to me the idea of artifacts in the build process? I have the workspace directory where I check out the code to compile and run my ant scripts etc. At the end, in my case,..

PhoneGap Eclipse Issue - eglCodecCommon glUtilsParamSize: unknow param errors

I have just started on phonegap and trying to setup first basic minimal project in eclipse. I followed through the phonegap docs at

MySQL LEFT JOIN Multiple Conditions

I have two tables: A and B linked by "group_id". 2 variables I'm using: $keyword, $_SESSION['user_id'] A group_id keyword B id group_id user_id I want to be able to select all the groups that this..

Remove a modified file from pull request

I have 3 modified files (no new files) in a pull request at the moment. I would like to remove one of those files from the pull request, so that the pull request only contains changes to two files a..

Javascript .querySelector find <div> by innerTEXT

How can I find DIV with certain text? For example: <div> SomeText, text continues. </div> Trying to use something like this: var text = document.querySelector('div[SomeText*]').innerTE..

How to invoke function from external .c file in C?

My files are // main.c #include "add.c" int main(void) { int result = add(5,6); printf("%d\n", result); } and // add.c int add(int a, int b) { return a + b; } ..

Tkinter: "Python may not be configured for Tk"

Today I wanted to start working with Tkinter, but I have some problems. Python 3.2 (r32:88445, Mar 28 2011, 04:14:07) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more ..

Sending multipart/formdata with jQuery.ajax

I've got a problem sending a file to a serverside PHP-script using jQuery's ajax-function. It's possible to get the File-List with $('#fileinput').attr('files') but how is it possible to send this Dat..

R command for setting working directory to source file location in Rstudio

I am working out some tutorials in R. Each R code is contained in a specific folder. There are data files and other files in there. I want to open the .r file and source it such that I do not have to ..

MySQL Multiple Joins in one query?

I have the following query: SELECT dashboard_data.headline, dashboard_data.message, dashboard_messages.image_id FROM dashboard_data INNER JOIN dashboard_messages ON dashboard_message_id = da..

How to execute powershell commands from a batch file?

I have a PowerShell script to add a website to a Trusted Sites in Internet Explorer: set-location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" set-location ZoneMap\Domains new-..

How do I record audio on iPhone with AVAudioRecorder?

Now that iPhone 3.0 SDK is public, I think I can ask this question for those of you that have already been playing with the 3.0 SDK. I want to record audio in my application, but I want to use AVAudio..

Iterating C++ vector from the end to the beginning

Is it possible to iterate a vector from the end to the begin? for (vector<my_class>::iterator i = my_vector.end(); i != my_vector.begin(); /* ?! */ ) { } Or is that only possible with..

ComboBox: Adding Text and Value to an Item (no Binding Source)

In C# WinApp, how can I add both Text and Value to the items of my ComboBox? I did a search and usually the answers are using "Binding to a source".. but in my case I do not have a binding source read..

Proper way to concatenate variable strings

I need to create new variable from contents of other variables. Currently I'm using something like this: - command: echo "{{ var1 }}-{{ var2 }}-{{ var3 }}" register: newvar The problem is: Usag..

Database Structure for Tree Data Structure

What would be the best way to implement a customizable tree data structure (meaning, a tree structure with an unknown number of level) in a database? I've done this once before using a table with a f..

MSVCP120d.dll missing

Every time I want to compile my Visual Studio project I get the message that MSVCP120d.dll is missing. Google can't help me. I already installed some redistributables but they didn't help. I also foun..

How can I determine the URL that a local Git repository was originally cloned from?

I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitHub, and I neglected to note which one I took originally. How can I determine which of those for..

What are the differences between Abstract Factory and Factory design patterns?

I know there are many posts out there about the differences between these two patterns, but there are a few things that I cannot find. From what I have been reading, I see that the factory method pat..

Visual Studio Code Tab Key does not insert a tab

I'm using Visual Studio Code as my code editor. I did a search on google but wasn't able to find anything about my issue. The issue is simple, pressing ? Tab in the editor does nothing. I'm expecting ..

How to compare two dates in Objective-C

I have two dates: 2009-05-11 and the current date. I want to check whether the given date is the current date or not. How is this possible...

C#: Printing all properties of an object

Is there a method built in to .NET that can write all the properties and such of an object to the console? Could make one using reflection of course, but I'm curious to if this already exists... espec..

Clear text input on click with AngularJS

How can I clear a text input on click of a button using angularJS? The X is a seperate link, on which I would like to trigger a function. HTML <input type="text" class="form-control" data-ng-m..

How to set bootstrap navbar active class with Angular JS?

If I have a navbar in bootstrap with the items Home | About | Contact How do I set the active class for each menu item when they are active? That is, how can I set class="active" when the angular r..

jQuery Cross Domain Ajax

My ajax code is $.ajax({ type: 'GET', dataType: "jsonp", processData: false, crossDomain: true, jsonp: false, url: "", success: funct..

How do you get the file size in C#?

I need a way to get the size of a file using C#, and not the size on disk. How is this possible? Currently I have this loop foreach (FileInfo file in downloadedMessageInfo.GetFiles()) { //file.L..

Name node is in safe mode. Not able to leave

root# bin/hadoop fs -mkdir t mkdir: org.apache.hadoop.hdfs.server.namenode.SafeModeException: Cannot create directory /user/root/t. Name node is in safe mode. not able to create anything in hdfs I di..

How to change package name of Android Project in Eclipse?

I have an Android project created in Eclipse. I want to modify the package name and application of the project. How do I do that in Eclipse?..

How to embed a YouTube channel into a webpage

Can anyone suggest how I embed a youtube channel into a webpage - I am getting conflicting information from various sites, ideally using the custom player if possible? thanks..

Parsing JSON string in Java

I am trying to parse a JSON string in java to have the individual value printed separately. But while making the program run I get the following error- Exception in thread "main" java.lang.RuntimeExc..

nodejs - How to read and output jpg image?

I've been trying to find an example of how to read a jpeg image and then show the image. var http = require('http'), fs = require('fs'); http.createServer(function (req, res) { res.writeHead(200..

When to use static keyword before global variables?

Can someone explain when you're supposed to use the static keyword before global variables or constants defined in header files? For example, lets say I have a header file with the line: const floa..

How can I SELECT rows with MAX(Column value), DISTINCT by another column in SQL?

My table is: id home datetime player resource ---|-----|------------|--------|--------- 1 | 10 | 04/03/2009 | john | 399 2 | 11 | 04/03/2009 | juliet | 244 5 | 12 | 04/03/2009 | bor..

How do I automatically set the $DISPLAY variable for my current session?

I see that $DISPLAY is set to localhost:0.0 if I am running over a vnc server this may not be correct, is there a way to automatically set it in my login script?..

Box-Shadow on the left side of the element only

I have been having trouble setting a box shadow on the left side of an element only. I tried this: box-shadow: -10px 0px 3px 0px #aaa; However, the box shadow looks more like a grey line and lacks..

access key and value of object using *ngFor

I am a bit confused about how to get the key and value of an object in angular2 while using *ngFor for iterating over the object. I know in angular 1.x there is a syntax like ng-repeat="(key, value)..

How do I break a string in YAML over multiple lines?

In YAML, I have a string that's very long. I want to keep this within the 80-column (or so) view of my editor, so I'd like to break the string. What's the syntax for this? In other words, I have this..

Is there are way to make a child DIV's width wider than the parent DIV using CSS?

Is there a way to have a child DIV within a parent container DIV that is wider than it's parent. The child DIV needs to be the same width of the browser viewport. See example below: The child DIV m..

Import an existing git project into GitLab?

I have an account of a Gitlab installation where I created the repository "ffki-startseite" Now I want to clone the repository git:// into that repository with ..

NSString with \n or line break

Does anyone know how to use line breaks in NSString? I need to do something like this - [NSString stringWithFormat:@"%@,\n%@", mystring1,mystring2]; ..

Kill a Process by Looking up the Port being used by it from a .BAT

In Windows what can look for port 8080 and try to kill the process it is using through a .BAT file?..

Simple excel find and replace for formulas

I have numerous cells all over the place on a worksheet that look like =((E9-E8)/E8). I want to use the first two values to go into this new formula, (EXP((LN(E9/E8)/14.32))-1). How can I change them..

How to set the part of the text view is clickable

I have the text "Android is a Software stack". In this text i want to set the "stack" text is clickable. in the sense if you click on that it will redirected to a new activity(not in the browser). I..

Delete all local git branches

I follow a development process where I create a new local branch for every new feature or story card. When finished I merge the branch into master and then push. What tends to happen over time due t..

jquery <a> tag click event

I am building a code which displays user information on search. User information, is then displayed in a fieldset, and a image, first name, last name and few profile info. is shown, and in the bottom ..

Injecting @Autowired private field during testing

I have a component setup that is essentially a launcher for an application. It is configured like so: @Component public class MyLauncher { @Autowired MyService myService; //other methods..

100% height minus header?

I want to create a layout for an admin panel, but I dont know how to get the #nav and #content container always at 100% of the browser window. I don't understand the inherit of 100% height attributes,..

How to save a bitmap on internal storage

this is my code I and I want to save this bitmap on my internal storage. The public boolean saveImageToInternalStorage is a code from google but I don't know how to use it. when I touch button2 follow..

Oracle SQL convert date format from DD-Mon-YY to YYYYMM

I have a to compare dates in 2 tables but the problem is that one table has the date in DD-Mon-YY format and the other in YYYYMM format. I need to make both of them YYYYMM for the comparison. I need..

"No such file or directory" but it exists

I simply want to run an executable from the command line, ./arm-mingw32ce-g++, but then I get the error message, bash: ./arm-mingw32ce-g++: No such file or directory I'm running Ubuntu Linux 10.10. ..

Kubernetes Pod fails with CrashLoopBackOff

I 'm Following this guide in order to set up a pod using minikube and pull an image from a private repository hosted at: When trying to set up a pod to pull the image i see CrashLoopBa..

MySQL - ignore insert error: duplicate entry

I am working in PHP. Please what's the proper way of inserting new records into the DB, which has unique field. I am inserting lot of records in a batch and I just want the new ones to be inserted an..

Run a Docker image as a container

After building a Docker image from a dockerfile, I see the image was built successfully, but what do I do with it? Shouldn't i be able to run it as a container?..

How to merge two json string in Python?

I recently started working with Python and I am trying to concatenate one of my JSON String with existing JSON String. I am also working with Zookeeper so I get the existing json string from zookeeper..

How do I write a correct micro-benchmark in Java?

How do you write (and run) a correct micro-benchmark in Java? I'm looking for some code samples and comments illustrating various things to think about. Example: Should the benchmark measure time/it..

dyld: Library not loaded ... Reason: Image not found

When trying to run an executable I've been sent in Mac OS X, I get the following error dyld: Library not loaded: libboost_atomic.dylib Referenced from: /Users/"Directory my executable is in" Reas..

How to use LINQ Distinct() with multiple fields

I have the following EF class derived from a database (simplified) class Product { public string ProductId; public string ProductName; public string CategoryId; public string Cat..

How do I convert a PDF document to a preview image in PHP?

What libraries, extensions etc. would be required to render a portion of a PDF document to an image file? Most PHP PDF libraries that I have found center around creating PDF documents, but is there a..

Flexbox and Internet Explorer 11 (display:flex in <html>?)

I am planning to move away from "floaty" layouts and use CSS flexbox for future projects. I was delighted to see that all major browsers in their current versions seem to support (in one way or anothe..

Maven Jacoco Configuration - Exclude classes/packages from report not working

I have a maven multi-module project and I'm using jacoco-maven for code coverage reports. Some classes should not be reported, as they're Spring configuration and I'm not interested in them. I have d..

What are the differences between the BLOB and TEXT datatypes in MySQL?

What is blob and what is text? What are the differences? When do I need to use blob and when do I need text as data type? Because for blob and text, there are mediumblob == mediumtext, smallblob == ..

Select first empty cell in column F starting from row 1. (without using offset )

This is one query that I am really confused with. Coz I have looked for this so many times but I always find the codes related to finding the last used or first non empty cell. Tried at below codes. d..

How to SELECT by MAX(date)?

This is the table structure: CREATE TABLE `reports` ( `report_id` int(11) NOT NULL auto_increment, `computer_id` int(11) NOT NULL default '0', `date_entered` datetime NOT NULL default '1970-01-0..

py2exe - generate single executable file

I thought I heard that py2exe was able to do this, but I never figured it out. Has anyone successfully done this? Can I see your file, and what command line options you used? Basically I'm..

Storing money in a decimal column - what precision and scale?

I'm using a decimal column to store money values on a database, and today I was wondering what precision and scale to use. Since supposedly char columns of a fixed width are more efficient, I was thi..

encrypt and decrypt md5

I am using code $enrypt=md5($pass) and inserting $encrypt to database. I want to find out a way to decrypt them. I tried using a decrypting software but it says the hash should be of exactly 16 bytes..

pandas: multiple conditions while indexing data frame - unexpected behavior

I am filtering rows in a dataframe by values in two columns. For some reason the OR operator behaves like I would expect AND operator to behave and vice versa. My test code: import pandas as pd df..

Check if number is decimal

I need to check in PHP if user entered a decimal number (US way, with decimal point: X.XXX) Any reliable way to do this?..

What is lazy loading in Hibernate?

What is lazy loading in Java? I don't understand the process. Can anybody help me to understand the process of lazy loading?..

Multiprocessing: How to use on a function defined in a class?

When I run something like: from multiprocessing import Pool p = Pool(5) def f(x): return x*x, [1,2,3]) it works fine. However, putting this as a function of a class: class calculate..

How do you get the selected value of a Spinner?

I am trying to get the selected items string out of a Spinner. So far I have gotten this: bundle.putString(ListDbAdapter.DB_PRI, v.getText().toString()); This does not work and gives a class castin..

Install an apk file from command prompt?

I want to install a file using the Windows command line. First I want to build after compiling all the .jar files to create an .apk file for an Android application without using Eclipse. Does anyone ..

Git push rejected "non-fast-forward"

I am fairly new to git, yet currently using it to manage our code in a team environment. I had some rebasing issues, and I fixed them using: git checkout --ours filename.txt git add filename.txt git r..

Blurry text after using CSS transform: scale(); in Chrome

Seems like there has been a recent update to Google Chrome that causes blurry text after doing a transform: scale(). Specifically I'm doing this: @-webkit-keyframes bounceIn { 0% { opacity: 0; ..

Angular: conditional class with *ngClass

What is wrong with my Angular code? I am getting: Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass ... <ol class="breadcrumb"> <li *ngClass="{act..

Delete with Join in MySQL

Here is the script to create my tables: CREATE TABLE clients ( client_i INT(11), PRIMARY KEY (client_id) ); CREATE TABLE projects ( project_id INT(11) UNSIGNED, client_id INT(11) UNSIGNE.. localhost/ - Connection refused

I am using xampp apache server to serve resources to the application from my machine. But i am getting the above error. I got something on the google. pointing towards possible solution here http://..

Delete all rows with timestamp older than x days

I want to delete all the rows with timestamp older than 180 days from a specific table in my database. I've tried the this: DELETE FROM on_search WHERE search_date < DATE_SUB(NOW(), INTERVAL 180 ..

AttributeError("'str' object has no attribute 'read'")

In Python I'm getting an error: Exception: (<type 'exceptions.AttributeError'>, AttributeError("'str' object has no attribute 'read'",), <traceback object at 0x1543ab8>) Given ..

Error: "Could Not Find Installable ISAM"

I've written some VBA code in an Excel workbook to retrieve data from an Access database in the same directory on a desktop. It works fine on my machine and several other machines running Windows XP,..

Create a hexadecimal colour based on a string with JavaScript

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

Execute JavaScript code stored as a string

How do I execute some JavaScript that is a string? function ExecuteJavascriptString() { var s = "alert('hello')"; // how do I get a browser to alert('hello')? } ..

R : how to simply repeat a command?

I'm trying to repeat this simple command 10,000 times (via a simple and easy solution): Tandem <- sample(OUT, size = 815, replace = TRUE, prob = NULL); mean(Tandem) Any advice would be greatly a..

Best way to load module/class from lib folder in Rails 3?

Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore, what would be the best way to load them? From github: A few changes were done in this commit: Do not auto..

determine DB2 text string length

I am trying to find out how to write an SQL statement that will grab fields where the string is not 12 characters long. I only want to grab the string if they are 10 characters. What function can do..

How can I call a method in Objective-C?

I am trying to build an iPhone app. I created a method like this: - (void)score { // some code } and I have tried to call it in an other method like this: - (void)score2 { @selector(score..