Questions Tagged with #Fetchxml

A proprietary query language used in Dynamics CRM. It can be used in Javascript, SSRS, and web services.

HTTP 415 unsupported media type error when calling Web API 2 endpoint

I have an existing Web API 2 service and need to modify one of the methods to take a custom object as another parameter, currently the method has one parameter which is a simple string coming from the..

How to change the docker image installation directory?

From what I can tell, docker images are installed to /var/lib/docker as they are pulled. Is there a way to change this location, such as to a mounted volume like /mnt?..

Deprecation warning in Moment.js - Not in a recognized ISO format

I'm getting a warning that a value provided to moment is not in a recognized ISO format. I changed my variable today with the moment function and still it doesn't work. Here's the warning error: Depr..

Add button to a layout programmatically

I'm having trouble adding a button to a layout that I've created in XML. Here's what I want to achieve: //some class else { startActivity(new Intent(StatisticsScreen.this, ScreenTemperature.c..

How can I build multiple submit buttons django form?

I have form with one input for email and two submit buttons to subscribe and unsubscribe from newsletter: <form action="" method="post"> {{ form_newsletter }} <input type="submit" name="news..

GUI-based or Web-based JSON editor that works like property explorer

Background: This is a request for something that may not exist yet, but I've been meaning to build one for a long time. First I will ask if anyone has seen anything like it yet. Suppose you have an ar..

How do I find out what type each object is in a ArrayList<Object>?

I have a ArrayList made up of different elements imported from a db, made up of strings, numbers, doubles and ints. Is there a way to use a reflection type technique to find out what each type of data..

How do I format a date as ISO 8601 in moment.js?

