Questions Tagged with #Data access

Service located in another namespace

I have been trying to find a way to define a service in one namespace that links to a Pod running in another namespace. I know that containers in a Pod running in namespaceA can access serviceX defin..

Encoding Javascript Object to Json string

I want to encode a Javascript object into a JSON string and I am having considerable difficulties. The Object looks something like this new_tweets[k]['tweet_id'] = 98745521; new_tweets[k]['user_id']..

Why is my JQuery selector returning a n.fn.init[0], and what is it?

I have a set of dynamically generated checkboxes, where each of them has a data-id attribute corresponding to a database integer id. When i populate my html-form with an object to edit, there is a lis..

What is key=lambda

While using some built-in functions like sorted, sum... I noticed the usage of key=lambda What is lambda? How does it work? What other functions use key=lambda? Are there any other key values like..

What's the difference between UTF-8 and UTF-8 without BOM?

What's different between UTF-8 and UTF-8 without a BOM? Which is better? ..

How to format background color using twitter bootstrap?

I am playing with the styles on the website here: I am trying to include background-color #2ba6cb on the hero unit. When I include: <div class="row" style ='background-c..

Can I use git diff on untracked files?

Is it possible to ask git diff to include untracked files in its diff output, or is my best bet to use git add on the newly created files and the existing files I have edited, then use: git diff --cac..

width:auto for <input> fields

Newbie CSS question. I thought width:auto for a display:block element meant 'fill available space'. However for an <input> element this doesn't seem to be the case. For example: <body> &l..

Differences between unique_ptr and shared_ptr

Possible Duplicates: pimpl: shared_ptr or unique_ptr smart pointers (boost) explained Could someone explain differences between shared_ptr and unique_ptr?..

How to load specific image from assets with Swift

I'm new to Swift and I want to load a special image from assets. For example I have: image 1 for iphone 4s = [email protected] image 2 for iphone 5/5s = [email protected] image 3 for iphon..

How to set environment variable or system property in spring tests?

I'd like to write some tests that check the XML Spring configuration of a deployed WAR. Unfortunately some beans require that some environment variables or system properties are set. How can I set an ..

Can a div have multiple classes (Twitter Bootstrap)

Can a div tag have two classes? I am using twitter bootstrap, and there are two predefined classes that I would like to use. One is an active class that I would like to use on a dropdown-toggle with..

json_encode(): Invalid UTF-8 sequence in argument

I'm calling json_encode() on data that comes from a MySQL database with utf8_general_ci collation. The problem is that some rows have weird data which I can't clean. For example symbol ?, so once it r..

How to embed an autoplaying YouTube video in an iframe?

I am trying to embed the new iframe version of a YouTube video and get it to auto play. As far as I can tell, there is no way of doing this by amending flags to the URL. Is there a way to do it by u..

iOS change navigation bar title font and color

So i have this code that should change the nav bar title font, but it doenst NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont ..

JSON Stringify changes time of date because of UTC

My date objects in JavaScript are always represented by UTC +2 because of where I am located. Hence like this Mon Sep 28 10:00:00 UTC+0200 2009 Problem is doing a JSON.stringify converts the above ..

How do I add a foreign key to an existing SQLite table?

I have the following table: CREATE TABLE child( id INTEGER PRIMARY KEY, parent_id INTEGER, description TEXT); How do I add a foreign key constraint on parent_id? Assume foreign keys are en..

Marquee text in Android

How can I use marquee text in an android application?..

How to make links in a TextView clickable?

I have the following TextView defined: <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/txtCredits" android:autoLink="web" android:..

Enable VT-x in your BIOS security settings (refer to documentation for your computer)

While I was adding a virtual device in my Android Studio, Android Studio is Showing This Error. See This Image: ...

Inline style to act as :hover in CSS

I know that embedding CSS styles directly into the HTML tags they affect defeats much of the purpose of CSS, but sometimes it's useful for debugging purposes, as in: <p style="font-size: 24px">..

Reading binary file and looping over each byte

In Python, how do I read in a binary file and loop over each byte of that file?..

Does "git fetch --tags" include "git fetch"?

A nice and simple question - is the function of "git fetch" a strict sub-set of git fetch --tags? I.e. if I run git fetch --tags, is there ever a reason to immediately run git fetch straight afterwar..

Python error: TypeError: 'module' object is not callable for HeadFirst Python code

I'm following the tutorial from the HeadFirst Python book. In chapter 7, I get an error message when trying to run the next code: Athlete class: class AthleteList(list): def __init__(self, a_nam..

Android Preventing Double Click On A Button

What is the best way to prevent double clicks on a button in Android? ..

How to determine the IP address of a Solaris system

What command do I want to issue when I want to know the IP address of the Solaris machine I'm logged onto?..

