Questions Tagged with #C++builder

Embarcadero C++Builder is a RAD C++ environment (compiler system & IDE) and component framework for Windows, OS X, iOS and Android.

'cannot find or open the pdb file' Visual Studio C++ 2013

I just downloaded VS 2013 Community Edition and I wrote my first app. When I run it it shows in the output section: 'ConsoleApplication1.exe' (Win32): Loaded 'C:\Users\Toshiba\Documents\Visual Studio..

What are the rules for calling the superclass constructor?

What are the C++ rules for calling the superclass constructor from a subclass one? For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an impl..

access denied for user @ 'localhost' to database ''

I'm seeing a lot of of similar questions to this. but can't find one exactly like mine yet. Not sure where to change these settings or anything, any help appreciated. access denied Access denied for..


We've recently had the need to add columns to a few of our existing SQLite database tables. This can be done with ALTER TABLE ADD COLUMN. Of course, if the table has already been altered, we want to..

How do you display code snippets in MS Word preserving format and syntax highlighting?

Does anyone know a way to display code in Microsoft Word documents that preserves coloring and formatting? Preferably, the method would also be unobtrusive and easy to update. I have tried to include..

How do I encode and decode a base64 string?

How do I return a base64 encoded string given a string? How do I decode a base64 encoded string into a string? ..

Need to install urllib2 for Python 3.5.1

