Questions Tagged with #String aggregation

How can I combine multiple rows into a comma-delimited list in Oracle?

I have a simple query: select * from countries with the following results: country_name ------------ Albania Andorra Antigua ..... I would like to return the results in one row, so like this: A..

How to make a query with group_concat in sql server

I know that in sql server we cannot use Group_concat function but here is one issue i have in which i need to Group_Concat my query.I google it found some logic but not able to correct it.My sql query..

How can multiple rows be concatenated into one in Oracle without creating a stored procedure?

How can I achieve the following in oracle without creating a stored procedure? Data Set: question_id element_id 1 7 1 8 2 9 3 10 3 ..

Postgresql GROUP_CONCAT equivalent?

I have a table and I'd like to pull one row per id with field values concatenated. In my table, for example, I have this: TM67 | 4 | 32556 TM67 | 9 | 98200 TM67 | 72 | 22300 TM99 | 2 | 23009 TM99..

SQL Query to concatenate column values from multiple rows in Oracle

Would it be possible to construct SQL to concatenate column values from multiple rows? The following is an example: Table A PID A B C Table B PID SEQ Desc A 1 Have A 2 ..

How do I create a comma-separated list using a SQL query?

I have 3 tables called: Applications (id, name) Resources (id, name) ApplicationsResources (id, app_id, resource_id) I want to show on a GUI a table of all resource names. In one cell in each row..

Simulating group_concat MySQL function in Microsoft SQL Server 2005?

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not by choice, but that's life). In the original app, we used almost entirely ANSI-SQL compliant statements, with one signif..

What is the best way to generate a unique and short file name in Java

I don't necessarily want to use UUIDs since they are fairly long. The file just needs to be unique within its directory. One thought which comes to mind is to use File.createTempFile(String prefix, ..

Convert the values in a column into row names in an existing data frame

I would like to convert the values in a column of an existing data frame into row names. Is is possible to do this without exporting the data frame and then reimporting it with a row.names = call? Fo..

CURL ERROR: Recv failure: Connection reset by peer - PHP Curl

I'm having this strange error, CURL ERROR: Recv failure: Connection reset by peer This is how it happens, if I did not connect to the server and all of a sudden trying to connect to the server via CU..

Example for boost shared_mutex (multiple reads/one write)?

I have a multithreaded app that has to read some data often, and occasionally that data is updated. Right now a mutex keeps access to that data safe, but it's expensive because I would like multiple t..

How to Import Excel file into mysql Database from PHP

Lets say, i want to import/upload excel file to mysql from PHP My HTML is like below <form enctype="multipart/form-data" method="post" role="form"> <div class="form-group"> &..

Label encoding across multiple columns in scikit-learn

I'm trying to use scikit-learn's LabelEncoder to encode a pandas DataFrame of string labels. As the dataframe has many (50+) columns, I want to avoid creating a LabelEncoder object for each column; I'..

What is the difference between atan and atan2 in C++?

What is the difference between atan and atan2 in C++?..

How to serialize an object into a string

I am able to serialize an object into a file and then restore it again as is shown in the next code snippet. I would like to serialize the object into a string and store into a database instead. Can a..

Tips for debugging .htaccess rewrite rules

Many posters have problems debugging their RewriteRule and RewriteCond statements within their .htaccess files. Most of these are using a shared hosting service and therefore don't have access to the..

TimePicker Dialog from clicking EditText

I've already got a DatePicker which pops up when the user clicks on the EditText field eReminderDate.setOnClickListener(new OnClickListener() { @Override public void onClick(..

replace special characters in a string python

I am using urllib to get a string of html from a website and need to put each word in the html document into a list. Here is the code I have so far. I keep getting an error. I have also copied the er..

JQuery to load Javascript file dynamically

I have a very large javascript file I would like to load only if the user clicks on a certain button. I am using jQuery as my framework. Is there a built-in method or plugin that will help me do thi..

How to set Spinner default value to null?

I'm trying to get a Spinner to load up with no selected value. Once the user selects a value it then takes them to another page. This is proving to be a problem because at present, the page just loa..

How to change package name in android studio?

I have made an app and it is my very first app so when I started coding, I left the package name as com.example.stuff and now when I try to upload to the play store it wont let me due to the package n..

How to resolve this JNI error when trying to run LWJGL "Hello World"?

I'm trying to run the sample "Hello World" from the LWJGL website From this link: LWJGL "Getting Started" I'm trying to do this via the command line, just so I understand the "behind the scenes" a b..

What is the string length of a GUID?

I want to create a varchar column in SQL that should contain N'guid' while guid is a generated GUID by .NET (Guid.NewGuid) - class System.Guid. What is the length of the varchar I should expect from ..

OpenJDK8 for windows

Im a bit confused about how to download openjdk8 for windows. If I go to http://openjdk.java.net/install/ then under JDK 8 there are only two sections: "Debian, Ubuntu, etc." and "Fedora, Oracle Linu..

Private vs Protected - Visibility Good-Practice Concern

I've been searching and I know the theoretic difference. public - Any class/function may access the method/property. protected - Only this class and any subclasses may access the method/property. pr..