This docs mention moment.ISO_8601 as a formatting option (from 2.7.0 - http://momentjs.com/docs/#/parsing/special-formats/), but neither of these work (even 2.7.0): var date = moment(); date.format(m..

Check synchronously if file/directory exists in Node.js

How can I synchronously check, using node.js, if a file or directory exists?..

Checking whether a variable is an integer or not

How do I check whether a variable is an integer?..

How to git reset --hard a subdirectory?

UPDATE²: With Git 2.23 (August 2019), there's a new command git restore that does this, see the accepted answer. UPDATE: This will work more intuitively as of Git 1.8.3, see my own answer. ..

JSON and XML comparison

I want to know which is faster: XML and JSON? When to use which one ?..

JQuery Event for user pressing enter in a textbox?

Is there any event in Jquery that's triggered only if the user hits the enter button in a textbox? Or any plugin that can be added to include this? If not, how would I write a quick plugin that would ..

batch file to list folders within a folder to one level

I have searched and searched to no avail so apologies if the answer does exist. I am not very good with batch files so please keep this in mind. All I am after is a single batch file that will list/..

jQuery Ajax calls and the Html.AntiForgeryToken()

I have implemented in my app the mitigation to CSRF attacks following the informations that I have read on some blog post around the internet. In particular these post have been the driver of my imple..

set div height using jquery (stretch div height)

I have 3 divs with ids header, content and footer. Header and footer has fixed height and they are styled to float on top and bottom. I want the middle content height calculated automatically with jqu..

Standard concise way to copy a file in Java?

It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a buffer, reading in one file, looping through it, and writing it out to the other steam. The we..

Why is it faster to check if dictionary contains the key, rather than catch the exception in case it doesn't?

Imagine the code: public class obj { // elided } public static Dictionary<string, obj> dict = new Dictionary<string, obj>(); Method 1 public static obj FromDict1(string name) { ..

Access restriction on class due to restriction on required library rt.jar?

I'm attempting to compile Java 1.4 code that was created by IBM's WSDL2Java on Java5 without recreating the stubs and saw this error in Eclipse. I'm under the assumption that the stubs generated shoul..

Losing scope when using ng-include

I have this module routes: var mainModule = angular.module('lpConnect', []). config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/home', {template:'views/home...

html script src="" triggering redirection with button

i have the following login.html page for login located in design folder. <html> <head> <title>Login Page</title> <script src="../Script/login.js"> </script&..

Concat strings by & and + in VB.Net

Is there any difference between & and + operators while concatenating string? if yes, then what is difference? And if No, then why below code generating exception? Example: Dim s, s1, t As S..

Compare 2 JSON objects

Possible Duplicate: Object comparison in JavaScript Is there any method that takes in 2 JSON objects and compares the 2 to see if any data has changed? Edit After reviewing the comments, ..

How to listen for 'props' changes

In the VueJs 2.0 docs I can't find any hooks that would listen on props changes. Does VueJs have such hooks like onPropsUpdated() or similar? Update As @wostex suggested, I tried to watch my prope..

Difference between adjustResize and adjustPan in android?

I tried to write a code which is used to re-size the UI components when soft-keyboard appears. When I use adjustResize, it res-size the UI components and at the same time adjustPan gave me same outpu..

How do I find out what is hammering my SQL Server?

My SQL Server CPU has been at around 90% for the most part of today. I am not in a position to be able to restart it due to it being in constant use. Is it possible to find out what within SQL is ca..

What does the question mark and the colon (?: ternary operator) mean in objective-c?

What does this line of code mean? label.frame = (inPseudoEditMode) ? kLabelIndentedRect : kLabelRect; The ? and : confuse me...

How do I get row id of a row in sql server

I have one table CSBCA1_5_FPCIC_2012_EES207201222743, having two columns employee_id and employee_name I have used following query SELECT ROW_NUMBER() OVER (ORDER BY EMPLOYEE_ID) AS ID, EMPLOYEE_ID..

How to add rows dynamically into table layout

I have certain data in sqllite and it update every time whenever, I click on save button and I want to show the data into a table layout for adding more rows for updated data. I have certain code but..

Replace characters from a column of a data frame R

I have a data frame a <- runif (10) b <- letters [1:10] c <- c(rep ("A-B", 4), rep("A_C", 6)) data1 <- data.frame (a, b, c) data1 And I wan to replace _ in A_C of column c for - to hav..

Remove Project from Android Studio

Does any one know how to remove a project from Android Studio in an attempt to re- export it from Eclipse? So far I have tried removing all the gradle files associated with the project, which causes..

Send form data using ajax

I want to send all input in a form with ajax .I have a form like this. <form action="target.php" method="post" > <input type="text" name="lname" /> <input type="text" name="fn..

Disable submit button ONLY after submit

I have the following HTML and jquery: <html dir="ltr" lang="en"> <head> </head> <body> <h2>Test disabling submit button for 1 minute...</h2> <br/> <p s..

Accessing the last entry in a Map

How to move a particular HashMap entry to Last position? For Example, I have HashMap values like this: HashMap<String,Integer> map = new HashMap<String,Integer>(); map= {Not-Specified 1..

Why use Ruby's attr_accessor, attr_reader and attr_writer?

Ruby has this handy and convenient way to share instance variables by using keys like attr_accessor :var attr_reader :var attr_writer :var Why would I choose attr_reader or attr_writer if I could s..

Change CSS class properties with jQuery

Is there a way to change the properties of a CSS class, not the element properties, using jQuery? This is a practical example: I have a div with class red .red {background: red;} I want to change..

Get random item from array

$items = Array(523,3452,334,31,...5346); Each item of this array is some number. How do I get random item from $items?..

File Upload ASP.NET MVC 3.0

(Preface: this question is about ASP.NET MVC 3.0 which was released in 2011, it is not about ASP.NET Core 3.0 which was released in 2019) I want to upload file in asp.net mvc. How can I upload the fi..

Python convert object to float

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

How to create Gmail filter searching for text only at start of subject line?

We receive regular automated build messages from Jenkins build servers at work. It'd be nice to ferret these away into a label, skipping the inbox. Using a filter is of course the right choice. The..

Why call super() in a constructor?

I'm dealing with a class which extends JFrame. It's not my code and it makes a call to super before it begins constructing the GUI. I'm wondering why this is done since I've always just accessed the ..

Create Test Class in IntelliJ

I'm working within the traditional Maven Java project structure inside IntelliJ, e.g. main/java/com/x/y test/java/com/x/y When I create a class called Foo in main/java/com/x/y using IntelliJ I woul..

Fire event on enter key press for a textbox

I have the following asp.net textbox control. <asp:TextBox ID="txtAdd" runat="server" /> After the user writes something in this textbox and presses the ENTER key, I want to run some code fro..

See line breaks and carriage returns in editor

Does anyone know of a text editor on Linux that allows me to see line breaks and carriage returns? Does Vim support this feature?..

How can I add a table of contents to a Jupyter / JupyterLab notebook?

The documentation at http://ipython.org/ipython-doc/stable/interactive/notebook.html says You can provide a conceptual structure for your computational document as a whole using different levels o..

C# Equivalent of SQL Server DataTypes

For the following SQL Server datatypes, what would be the corresponding datatype in C#? Exact Numerics bigint numeric bit smallint decimal smallmoney int tinyint money Approximate Numerics floa..

How to set zoom level in google map

Here is the code I have written to add a marker to the google map by providing latitude and longitude. The problem is that I get a very highly zoomed google map. I have tried setting the zoom level to..

OpenSSL Command to check if a server is presenting a certificate

I'm trying to run an openssl command to narrow down what the SSL issue might be when trying to send an outbound message from our system. I found this command in another topic: Using openssl to get th..

Rename a column in MySQL

I am trying to rename a column in MySQL community server 5.5.27 using this SQL expression: ALTER TABLE table_name RENAME COLUMN old_col_name TO new_col_name; I also tried ALTER TABLE table_name ..

Error: More than one module matches. Use skip-import option to skip importing the component into the closest module

When I try to create a component in the angular cli, it's showing me this error. How do I get rid of it ? Error: More than one module matches. Use skip-import option to skip importing the componen..

PowerShell To Set Folder Permissions

I am trying to use the "default" options in applying folder permissions; by that, I mean that using the "Full Controll, Write, Read, etc" in the 'Properties' for a folder. The following script works ..

How to update a value in a json file and save it through node.js

How do I update a value in a json file and save it through node.js? I have the file content: var file_content = fs.readFileSync(filename); var content = JSON.parse(file_content); var val1 = content.v..

regex match any whitespace

I want to make a replacement using regex and preg_replace function. this is my code $verif = "/wordA(\s*)wordB(?! wordc)/i"; $replacement = 'wordA wordb wordc'; $newvar = preg_replace($verif, $replac..

Best way to update data with a RecyclerView adapter

When I have to use a classic adapter with a ListView, I update my data in the ListView like this: myAdapter.swapArray(data); public swapArray(List<Data> data) { clear(); addAll(data); no..

Sublime Text from Command Line

I installed Sublime Text and wanted to know how to open rb files in it from the terminal. I saw What is the command to make Sublime Text my core editor? and I see that I can make Sublime my core edito..

Convert RGB values to Integer

So in a BufferedImage, you receive a single integer that has the RGB values represented in it. So far I use the following to get the RGB values from it: // rgbs is an array of integers, every single ..

Formula to check if string is empty in Crystal Reports

I have written a formula to return a string based on logic run on a string field in my database. I have everything working, except I'm unable to return when the field is the empty string. This is wh..

How to run different python versions in cmd

How can I configure windows command dialog to run different python versions in it? For example when I type python2 it runs python 2.7 and when I type python3 it runs python 3.3? I know how to configur..

How to display full (non-truncated) dataframe information in html when converting from pandas dataframe to html?

I converted a pandas dataframe to an html output using the DataFrame.to_html function. When I save this to a separate html file, the file shows truncated output. For example, in my TEXT column, df...

Accessing SQL Database in Excel-VBA

I am copying an VBA code snippet from MSDN that shows me how to grab results from a SQL query into excel sheet (Excel 2007): Sub GetDataFromADO() 'Declare variables' Set objMyConn = New ..

Perform Button click event when user press Enter key in Textbox

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button..

Regex to check if valid URL that ends in .jpg, .png, or .gif

I would like users to submit a URL that is valid but also is an image, ending with .jpg, .png, or .gif...

SimpleDateFormat returns 24-hour date: how to get 12-hour date?

I want current time in millis and then to store it in 12 hour format but with this piece of code I am getting 24 hour format time. long timeInMillis = System.currentTimeMillis(); Calendar cal1 = Cale..

How to capture a list of specific type with mockito

Is there a way to capture a list of specific type using mockitos ArgumentCaptore. This doesn't work: ArgumentCaptor<ArrayList<SomeType>> argument = ArgumentCaptor.forClass(ArrayList.class..

Oracle query execution time

I would like to get the query execution time in Oracle. I don't want the time Oracle needs to print the results - just the execution time. In MySQL it is easy to get the execution time from the shell..

Excel: VLOOKUP that returns true or false?

In Excel we have the VLOOKUP function that looks for a value in a column in a table and then returns a value from a given column in that table if it finds something. If it doesn't, it produces an erro..

Android Google Maps API V2 Zoom to Current Location

I'm trying to mess around with the Maps API V2 to get more familiar with it, and I'm trying to start the map centered at the user's current location. Using the map.setMyLocationEnabled(true); statemen..

Angular CLI SASS options

I'm new to Angular and I'm coming from the Ember community. Trying to use the new Angular-CLI based off of Ember-CLI. I need to know the best way to handle SASS in a new Angular project. I tried usi..

How do you grep a file and get the next 5 lines

How do I grep a file for 19:55 and get the Line 1,2,3,4,5? 2013/10/08 19:55:27.471 Line 1 Line 2 Line 3 Line 4 Line 5 2013/10/08 19:55:29.566 Line 1 Line 2 Line 3 Line 4 Line 5 ..

How to match "anything up until this sequence of characters" in a regular expression?

Take this regular expression: /^[^abc]/. This will match any single character at the beginning of a string, except a, b, or c. If you add a * after it – /^[^abc]*/ – the regular expression will c..

jQuery AJAX Character Encoding

I'm currently coding a French website. There's a schedule page, where a link on the side can be used to load another day's schedule. Here's the JS I'm using to do this: <script type="text/jav..

Oracle Differences between NVL and Coalesce

Are there non obvious differences between NVL and Coalesce in Oracle? The obvious differences are that coalesce will return the first non null item in its parameter list whereas nvl only takes two pa..

How to coerce a list object to type 'double'

The code: a <- structure(list(`X$Days` = c("10", "38", "66", "101", "129", "185", "283", "374")), .Names = "X$Days") Then a is like $`X$Days` [1] "10" "38" "..

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

Disable elastic scrolling in Safari

I just wanted to diable the elastic scrolling/bounce effect in Safari (OSX Lion). I found the solution to set overflow: hidden for body in css, but as expected it only disables the scrollbar, so if t..

long long int vs. long int vs. int64_t in C++

I experienced some odd behavior while using C++ type traits and have narrowed my problem down to this quirky little problem for which I will give a ton of explanation since I do not want to leave anyt..

How to store a list in a column of a database table

So, per Mehrdad's answer to a related question, I get it that a "proper" database table column doesn't store a list. Rather, you should create another table that effectively holds the elements of sai..

Job for mysqld.service failed See "systemctl status mysqld.service"

Console says [root@ip-172-31-18-2 mysql]# service mysqld start Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See "systemctl statu..

mySQL :: insert into table, data from another table?

I was wondering if there is a way to do this purely in sql: q1 = SELECT campaign_id, from_number, received_msg, date_received FROM `received_txts` WHERE `campaign_id` = '8'; INSERT INTO action_..

Find and replace with a newline in Visual Studio Code

I am trying out the new Microsoft Visual Studio Code editor in Linux Fedora environment. I would like to know how to replace new line (\n) in place of some other text. For example, I have html text ..

Simplest/cleanest way to implement a singleton in JavaScript

What is the simplest/cleanest way to implement the singleton pattern in JavaScript?..

JSON find in JavaScript

Is there a better way other than looping to find data in JSON? It's for edit and delete. for(var k in objJsonResp) { if (objJsonResp[k].txtId == id) { if (action == 'delete') { objJsonRes..

How to enumerate an enum with String type?

enum Suit: String { case spades = "?" case hearts = "?" case diamonds = "?" case clubs = "?" } For example, how can I do something like: for suit in Suit { // do something with ..

How to remove decimal part from a number in C#

I have number of type double. double a = 12.00 I have to make it as 12 by removing .00 Please help me..

IE9 jQuery AJAX with CORS returns "Access is denied"

The following works in all browsers except IE (I'm testing in IE 9). jQuery.support.cors = true; ... $.ajax( url + "messages/postMessageReadByPersonEmail", { ..

How to hide 'Back' button on navigation bar on iPhone?

I added a navigation control to switch between views in my app. But some of the views shouldn't have 'Back' (the previous title) button. Any ideas about how to hide the back button?..

Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib

When starting up my web site for the first time, I'm getting this error Could not load type 'System.Runtime.CompilerServices.ExtensionAttribute' from assembly 'mscorlib, Version=4.0.0.0, Culture=neut..

How to solve ERR_CONNECTION_REFUSED when trying to connect to localhost running IISExpress - Error 502 (Cannot debug from Visual Studio)?

This is running on Windows Server 2008 and used to work several months ago. I am just now using this server again for some dev work with VS. This is live web server used to serve up a few test sites..

Open files always in a new tab

I am using Visual Studio Code 1.3.1 with the newly introduced tabs. When I click on files, the first file will open in a tab. If I do not make any changes to this file, the second clicked file will o..

Absolute and Flexbox in React Native

I would like to put a white bar which would take all of the width at the bottom of the screen. To do so I thought about using absolute positioning with the inherited flexbox parameters. With the fol..

ping response "Request timed out." vs "Destination Host unreachable"

When I ping an IP address, what is the difference between Request timed out and Destination host unreachable returned from the command?..

UNC path to a folder on my local computer

What's the UNC path to a folder on my local computer, and how can I access it? I have tried: Security for the folder -- set to Everyone Full Control (for now!) Sharing permissions -- set to Everyone..

Convert a row of a data frame to vector

I want to create a vector out of a row of a data frame. But I don't want to have to row and column names. I tried several things... but had no luck. This is my data frame: > df <- data.frame(a..

How to overload functions in javascript?

Classical (non-js) approach to overloading: function myFunc(){ //code } function myFunc(overloaded){ //other code } Javascript wont let more than one function be defined with the same name. As s..

Excel error HRESULT: 0x800A03EC while trying to get range with cell's name

I am working with Window Service project. that have to write data to a sheet in Excel file in a sequence times. But sometimes, just sometimes, the service throw out the exception "Exception from HRES..

ant build.xml file doesn't exist

After the installation of my ant in my windows 7 . In cmd i typed ant -v it's given the ant version but it says the following also. Buildfile: build.xml does not exist! Build failed What's the pro..

error: ‘NULL’ was not declared in this scope

I get this message when compiling C++ on gcc 4.3 error: ‘NULL’ was not declared in this scope It appears and disappears and I don't know why. Why? Thanks...

Sort a Custom Class List<T>

I would like to sort my list with the date property. This is my custom class: using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Test.Web { public clas..

What's the difference between echo, print, and print_r in PHP?

I use echo and print_r much, and almost never use print. I feel echo is a macro, and print_r is an alias of var_dump. But that's not the standard way to explain the differences...

How to parse JSON data with jQuery / JavaScript?

I have a AJAX call that returns some JSON like this: $(document).ready(function () { $.ajax({ type: 'GET', url: 'http://example/functions.php', data: { get_param: 'valu..

How to make a background 20% transparent on Android

How do I make the background of a Textview about 20% transparent (not fully transparent), where there is a color in the background (i.e. white)?..

Return value using String result=Command.ExecuteScalar() error occurs when result returns null

I want to fetch 1st row 1st cell value from database it works well with below code . But when there is no result found it throws Exception. How to handle with DBNull . Should i change my query ? whic..

1052: Column 'id' in field list is ambiguous

I have 2 tables. tbl_names and tbl_section which has both the id field in them. How do I go about selecting the id field, because I always get this error: 1052: Column 'id' in field list is ambiguous..

show icon in actionbar/toolbar with AppCompat-v7 21

I tried these - but still do not see the icon like before: getSupportActionBar().setLogo(R.drawable.ic_launcher); getSupportActionBar().setDisplayUseLogoEnabled(true); getSupportActionBar().setIcon(R..

pandas groupby sort within groups

I want to group my dataframe by two columns and then sort the aggregated results within the groups. In [167]: df Out[167]: count job source 0 2 sales A 1 4 sales B 2 6 sales C 3 ..

Import JavaScript file and call functions using webpack, ES6, ReactJS

Trying to do something I would think would be very simple. I would like to import an existing JavaScript library and then call it's functions. So for example I would like to import blah.js and then c..

Available text color classes in Bootstrap

I'm developing a sign up page, by putting some text as the title at the navigation bar. I want to give those texts different colors. For this purpose I'm using a separate CSS file, but I want to do th..

Float sum with javascript

Possible Duplicate: Is JavaScript's Math broken? I'm calculating the sum of several float values using javascript and... I've noticed a strange thing never seen before. Executing this c..

Using a dictionary to count the items in a list

I'm new to Python and I have a simple question, say I have a list of items: ['apple','red','apple','red','red','pear'] Whats the simpliest way to add the list items to a dictionary and count how ma..

How to pass multiple parameter to @Directives (@Components) in Angular with TypeScript?

Since I've created @Directive as SelectableDirective, I'm little bit confused, about how to pass more than one value to the custom directive. I have searched a lot but didn't get proper solution in An..

How to bind Close command to a button

The easiest way is to implement ButtonClick event handler and invoke Window.Close() method, but how doing this through a Command binding? ..

Export table to file with column headers (column names) using the bcp utility and SQL Server 2008

I have seen a number of hacks to try to get the bcp utility to export column names along with the data. If all I am doing is dumping a table to a text file what is the most straightforward method to h..

git pull error "The requested URL returned error: 503 while accessing"

I've been facing problems accessing my git repository lately. It worked perfectly fine earlier but now I cannot run any command on CLI. I can however, access the corresponding Web Page, Could someone..

Double decimal formatting in Java

I'm having some problems formatting the decimals of a double. If I have a double value, e.g. 4.0, how do I format the decimals so that it's 4.00 instead?..

How to prevent page from reloading after form submit - JQuery

I am working on a website for my app development class and I have the weirdest issue. I am using a bit of JQuery to send form data to a php page called 'process.php, and then upload it to my DB. The..

TypeError: Cannot read property 'then' of undefined

loginService.islogged() Above function return a string like "failed". However, when I try to run then function on it, it will return error of TypeError: Cannot read property 'then' of undefined ..

Can't load IA 32-bit .dll on a AMD 64-bit platform

I am trying to use SVMLight from Java, using the JNI wrapper on this page: static { System.loadLibrary("lib/JNI_SVM-light-6.01/lib/svmlight"); } I get the following error: ... lib\JNI_S..

How to use unicode characters in Windows command line?

We have a project in Team Foundation Server (TFS) that has a non-English character (š) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the š let..

Converting String to "Character" array in Java

I want to convert a String to an array of objects of Character class but I am unable to perform the conversion. I know that I can convert a String to an array of primitive datatype type "char" with th..

How can I catch an error caused by mail()?

Does anyone know how can I catch a mail error (error is displayed while sending email and the error is caused by the mailserver down) in php? Error that was caused by emailserver down is below: &..

How to convert a char array to a string?

Converting a C++ string to a char array is pretty straightorward using the c_str function of string and then doing strcpy. However, how to do the opposite? I have a char array like: char arr[ ] = "Th..

HQL ERROR: Path expected for join

I keep trying variations of this query and can't seem to make this happen. I've also referenced this post: Path Expected for Join! Nhibernate Error and can't seem to apply the same logic to my query...

How do I auto size a UIScrollView to fit its content

Is there a way to make a UIScrollView auto-adjust to the height (or width) of the content it's scrolling? Something like: [scrollView setContentSize:(CGSizeMake(320, content.height))]; ..

How to select an element by classname using jqLite?

I'm trying to remove jquery from my Angular.js app in order to make it lighter, and put Angular's jqLite instead. But the app makes heavy use of find('#id') and find ('.classname'), which are not supp..

How to add a "confirm delete" option in ASP.Net Gridview?

How to add a "confirm delete" option in ASP.Net Gridview ?..

Get URL query string parameters

What is the "less code needed" way to get parameters from a URL query string which is formatted like the following? www.mysite.com/category/subcategory?myqueryhash Output should be: myqueryhash ..

When is std::weak_ptr useful?

I started studying smart pointers of C++11 and I don't see any useful use of std::weak_ptr. Can someone tell me when std::weak_ptr is useful/necessary?..

Using PowerShell credentials without being prompted for a password

I'd like to restart a remote computer that belongs to a domain. I have an administrator account but I don't know how to use it from powershell. I know that there is a Restart-Computer cmdlet and that..

how to use the Box-Cox power transformation in R

I need to transform some data into a 'normal shape' and I read that Box-Cox can identify the exponent to use to transform the data. For what I understood car::boxCoxVariable(y) is used for respon..

Cannot read property 'getContext' of null, using canvas

I get the error Uncaught TypeError: Cannot read property 'getContext' of null and the important parts in files are... I am wondering since game.js is in a directory below, it cannot find canvas? What ..

How can I find the maximum value and its index in array in MATLAB?

Suppose I have an array, a = [2 5 4 7]. What is the function returning the maximum value and its index? For example, in my case that function should return 7 as the maximum value and 4 as the index...

git clone: Authentication failed for <URL>

Trying to access private corporate tfs. They gave me access by giving appropriate rights to windows user (domain\login). I'm fine with accessing web interface of tfs, browse repository and stuff. Bu..

Is there a SELECT ... INTO OUTFILE equivalent in SQL Server Management Studio?

MySQL had a nifty command SELECT ... INTO OUTFILE that could write the result set into a file (CSV format or some other optional format). I am currently using SQL Server Management Studio to query..

How to make PDF file downloadable in HTML link?

I am giving link of a pdf file on my web page for download, like below <a href="myfile.pdf">Download Brochure</a> The problem is when user clicks on this link then If the user have in..

To draw an Underline below the TextView in Android

I want to draw the underline below my TextView. I have searched a few content but couldn't find out anything fruitful. Can anyone please help me out here?..

How to check if the request is an AJAX request with PHP

I would like to check server-side if a request to my php page is an ajax request or not. I saw two ways to do this: First way: sending a GET parameter in the request which tells the page that this i..

how to rotate a bitmap 90 degrees

There is a statement in android canvas.drawBitmap(visiblePage, 0, 0, paint); When I add canvas.rotate(90), there is no effect. But if I write canvas.rotate(90) canvas.drawBitmap(visiblePage, 0, 0, ..

array filter in python?

For example, I have two lists A = [6, 7, 8, 9, 10, 11, 12] subset_of_A = [6, 9, 12]; # the subset of A the result should be [7, 8, 10, 11]; the remaining elements Is there a built-..

window.open(url, '_blank'); not working on iMac/Safari

I've build a web page that let's you select a page name from a drop down list and then transfers the browser to that page. The code that does the transfer is if (url){ window.open(url, '_blank')..

For-each over an array in JavaScript

How can I loop through all the entries in an array using JavaScript? I thought it was something like this: forEach(instance in theArray) Where theArray is my array, but this seems to be incorrect...

how to clear JTable

How can i clear the content of the JTable using Java....

vba pass a group of cells as range to function

I'm getting a group of cells and doing some calculations over them in function below. It works if I pass a range (with : sign) as first parameter, but it fails if I choose some cells as its range (A1..

JQuery - Storing ajax response into global variable

Im still somewhat of a newbie on jQuery and the ajax scene, but I have an $.ajax request performing a GET to retrieve some XML files (~6KB or less), however for the duration the user spends on that pa..

HTML form with two submit buttons and two "target" attributes

I have one HTML <form>. The form has only one action="" attribute. However I wish to have two different target="" attributes, depending on which button you click to submit the form. This is pr..

MySQL Query GROUP BY day / month / year

Is it possible to make a simple query to count how many records I have in a determined period of time like a year, month, or day, having a TIMESTAMP field, like: SELECT COUNT(id) FROM stats WHERE re..

What is the "right" JSON date format?

I've seen so many different standards for the JSON date format: "\"\\/Date(1335205592410)\\/\"" .NET JavaScriptSerializer "\"\\/Date(1335205592410-0500)\\/\"" .NET DataContractJsonSerializ..

How to change checkbox's border style in CSS?

How can I change checkbox (input) border's style? I've put border:1px solid #1e5180 upon it, but in FireFox 3.5, nothing happens!..

How to destroy a JavaScript object?

Recently, I came across one of my application which consumes too much memory and increasing by 10 MB/sec. So, I like to know the best way to destroy JavaScript object and variables so memory consumpt..

How to format DateTime columns in DataGridView?

I'm using a DataGridView with object data binding to display information about logging entities in a system, retrieved via SOAP from a remote service. One of the columns is called "Last action" and me..

What is the difference between user and kernel modes in operating systems?

What are the differences between User Mode and Kernel Mode, why and how do you activate either of them, and what are their use cases?..

Windows Explorer "Command Prompt Here"

I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory. I am aware of Power Toys "Command Prompt", but that only works as a cont..

Java ElasticSearch None of the configured nodes are available

Just downloaded and installed elasticsearch 1.3.2 in past hour Opened IP tables to port 9200 and 9300:9400 Set my computer name and ip in /etc/hosts Head Module and Paramedic Installed and running ..

Is it possible to disable floating headers in UITableView with UITableViewStylePlain?

I'm using a UITableView to layout content 'pages'. I'm using the headers of the table view to layout certain images etc. and I'd prefer it if they didn't float but stayed static as they do when the st..

How to access elements of a JArray (or iterate over them)

I have the following Json gotten from Twitter + token {[ { "trends": [ { "name": "Croke Park II", "url": "http://twitter.com/search?q=%22Croke+Park+II%22", ..

cannot import name patterns

Before I wrote in urls.py, my code... everything worked perfectly. Now I have problems - can't go to my site. "cannot import name patterns" My urls.py is: from django.conf.urls import patterns, incl..

Python Anaconda - How to Safely Uninstall

I installed Python Anaconda on Mac (OS Mavericks). I wanted to revert to the default version of Python on my Mac. What's the best way to do this? Should I delete the ~/anaconda directory? Any other ch..

Count frequency of words in a list and sort by frequency

I am using Python 3.3 I need to create two lists, one for the unique words and the other for the frequencies of the word. I have to sort the unique word list based on the frequencies list so that th..

How to declare a constant in Java

We always write: public static final int A = 0; Question: Is static final the only way to declare a constant in a class? If I write public final int A = 0; instead, is A still a constant o..

Convert data.frame column to a vector?

I have a dataframe such as: a1 = c(1, 2, 3, 4, 5) a2 = c(6, 7, 8, 9, 10) a3 = c(11, 12, 13, 14, 15) aframe = data.frame(a1, a2, a3) I tried the following to convert one of the columns to a vector, ..

sublime text2 python error message /usr/bin/python: can't find '__main__' module in ''

I installed sublime text 2 to OSX 10.8.2. In my Mac, python 2.7.3 is installed. In sublime text2, I just type print 'Hello' but error occurred like below. /usr/bin/python: can't find '__main__'..

Select from table by knowing only date without time (ORACLE)

I'm trying to retrieve records from table by knowing the date in column contains date and time. Suppose I have table called t1 which contains only two column name and date respectively. The data sto..

Unable to execute dex: GC overhead limit exceeded in Eclipse

When I downloaded the Git project OsmAnd and went to compile it, Eclipse returned these errors: [Dex Loader] Unable to execute dex: GC overhead limit exceeded [OsmAnd] Conversion to Dalvik format..

Creating a simple login form

I am trying to create a simple HTML log-in that is placed in a box. I want to have something like this: I have tried a few things but they all seem to have been in vain. Here is my code thus far. H..

What does the percentage sign mean in Python

In the tutorial there is an example for finding prime numbers: >>> for n in range(2, 10): ... for x in range(2, n): ... if n % x == 0: ... print(n, 'equals', x, '*', ..

How to set the height and the width of a textfield in Java?

I was trying to make my JTextField fill the width and set a height for it but still failed. I tried adding the code setPreferredSize(new Dimension(320,200)); but still failed. Is there any way I can m..

Pandas count(distinct) equivalent

I am using pandas as a db substitute as I have multiple databases (oracle, mssql, etc) and I am unable to make a sequence of commands to a SQL equivalent. I have a table loaded in a DataFrame with so..

Java Replace Character At Specific Position Of String?

I am trying to replace a character at a specific position of a string. For example: String str = "hi"; replace string position #2 (i) to another letter "k" How would I do this? Thanks! ..

ORA-00060: deadlock detected while waiting for resource

I have a series of scripts running in parallel as a nohup on an AIX server hosting oracle 10g. These scripts are written by somebody else and are meant to be executed concurrently. All the scripts are..

Setting device orientation in Swift iOS

I am working on a swift app for iPhone. There is a modal view in my application that I want only to be in portrait view. My question is, how do I programmatically force the phone to not allow rotatio..

Create a Maven project in Eclipse complains "Could not resolve archetype"

I am totally a newbie with Maven. I want to create a Maven project with Eclipse Juno EE with archetype "webapp". I installed "Maven Integration for Eclipse WTP (incubation)" and I also have installed ..

Jquery: Checking to see if div contains text, then action

I'm trying to check in jQuery if a div contains some text, and then add a class if it does. So I wrote something like this: if( $("#field > div.field-item").text().indexOf('someText') = 0) { ..

When to use MongoDB or other document oriented database systems?

We offer a platform for video- and audio-clips, photos and vector-grafics. We started with MySQL as the database backend and recently included MongoDB for storing all meta-information of the files, be..

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

How can I find whitespace in a String?

How can I check to see if a String contains a whitespace character, an empty space or " ". If possible, please provide a Java example. For example: String = "test word"; ..

How can I get this ASP.NET MVC SelectList to work?

I create a selectList in my controller, to display in the view. I'm trying to create it on the fly, sorta thing .. like this... myViewData.PageOptionsDropDown = new SelectList(new [] {"10", "15"..

Unrecognized SSL message, plaintext connection? Exception

I have a java complied package to speak with the https server on net. Running the compilation gives the following exception: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection..

SQL Group By with an Order By

I have a table of tags and want to get the highest count tags from the list. Sample data looks like this id (1) tag ('night') id (2) tag ('awesome') id (3) tag ('night') using SELECT COUNT(*), `T..

Text vertical alignment in WPF TextBlock

How do I assign vertical center alignment to the text inside a TextBlock? I found TextAlignment property but it is for horizontal text alignment. How do I do it for vertical text alignment?..

Error in Python script "Expected 2D array, got 1D array instead:"?

I'm following this tutorial to make this ML prediction: import numpy as np import matplotlib.pyplot as plt from matplotlib import style style.use("ggplot") from sklearn import svm x = [1, 5, 1.5, 8..

how to implement a long click listener on a listview

I want to add OnLongClickListener on my list view. Whenever the user long press the item in list some action should be performed, But my code does not catch this listener. Please let me know where I a..

javascript regex : only english letters allowed

Quick question: I need to allow an input to only accept letters, from a to z and from A to Z, but can't find any expression for that. I want to use the javascript test() method...

What is the difference between 'typedef' and 'using' in C++11?

I know that in C++11 we can now use using to write type alias, like typedefs: typedef int MyInt; Is, from what I understand, equivalent to: using MyInt = int; And that new syntax emerged from the ef..

Java Error: "Your security settings have blocked a local application from running"

I'm trying to run this simple HelloWorld code written in Java from my browser (Chrome): public class HelloWorld extends JApplet { public void init() { try { SwingUtilities.invokeAndWait(n..

ng-repeat finish event

I want to call some jQuery function targeting div with table. That table is populated with ng-repeat. When I call it on $(document).ready() I have no result. Also $scope.$on('$viewContentL..

How do I capture the output of a script if it is being ran by the task scheduler?

Using Windows Server 2008, how do I go about capturing the output of a script that is being ran with the windows task scheduler? I'm testing a rather long custom printing batch-script, and for debugg..

Database Diagram Support Objects cannot be Installed ... no valid owner

I tried to create a database diagramm with SQL Server 2008, but an error occurs: Database diagram support objects cannot be installed because this database does not have a valid owner. To co..

Go to next item in ForEach-Object

I have a PowerShell script that does some checks on all Domain Admins in a number of domains. For each user account a number of checks are preformed. When one of them fails the script should go to the..

How can I get href links from HTML using Python?

import urllib2 website = "WEBSITE" openwebsite = urllib2.urlopen(website) html = getwebsite.read() print html So far so good. But I want only href links from the plain text HTML. How can I solve..

Replace forward slash "/ " character in JavaScript string?

I have this string: var someString = "23/03/2012"; and want to replace all the "/" with "-". I tried to do this: someString.replace(///g, "-"); But it seems you cant have a forward slash / in ..

Moving uncommitted changes to a new branch

Possible Duplicate: Move existing, uncommited work to a new branch in Git I have some code in branch ABC. After making some changes to it, i'd like to move all those uncommitted changes i..

How do I use arrays in C++?

C++ inherited arrays from C where they are used virtually everywhere. C++ provides abstractions that are easier to use and less error-prone (std::vector<T> since C++98 and std::array<T, n>..

Alphabet range in Python

Instead of making a list of alphabet characters like this: alpha = ['a', 'b', 'c', 'd'.........'z'] is there any way that we can group it to a range or something? For example, for numbers it can be..

Android view layout_width - how to change programmatically?

This is my view, and I wish to change layout_width to "10dip". How do I do so programmatically? Note, this is not a LinearLayout, it's a View. <View android:id="@+id/nutrition_bar_filled" ..

To compare two elements(string type) in XSLT?

i am new to XSLT ,can any one please suggest to me how to compare two elements coming from xml as string their values are: <OU_NAME>Vision Operations</OU_NAME> --XML code <OU_ADDR1>..

Why do we use web.xml?

What is the use of web.xml and why do we use? <filter> <filter-name>wicket.mysticpaste</filter-name> <filter-class>org.apache.wicket.protocol.http.WicketFilter..

Access Control Origin Header error using Axios in React Web throwing error in Chrome

Im making an API call using Axios in a React Web app. However Im getting the error in Chrome as, XMLHttpRequest cannot load https://example.restdb.io/rest/mock-data. No 'Access-Control-Allow-Origi..

How to increase IDE memory limit in IntelliJ IDEA on Mac?

I'm using IDEA 12 Leda on Mountain Lion. I wanted to increase the maximum memory that IDE can use. I set the VMOptions in Info.plist file to be -Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:n..

How to upgrade PostgreSQL from version 9.6 to version 10.1 without losing data?

I'm using the PostgreSQL database for my Ruby on Rails application (on Mac OS X 10.9). Are there any detailed instructions on how to upgrade PostgreSQL database? I'm afraid I will destroy the data i..

How to quickly and conveniently disable all console.log statements in my code?

Is there any way to turn off all console.log statements in my JavaScript code, for testing purposes?..

Assigning default values to shell variables with a single command in bash

I have a whole bunch of tests on variables in a bash (3.00) shell script where if the variable is not set, then it assigns a default, e.g.: if [ -z "${VARIABLE}" ]; then FOO='default' else ..

Extracting jar to specified directory

I wanted to extract one of my jars to specified directory using jar command line utility. If I understand this right -C option should to the trick but when I try jar xvf myJar.jar -C ./directoryToE..