What's the difference between align-content and align-items?

Can anybody show me the difference between align-items and align-content?..

HTML Entity Decode

How do I encode and decode HTML entities using JavaScript or JQuery? var varTitle = "Chris&apos; corner"; I want it to be: var varTitle = "Chris' corner"; ..

How to use Python requests to fake a browser visit a.k.a and generate User Agent?

I want to get the content from this website. If I use a browser like Firefox or Chrome I could get the real website page I want, but if I use the Python requests package (or wget command) to get it, i..

How to align td elements in center

I have created a simple table and want to align the td elements in center but align:center in css doesn't seem to work .cTable td{ align:center; } <table border='1' id='mytable' class="cTable"&g..

How can I position my div at the bottom of its container?

Given the following HTML: _x000D_ _x000D_ <div id="container"> <!-- Other elements here --> <div id="copyright"> Copyright Foo web designs </div> </div>_x000D_ ..

Two values from one input in python?

This is somewhat of a simple question and I hate to ask it here, but I can't seem the find the answer anywhere else: is it possible to get multiple values from the user in one line of Python? For in..

Critical t values in R

I need to determine the critical t values for one-sided tails of 75% and 99%, for 40 degrees of freedom. The following is code for a two-sided 99% critical t values: qt(0.01, 40) but how can I det..

python pandas dataframe columns convert to dict key and value

I have a pandas data frame with multiple columns and I would like to construct a dict from two columns: one as the dict's keys and the other as the dict's values. How can I do that? Dataframe: ..

How do I filter an array with TypeScript in Angular 2?

ng-2 parent-child data inheritance has been a difficulty for me. What seems that could be a fine working practical solution is filtering my total array of data to an array consisting of only child d..

How can I add a string to the end of each line in Vim?