Java BigDecimal: Round to the nearest whole value

I need the following results 100.12 -> 100.00 100.44 -> 100.00 100.50 -> 101.00 100.75 -> 101.00 .round() or .setScale() ? How do I go about this?..

How to kill a process in MacOS?

I tried kill -9 698 but the process did not die. $ ps -ef | grep chromium 502 698 811 0 0:01.24 ?? 0:07.28 /Users/lucius/chromium/src/xcodebuild/Debug/Chromium.app/Contents/MacOS/Ch..

Equivalent of Super Keyword in C#

What is the equivalent c# keyword of super keyword (java). My java code : public class PrintImageLocations extends PDFStreamEngine { public PrintImageLocations() throws IOException { ..

How to change ReactJS styles dynamically?

I was trying to run ReactJS inside my twitter bootstrap web app. I have some issues using styles. Having this div: ... <div class="ui-progressbar-value ui-widget-header ui-corner-left" styl..

SQL Server - copy stored procedures from one db to another

I am new to SQL, and what I needed to do was to combine 2 .mdf databases into one. I did that using SQL Server 2008 Manager - Tasks > Import/Export tables.The tables and views were copied successfully..

Newline in JLabel

How can I display a newline in JLabel? For example, if I wanted: Hello World! blahblahblah This is what I have right now: JLabel l = new JLabel("Hello World!\nblahblahblah", SwingConstants..

How to copy a file to multiple directories using the gnu cp command

Is it possible to copy a single file to multiple directories using the cp command ? I tried the following , which did not work: cp file1 /foo/ /bar/ cp file1 {/foo/,/bar} I know it's possible us..

The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

When I attempt to connect to a MySQL server from PHP, I see the following error: Deprecated: The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /path..

Default behavior of "git push" without a branch specified

I use the following command to push to my remote branch: git push origin sandbox If I say git push origin does that push changes in my other branches too, or does it only update my current branc..

How to tell if node.js is installed or not

I've recently installed node.js and I have no idea how to run applications. I installed node.js but couldn't find further instructions. What does one really need to do? I wanted to see if it was actua..

How do I get logs/details of ansible-playbook module executions?

Say I execute the following. $ cat test.sh #!/bin/bash echo Hello World exit 0 $ cat Hello.yml --- - hosts: MyTestHost tasks: - name: Hello yourself script: test.sh $ ansible-playbook He..

jQuery pass more parameters into callback

Is there a way to pass more data into a callback function in jQuery? I have two functions and I want the callback to the $.post, for example, to pass in both the resulting data of the AJAX call, as w..

Check whether there is an Internet connection available on Flutter app

I have a network call to be executed. But before doing that I need to check whether the device have internet connectivity. This is what i have done so far: var connectivityResult = new Connectivit..

What is the HTML5 equivalent to the align attribute in table cells?

I'm refactoring an old site, and that maze is full of tables. We're moving to HTML5 and I need to fix a table full of <td align="center"> code. I found a partial solution by creating a class..

How to make inline functions in C#

I'm using Linq To XML new XElement("Prefix", Prefix == null ? "" : Prefix) but I want to do some computation to the prefix before adding it to the xml, like eliminating spaces, special chars, some ..

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

How is __eq__ handled in Python and in what order?

Since Python does not provide left/right versions of its comparison operators, how does it decide which function to call? class A(object): def __eq__(self, other): print "A __eq__ cal..

Examples for string find in Python

I am trying to find some examples but no luck. Does anyone know of some examples on the net? I would like to know what it returns when it can't find, and how to specify from start to end, which I gues..

Python return list from function

I have a function that parses a file into a list. I'm trying to return that list so I can use it in other functions. def splitNet(): network = [] for line in open("/home/tom/Dropbox/CN/Pytho..

how to pass variable from shell script to sqlplus

I have a shell script that calls file.sql I am looking for a way to pass some parameters to my file.sql. If I don't pass a variable with some value to the sql script, I will have to create multiple ..

How to get the list of files in a directory in a shell script?

I'm trying to get the contents of a directory using shell script. My script is: for entry in `ls $search_dir`; do echo $entry done where $search_dir is a relative path. However, $search_dir co..

Best way to do nested case statement logic in SQL Server

I'm writing an SQL Query, where a few of the columns returned need to be calculated depending on quite a lot of conditions. I'm currently using nested case statements, but its getting messy. Is there..


What does auto do in margin:0 auto?

What does auto do in margin:0 auto;? I can't seem to understand what auto does. I know it sometimes has an effect of centering objects. Thanks...

Java: Get month Integer from Date

How do I get the month as an integer from a Date object (java.util.Date)?..

Close pre-existing figures in matplotlib when running from eclipse

My question is simple: I have a python script that generates figures using matplotlib. Every time i run it it generates new windows with figures. How can I have the script close windows that were open..

How to revert the last migration?

I've made a migration that added a new table and want to revert it and delete the migration, without creating a new migration. How do I do it? Is there a command to revert last migration and then I c..

XAMPP - Apache could not start - Attempting to start Apache service

While trying to start Apache using XAMPP, I was receiving - "Attempting to start Apache service..." message in XAMPP UI. No further details were available. Where can I see the logs (I was running XA..

How to create a testflight invitation code?

I am a registered iOS developer and a developer friend of mine is trying to send me a testflight version. For some reason he can't sent me an invitation - I believe this is because I am registered as..

Get Value of a Edit Text field

I am learning how to create UI elements. I have created a few EditText input fields. On the click of a Button I want to capture the content typed into that input field. <EditText android:id="@+id/..

Add Facebook Share button to static HTML page

Is there any way to add a Facebook Share Button to a static HTML page? I've implemented a simple web site with no server side, just a bunch of html pages and I was abble to add a Like button because i..

angular-cli server - how to specify default port

Using angular-cli with the ng serve command, how can I specify a default port so I do not need to manually pass the --port flag every time? I'd like to change from the default port 4200...

ASP.net vs PHP (What to choose)

I have been assigned a task to develop a new web application. Its a kind of social web applications, for the sake of understanding you can say its similar to facebook. Now before start developing such..

Conditionally Remove Dataframe Rows with R

Using R, how can I write the following logic into the dataframe: IF column A = B and Column E = 0, delete row..

LINQ query to return a Dictionary<string, string>

I have a collection of MyClass that I'd like to query using LINQ to get distinct values, and get back a Dictionary<string, string> as the result, but I can't figure out how I can do it any simpler ..

How to get JSON data from the URL (REST API) to UI using jQuery or plain JavaScript?

I have a URL "http://localhost:8888/api/rest/abc" which will give following json data. I wants to get this data in my UI using Jquery or java script. I'm trying this from couple of hours but I'm unabl..

Order columns through Bootstrap4

I have 3 columns which I want to order in different ways on desktop and mobile. Currently, my gird looks like this: _x000D_ _x000D_ <div class="row">_x000D_ <div class="col-xs-3 col-md-6"&..

How do I add to the Windows PATH variable using setx? Having weird problems

I want to modify the Windows PATH variable using setx. The following works at least 50% of the time on Windows 8: setx PATH %PATH%;C:\Python27\;C:\Python27\Scripts\ If it gives the error "the defau..

Focus Input Box On Load

How can the cursor be focus on a specific input box on page load? Is it posible to retain initial text value as well and place cursor at end of input? <input type="text" size="25" id="myinputbox..

Reset Excel to default borders

Ok, so you know what a spreadsheet looks like when you open a new on in Excel; the borders are a light blue. These are only on the screen though, if you print the sheet it will not have borders. Say y..

Why does SSL handshake give 'Could not generate DH keypair' exception?

When I make an SSL connection with some IRC servers (but not others - presumably due to the server's preferred encryption method) I get the following exception: Caused by: java.lang.RuntimeException:..

how to end ng serve or firebase serve

I've been doing web development with Angular2 and have been using both Angular2 and Firebase to run local servers. I haven't been able to find a command similar to typing quit when using Ionic to crea..

XAMPP Port 80 in use by "Unable to open process" with PID 4

XAMPP won't work it says Port 80 in use by "Unable to open process" with PID 4! 6:32:24 PM [Apache] Apache WILL NOT start without the configured ports free! 6:32:24 PM [Apache] You need to u..

MVC Razor view nested foreach's model

Imagine a common scenario, this is a simpler version of what I'm coming across. I actually have a couple of layers of further nesting on mine.... But this is the scenario Theme contains List Catego..

How/when to use ng-click to call a route?

Suppose you are using routes: // bootstrap myApp.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $routeProvider.when('/home', { templateUrl:..

Is there a way to access the "previous row" value in a SELECT statement?

I need to calculate the difference of a column between two lines of a table. Is there any way I can do this directly in SQL? I'm using Microsoft SQL Server 2008. I'm looking for something like this: ..

Scraping: SSL: CERTIFICATE_VERIFY_FAILED error for http://en.wikipedia.org

I'm practicing the code from 'Web Scraping with Python', and I keep having this certificate problem: from urllib.request import urlopen from bs4 import BeautifulSoup import re pages = set() def ge..

How to use vagrant in a proxy environment?

My company's network is using proxy. So when I use vagrant up, it showed me a 401 permission error. How can I do some setting to use vagrant?..

Custom Drawable for ProgressBar/ProgressDialog

Reading the limited documentation that Google has provided, I get the feeling that it is possible to change the look (drawable) of a ProgressBar/ProgressDialog by simply creating a new style an assign..

How do I set up DNS for an apex domain (no www) pointing to a Heroku app?

I already added a custom domain to my Heroku app and it works with www.domain.com. I need to know how to set up the domain without www to resolve to the app, too. Here are my current DNS settings: ..

How to print formatted BigDecimal values?

I have a BigDecimal field amount which represents money, and I need to print its value in the browser in a format like $123.00, $15.50, $0.33. How can I do that? (The only simple solution which I se..

check all socket opened in linux OS

My program opens a socket with this function: sockfd = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP) After finish sending data the socket is closed: close(sockfd); But the issue is when the pr..

How to check for file existence

Is there a Ruby class/method where I could pass "a full path", home/me/a_file.txt, to identify whether it is a valid file path?..

What's the fastest algorithm for sorting a linked list?

I'm curious if O(n log n) is the best a linked list can do...

What is a non-capturing group in regular expressions?

How are non-capturing groups, i.e. (?:), used in regular expressions and what are they good for?..

Get Substring - everything before certain char

I'm trying to figure out the best way to get everything before the - character in a string. Some example strings are below. The length of the string before - varies and can be any length 223232-1.j..

Looping through all rows in a table column, Excel-VBA

I'm currently working on a data set which is formatted as a table, with headers. What I need to do is cycle through all cells in a specific column and change the contents. Through research on MSDN I..

Access denied for user 'root'@'localhost' (using password: Yes) after password reset LINUX

I have a MySQL installed on my linux server, I forgot it's password so I went and changed it using the methods I found on the web. What I did was as follows: /etc/init.d/mysql stop mysqld_safe --skip..

iOS 7 App Icons, Launch images And Naming Convention While Keeping iOS 6 Icons

I just finished an app on iOS 6 and bought a developer account a week ago so haven't had much time playing with the iOS 7 SDK. Just downloaded the Golden Master version and trying to upgrade my app to..

Add up a column of numbers at the Unix shell

Given a list of files in files.txt, I can get a list of their sizes like this: cat files.txt | xargs ls -l | cut -c 23-30 which produces something like this: 151552 319488 1536000 225280 ..

WAITING at sun.misc.Unsafe.park(Native Method)

One of my applications hangs under some period of running under load, does anyone know what could cause such output in jstack: "scheduler-5" prio=10 tid=0x00007f49481d0000 nid=0x2061 waiting on condi..

Find an object in SQL Server (cross-database)

If I've been told a table (or proc) name, but not which connected database the object is located in, is there any simple script to search for it? Maybe search somewhere in the System Databases? (I'm..

Using atan2 to find angle between two vectors

I understand that: atan2(vector.y, vector.x) = the angle between the vector and the X axis. But I wanted to know how to get the angle between two vectors using atan2. So I came across this solution:..

Node.js vs .Net performance

I've read a lot about Node.js being fast and able to accommodate large amounts of load. Does anyone have any real-world evidence of this vs other frameworks, particularly .Net? Most of the articles I'..

iOS: Modal ViewController with transparent background

I'm trying to present a view controller modally, with a transparent background. My goal is to let both the presenting and presented view controllers's view to be displayed at the same time. The proble..

How can I delete an item from an array in VB.NET?

How can I delete an item from an array in VB.NET?..

How do I convert a decimal to an int in C#?

How do I convert a decimal to an int?..

AngularJS toggle class using ng-class

I am trying to toggle the class of an element using ng-class <button class="btn"> <i ng-class="{(isAutoScroll()) ? 'icon-autoscroll' : 'icon-autoscroll-disabled'}"></i> </butto..

Set port for php artisan.php serve

How do we set a custom port for test server? Normally when we do php artisan serve the folder gets served as : localhost:8000 How do could we access one folder as: localhost:8080 I want to ..

How to access environment variable values?

I set an environment variable that I want to access in my Python application. How do I get its value?..

How to base64 encode image in linux bash / shell

I'm trying to base64 encode an image in a shell script and put it into variable: test="$(printf DSC_0251.JPG | base64)" echo $test RFNDXzAyNTEuSlBH I've also tried something like this: test=\`echo..

How to read a PEM RSA private key from .NET

I've got an RSA private key in PEM format, is there a straight forward way to read that from .NET and instantiate an RSACryptoServiceProvider to decrypt data encrypted with the corresponding public ke..

Truncate string in Laravel blade templates

Is there a truncate modifier for the blade templates in Laravel, pretty much like Smarty? I know I could just write out the actual php in the template but i'm looking for something a little nicer to ..

How to start Apache and MySQL automatically when Windows 8 comes up

I am using XAMPP, version 3.2.1. I just installed it on Windows 8. Every time I need to go to the XAMPP Control Panel to start services (MySQL, Apache,...); in Windows 7 it started automatic..

While loop in batch

Here is what I want, inside the BACKUPDIR, I want to execute cscript /nologo c:\deletefile.vbs %BACKUPDIR% until number of files inside the folder is greater than 21(countfiles holds it). Here is my c..

How do I get the row count of a Pandas DataFrame?

I'm trying to get the number of rows of dataframe df with Pandas, and here is my code. Method 1: total_rows = df.count print total_rows + 1 Method 2: total_rows = df['First_columnn_label'].count prin..

How to handle checkboxes in ASP.NET MVC forms?

Caution: This question is over nine years old! Your best option is to search for newer questions, or to search the answers below looking for your specific version of MVC, as many answers here are ob..

Java: Multiple class declarations in one file

In Java, you can define multiple top level classes in a single file, providing that at most one of these is public (see JLS §7.6). See below for example. Is there a tidy name for this technique (a..

How to "properly" print a list?

So I have a list: ['x', 3, 'b'] And I want the output to be: [x, 3, b] How can I do this in python? If I do str(['x', 3, 'b']), I get one with quotes, but I don't want quotes...

LogCat message: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included

I have an application that uses the Google Maps Android v2 API. I've added the google-play-services_lib library project to my workspace and added a reference to it from my application project, followi..

What is the best practice for creating a favicon on a web site?

Question What is the best practice for creating a favicon on a web site? and is an .ico file with both 16x16 and 32x32 images better than a .png file with 16x16 only? Could the right method preferre..

Difference between binary semaphore and mutex

Is there any difference between a binary semaphore and mutex or are they essentially the same?..

What is a good pattern for using a Global Mutex in C#?

The Mutex class is very misunderstood, and Global mutexes even more so. What is good, safe pattern to use when creating Global mutexes? One that will work Regardless of the locale my machine is in..

How to convert comma-separated String to List?

Is there any built-in method in Java which allows us to convert comma separated String to some container (e.g array, List or Vector)? Or do I need to write custom code for that? String commaSeparated ..

Reading a simple text file

I am trying to read a simple text file in my sample Android Application. I am using the below written code for reading the simple text file. InputStream inputStream = openFileInput("test.txt"); Input..

How to set Oracle's Java as the default Java in Ubuntu?

How do I change the value of JAVA_HOME in Ubuntu to point to Oracle's Java? Should it point to java-6-sun or java-6-sun-1.6.0.24 ?..

How can I calculate the difference between two ArrayLists?

I have two ArrayLists. ArrayList A contains: ['2009-05-18','2009-05-19','2009-05-21'] ArrayList B contains: ['2009-05-18','2009-05-18','2009-05-19','2009-05-19','2009-05-20','2009-05-21','2009-05..

MySQL: determine which database is selected?

After calling mysql_select_db to grab a database, is there any way to later output the name of the database that is currently selected? This seems very basic but I couldn't find anything on php.net or..

How to select the rows with maximum values in each group with dplyr?

I would like to select a row with maximum value in each group with dplyr. Firstly I generate some random data to show my question set.seed(1) df <- expand.grid(list(A = 1:5, B = 1:5, C = 1:5)) df..

How to create dictionary and add key–value pairs dynamically?

From post: Sending a JSON array to be received as a Dictionary<string,string> I’m trying to do this same thing as that post. The only issue is that I don’t know what the keys and the value..

How to debug an apache virtual host configuration?

Once again, I have a problem with my apache virtual host configuration. (The default configuration is used instead of my specific one). The problem is not really the misconfiguration but how to solve..

Invert match with regexp

With PCRE, how can you construct an expression that will only match if a string is not found. If I were using grep (which I'm not) I would want the -v option. A more concrete example: I want my r..

How do you make a LinearLayout scrollable?

I have lot of items on the screen and I need to use the scrollbar so the user can scroll down. However, the scroll is either not visible or it's not working. How is it possible to add a scrollbar to a..

How to add a progress bar to a shell script?

When scripting in bash or any other shell in *NIX, while running a command that will take more than a few seconds, a progress bar is needed. For example, copying a big file, opening a big tar file. ..

How to convert comma separated string into numeric array in javascript

I have a one-dimensional array of integer in JavaScript that I'd like to add data from comma separated string, Is there a simple way to do this? e.g : var strVale = "130,235,342,124 ";..

Set default option in mat-select

I have a simple select option form field in my Angular material project: component.html <mat-form-field> <mat-select [(value)]="modeSelect" placeholder="Mode"> <mat-option..

Using true and false in C

As far as I can see there are 3 ways to use booleans in c with the bool type, from then using true and false defining using preprocessor #define FALSE 0 ... #define TRUE !(FALSE) Just to use consta..

Use of for_each on map elements

I have a map where I'd like to perform a call on every data type object member function. I yet know how to do this on any sequence but, is it possible to do it on an associative container? The closes..

NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack

I'm trying to summarize my knowledge about the most popular JavaScript package managers, bundlers, and task runners. Please correct me if I'm wrong: npm & bower are package managers. They just d..

How to use Visual Studio Code as Default Editor for Git

When using git at the command line, I am wondering if it is possible to use Visual Studio Code as the default editor, i.e. when creating commit comments, and looking at a diff of a file from the comma..

How to import RecyclerView for Android L-preview

Trying to use the new RecyclerView from the support library. I downloaded the 20 update for the support library using the SDK manager. I've added the jar file to the libs folder - and added to build ..

Change MySQL root password in phpMyAdmin

I've setup wamp server on window. Then, I use MySQL root password by cmd. As a result, when I access phpMyAdmin site, Access denied appeared (Default user for phpMyAdmin is root and password is blank/..

Converting string to byte array in C#

I'm converting something from VB into C#. Having a problem with the syntax of this statement: if ((searchResult.Properties["user"].Count > 0)) { profile.User = System.Text.Encoding.UTF8.GetStr..

How can I find the number of arguments of a Python function?

How can I find the number of arguments of a Python function? I need to know how many normal arguments it has and how many named arguments. Example: def someMethod(self, arg1, kwarg1=None): pass ..

Trouble setting up git with my GitHub Account error: could not lock config file

I'm getting this error when trying to set the global config: $ git config --global user.name "Your Name Here" error: could not lock config file /pathto/file/.gitconfig: No such file or directory an..

Is it possible to use the SELECT INTO clause with UNION [ALL]?

In SQL Server this inserts 100 records, from the Customers table into tmpFerdeen :- SELECT top(100)* INTO tmpFerdeen FROM Customers Is it possible to do a SELECT INTO across a UNION ALL SELECT :- ..

numpy get index where value is true

>>> ex=np.arange(30) >>> e=np.reshape(ex,[3,10]) >>> e array([[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [10, 11, 12, 13, 14, 15, 16, 17, 18, 19], [20, 21, 22, ..

Wait until page is loaded with Selenium WebDriver for Python

I want to scrape all the data of a page implemented by a infinite scroll. The following python code works. for i in range(100): driver.execute_script("window.scrollTo(0, document.body.scrollHeigh..

Python 3 Float Decimal Points/Precision

I am reading a text file with floating point numbers, all with either 1 or 2 decimal points. I am using float() to convert a line into a float, and raising a ValueError if that fails. I am storing all..

UnicodeEncodeError: 'ascii' codec can't encode character u'\xef' in position 0: ordinal not in range(128)

I want to parse my XML document. So I have stored my XML document as below class XMLdocs(db.Expando): id = db.IntegerProperty() name=db.StringProperty() content=db.BlobProperty() ..

Copy array items into another array

I have a JavaScript array dataArray which I want to push into a new array newArray. Except I don't want newArray[0] to be dataArray. I want to push in all the items into the new array: var newArray =..

C++ wait for user input

What would be the best way to wait for user input in console application? std::cout << "press any key to exit..."; // wait for user to hit enter or another key ..

Excel is not updating cells, options > formula > workbook calculation set to automatic

The usual answer to this question is to turn formulas to automatic. This, in my case, is not working. The second usual answer is that there is some macro that is affecting the Excel settings. This..

Tomcat 7 is not running on browser(http://localhost:8080/ )

Actually the apache-tomcat 7 server running at The Eclipse.but in browser getting error "The requested resource is not available." .Any reasons Please..?..

jQuery - Fancybox: But I don't want scrollbars!

I am using jQuery Fancybox for a popup registration form here I would like the form to come up at the size of 450px by 700px but no matter what I set the height and width at I get scrollbars: <sc..

Intent.putExtra List

Possible Duplicate: How to put a List in intent I want to pass a List from one activity to another. So far I have not been successful. This is my code. //desserts.java private List<..

json.decoder.JSONDecodeError: Extra data: line 2 column 1 (char 190)

I am running the following code- import json addrsfile = open("C:\\Users\file.json", "r") addrJson = json.loads(addrsfile.read()) addrsfile.close() if addrJson: print("yes") But giving me fo..

Can I execute a function after setState is finished updating?

I am very new to ReactJS (as in, just started today). I don't quite understand how setState works. I am combining React and Easel JS to draw a grid based on user input. Here is my JS bin: http://js..

jQuery selector to get form by name

I have the following HTML: <form name="frmSave">...</form> Just to know, I am not able to modify the HTML in order to add an id or something else. This is what I tried to get the form ..

How do I put text on ProgressBar?

I have used ProgressBar Control in my c# desktop application.I have used it in a thread other then the thread in which control has been declared.Its working Fine. Now I am wondering how i can show som..

TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

I having trouble passing a function as a parameter to another function. This is my code: ga.py: def display_pageviews(hostname): pageviews_results = get_pageviews_query(service, hostname).execut..

How to check the installed version of React-Native

I'm going to upgrade react-native but before I do, I need to know which version I'm upgrading from to see if there are any special notes about upgrading from my version. How do I find the version of..

JQuery string contains check

I need to check whether a string contains another string or not? var str1 = "ABCDEFGHIJKLMNOP"; var str2 = "DEFG"; Which function do I use to find out if str1 contains str2?..

Effects of the extern keyword on C functions

In C, I did not notice any effect of the extern keyword used before function declaration. At first, I thought that when defining extern int f(); in a single file forces you to implement it outside of ..

Where is shared_ptr?

I am so frustrated right now after several hours trying to find where shared_ptr is located. None of the examples I see show complete code to include the headers for shared_ptr (and working). Simply s..

Java: Replace all ' in a string with \'

I need to escape all quotes (') in a string, so it becomes \' I've tried using replaceAll, but it doesn't do anything. For some reason I can't get the regex to work. I'm trying with String s = "You..

How to use QTimer

In Qt I'm trying to set a QTimer that calls a function called "update" every second. Here is my .cpp file: #include "mainwindow.h" #include "ui_mainwindow.h" #include <QTimer> #include "QDebug"..

No ConcurrentList<T> in .Net 4.0?

I was thrilled to see the new System.Collections.Concurrent namespace in .Net 4.0, quite nice! I've seen ConcurrentDictionary, ConcurrentQueue, ConcurrentStack, ConcurrentBag and BlockingCollection. ..

Get The Current Domain Name With Javascript (Not the path, etc.)

I plan on buying two domain names for the same site. Depending on which domain is used I plan on providing slightly different data on the page. Is there a way for me to detect the actual domain name..

Difference between == and === in JavaScript

What is the difference between == and === in JavaScript? I have also seen != and !== operators. Are there more such operators?..

C++: variable 'std::ifstream ifs' has initializer but incomplete type

Sorry if this is pretty noobish, but I'm pretty new to C++. I'm trying to open a file and read it using ifstream: vector<string> load_f(string file) { vector<string> text; ifstream i..

How does Tomcat find the HOME PAGE of my Web App?

I am just getting started to learn about Web Apps and deploying them to Tomcat. So I started with a sample web app project - made up of struts, hibernate, etc., etc. The ANT build was successful. Also..

Does Enter key trigger a click event?

In the code below removeSelectedCountry() should be called when a span element is clicked and handleKeyDown($event) should be called when there is a keydown event on a div. @Component({ selector:..

How to find the minimum value of a column in R?

I am new in R and I am trying to do something really simple. I had load a txt file with four columns and now I want to get the minimum value of the second column. This is the code that I have: ## Ch..

Could not load file or assembly '***.dll' or one of its dependencies

I have this dll that I created a long time ago and use to connect to the db of a specific software that I develop for. I have had no issues for well over 4 years and countless applications with this d..

Pylint, PyChecker or PyFlakes?

I would like to get some feedback on these tools on: features; adaptability; ease of use and learning curve. ..

<div> cannot appear as a descendant of <p>

I'm seeing this. It's not a mystery what it is complaining about: Warning: validateDOMnesting(...): <div> cannot appear as a descendant of <p>. See ... SomeComponent > p > ... > ..

What is the precise meaning of "ours" and "theirs" in git?

This might sound like too basic of a question, but I have searched for answers and I am more confused now than before. What does "ours" and "theirs" mean in git when merging my branch into my other b..

Find Locked Table in SQL Server

How can we find which table is locked in the database? Please, suggest...

Array.Add vs +=

I've found some interesting behaviour in PowerShell Arrays, namely, if I declare an array as: $array = @() And then try to add items to it using the $array.Add("item") method, I receive the followi..

How to add "active" class to wp_nav_menu() current menu item (simple way)

I am creating custom Wordpress theme using a starter theme _Underscores. I am also using Bootstrap as a front-end framework. I would like to modify wp_nav_menu so that it assigns current menu item cl..

"The semaphore timeout period has expired" error for USB connection

I'm getting this error... The semaphore timeout period has expired. On this line... ThePorts.ActivePort1.Open(); ...but I only get it from time to time. When it happens, it happens over an..

How do I upload a file with metadata using a REST web service?

I have a REST web service that currently exposes this URL: http://server/data/media where users can POST the following JSON: { "Name": "Test", "Latitude": 12.59817, "Longitude": 52.1287..

ASP.NET custom error page - Server.GetLastError() is null

I have a custom error page set up for my application: <customErrors mode="On" defaultRedirect="~/errors/GeneralError.aspx" /> In Global.asax, Application_Error(), the following code works to ..

Loop X number of times

I'm working on my first PowerShell script and can't figure the loop out. I have the following, which will repeat $ActiveCampaigns number of times: Write-Host "Creating $PQCampaign1 Pre-Qualified Rep..

Convert an NSURL to an NSString

I have an app where the user can choose an image either from the built-in app images or from the iphone photo library. I use an object Occasion that has an NSString property to save the imagePath. N..

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

How to Deserialize JSON data?

I am new to working with JSON data. I am reading data from a web service. The query data sent back is the following: [["B02001_001E","NAME","state"], ["4712651","Alabama","01"], ["691189","Alaska"..

Android. Fragment getActivity() sometimes returns null

In developer console error reports sometimes I see reports with NPE issue. I do not understand what is wrong with my code. On emulator and my device application works good without forcecloses, howeve..

'and' (boolean) vs '&' (bitwise) - Why difference in behavior with lists vs numpy arrays?

What explains the difference in behavior of boolean and bitwise operations on lists vs NumPy arrays? I'm confused about the appropriate use of & vs and in Python, illustrated in the following ex..

SQL to Query text in access with an apostrophe in it

I am trying to query a name (Daniel O'Neal) in column names tblStudents in an Access database, however Access reports a syntax error with the statement: Select * from tblStudents where name like 'Dani..

$_POST Array from html form

I am trying to send data from multiple checkboxes (id[]) and create an array "info" in php to allow me to run a script for each value (however the quantity of values may change each time) however firs..

Greater than less than, python

I am doing a ranking type thing, what happens is I compare the score to the current score and if the score is lower then the current then the player has got a high score, but when using this code here..

jQuery Change event on an <input> element - any way to retain previous value?

I've been searching around this morning and I'm not finding any simple solutions... basically, I want to capture a change in an input element, but also know the previous value. Here's a change event..

Extreme wait-time when taking a SQL Server database offline

I'm trying to perform some offline maintenance (dev database restore from live backup) on my dev database, but the 'Take Offline' command via SQL Server Management Studio is performing extremely slowl..

How to set thousands separator in Java?

How to set thousands separator in Java? I have String representation of a BigDecimal that I want to format with a thousands separator and return as String...

How do I pass a value from a child back to the parent form?

How do I pass a value from a child back to the parent form? I have a string that I would like to pass back to the parent. I launched the child using: FormOptions formOptions = new FormOptions(); for..

Listing only directories using ls in Bash?

This command lists directories in the current path: ls -d */ What exactly does the pattern */ do? And how can we give the absolute path in the above command (e.g. ls -d /home/alice/Documents) for li..

Oracle copy data to another table

In the Oracle, I copy data from a backup to a new table, it doesn't work. what is the correct syntax ? Thanks select CODE, MESSAGE into EXCEPTION_CODES (CODE, MESSAGE) from Exception_code_tmp th..

uint8_t vs unsigned char

What is the advantage of using uint8_t over unsigned char in C? I know that on almost every system uint8_t is just a typedef for unsigned char, so why use it?..

Iterate through a C array

I have an array of structs that I created somewhere in my program. Later, I want to iterate through that, but I don't have the size of the array. How can I iterate through the elements? Or do I need..

Mismatch Detected for 'RuntimeLibrary'

I downloaded and extracted Crypto++ in C:\cryptopp. I used Visual Studio Express 2012 to build all the projects inside (as instructed in readme), and everything was built successfully. Then I made a t..

How to check if matching text is found in a string in Lua?

I need to make a conditional that is true if a particular matching text is found at least once in a string of text, e.g.: str = "This is some text containing the word tiger." if string.match(str, "ti..

Split a string by a delimiter in python

How to split this string where __ is the delimiter MATCHES__STRING To get an output of ['MATCHES', 'STRING']?..

How to check if a Constraint exists in Sql server?

I have this sql: ALTER TABLE dbo.ChannelPlayerSkins DROP CONSTRAINT FK_ChannelPlayerSkins_Channels but apparently, on some other databases we use, the constraint has a different name. How do I ..

C++ Object Instantiation

I'm a C programmer trying to understand C++. Many tutorials demonstrate object instantiation using a snippet such as: Dog* sparky = new Dog(); which implies that later on you'll do: delete sparky..

How can I build for release/distribution on the Xcode 4?

Build for debug is just press on the PLAY symbol, but I don't know how to Build for distribution/release? ..

Convert a list to a data frame

I have a nested list of data. Its length is 132 and each item is a list of length 20. Is there a quick way to convert this structure into a data frame that has 132 rows and 20 columns of data? Here is..

How to create Custom Ratings bar in Android

Hello all i need to perform Ratings in my application... SO i need to create custom Ratings bar... Can Anyone Help me in this?..

Relative paths in Python

I'm building a simple helper script for work that will copy a couple of template files in our code base to the current directory. I don't, however, have the absolute path to the directory where the te..

How to create an alert message in jsp page after submit process is complete

I am trying to add a message in my jsp after the process is done by hitting the submit button. function onSubmit() { alert("Master_Data.xlsx and Consistency_Check_Data.xlsx are located under d:/stage..

How do I select which GPU to run a job on?

In a multi-GPU computer, how do I designate which GPU a CUDA job should run on? As an example, when installing CUDA, I opted to install the NVIDIA_CUDA-<#.#>_Samples then ran several instance..

Unsupported operand type(s) for +: 'int' and 'str'

I am currently learning Python so I have no idea what is going on. num1 = int(input("What is your first number? ")) num2 = int(input("What is your second number? ")) num3 = int(input("What is your t..

Flask Value error view function did not return a response

Error message: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1836, in __call__ return self.wsgi_app(environ, start_response) File "/usr/l..

Something better than .NET Reflector?

I used to love .NET Reflector back in the day, but ever since Red Gate Software took over it has gone downhill dramatically. Now it forces me to update (which is absolutely ridiculous), half the time ..

How to use "svn export" command to get a single file from the repository?

How can I use the svn export command to get a single file from the repository? I've tried this: svn export e:\repositories\process\test.txt c:\ But I get this error: svn: e:\repositories\proce..

How do you determine a processing time in Python?

I'm new to Python, and confused by the date/time documentation. I want to compute the time that it takes to perform a computation. In java, I would write: long timeBefore = System.currentTimeMillis..

Normalize data in pandas

Suppose I have a pandas data frame df: I want to calculate the column wise mean of a data frame. This is easy: df.apply(average) then the column wise range max(col) - min(col). This is easy ag..

git: fatal unable to auto-detect email address

I just cannot commit with git on Ubuntu 14.04 Error message is: git: fatal unable to auto-detect email address (got "some wrong email") I tried git-config with and without the --global option s..

How to install latest version of git on CentOS 7.x/6.x

I used the usual: yum install git It did not install the latest version of git on my CentOS 6. How can I update to the latest version of git for CentOS 6? The solution can be applicable to newer v..

How to perform keystroke inside powershell?

I have ps1 script to grab some information from the vmware cluster environment. In some place of ps1 script requires the ENTER button keystroke. So, How to do that ? -Thanks..

How to hide "Showing 1 of N Entries" with the dataTables.js library

How do you remove the "Showing 1 of N entries" line of text on a dataTable (that is when using the javascript library dataTables? I think I was looking for something along these lines... $('#example..