I'm running Python 3.5.1 for Mac. I want to use urllib2 module. I tried installing it but I was told that it's been split into urllib.request and urllib.error for Python 3. My command (running from ..

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 3 2: ordinal not in range(128)

I am parsing an xsl file using xlrd. Most of the things are working fine. I have a dictionary where keys are strings and values are lists of strings. All the keys and values are unicode. I can print m..

How do I find the location of my Python site-packages directory?

How do I find the location of my site-packages directory?..

Python - How to concatenate to a string in a for loop?

I need to "concatenate to a string in a for loop". To explain, I have this list: list = ['first', 'second', 'other'] And inside a for loop I need to end with this: endstring = 'firstsecondother' ..

jQuery event for images loaded

Is it possible to detect when all images are loaded via a jQuery event? Ideally, there should be a $(document).idle(function() { } or $(document).contentLoaded(function() { } But I can't find ..

What is resource-ref in web.xml used for?

I'm just wondering when/why you would define a <resource-ref> element in your web.xml file? I would have thought that it would be defined in your web/app server using JNDI and then look up the ..

How to disable spring security for particular url

I am using stateless spring security,but in case of signup i want to disable spring security.I disabled using antMatchers("/api/v1/signup").permitAll(). but it is not working,i am getting error b..

How to convert md5 string to normal text?

I have saved user passwords in MD5 form in my database, now I want to send password to users in plaintext, is there any way I can convert an MD5 string to plaintext? ..

When to use SELECT ... FOR UPDATE?

Please help me understand the use-case behind SELECT ... FOR UPDATE. Question 1: Is the following a good example of when SELECT ... FOR UPDATE should be used? Given: rooms[id] tags[id, name] room_..

how to detect search engine bots with php?

How can one detect the search engine bots using php?..

Get local href value from anchor (a) tag

I have an anchor tag that has a local href value, and a JavaScript function that uses the href value but directs it to a slightly different place than it would normally go. The tag looks like <a ..

Detecting TCP Client Disconnect

Let's say I'm running a simple server and have accept()ed a connection from a client. What is the best way to tell when the client has disconnected? Normally, a client is supposed to send a close com..

MySql difference between two timestamps in days?

How can I get the difference between two timestamps in days? Should I be using a datetime column for this? I switched my column to datetime. Simple subtraction doesn't seem to give me a result in day..

Recursion or Iteration?

Is there a performance hit if we use a loop instead of recursion or vice versa in algorithms where both can serve the same purpose? Eg: Check if the given string is a palindrome. I have seen many prog..

matplotlib has no attribute 'pyplot'

I can import matplotlib but when I try to run the following: matplotlib.pyplot(x) I get: Traceback (most recent call last): File "<pyshell#31>", line 1, in <module> matplotli..

Which type of folder structure should be used with Angular 2?

I am an Angular 1 developer that is starting to learn about Angular 2. There are a lot of different types of folder structure methods depending on the training material. I am going to list each one ..

AngularJS: ng-repeat list is not updated when a model element is spliced from the model array

I have two controllers and share data between them with an app.factory function. The first controller adds a widget in the model array (pluginsDisplayed) when a link is clicked. The widget is pushed ..

Bootstrap 3 - jumbotron background image effect

Hi I'm trying to build a site with a jumbotron with a background image, which in itself is not hard: HTML: <div class="jumbotron"> ... </div> CSS: (which lies in my custom css file and..

What is the best open-source java charting library? (other than jfreechart)

Why are there not more opensource easy to use charting libraries for Java?. The only successful opensource project in this area seems to be jfreechart, and it doesn't even have any documentation or ex..

WARNING: sanitizing unsafe style value url

I want to set the background image of a DIV in a Component Template in my Angular 2 app. However I keep getting the following warning in my console and I don't get the desired effect... I am unsure if..

How to create empty folder in java?

I tried to use the File class to create an empty file in a directory like "C:/Temp/Emptyfile". However, when I do that, it shows me an error : "already made folder Temp". Otherwise, it won't create on..

A method to reverse effect of java String.split()?

I am looking for a method to combine an array of strings into a delimited String. An opposite to split(). Wanted to ask the forum before I try writing my own (since the JDK has everything)..

PHP/Apache: PHP Fatal error: Call to undefined function mysql_connect()

I have MySQL (5.5.23 Community Server), Apache (2.2), and PHP (5.3.13) running on a Fedora 15 machine (64-bit). Each works with no problem on their own. I thought that PHP was configured/compiled to ..

How to get ip address of a server on Centos 7 in bash

Previously I used the following command in bash to find the main ip of my server ipaddr=$(/sbin/ifconfig|grep inet|head -1|sed 's/\:/ /'|awk '{print $3}' | grep -v '') But in centos7 it no..

Visual Studio loading symbols

I'm working on a ColdFusion project for a while now, and Visual Studio started to behave strange for me at least. I observed that when I started debugging, it built the project, it started the deploy..

Python constructors and __init__

Why are constructors indeed called "Constructors"? What is their purpose and how are they different from methods in a class? Also, can there be more that one __init__ in a class? I tried the..

Way to get all alphabetic chars in an array in PHP?

Is there a way to get all alphabetic chars (A-Z) in an array in PHP so I can loop through them and display them?..

How do you remove a specific revision in the git history?

Suppose your git history looks like this: 1 2 3 4 5 1–5 are separate revisions. You need to remove 3 while still keeping 1, 2, 4 and 5. How can this be done? Is there an efficient method when the..

Toggle input disabled attribute using jQuery

Here is my code: $("#product1 :checkbox").click(function(){ $(this) .closest('tr') // Find the parent row. .find(":input[type='text']") // Find text elements in that row. ..

Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 4 (Year)

I'm getting the conversion error when I try to import a text file to my database. Below is the error message I received: Bulk load data conversion error (type mismatch or invalid character for the sp..

Android Studio is slow (how to speed up)?

I recently upgraded from Eclipse to Android Studio and I'm not really liking the experience. I'm comparing them both on a Windows 7 64 bit ultimate with 16GB of ram and Intel i7 4770 running NVidia Ge..

Strings in C, how to get subString

I have a string: char * someString; If I want the first five letters of this string and want to set it to otherString, how would I do it?..

How to turn off the Eclipse code formatter for certain sections of Java code?

I've got some Java code with SQL statements written as Java strings (please no OR/M flamewars, the embedded SQL is what it is - not my decision). I've broken the SQL statements semantically into seve..

Calendar.getInstance(TimeZone.getTimeZone("UTC")) is not returning UTC time

I am really confused with the result I am getting with Calendar.getInstance(TimeZone.getTimeZone("UTC")) method call, it's returning IST time. Here is the code I used Calendar cal_Two = Calendar.g..

how to rotate text left 90 degree and cell size is adjusted according to text in html

Suppose i have table with some rows and column,so i want to rotate text in cells something like this: problem is when i rotate text using style : #rotate { -moz-transform: rotate(-90.0deg); ..

How to find the Git commit that introduced a string in any branch?

I want to be able to find a certain string which was introduced in any commit in any branch, how can I do that? I found something (that I modified for Win32), but git whatchanged doesn't seem to be lo..

Converting a view to Bitmap without displaying it in Android?

I will try to explain what exactly I need to do. I have 3 separate screens say A,B,C. There is another screen called say HomeScreen where all the 3 screens bitmap should be displayed in Gallery view ..

What programming language does facebook use?

I don't know much about programming languages, but am interested in a career with facebook, so I was wondering if someone could tell me what programming language facebook uses. Also, do any other soc..

Define the selected option with the old input in Laravel / Blade

I have this code: <select required="required" class="form-control" name="title"> <option></option> @foreach ($titles as $key => $val) @if (stristr($key, 'isGroup'..

Error Code 1292 - Truncated incorrect DOUBLE value - Mysql

I am not sure what is this error! #1292 - Truncated incorrect DOUBLE value: I don't have double value field or data! I have wasted a whole hour trying to figure this out! here is my query INSER..

final keyword in method parameters

I often encounter methods which look like the following: public void foo(final String a, final int[] b, final Object1 c){ } What happens if this method is called without passing it final parameters..

How to resize a VirtualBox vmdk file

I've run out of space on a virtual machine disk which is a vmdk and need to resize the virtual image. Resizing with the command vboxmanage modifyhd Machine-disk1.vmdk --resize 30720 gives the erro..

Create a CSV File for a user in PHP

I have data in a MySQL database. I am sending the user a URL to get their data out as a CSV file. I have the e-mailing of the link, MySQL query, etc. covered. How can I, when they click the link, ha..

JavaScript: Check if mouse button down?

Is there a way to detect if a mouse button is currently down in JavaScript? I know about the "mousedown" event, but that's not what I need. Some time AFTER the mouse button is pressed, I want to be ..

How should I use try-with-resources with JDBC?

I have a method for getting users from a database with JDBC: public List<User> getUser(int userId) { String sql = "SELECT id, name FROM users WHERE id = ?"; List<User> users = new..

Is there any sizeof-like method in Java?

Is there any built-in method in Java to find the size of any datatype? Is there any way to find size?..

How do you get the current project directory from C# code when creating a custom MSBuild task?

Instead of running an external program with its path hardcoded, I would like to get the current Project Dir. I'm calling an external program using a process in the custom task. How would I do that? A..

How do I get a string format of the current date time, in python?

For example, on July 5, 2010, I would like to calculate the string July 5, 2010 How should this be done?..

Rails: How can I set default values in ActiveRecord?

How can I set default value in ActiveRecord? I see a post from Pratik that describes an ugly, complicated chunk of code: class It..

What does "ulimit -s unlimited" do?

There are understandably many related questions on stack allocation What and where are the stack and heap? Why is there a limit on the stack size? Size of stack and heap memory However on various ..

How do I compare two hashes?

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

Search all the occurrences of a string in the entire project in Android Studio

I've just started using Android Studio (IntelliJ), and I now look for the feature to find the occurrence of a string in any of the files in my project. For example: I want to find all the files that c..

reading from stdin in c++

I am trying to read from stdin using C++, using this code #include <iostream> using namespace std; int main() { while(cin) { getline(cin, input_line); cout << input_l..

Loop through the rows of a particular DataTable

IDE : VS 2008, Platform : .NET 3.5, Hi, Here is my DataTable columns : ID Note Detail I want to write sth like this : //below code block is not the right syntax For each q in dtDataTable.Column..

Root element is missing

I am reading xml from xxx URl but i am getting error as Root element is missing. My code to read xml response is as follows: XmlDocument doc = new XmlDocument(); doc.Load("URL from which i am re..

Whitespace Matching Regex - Java

The Java API for regular expressions states that \s will match whitespace. So the regex \\s\\s should match two spaces. Pattern whitespace = Pattern.compile("\\s\\s"); matcher = whitespace.matcher(mo..

Uncaught TypeError: $(...).datepicker is not a function(anonymous function)

I found few answers on stack overflow but still cant resolve my problem. I am running on Django but I dont think it is relevant for this error. I try to make work my date picker java script but I am ..

How to rollback a specific migration?

I have the following migration file db\migrate\20100905201547_create_blocks.rb How can I specifically rollback that migration file? ..

How to deal with "data of class uneval" error from ggplot2?

While trying to overlay a new line to a existing ggplot I am getting the following error: Error: ggplot2 doesn't know how to deal with data of class uneval The first part of my code works fine. B..

HTML image not showing in Gmail

I'm sending an e-mail newsletter in HTML. Inside the HTML I have something like <img height='70' width='70' style='display:block' src=''> When I open the newsletter ..

How do you post to the wall on a facebook page (not profile)

I have a blog site written in php and it posts new blog posts to twitter and a blog ping automatically under the hood using simple http post requests passed using php curl. I have a facebook page for..

Get the latest record with filter in Django

I am trying to get the latest Django model object but cannot seem to succeed. Neither of these are working: obj = Model.objects.filter(testfield=12).latest() obj = Model.objects.latest().filter(t..

How to go to a specific element on page?

On my HTML page, I want to be able to 'go to' / 'scroll to' / 'focus on' an element on the page. Normally, I'd use an anchor tag with a href="#something", but I'm already using the hashchange event ..

how to prevent adding duplicate keys to a javascript array

I found a lot of related questions with answers talking about loops and using hasOwnProperty but nothing I do works properly. All I want to do is check whether or not a key exists in an array..

mysql SELECT IF statement with OR

The following works - returns Y when chargeback equal to 1 else it defaults to N IF(fd.charge_back = 1, 'Y', 'N') AS charge_back however I cannot seem to get this one working? Is the syntax valid ..

Eclipse error, "The selection cannot be launched, and there are no recent launches"

I have just started Android programming so downloaded Eclipse and got started. Created my first project following tutorial from here:

Is it possible to ignore one single specific line with Pylint?

I have the following line in my header: import config.logging_settings This actually changes my Python logging settings, but Pylint thinks it is an unused import. I do not want to remove unused-impor..

Why do you create a View in a database?

When and Why does some one decide that they need to create a View in their database? Why not just run a normal stored procedure or select?..

C# : assign data to properties via constructor vs. instantiating

Supposing I have an Album class : public class Album { public string Name {get; set;} public string Artist {get; set;} public int Year {get; set;} public Album() { } public..

How can I declare dynamic String array in Java

I am using String Array declare as zoom z[]=new String[422];. But this array stores value from 0 to 32, so I got null pointer exception after looping value 32. How to solve this problem in java? Ho..

jQuery find parent form

i have this html <ul> <li><form action="#" name="formName"></li> <li><input type="text" name="someName" /></li> <li><input type="text" n..

Getting Image from API in Angular 4/5+?

I have new to develop Angular 4. I have facing issue while getting response from API about display image.In API,an image file has input-stream file,I don't know how to retrieve it and display it prope..

fs: how do I locate a parent folder?

How do I write this to go back up the parent 2 levels to find a file? fs.readFile(__dirname + ''); ..

Calculate days between two Dates in Java 8

I know there are lots of questions on SO about how to get Dates in Java, but I want an example using new Java 8 Date API. I also know about the JodaTime library, but I want a method without relying on..

Does Android support near real time push notification?

I recently learned about the ability of iPhone apps to receive nearly instantaneous notifications to apps notifications to apps. This is provided in the form of push notifications, a bespoke protocol..

POST data in JSON format

I have some data that I need to convert to JSON format and then POST it with a JavaScript function. <body onload="javascript:document.myform.submit()"> <form action="

Deep copy in ES6 using the spread syntax

I am trying to create a deep copy map method for my Redux project that will work with objects rather than arrays. I read that in Redux each state should not change anything in the previous states. ex..

Bootstrap modal: is not a function

I have a modal in my page. When I try to call it when the windows load, it prints an error to the console that says : $(...).modal is not a function This is my Modal HTML : <div class="modal f..

bootstrap popover not showing on top of all elements

I'm working on a bootstrap site and after updating to bootstrap 2.2 from 2.0 everything worked except the popover. The popovers still show up fine, but they don't show up on top of all other elements..

How to do integer division in javascript (Getting division answer in int not float)?

Is there any function in Javascript that lets you do integer division, I mean getting division answer in int, not in floating point number. var x = 455/10; // Now x is 45.5 // Expected x to be 45 B..

Get value (String) of ArrayList<ArrayList<String>>(); in Java

I know it's simple question, but in ArrayList<ArrayList<String>> collection; ArrayList<String> listOfSomething; collection= new ArrayList<ArrayList<String>>(); listOfSom..

Redirecting to previous page after login? PHP

I've been searching for a solution but it's seem I can't get it right, no matter what I try. After successful login, the user should be redirected to the page he came from, let's say he's been brow..

How to create an Oracle sequence starting with max value from a table?

Trying to create a sequence in Oracle that starts with the max value from a specific table. Why does this not work? CREATE SEQUENCE transaction_sequence MINVALUE 0 START WITH (SELECT MAX(trans_se..

How do I check whether input string contains any spaces?

I have a input dialog that asks for XML element name, and I want to check it to see if it has any spaces. can I do something like name.matches()?..

Convert a String representation of a Dictionary to a dictionary?

How can I convert the str representation of a dict, such as the following string, into a dict? s = "{'muffin' : 'lolz', 'foo' : 'kitty'}" I prefer not to use eval. What else can I use? The main re..

How do change the color of the text of an <option> within a <select>?

I am trying to change the color of the first option to grey color, that only the text (select one option) but here it's not working here: _x000D_ _x000D_ .grey_color {_x000D_ color: #ccc;_x000D_ ..

Using colors with printf

When written like this, it outputs text in blue: printf "\e[1;34mThis is a blue text.\e[0m" But I want to have format defined in printf: printf '%-6s' "This is text" Now I have tried several opt..

Undefined behavior and sequence points

What are "sequence points"? What is the relation between undefined behaviour and sequence points? I often use funny and convoluted expressions like a[++i] = i;, to make myself feel better. W..

Warning: Found conflicts between different versions of the same dependent assembly

I am currently developing a .NET application, which consists of 20 projects. Some of those projects are compiled using .NET 3.5, some others are still .NET 2.0 projects (so far no problem). The probl..

npm not working - "read ECONNRESET"

I'm having a problem with npm, I cant install anything. Here is the error messages: C:\Windows\system32>npm install -g yo npm http GET npm http GET https://registry.n..

Undefined reference to pow( ) in C, despite including math.h

Possible Duplicate: Problem using pow() in C what is 'undefined reference to `pow'' I'm having a bit of an issue with a simple piece of coursework for uni that's really puzzli..

how to check if string contains '+' character

I want to check if my string contains a + character.I tried following code s= "ddjdjdj+kfkfkf"; if(s.contains ("\\+"){ String parts[] = s.split("\\+); s= parts[0]; // i want to strip part after..

How can I declare and define multiple variables in one line using C++?

I always though that if I declare these three variables that they will all have the value 0 int column, row, index = 0; But I find that only index equals zero & the others are junk like 844553 ..

How to remove a package from Laravel using composer?

What is the correct way to remove a package from Laravel using composer? So far I've tried: Remove declaration from composer.json (in "require" section) Remove any Class Aliases from

Why does git revert complain about a missing -m option?

So I'm working on a project with other people, and there's multiple github forks being worked on. Someone just made a fix for a problem and I merged with his fork, but then I realized that I could fin..

How to Insert Double or Single Quotes

I have a long list of names that I need to have quotes around (it can be double or single quotes) and I have about 8,000 of them. I have them in Excel without any quotes and I can copy all of the name..

jQuery check if an input is type checkbox?

I'd like to find out if an input is a checkbox or not, and the following doesn't work: $("#myinput").attr('checked') === undefined Thank you once again!..

Return index of highest value in an array

From an array that looks something like the following, how can I get the index of the highest value in the array. For the array below, the desired result would be '11'. Array ( [11] => 14 ..

How to get random value out of an array?

I have an array called $ran = array(1,2,3,4); I need to get a random value out of this array and store it in a variable, how can I do this?..

Bash script and /bin/bash^M: bad interpreter: No such file or directory

I'm learning through this tutorial to learn bash scripts to automate a few tasks for me. I'm connecting to a server using putty. The script, located in .../Documents/LOG, is: #!/bin/bash # My first ..

Handling key-press events (F1-F12) using JavaScript and jQuery, cross-browser

I want to handle F1-F12 keys using JavaScript and jQuery. I am not sure what pitfalls there are to avoid, and I am not currently able to test implementations in any other browsers than Internet Explo..

MySQL Workbench not displaying query results

When I query a table in MySQL Workbench, no results are shown, the result section is just blank, no grid or anything. However if I export the data, it is all there. Everything worked fine until a coup..

Force flex item to span full row width

I'm trying to retain the first 2 child elements on the same row while the third element is in its own below at full width, all while using flex. I'm particularly interested in using the flex-grow and..

How to store image in SQLite database

In my application I am uploading an image from gallery and I want to store this image in the SQLite database. How do I store a bitmap in the database? I am converting bitmap to a string and saving it ..

C: printf a float value

I want to print a float value which has 2 integer digits and 6 decimal digits after the comma. If I just use printf("%f", myFloat) I'm getting a truncated value. I don't know if this always happens i..

Positive Number to Negative Number in JavaScript?

Basically, the reverse of abs. If I have: if ($this.find('.pdxslide-activeSlide').index() < slideNum - 1) { slideNum = -slideNum } console.log(slideNum) No matter what console always returns a..

How do I put variables inside javascript strings?

s = 'hello %s, how are you doing' % (my_name) That's how you do it in python. How can you do that in javascript/node.js?..

Setting Curl's Timeout in PHP

I'm running a curl request on an eXist database through php. The dataset is very large, and as a result, the database consistently takes a long amount of time to return an XML response. To fix that, w..

Why does python use 'else' after for and while loops?

I understand how this construct works: for i in range(10): print(i) if i == 9: print("Too big - I'm giving up!") break; else: print("Completed successfully") But I don'..

Warning: Cannot modify header information - headers already sent by ERROR

I've been struggling with this error for a while now. To start with, I just thought it was white space, but after further research I think it might be a problem similar to this: Look for any stat..

How to Convert unsigned char* to std::string in C++?

I have unsigned char*, want to convert it to std::string. Can you please tell me the safest way to do this?..

Python urllib2 Basic Auth Problem

Update: based on Lee's comment I decided to condense my code to a really simple script and run it from the command line: import urllib2 import sys username = sys.argv[1] password = sys.argv[2] url =..

How to make HTML Text unselectable

I would like to add text to my webpage as a label and make it unselectable. In other words, When the mouse cursor is over the text I would like it to not turn into a text selecting cursor at all. A ..

Caused By: java.lang.NoClassDefFoundError: org/apache/log4j/Logger

I've got an interesting problem in which the org.apache.log4j.Logger class is not found during runtime. I'm trying to get authorized and that is where it's failing: OAuthAuthorizer oauthAuthorizer = ..

How can I delete a newline if it is the last character in a file?

I have some files that I'd like to delete the last newline if it is the last character in a file. od -c shows me that the command I run does write the file with a trailing new line: 0013600 n t ..

jQuery ajax success callback function definition

I want to use jQuery ajax to retrieve data from a server. I want to put the success callback function definition outside the .ajax() block like the following. So do I need to declare the variable dat..

Order Bars in ggplot2 bar graph

I am trying to make a bar graph where the largest bar would be nearest to the y axis and the shortest bar would be furthest. So this is kind of like the Table I have Name Position 1 James Go..

Detect Browser Language in PHP

I use the following PHP script as index for my website. This script should include a specific page depending on the browser's language (automatically detected). This script does not work well with a..

How does Trello access the user's clipboard?

When you hover over a card in Trello and press Ctrl+C, the URL of this card is copied to the clipboard. How do they do this? As far as I can tell, there is no Flash movie involved. I've got Flashbloc..

[Vue warn]: Property or method is not defined on the instance but referenced during render

var MainTable = Vue.extend({ template: "<ul>" + "<li v-for='(set,index) in settings'>" + "{{index}}) " + "{{set.title}}" + "<button @click='changeSetting(index)'> I..

Ping all addresses in network, windows

Is it possible in windows cmd line to check all of the network addresses (with ping or similar) to see which ones are taken/ have active devices: ie. something that does something like the following:..

How get an apostrophe in a string in javascript

I'm doing some stuff with javascript and I'm wondering, how do I put an apostrophe in a string in javascript? theAnchorText = 'I apostrophe M home'; ..

How do I enable/disable log levels in Android?

I am having lots of logging statements to debug for example. Log.v(TAG, "Message here"); Log.w(TAG, " WARNING HERE"); while deploying this application on device phone i want to turn off the verbose..

How can I install Visual Studio Code extensions offline?

I have installed Visual Studio Code on a machine that is not, and cannot be, connected to the Internet. According to the documentation, I can install an extension from the command line if I have the ...

JUNIT Test class in Eclipse - java.lang.ClassNotFoundException

I'm trying to run my junit test (to verify that a properties file loads correctly) but I get ClassNotFoundException although the class is there and all required libraries are there too. Here it is t..

Creating a DateTime in a specific Time Zone in c#

I'm trying to create a unit test to test the case for when the timezone changes on a machine because it has been incorrectly set and then corrected. In the test I need to be able to create DateTime o..

Reloading submodules in IPython

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

What is the better API to Reading Excel sheets in java - JXL or Apache POI

Which of the 2 APIs is simpler to read/write/edit excel sheets ? Do these APIs not support CSV extensions ? Using JXL for file.xls and file.xlsx, I get an exception like:

CKEditor instance already exists

I am using jquery dialogs to present forms (fetched via AJAX). On some forms I am using a CKEditor for the textareas. The editor displays fine on the first load. When the user cancels the dialog, I a..

How to find the lowest common ancestor of two nodes in any binary tree?

The Binary Tree here is may not necessarily be a Binary Search Tree. The structure could be taken as - struct node { int data; struct node *left; struct node *right; }; The maximum solu..

using scp in terminal

I have created a file on a remote computer that I have ssh-ed into. I want to transfer the file back to the laptop I am using at the moment. I see that I am supposed to use the command: scp username@..

PHP Warning: mysqli_connect(): (HY000/2002): Connection refused

I am using PHP 5.5 and MAMP (downloaded from here): I have a basic script like this: <?php $servername = ""; $username = "root"; $password = "root"; // Create connection $conn = mysqli_..

select and echo a single field from mysql db using PHP

Im trying to select the title column from a particular row $eventid = $_GET['id']; $field = $_GET['field']; $result = mysql_query("SELECT $field FROM `events` WHERE `id` = '$eventid' "); echo $result..

Set maxlength in Html Textarea

How can I set the maxlength in a textarea? And why maxlength is not working properly in textarea?..

AngularJS: how to enable $locationProvider.html5Mode with deeplinking

When enabling the html5Mode in AngularJS via $locationProvider.html5Mode(true), navigation seems to be skewed when you land on a page deeper in the site. for example: when i nav..

Scala how can I count the number of occurrences in a list

val list = List(1,2,4,2,4,7,3,2,4) I want to implement it like this: list.count(2) (returns 3)...

Dialogs / AlertDialogs: How to "block execution" while dialog is up (.NET-style)

Coming from the .NET-environment, I'm now looking to understand how Dialogs work in Android. In .NET, when calling MessageBox.Show(...) that creates and shows a popup dialog. In the call to Show I ca..

Setting default value for TypeScript object passed as argument

function sayName(params: {firstName: string; lastName?: string}) { params.lastName = params.lastName || 'smith'; // <<-- any better alternative to this? var name = params.firstName + pa..

Subtracting 1 day from a timestamp date

I am using Datagrip for Postgresql. I have a table with a date field in timestamp format (ex: 2016-11-01 00:00:00). I want to be able to: apply a mathematical operator to subtract 1 day filter it..

element not interactable exception in selenium web automation

In the below code i cannot send password keys in the password field, i tried clicking the field, clearing the field and sending the keys. But now working in any of the method. But its working if i deb..

nginx - nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)

All of a sudden I am getting the below nginx error * Restarting nginx * Stopping nginx nginx ...done. * Starting nginx nginx nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)..

How do you run a js file using npm scripts?

I can't get npm to work. My package.json file has "scripts": { "build": "build.js" } and I have a build.js file in the same folder that just console.logs. When I run npm run build I get the er..

Java 8 Filter Array Using Lambda

I have a double[] and I want to filter out (create a new array without) negative values in one line without adding for loops. Is this possible using Java 8 lambda expressions? In python it would be t..

How to configure Fiddler to listen to localhost?

I want to monitor HTTP traffic between a process on my local machine and another (server) process, also running on my local machine. How can I configure Fiddler to listen to traffic to and from loc..

Disable LESS-CSS Overwriting calc()

Right Now I'm trying to do this in CSS3 in my LESS code: width: calc(100% - 200px); However, when LESS compiles it is outputting this: width: calc(-100%); Is there a way to tell LESS not to comp..

How to print variable addresses in C?

When i run this code. #include <stdio.h> void moo(int a, int *b); int main() { int x; int *y; x = 1; y = &x; printf("Address of x = %d, value of x = %d\n", &x, ..

Python: read all text file lines in loop

I want to read huge text file line by line (and stop if a line with "str" found). How to check, if file-end is reached? fn = 't.log' f = open(fn, 'r') while not _is_eof(f): ## how to check that end i..

How to make an HTTP get request with parameters

Is it possible to pass parameters with an HTTP get request? If so, how should I then do it? I have found an HTTP post requst (link). In that example the string postData is sent to a webserver. I would..

Equivalent to AssemblyInfo in dotnet core/csproj

Since dotnet core moved back to the .csproj format, there is a new autogenerated MyProject.AssemblyInfo.cs which contains, among others: [assembly: AssemblyCompany("MyProject")] [assembly: A..

How to keep :active css style after clicking an element

I use anchor as my site navigation. <div id='nav'> <a href='#abouts'> <div class='navitem about'> about </div> </a> <a href='#workss'> <div class='navitem work..

Get UIScrollView to scroll to the top

How do I make a UIScrollView scroll to the top?..

TypeError: '<=' not supported between instances of 'str' and 'int'

I'm learning python and working on exercises. One of them is to code a voting system to select the best player between 23 players of the match using lists. I'm using Python3. My code: players= [0,..

How can I check Drupal log files?

How can I check Drupal log files? I'm using Ubuntu 10.10 + Apache2 + PHP 5.33 + MySQL and Drupal 7...

How do I display a MySQL error in PHP for a long query that depends on the user input?

In PHP, I am trying to execute a long MySQL query that depends on the user input. However, my query fails with the following message, "Query Failed". Actually I have printed this message whenever t..

How to fix System.NullReferenceException: Object reference not set to an instance of an object

EDIT: This issue is resolved, good thanks to Reniuz for his 5 hours of work and research of this issue, thank's everyone. NullReferenceException: Object reference not set to an instance of an object...

C# MessageBox dialog result

I want to make a MessageBox confirmation. Here is the message box: MessageBox.Show("Do you want to save changes?", "Confirmation", messageBoxButtons.YesNoCancel); And I want to make something like ..

Android background music service

I am developing an entertainment app in android. I want to play background music, and I want to use service for that. App have 3 activities and music must be played across all activities. Also, when a..

How do I clear the dropdownlist values on button click event using jQuery?

How do I clear the dropdownlist values on button click event using jQuery?..

"Could not find a version that satisfies the requirement opencv-python"

I am struggling with Jetson TX2 board (aarch64). I need to install python wrapper for OpenCV. I can do: $ sudo apt-get install python-opencv But I cannot do: $ sudo pip install opencv-python I..

.NET Global exception handler in console application

Question: I want to define a global exception handler for unhandled exceptions in my console application. In, one can define one in global.asax, and in windows applications /services, one can ..

PHP Get name of current directory

I have a php page inside a folder on my website. I need to add the name of the current directory into a variable for example: $myVar = current_directory_name; Is this possible?..

Setting the User-Agent header for a WebClient request

What is the proper way of setting the User-Agent header for a WebClient request for Windows Phone 7? I found 2 options, but not sure which one is the correct one. Considering a WebClient object: WebC..

AngularJS is rendering <br> as text not as a newline

I am sure this has been asked before but I cannot find the answer. I have an AngularJS script that is pulling from a DB and then rendering to content. Everything is working correctly except a couple..

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

How to use XPath contains() here?

I'm trying to learn XPath. I looked at the other contains() examples around here, but nothing that uses an AND operator. I can't get this to work: //ul[@class='featureList' and contains(li, 'Model')]..

Android Studio and Gradle build error

I've been using the new preview of android studio and really like it. But recently my project won't build. I get the following error: Gradle: FAILURE: Build failed with an exception. * What went wr..

Does MS SQL Server's "between" include the range boundaries?

For instance can SELECT foo FROM bar WHERE foo BETWEEN 5 AND 10 select 5 and 10 or they are excluded from the range?..

How to clear Route Caching on server: Laravel 5.2.37

This is regarding route cache on localhost About Localhost I have 2 routes in my route.php file. Both are working fine. No problem in that. I was learning route:clear and route:cache and found a sma..

HTML entity for check mark

Possible Duplicate: Tick symbol in HTML/XHTML Is there an HTML entity for a check mark? I've searched for it in various html entities cheat sheets but didn't find it..

Remove composer

I installed composer while trying to install cakePhp, but the installation was not successful and I want to uninstall composer. I am not finding any way to do this. For the installation I used the c..

RegEx for validating an integer with a maximum length of 10 characters

Could you please point me the appropriate RegEx for validating an integer with a maximum length of 10 characters? Valid ones include: 1234567890..

printf() formatting for hex

This is more of a curious query than an important question, but why when printing hex as an 8 digit number with leading zeros, does this %#08X Not display the same result as 0x%08X? When I try to use..

In laymans terms, what does 'static' mean in Java?

I have been told several definitions for it, looked on Wikipedia, but as a beginner to Java I'm still not sure what it means. Anybody fluent in Java?..

The representation of if-elseif-else in EL using JSF

The following JSF code contains two separate <c:if></c:if>. Let's look at it. <?xml version='1.0' encoding='UTF-8' ?> <html xmlns="" xmlns:h="ht..

HTML5 video - show/hide controls programmatically

I am looking for a way to show or hide HTML5 video controls at will via javascript. The controls are currently only visible when the video starts to play Is there a way to do this with the native vid..

Finding all positions of substring in a larger string in C#

I have a large string I need to parse, and I need to find all the instances of extract"(me,i-have lots. of]punctuation, and store the index of each to a list. So say this piece of string was in the ..

Nexus 7 (2013) and Win 7 64 - cannot install USB driver despite checking many forums and online resources

I'm trying to set up my Nexus 7 (2013) for debugging, but I am getting stuck at the step where you install the USB driver. Here's what I've tried so far: Steps taken: Turned on debugging mode on N..

How to printf a 64-bit integer as hex?

With the following code I am trying to output the value of a unit64_t variable using printf(). Compiling the code with gcc, returns the following warning: warning: format ‘%x’ expects argument..

How to change the color of header bar and address bar in newest Chrome version on Lollipop?

Haven't found anything on this topic yet. I really like the ability to change the color of address bar and header color on Overview? Is there any easy way to do this? . I think you need Android 5.0..

Is there a way I can capture my iPhone screen as a video?

I want to be able to capture my iPhone's screen as a video, but I'm not sure the best way to do this. Can anyone help guide me on how to best do this without jailbreak?..

Generating a random hex color code with PHP

I'm working on a project where I need to generate an undefined number of random, hexadecimal color codes…how would I go about building such a function in PHP?..

How to write a link like <a href="#id"> which link to the same page in PHP?

like in HTML, I could write <a href="#id"> which could link to the place where I make a <a id="id"> . but it seems that it does not work in PHP. How to do that? the original code is from ..

Stack Memory vs Heap Memory

Possible Duplicate: What and where are the stack and heap I am programming in C++ and I am always wondering what exactly is stack memory vs heap memory. All I know is when I call new, I wou..

Why functional languages?

I see a lot of talk on here about functional languages and stuff. Why would you use one over a "traditional" language? What do they do better? What are they worse at? What's the ideal functional p..

Make button width fit to the text

While I was fiddling with this 'Fancy 3D Button' example, I found that the width seemed to be hard-coded to fit the text's width. Here is the HTML / CSS: _x000D_ _x000D_ body {_x000D_ background-..

Change the bullet color of list

I have a list, <ul class="listStyle"> <li> <strong>View :</strong> blah blah. </li> <li> <strong>Edit :&l..

Script parameters in Bash

I'm trying to make a shell script which should be used like this: -from /home/kristoffer/test.png -to /home/kristoffer/test.txt The script will then ocr convert the image file to a tex..

How to substitute shell variables in complex text files

I have several text files in which I have introduced shell variables ($VAR1 or $VAR2 for instance). I would like to take those files (one by one) and save them in new files where all variables would ..

How to get the excel file name / path in VBA

Say, I'm writing a VBA inside my excel file sample.xls. Now I want to get the full path of sample.xls in my VBA. How do I do it?..

Javascript querySelector vs. getElementById

I have heard that querySelector & querySelectorAll are new methods to select DOM elements. How do they compare to the older methods, getElementById & getElementsByClassName in terms of perform..

Java String to SHA1

I'm trying to make a simple String to SHA1 converter in Java and this is what I've got... public static String toSHA1(byte[] convertme) { MessageDigest md = null; try { md = MessageDi..

When should I use a table variable vs temporary table in sql server?

I'm learning more details in table variable. It says that temp tables are always on disk, and table variables are in memory, that is to say, the performance of table variable is better than temp table..

How to format dateTime in django template?

That: {{ wpis.entry.lastChangeDate|date:"D d M Y" }} gives me (why?): 2009-07-24 21:45:38.986156 and i don't know how to skip fraction part... In my model i have: addedDate = models.DateTim..

What is the difference between active and passive FTP?

Can someone tell me what is the difference between active and passive FTP? Which one is preferable?..

Is it possible to overwrite a function in PHP

Can you declare a function like this... function ihatefooexamples(){ return "boo-foo!"; }; And then redeclare it somewhat like this... if ($_GET['foolevel'] == 10){ function ihatefooexamples()..