I want to add * to the end of each line in Vim. I tried the code unsuccessfully :%s/\n/*\n/g ..

Show a leading zero if a number is less than 10

Possible Duplicate: JavaScript equivalent to printf/string.format How can I create a Zerofilled value using JavaScript? I have a number in a variable: var number = 5; I need that numbe..

How npm start runs a server on port 8000

I recently used a angular-seed folder from github for angular application development. In some previous angularjs tutorial there was a script folder and a server.js file in the angular-seed folder whi..

How to sum a list of integers with java streams?

I want to sum a list of integers. It works as follows, but the syntax does not feel right. Could the code be optimized? Map<String, Integer> integers; integers.values().stream().mapToInt(i ->..

SQL: set existing column as Primary Key in MySQL

I have a database with 3 columns: id, name, somethingelse This table has no index set and i am getting "No index defined!" in phpmyadmin id is a 7digit alphanumeric value, unique to each row. I ..

program cant start because php5.dll is missing

I installed XAMPP , phpinfo: PHP Version 5.3.5 Downloaded PHPPDT, installed downloaded webserver debug extension, copied dummy.php added zend_extension="c:\edward\xampp\php\ext\5_3_x_nts_comp\ZendDeb..

How to remove part of a string before a ":" in javascript?

If I have a string Abc: Lorem ipsum sit amet, how can I use JavaScript/jQuery to remove the string before the : including the :. For example the above string will become: Lorem ipsum sit amet...

Tools: replace not replacing in Android manifest

I am using a gradle project with many different library dependencies and using the new manifest merger. In my <application /> tag I have it set up as such: <application tools:replace="androi..

Create a List that contain each Line of a File

I'm trying to open a file and create a list with each line read from the file. i=0 List=[""] for Line in inFile: List[i]=Line.split(",") i+=1 print List But this sample code..

The operation cannot be completed because the DbContext has been disposed error

I'm new to EF and I'm trying to use an extension method which converts from my Database type User to my info class UserInfo. I'm using database first if that makes a difference? My code below gives t..

Error: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'

I recently upgraded/updated Entity Framework in an old project from version 4 or 5 to version 6. Now I get this exception: An exception of type 'System.InvalidOperationException' occurred in Ent..

Set width of dropdown element in HTML select dropdown options

I am working on a website that involves automatically populating a select box using a PHP script. This all works fine except the problem is that what I am using to populate the text box have very lon..

Generate a Hash from string in Javascript

I need to convert strings to some form of hash. Is this possible in JavaScript? I'm not utilizing a server-side language so I can't do it that way...

How can you get the Manifest Version number from the App's (Layout) XML variables?

I would like to have a way to reference the project's manifest version number in the main part of the code. What I have been doing up until now is to link the version number in a String XML file to th..

Jquery checking success of ajax post

how do i define the success and failure function of an ajax $.post?..

How to remove focus from single editText

In my application I have a single EditText together with some TextViews, button and a spinner. My EditText receives focus since it is the only focusable view in this activity, I believe. My EditText s..

Pure CSS to make font-size responsive based on dynamic amount of characters

I know that this could be solved fairly easily with Javascript, but I'm only interested in a pure CSS solution. I want a way to dynamically resize text so that it always fits into a fixed div. Here ..

How to receive POST data in django

I've been trying to integrate a payment gateway into my site in django. I'm having trouble getting the response data from the payment gateway. The payment gateway has sample docs for php which looks ..

git still shows files as modified after adding to .gitignore

i'm adding this to .gitignore file .idea/* but anyway the status is: # modified: .gitignore # modified: .idea/.generators # modified: .idea/dovezu.iml # modified: ...

Java: convert seconds to minutes, hours and days

"The output should look like this (it is a good idea to echo back the input): You entered 500,000 seconds, which is 5 days, 18 hours, 53 minutes and 20 seconds. (5 days 18:53:20 hours) So can you guy..

Could not load file or assembly 'Newtonsoft.Json, Version=, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'

I am getting the Error System.IO.FileLoadException : Could not load file or assembly 'Newtonsoft.Json, Version=, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its depende..

How to programmatically set the ForeColor of a label to its default?

I'm using VS2010 C# ASP.NET To programmatically change the ForeColor of an asp:Label named lblExample to 'Red', I write this: lblExample.ForeColor = System.Drawing.Color.Red; After changing the Fo..

Unicode (UTF-8) reading and writing to files in Python

I'm having some brain failure in understanding reading and writing text to a file (Python 2.4). # The string, which has an a-acute in it. ss = u'Capit\xe1n' ss8 = ss.encode('utf8') repr(ss), repr(ss8..

What is the purpose of using -pedantic in GCC/G++ compiler?

This note says: -ansi: tells the compiler to implement the ANSI language option. This turns off certain "features" of GCC which are incompatible with the ANSI standard. -pedantic: used ..

CSS body background image fixed to full screen even when zooming in/out

I am trying to achieve something like this with CSS: I'd like to keep the body background image fixed on fullscreen, this is sort of done by the following code: body { background: url(../img/bea..

Submit form without page reloading

I have a classifieds website, and on the page where ads are showed, I am creating a "Send a tip to a friend" form... So anybody who wants can send a tip of the ad to some friends email-adress. I am ..

laravel Eloquent ORM delete() method

Hi I am studying laravel. I use Eloquent ORM delete method but I get a different result.Not true or false but null. I set an resource route and there is a destroy method in UsersController. public fu..

Load and execution sequence of a web page?

I have done some web based projects, but I don't think too much about the load and execution sequence of an ordinary web page. But now I need to know detail. It's hard to find answers from Google or S..

How to activate virtualenv?

I have been through search and tried various alternatives without success and spent several days on it now - driving me mad. Running on Red Hat Linux with Python 2.5.2 Began using most recent Virtual..

Simple If/Else Razor Syntax

I'm trying to do a simple If/Else within a foreach with this code: @{ var count = 0; foreach (var item in Model) { if (count++ % 2 == 0) { @:<tr class="alt-row"> } else { ..

Make a simple fade in animation in Swift?

I am trying to make a simple animation in Swift. It is a fade in. I attempted: self.myFirstLabel.alpha = 0 self.myFirstButton.alpha = 0 self.mySecondButton.alpha = 0 Then, I have: self.view.addSu..

How to disable input conditionally in vue.js

I have an input: <input type="text" id="name" class="form-control" name="name" v-model="" :disabled="validated ? '' : disabled"> and in my Vue.js component, I have: .. .. ready() {..

How can I enable cURL for an installed Ubuntu LAMP stack?

I have installed the Ubuntu LAMP stack. But cURL is not enabled, and neither can I can find the extension listed in the INI file. I added it manually, but it didn't work either. How should I enable cU..

Should CSS always preceed Javascript?

In countless places online I have seen the recommendation to include CSS prior to JavaScript. The reasoning is generally, of this form: When it comes to ordering your CSS and JavaScript, you want you..

Popup Message boxes

I am unsure of how to code popup message box in my methods. public String verify(){ String result = "failed"; int authcode = staffBean.getVerifyCodeByName(getLoginUserName()); if (code =..

download and install visual studio 2008

Ok, this may be the dumbest question ever, but I swear I searched for the answer and don't know what to do. I need to install Visual Studio 2008. The free version. I need it in order to compile somet..

Function of Project > Clean in Eclipse

What does Eclipse's Project → Clean... tool actually do?..

Keep SSH session alive

I use ssh -p8520 username@remote_host to login remote server. Issue: It is always connected and works properly when I am in the work place. Unfortunately, terminal freezes in 10 - 15 minutes after I..

using href links inside <option> tag

I have the following HTML code: <select name="forma"> <option value="Home">Home</option> <option value="Contact">Contact</option> <option value="Sitemap"&..

Max retries exceeded with URL in requests

I'm trying to get the content of App Store > Business: import requests from lxml import html page = requests.get("") tree = html.fromstring(..

How to Query an NTP Server using C#?

All I need is a way to query an NTP Server using C# to get the Date Time of the NTP Server returned as either a string or as a DateTime. How is this possible in its simplest form?..

Resolving ORA-4031 "unable to allocate x bytes of shared memory"

I need some pointers on how to diagnose and fix this problem. I don't know if this is a simple server setup problem or an application design problem (or both). Once or twice every few months this Ora..

iOS application: how to clear notifications?

I've an iOS application where some Push Notification are sent to. My problem is, that the messages/notifications stays in the Notification Center in iOS after then are tapped. How can I remove a notif..

How to refresh activity after changing language (Locale) inside application

My application users can change the language from the app's settings. Is it possible to change the language inside the application without having effect to general language settings ? This question o..

Hide/Show Column in an HTML Table

I have an HTML table with several columns and I need to implement a column chooser using jquery. When a user clicks on a checkbox I want to hide/show the corresponding column in the table. I would l..

Cannot find either column "dbo" or the user-defined function or aggregate "dbo.Splitfn", or the name is ambiguous

Hai guys, I ve used the following split function, CREATE FUNCTION dbo.Splitfn(@String varchar(8000), @Delimiter char(1)) returns @temptable TABLE (items varchar(8000)) as begin..

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile)

I am using Maven 3.0.5 and Spring Tool Source 3.2 with Maven plugin installed. When I try to do 'Run As---> Maven install', I am getting the following error: [INFO] Scanning for projects... [INFO] ..

Best way to encode text data for XML

I was looking for a generic method in .Net to encode a string for use in an Xml element or attribute, and was surprised when I didn't immediately find one. So, before I go too much further, could I j..

How to log PostgreSQL queries?

How to enable logging of all SQL executed by PostgreSQL 8.3? Edited (more info) I changed these lines : log_directory = 'pg_log' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' l..

Retrieving the first digit of a number

I am just learning Java and am trying to get my program to retrieve the first digit of a number - for example 543 should return 5, etc. I thought to convert to a string, but I am not sure how I can co..

how do I initialize a float to its max/min value?

How do I hard code an absolute maximum or minimum value for a float or double? I want to search out the max/min of an array by simply iterating through and catching the largest. There are also positi..

Calling a function every 60 seconds

Using setTimeout() it is possible to launch a function at a specified time: setTimeout(function, 60000); But what if I would like to launch the function multiple times? Every time a time interval p..

how to break the _.each function in underscore.js

I'm looking for a way to stop iterations of underscore.js _.each() method, but can't find the solution. jQuery .each() can break if you do return false. Is there a way to stop underscore each()? _([..

How to set a default row for a query that returns no rows?

I need to know how to return a default row if no rows exist in a table. What would be the best way to do this? I'm only returning a single column from this particular table to get its value. Edit: T..

How to add a class to a given element?

I have an element that already has a class: <div class="someclass"> <img ... id="image1" name="image1" /> </div> Now, I want to create a JavaScript..

Reading a registry key in C#

I have developed an application and installed it on a client computer. In my application I need to get its installation path. My application has a registry entry at: HKEY_LOCAL_MACHINE\SOFTWARE\MyAp..

OnClickListener in Android Studio

I'm attempting to develop and app using the new Android Studio, but I keep receiving major errors on my OnClickListeners. Mainly it is telling me that it cannot resolve symbol "setOnClickListener" and..

Access a global variable in a PHP function

According to the most programming languages scope rules, I can access variables that are defined outside of functions inside them, but why doesn't this code work? <?php $data = 'My data'; ..

Python: How to create a unique file name?

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

Validation to check if password and confirm password are same is not working

Here's my code: function validate_form(thisform) { with (thisform) { if (validate_required(name,"Name must be filled out!")==false) {name.focus();return false;} if (validate_required(coun..

Get product id and product type in magento?

I am creating magento store. I am beginner in magento. I want to get product id and product input type in my phtml file is this possible? please guide me.. I am trying to this way to get product typ..

Select dropdown with fixed width cutting off content in IE

The issue: Some of the items in the select require more than the specified width of 145px in order to display fully. Firefox behavior: clicking on the select reveals the dropdown elements list adjus..

how to resolve DTS_E_OLEDBERROR. in ssis

In an ssis package consists of data flow task,contains OLEDB source and OLDB Target ..provider is sql native client..This used to run fine ..but now got an error as shown below.. Please tell me ho..

Android Fastboot devices not returning device

At the moment I would like to reinstall Android on my device(custom hardware device). I got the image files after building. But when I enter fastboot devices nothing returns. adb devices is working...

How to check if android checkbox is checked within its onClick method (declared in XML)?

I have a checkbox in android which has the following XML: <CheckBox android:id="@+id/item_check" android:layout_width="wrap_content" android:layout_height="wrap_content" android:onClic..

Go to particular revision

I cloned a git repository of a certain project. Can I turn the files to the initial state and when I review the files go to revision 2, 3, 4 ... most recent? I'd like to have an overview of how the pr..

How to refresh a Page using react-route Link

I am trying to refresh a page using react-route Link. But the way I have implemented it goes to the URL one step back.(as an example if the URL was ../client/home/register and when I press the reload ..

Setting an image button in CSS - image:active

I'm trying to replace the submit button with an image by defining it in a class="myButton" and change the styles in CSS. the myButton:active doesn't seem to work when being clicked. Here is my CSS: ..

How do I install Keras and Theano in Anaconda Python on Windows?

I am trying to work on neural networks in Python using the following Keras packages: from keras.utils import np_utils from keras.layers.core import Dense, Activation, Dropout from keras.models import..

How do you use window.postMessage across domains?

It seems like the point of window.postMessage is to allow safe communication between windows/frames hosted on different domains, but it doesn't actually seem to allow that in Chrome. Here's the scena..

Converting .NET DateTime to JSON

Possible Duplicate: How to format a JSON date? My webs service is returning a DateTime to a jQuery call. The service returns the data in this format: /Date(1245398693390)/ How can I conv..

Are dictionaries ordered in Python 3.6+?

Dictionaries are ordered in Python 3.6 (under the CPython implementation at least) unlike in previous incarnations. This seems like a substantial change, but it's only a short paragraph in the documen..

How to install Guest addition in Mac OS as guest and Windows machine as host

I am trying to copy contents from my host machine to a guest machine, but for copying I need to install the Guest additions disk. Or there is there another way to access host machine content on the g..

Javascript, viewing [object HTMLInputElement]

I'm just started to learn HTML. Doing an alert() on one of my variables gives me this result [object HTMLInputElement]. How to get the data, that were added in text field, where my input type is tex..

Does mobile Google Chrome support browser extensions?

Can I create a plugin or an extension for Google Chrome MOBILE (Android Google Chrome)? If not, can I create an extension for Google Chrome (desktop), which will add a button in Google Chrome bar. Th..

how to implement login auth in node.js

I have this node server running : var server=http.createServer(function(request, responsehttp) { if (request.method == 'POST') { var body = ''; request.on('data', function (data) ..

SQL Server insert if not exists best practice

I have a Competitions results table which holds team member's names and their ranking on one hand. On the other hand I need to maintain a table of unique competitors names: CREATE TABLE Competitors ..

ASP.NET Temporary files cleanup

Can I safely delete the contents of this folder C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root on a Windows 2003 R2 standard system, given that I am not using IIS (6/..

Spring CORS No 'Access-Control-Allow-Origin' header is present

I am getting the following problem after porting web.xml to java config No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63342' is therefore not ..

How can I profile C++ code running on Linux?

I have a C++ application, running on Linux, which I'm in the process of optimizing. How can I pinpoint which areas of my code are running slowly?..

Replace Fragment inside a ViewPager

I'm trying to use Fragment with a ViewPager using the FragmentPagerAdapter. What I'm looking for to achieve is to replace a fragment, positioned on the first page of the ViewPager, with another one. ..

How to make vim paste from (and copy to) system's clipboard?

Unlike other editors, vim stores copied text in its own clipboard. So, it's very hard for me to copy some text from a webpage and paste it into the current working file. It so happens I have to either..

Adding to the classpath on OSX

Can anyone tell me how to add to the classpath on OSX? ..

How to tell if a string is not defined in a Bash shell script

If I want to check for the null string I would do [ -z $mystr ] but what if I want to check whether the variable has been defined at all? Or is there no distinction in Bash scripting?..

What do Push and Pop mean for Stacks?

long story short my lecturer is crap, and was showing us infix to prefix stacks via an overhead projector and his bigass shadow was blocking everything so i missed the important stuff he was referri..

What underlies this JavaScript idiom: var self = this?

I saw the following in the source for WebKit HTML 5 SQL Storage Notes Demo: function Note() { var self = this; var note = document.createElement('div'); note.className = 'note'; note.add..

CSS vertical alignment text inside li

I am displaying number of boxes in a row with fix height and width, generated from <li> tags. now I need to align the text in the vertical center. The CSS vertical-align has no impact, maybe I..

Initializing a dictionary in python with a key value and no corresponding values

I was wondering if there was a way to initialize a dictionary in python with keys but no corresponding values until I set them. Such as: Definition = {'apple': , 'ball': } and then later i can set ..

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

How to remove provisioning profiles from Xcode

Does anyone know how to remove previously installed provisioning profiles from Xcode? I have seen this link, but I am not able to find that location in my system. So I think there must be some other..

Spring MVC UTF-8 Encoding

At the moment I'm trying to get started with Spring MVC. While trying things out I ran into an encoding issue. I want to display UTF-8 characters on my JSP-Pages so I added a String with UTF-8 chara..

How do I do an OR filter in a Django query?

I want to be able to list the items that either a user has added (they are listed as the creator) or the item has been approved. So I basically need to select: item.creator = owner or item.moderated..

How to display the value of the bar on each bar with pyplot.barh()?

I generated a bar plot, how can I display the value of the bar on each bar? Current plot: What I am trying to get: My code: import os import numpy as np import matplotlib.pyplot as plt x = [u..

Delete entire row if cell contains the string X

I am new to VBA and I am trying to come up with a way to delete all rows (and shift cells up, if possible) where the website column cell contains the word none. The table contains 5000+ records and th..

How to use if statements in LESS

I'm looking for some kind of if-statement to control the background-color of different div elements. I have tried the below, but it doesn't compile @debug: true; header { background-color: (yello..

Should black box or white box testing be the emphasis for testers?

Which type of testing would you say should be the emphasis (for testers/QAs), and why? A quick set of definitions from wikipedia: Black box testing takes an external perspective of the test objec..

Is there a command for formatting HTML in the Atom editor?

I would like to format my HTML with a command, as I do in Visual Studio, using Ctrl+K+D. Is this possible in Atom? If not, are there other options?..

Call japplet from jframe

I Designed JApplet class manually and I designed main class by using Netbean Builder which generate the code automatically by default the class will be extends JFrame. so how can I run the JApplet cla..

sys.argv[1] meaning in script

I'm currently teaching myself Python and was just wondering (In reference to my example below) in simplified terms what the sys.argv[1] represents. Is it simply asking for an input? #!/usr/bin/python..

LINQ: Distinct values

I have the following item set from an XML: id category 5 1 5 3 5 4 5 3 5 3 I need a distinct list of these items: 5 1 5..

Generating UML from C++ code?

Is there a tool that can parse C++ files within a project and generate UML from it?..

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

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

How to modify a text file?

I'm using Python, and would like to insert a string into a text file without deleting or copying the file. How can I do that?..

SQL count rows in a table

I need to send a SQL query to a database that tells me how many rows there are in a table. I could get all the rows in the table with a SELECT and then count them, but I don't like to do it this way. ..

JavaScript moving element in the DOM

Let's say I have three <div> elements on a page. How can I swap positions of the first and third <div>? jQuery is fine...

Add timestamp column with default NOW() for new rows only

I have a table that has thousands of rows. Since the table wasn't constructed with created_at column initially, there is no way of getting their creation timestamp. It is crucial though to start getti..

How can I install a CPAN module into a local directory?

I'm using a hosted Linux machine so I don't have permissions to write into the /usr/lib directory. When I try to install a CPAN module by doing the usual: perl Makefile.PL make test make install T..

How to upgrade pip3?

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

How to change the color of a button?

I'm new to android programming. How do I change the color of a button? <Button android:id="@+id/btn" android:layout_width="55dp" android:layout_height="50dp" android:layout_gravity..

Node JS Promise.all and forEach

I have an array like structure that exposes async methods. The async method calls return array structures that in turn expose more async methods. I am creating another JSON object to store values obta..

Error : java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V

I am developing a small Spring application. I have to store the details of the student information in the database. I have developed one SimpleFormController. I have used NetBeans + Hibernate mapping ..

How can I rename a conda environment?

I have a conda environment named old_name, how can I change its name to new_name without breaking references?..

How to redirect the output of the time command to a file in Linux?

Just a little question about timing programs on Linux: the time command allows to measure the execution time of a program: [ed@lbox200 ~]$ time sleep 1 real 0m1.004s user 0m0.000s sys 0m0...

Mythical man month 10 lines per developer day - how close on large projects?

Everybody always says that they can beat the "10 lines per developer per day" from the "Mythical Man Month", and starting a project, I can usually get a couple hundred lines in in a day. But at my pr..

How to manually reload Google Map with JavaScript

I am using this piece of code within a Bootstrap template. I am facing issues when loading images within a Bootstrap Tab content pane. This is the JavaScript code which I use to initialize the Map: ..

How to change resolution (DPI) of an image?

I have a JPEG picture with a DPI of 72. I want to change 72 dpi to 300 dpi. How could I change resolution of JPEG pictures using C#?..

How to get the difference between two dictionaries in Python?

I have two dictionaries. I need to find the difference between the two which should give me both key and value. I have searched and found some addons/packages like datadiff, dictdiff-master but when ..

write a shell script to ssh to a remote machine and execute commands

I have two questions: There are multiple remote linux machines, and I need to write a shell script which will execute the same set of commands in each machine. (Including some sudo operations). How ..

How to redirect a page using onclick event in php?

I tried with this code but it's not working, <input type="button" value="Home" class="homebutton" id="btnHome" onClick="<?php header("Location: /index.php"); ?>" /> ..

Not equal to != and !== in PHP

I've always done this: if ($foo !== $bar) But I realized that if ($foo != $bar) is correct too. Double = still works and has always worked for me, but whenever I search PHP operators I find no infor..

javax.servlet.ServletException cannot be resolved to a type in spring web app

I am developing web app using spring frame work, but i am getting following error in some of the jsp pages. javax.servlet.ServletException cannot be resolved to a type I have included servlet-api a..

How to write a PHP ternary operator

How do I write a PHP ternary operator with the elseif portion? I see basic examples with the if and else portions of the PHP ternary operator like this: echo (true) ? "yes" : "no"; //prints yes ..

How to pass the id of an element that triggers an `onclick` event to the event handling function

How do I pass the id of an element that triggers an onclick event to the event handling function. I am doing something like this- <link onclick="doWithThisElement(id_of_this_element)" /> ..

Tracking the script execution time in PHP

PHP must track the amount of CPU time a particular script has used in order to enforce the max_execution_time limit. Is there a way to get access to this inside of the script? I'd like to include ..

How do I negate a condition in PowerShell?

How do I negate a conditional test in PowerShell? For example, if I want to check for the directory C:\Code, I can run: if (Test-Path C:\Code){ write "it exists!" } Is there a way to negate that..

How to group time by hour or by 10 minutes

like when I do SELECT [Date] FROM [FRIIB].[dbo].[ArchiveAnalog] GROUP BY [Date] how can I specify the group period ? MS SQL 2008 2nd Edit I'm trying SELECT MIN([Date]) AS RecT, AVG(Value)..

How to pass parameters or arguments into a gradle task

I have a gradle build script into which I am trying to include Eric Wendelin's css plugin - Its easy enough to implement, and because I only want minificati..

Best way to get value from Collection by index

What is the best way to get value from java.util.Collection by index?..

What's the reason I can't create generic array types in Java?

What's the reason why Java doesn't allow us to do private T[] elements = new T[initialCapacity]; I could understand .NET didn't allow us to do that, as in .NET you have value types that at run-time..

Dynamic height for DIV

I have the following DIV <div id="products"> </div> #products { height: 102px; width: 84%; padding:5px; margin-bottom:8px; border: 1px solid #EFEFEF; } Now inside the DIV,..

Batch Files - Error Handling

I'm currently writing my first batch file for deploying an solution. I've been Googling a bit for a general error handling approach and can't find anything really useful. Basically if any thi..

How do I get first element rather than using [0] in jQuery?

I'm new to jQuery, apologies if this is a silly question. When I use it find an element using the id, I know theres always one match and in order to access it I would use the index [0]. Is there a be..

Count the number of times a string appears within a string

I simply have a string that looks something like this: "7,true,NA,false:67,false,NA,false:5,false,NA,false:5,false,NA,false" All I want to do is to count how many times the string "true" appears in ..

Jaxb, Class has two properties of the same name

with jaxb, i try to read an xml file only a few element in xml file are interesting, so i would like to skip many element xml content xml i try to read <?xml version="1.0" encoding="UTF-8"?> ..

async at console app in C#?

I have this simple code : public static async Task<int> SumTwoOperationsAsync() { var firstTask = GetOperationOneAsync(); var secondTask = GetOperationTwoAsync(); return await first..

ios simulator: how to close an app

When you "run" the simulator from xCode, the app automatically launches, and then you can click the home button to suspend the app. What I want to do is close the app from within the simulator. So, ho..

How to make a dropdown readonly using jquery?

I am using the following statement to make it readonly but it is not working. $('#cf_1268591').attr("readonly", "readonly"); I don't want make it disabled, I want to make it readonly...

How to backup Sql Database Programmatically in C#

I want to write a code to backup my Sql Server 2008 Database using C# in .Net 4 FrameWork. Can anyone help in this...

How do I add a library path in cmake?

I have 2 folders "inc" and "lib" in my project which have headers and static libs respectively. How do I tell cmake to use those 2 directories for include and linking respectively?..

When to use RDLC over RDL reports?

I have been studying SSRS 2005 / 2008 in the past weeks and have created some server side reports. For some application, a colleague suggested that I look into RDLC for that particular situation. I am..

JAXB: how to marshall map into <key>value</key>

The question is about JAXB Map marshalling - there is plenty of examples on how to marhsall a Map into a structure like follows: <map> <entry> <key> KEY </key> <v..

jquery can't get data attribute value

I am trying to set a variable in jQuery. The value is supposed to be set on the click event of the button. The onclick event fires but the x10Device variable remains undefined. I am on jquery 1.7.1..

How to: Add/Remove Class on mouseOver/mouseOut - JQuery .hover?

Looking to change the border color on a box.. ..when the user mouses over/out.. Here's the attempted code.. Needs Work! JQuery: <script> $("result").hover( function () { $(this).addCla..

How to do a https request with bad certificate?

Say I want to get programatically. Currently (ssl) has a bad certificate which is issued to * So when I run this: package main import ( "log" "net/h..

#1292 - Incorrect date value: '0000-00-00'

I referenced many questions which have the same title as mine, but they have a different approach and different issue so this question is not a duplicate. I have a table in which column fm_sctrdate i..

from list of integers, get number closest to a given value

Given a list of integers, I want to find which number is the closest to a number I give in input: >>> myList = [4, 1, 88, 44, 3] >>> myNumber = 5 >>> takeClosest(myList, my..

How do I to insert data into an SQL table using C# as well as implement an upload function?

Below is the code I am working with to try to insert data into my 'ArticlesTBL' table. I also want to upload an image file to my computer. I am getting an error reading: Incorrect syntax near 'Uploa..

How to construct a std::string from a std::vector<char>?

Short of (the obvious) building a C style string first then using that to create a std::string, is there a quicker/alternative/"better" way to initialize a string from a vector of chars?..

ImportError: No module named requests

Whenever I try to import requests, I get an error saying No module Named requests. import requests The error I get: File "", line 1, in <module> import requests ImportError: No mod..

auto run a bat script in windows 7 at login

I have recently acquired a windows 7 laptop from my late grandmother. I have been using it for work and other things. I decided to create a VM using VirtualBox And now I want to create a user on the (..

Only allow Numbers in input Tag without Javascript

I am fairly new. I am creating a webpage that ask a user for their ID. I want it to be a required field and only allow numbers. I appreciate if you lead me in the correct direction. this is what I ha..

How do I get the current username in Windows PowerShell?

How do I get the current username in Windows PowerShell?..

Android SDK Manager Not Installing Components

Not sure what I'm doing wrong here. I installed the Android SDK Manager, and am now trying to install a platform like the Android Dev website suggests. Once I clicked install I got an error stating th..

String comparison - Android

I'm unable to compare two strings using the following code: I have a string named "gender" which will have "Male" or "Female" as its value. if(gender == "Male") salutation ="Mr."; if(gender == "F..

Neither BindingResult nor plain target object for bean name available as request attr

Hi Experts, I have this controller code which is throwing the above mentioned error. It was working fine till yesterday, I have no clue what colleague did to this code and today I am seeing the erro..

Calculate the date yesterday in JavaScript

How can I calculate yesterday as a date in JavaScript?..

How to get the CPU Usage in C#?

I want to get the overall total CPU usage for an application in C#. I've found many ways to dig into the properties of processes, but I only want the CPU usage of the processes, and the total CPU like..

Looking for a short & simple example of getters/setters in C#

I am having trouble understanding the concept of getters and setters in the C# language. In languages like Objective-C, they seem an integral part of the system, but not so much in C# (as far as I can..

How to get the html of a div on another page with jQuery ajax?

I'm using jQuery's ajax code to load new pages, but wanted him to get only the html of a div. My codes: HTML: <body> <div id="content"></div> </body> Script: $.ajax({ ..

WebView showing ERR_CLEARTEXT_NOT_PERMITTED although site is HTTPS

I'm starting to work on an app on Android, so I don't have much. All I have is just a WebView so far. I created the project in Android Studio, and my project got set as an Android InstantApp. I'm not ..

Regular Expressions- Match Anything

How do I make an expression to match absolutely anything (including whitespaces)? Example: Regex: I bought _____ sheep. Matches: I bought sheep. I bought a sheep. I bought five sheep. I tried using ..

How to delete columns in pyspark dataframe

>>> a DataFrame[id: bigint, julian_date: string, user_id: bigint] >>> b DataFrame[id: bigint, quan_created_money: decimal(10,0), quan_created_cnt: bigint] >>> a.join(b,

Best way to pass parameters to jQuery's .load()

Is there a difference in passing parameters to .load $("#myDiv").load("myScript.php?var=x&var2=y&var3=z") vs $("#myDiv").load("myScript.php", {var1:x, var2:y, var3:z}) Also, is there a s..

Application not picking up .css file (flask/python)

I am rendering a template, that I am attempting to style with an external style sheet. File structure is as follows. /app - /services - /templates - ..

How to change Vagrant 'default' machine name?

Where does the name 'default' come from when launching a vagrant box? $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... Is there a way to set this?..