Questions Tagged with #Visualizer

Eclipse error "Could not find or load main class"

I know there are many duplicates of this question, but I have looked at them all, and none of them have solved the issue. I am trying to run a class that has a main function. I have cleaned the proje..

newline character in c# string

I have some html code in a C# string. If I look with the Text Visualizer of Visual Studio I can see it has numerous newlines in it. However, after i apply this code string modifiedString = originalSt..

What is the best free SQL GUI for Linux for various DBMS systems

As I make the full switch from Windows to Linux (CentOS 5) I'm in search of the best free GUI SQL Client tool for MSSQL, MySQL, Oracle, etc... any suggestions? I've tried DBVisualizer (The best bet s..

compare differences between two tables in mysql

Same as oracle diff: how to compare two tables? except in mysql. Suppose I have two tables, t1 and t2 which are identical in layout but which may contain different data. What's the best way to diff t..

Use cell's color as condition in if statement (function)

I am trying to get a cell to perform a function based on the hilight color of a cell. Here is the function I currently have: =IF(A6.Interior.ColorIndex=6,IF(ROUNDDOWN(IF(M6<3,0,IF(M6<5,1,IF(M6..

Is < faster than <=?

Is if (a < 901) faster than if (a <= 900)? Not exactly as in this simple example, but there are slight performance changes on loop complex code. I suppose this has to do something with generated..

how to convert a string date to date format in oracle10g

My date value is stored as varchar2 and the value is 15/August/2009,4:30 PM, how to convert this to a proper date format like DD-MM-YYYY...

How can I monitor the thread count of a process on linux?

I would like to monitor the number of threads used by a specific process on Linux. Is there an easy way to get this information without impacting the performance of the process?..

How to delete a folder in C++?

How can I delete a folder using C++? If no cross-platform way exists, then how to do it for the most-popular OSes - Windows, Linux, Mac, iOS, Android? Would a POSIX solution work for all of them?..

Write HTML string in JSON

Is it possible to write an HTML string inside JSON? Which I want to write like below in my JSON file: [ { "id": "services.html", "img": "img/SolutionInnerbananer.jpg", "h..

Error after upgrading pip: cannot import name 'main'

Whenever I am trying to install any package using pip, I am getting this import error: guru@guru-notebook:~$ pip3 install numpy Traceback (most recent call last): File "/usr/bin/pip3", line 9, in &..

How to open a web server port on EC2 instance

I'm running a CherryPy web server at on an EC2 instance. I can connect to the web server via local wget on the EC2 machine, but I can't reach the instance from my own remote machine (I ..

How do I copy folder with files to another folder in Unix/Linux?

I am having some issues to copy a folder with files in that folder into another folder. Command cp -r doesn't copy files in the folder...

Wrapping text inside input type="text" element HTML/CSS

The HTML shown below, <input type="text"/> is displayed in a browser like so: When I add the following text, The quick brown fox jumped over the lazy dog. Using the HTML below, <..

Get JSON data from external URL and display it in a div as plain text

I have an external resource similar to which returns a JSON. I want to display the value of result key in a div in html (lets say the name of t..

Composer: how can I install another dependency without updating old ones?

I have a project with a few dependencies and I'd like to install another one, but I'd like to keep the others the way they are. So I've edited the composer.json, but if I run composer install, I get t..

Get a DataTable Columns DataType

DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn(gridColumn1, typeof(bool))); I was expecting the result of the below line to include info about the DataColumns Type (bool): ?dt.Co..

Docker-Compose persistent data MySQL

I can't seem to get MySQL data to persist if I run $ docker-compose down with the following .yml version: '2' services: # other services data: container_name: flask_data image: mysql:lat..

Why am I seeing net::ERR_CLEARTEXT_NOT_PERMITTED errors after upgrading to Cordova Android 8?

After upgrading to Cordova Android 8.0, I am seeing net::ERR_CLEARTEXT_NOT_PERMITTED errors when trying to connect to http:// targets. Why is that and how can I resolve this?..

Javascript to display the current date and time

I have the following test Script to display the current date & time :- document.getElementById("para1").innerHTML = formatAMPM(); function formatAMPM() { var date = new Date(); var hours..

Show SOME invisible/whitespace characters in Eclipse

A long while back I transitioned to doing all my web application development in Eclipse from BBEdit. But I miss one little feature from BBEdit. I used to be able to show invisible characters like tabs..

HTML5 tag for horizontal line break

I did already find a post about using the <hr> tag to insert a line break, but when I looked up the tag on the w3 website ( it says that all attributes o..

Changing plot scale by a factor in matplotlib

I am creating a plot in python. Is there a way to re-scale the axis by a factor? The yscale and xscale commands only allow me to turn log scale off. Edit: For example. If I have a plot where the x s..

Python's equivalent of && (logical-and) in an if-statement

Here's my code: def front_back(a, b): # +++your code here+++ if len(a) % 2 == 0 && len(b) % 2 == 0: return a[:(len(a)/2)] + b[:(len(b)/2)] + a[(len(a)/2):] + b[(len(b)/2):] else: ..

Simple search MySQL database using php

I currently have a small php script that searches a database based on user input. There is an html file that has one field that is used for entry of search strings into the database. Essentially, you ..

How to pass variable as a parameter in Execute SQL Task SSIS?

I have ssis package in that I'm taking values from flat file and insert it into table. I have taken one Execute SQL Task in that creating one temptable CREATE TABLE [tempdb].dbo.##temptable ( date..

what's data-reactid attribute in html?

While I was going through the HTML of some pages, I noticed that some of them use this attribute "data-reactid" like : <a data-reactid="......" ></a> What is that attribute and what i..

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

Objective-C ARC: strong vs retain and weak vs assign

There are two new memory management attributes for properties introduced by ARC, strong and weak. Apart from copy, which is obviously something completely different, are there any differences between..

Batch file for PuTTY/PSFTP file transfer automation

I have a batch file for moving file from my local PC to server through SFTP. I have PuTTY installed in my system and the batch file code follows. cd C:\Program Files (x86)\PuTTY psftp open <IP>..

AngularJS - Multiple ng-view in single template

I am building a dynamic web app by using AngularJS. Is it possible to have multiple ng-view on a single template?..

How to remove symbols from a string with Python?

I'm a beginner with both Python and RegEx, and I would like to know how to make a string that takes symbols and replaces them with spaces. Any help is great. For example: how much for the maple syru..

The specified DSN contains an architecture mismatch between the Driver and Application. JAVA

I'm trying to connect to a database made by MS Access using Java, but I cannot seem to manage. I am using ODBC and I'm getting this exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] ..

When do you use varargs in Java?

I'm afraid of varargs. I don't know what to use them for. Plus, it feels dangerous to let people pass as many arguments as they want. What's an example of a context that would be a good place to u..

ImportError: No module named request

I am trying to install python SpeechRecognition on my machine.When i am trying to install the package as pip install SpeechRecognition. I am getting the following error. import json, urllib.request ..

Create Setup/MSI installer in Visual Studio 2017

I have written an outlook add-in VSTO in Visual Studio Pro 2017 (VB.NET). I have published it which creates a setup.exe which is OK but I would like to create a proper installer that copies the files..

No Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator

I am trying to consume an API using Retrofit and Jackson to deserialize. I am getting the onFailure error No Creators, like default construct, exist): cannot deserialize from Object value (no delegate..

jQuery jump or scroll to certain position, div or target on the page from button onclick

When I click on a button i want to be able to jump down or scroll to a specific div or target on the page. $('#clickMe').click(function() { //jump to certain position or div or #target on the pag..

jquery how to empty input field

I am in a mobile app and I use an input field in order user submit a number. When I go back and return to the page that input field present the latest number input displayed at the input field. Is t..

Android Studio says "cannot resolve symbol" but project compiles

I'm importing twitter4j in AndroidStudio, using the following in my build.gradle: dependencies { compile '' compile files('libs/twitter4j-core-3.0.4.jar') } ..

Android - Package Name convention

For the "Hello World" example in, the package name is "package com.example.helloandroid;" Is there any guideline/standard to name this package? (references would be nice)..

Checking to see if one array's elements are in another array in PHP

I have two arrays in PHP as follows: People: Array ( [0] => 3 [1] => 20 ) Wanted Criminals: Array ( [0] => 2 [1] => 4 [2] => 8 [3] => 11 [4] => 12..

How to get the sign, mantissa and exponent of a floating point number

I have a program, which is running on two processors, one of which does not have floating point support. So, I need to perform floating point calculations using fixed point in that processor. For that..

Numpy isnan() fails on an array of floats (from pandas dataframe apply)

I have an array of floats (some normal numbers, some nans) that is coming out of an apply on a pandas dataframe. For some reason, numpy.isnan is failing on this array, however as shown below, each el..

Cannot change column used in a foreign key constraint

I got this error when i was trying to alter my table. Error Code: 1833. Cannot change column 'person_id': used in a foreign key constraint 'fk_fav_food_person_id' of table 'table.favorite_food' He..

how to transfer a file through SFTP in java?

How to transfer a file through SFTP in java? I want sample code for SFTP client. I want to embed the SFTP server in my application and the client should able to send a file to my application. PS: Thi..

What is the default value for Guid?

The default value for int is 0 , for string is "" and for boolean it is false. Could someone please clarify what the default value for guid is? ..

Vue 'export default' vs 'new Vue'

I just installed Vue and have been following some tutorials to create a project using the vue-cli webpack template. When it creates the component, I notice it binds our data inside of the following: ..

How to fix Error: listen EADDRINUSE while using nodejs?

If I run a server with the port 80, and I try to use xmlHTTPrequest i get this error: Error: listen EADDRINUSE Why is it problem for nodejs, if I want to do a request, while I run a server on the por..

Optional query string parameters in ASP.NET Web API

I need to implement the following WebAPI method: /api/books?author=XXX&title=XXX&isbn=XXX&somethingelse=XXX&date=XXX All of the query string parameters can be null. That is, the cal..

Sort table rows In Bootstrap

Can someone please show me an example of code that I would have to use to sort a column of a table in Bootstrap? For example, if I want to sort by price, or by name...

How to change the application launcher icon on Flutter?

When I create an app with a flutter create command, the flutter logo is used as an application icon for both platforms. If I want to change the app icon, shall I go to both platforms directories and r..

Angularjs checkbox checked by default on load and disables Select list when checked

noob on stack overflow here. I am working on a webpage that has a transfer job function. This lets the user check a check-box to send the job back to the office, or select a technician from a list of ..

Get full path of the files in PowerShell

I need to get all the files including the files present in the subfolders that belong to a particular type. I am doing something like this, using Get-ChildItem: Get-ChildItem "C:\windows\System32" -..

Get next / previous element using JavaScript?

How do I get the next element in HTML using JavaScript? Suppose I have three <div>s and I get a reference to one in JavaScript code, I want to get which is the next <div> and which is the..

What's the difference between JPA and Hibernate?

I understand that JPA 2 is a specification and Hibernate is a tool for ORM. Also, I understand that Hibernate has more features than JPA 2. But from a practical point of view, what really is the diffe..

What is this CSS selector? [class*="span"]

I saw this selector in Twitter Bootstrap: .show-grid [class*="span"] { background-color: #eee; text-align: center; border-radius: 3px; min-height: 30px; line-height: 30px; } Doe..

Given URL is not allowed by the Application configuration Facebook application error

Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a sub..

How to use bootstrap-theme.css with bootstrap 3?

After downloading a complete pack of bootstrap 3 from, I noticed that there is a separate css file for theme. How to make use of it? Please explain? I included bootstrap-theme..

Using Java 8's Optional with Stream::flatMap

The new Java 8 stream framework and friends make for some very concise java code, but I have come across a seemingly-simple situation that is tricky to do concisely. Consider a List<Thing> thin..

How to specify names of columns for x and y when joining in dplyr?

I have two data frames that I want to join using dplyr. One is a data frame containing first names. test_data <- data.frame(first_name = c("john", "bill", "madison", "abby", "zzz"), ..

Convert canvas to PDF

Is it possible to directly convert canvas to pdf using JavaScript (pdf.js or something like that)? Is there another possible way like canvas to img and then img to pdf? Can you give me an example?..

What is N-Tier architecture?

I've seen quite a few developer job postings recently that include a sentence that reads more or less like this: "Must have experience with N-Tier architecture", or "Must be able to develop N-Tier app..

jQuery checkbox checked state changed event

I want an event to fire client side when a checkbox is checked / unchecked: $('.checkbox').click(function() { if ($(this).is(':checked')) { // Do stuff } }); Basically I want it to happen f..

How can I see which Git branches are tracking which remote / upstream branch?

I know I can do git branch --all, and that shows me both local and remote branches, but it's not that useful in showing me the relationships between them. How do I list branches in a way that shows w..

Counting Number of Letters in a string variable

I'm trying to count the number of letters in a string variable. I want to make a Hangman game, and I need to know how many letters are needed to match the amount in the word...

Click event on select option element in chrome

I'm having a problem in Chrome with the following: var items = $("option", obj); items.each(function(){ $(this).click(function(){ // alert("test"); process($(this).html()); ..

Why am I getting "Received fatal alert: protocol_version" or "peer not authenticated" from Maven Central?

I'm getting the below errors when connecting to Maven Central / after June 18th 2018. Received fatal alert: protocol_version or Received fatal alert: peer not authenticated..

Vbscript list all PDF files in folder and subfolders

Well here is my code but I just can not filter the listing using the objFile.Extension i am sure it is some thing silly Set objFSO = CreateObject("Scripting.FileSystemObject") objStartFolder = "C:\de..

Fastest way to update 120 Million records

I need to initialize a new field with the value -1 in a 120 Million record table. Update table set int_field = -1; I let it run for 5 hours before canceling it. I tried running it with tran..

Android failed to load JS bundle

I'm trying to run AwesomeProject on my Nexus5 (android 5.1.1). I'm able to build the project and install it on the device. But when I run it, I got a red screen saying Unable to download JS bundle. D..

Can you create nested WITH clauses for Common Table Expressions?

WITH y AS ( WITH x AS ( SELECT * FROM MyTable ) SELECT * FROM x ) SELECT * FROM y Does something like this work? I tried it earlier but I couldn't get it to work...

Can I use Twitter Bootstrap and jQuery UI at the same time?

I am using Twitter Bootstrap and I want to use an "auto-suggest" which is not available in Bootstrap, whereas jQuery UI has its own methods for auto-suggest. Can I use both? Will it overload the band..

When do I need a fb:app_id or fb:admins?

The doc for the facebook like button says , "When your Web page represents a real-world entity, things like movies, sports teams, celebrities, and restaurants, use the Open Graph protocol to specify i..

What is the canonical way to trim a string in Ruby without creating a new string?

This is what I have now - which looks too verbose for the work it is doing. @title = tokens[Title].strip! || tokens[Title] if !tokens[Title].nil? Assume tokens is a array obtained by splitti..

Amazon S3 exception: "The specified key does not exist"

I am using the AmazonS3Client in an Android app using a getObject request to download an image from my Amazon S3 bucket. Currently, I am getting this exception:

Android view pager with page indicator

I need to get page indicator in the view pager file with images. Here is my code. public class IndicatorActivity extends Activity { /** Called when the activity is first created. */ @Override ..

How to display HTML in TextView?

I have simple HTML: <h2>Title</h2><br> <p>description here</p> I want to display HTML styled text it in TextView. How to do this?..

Batch file to restart a service. Windows

How can I restart a windows service using a .bat file? I am on windows server...

Use grep to report back only line numbers

I have a file that possibly contains bad formatting (in this case, the occurrence of the pattern \\backslash). I would like to use grep to return only the line numbers where this occurs (as in, the ma..

Refresh Part of Page (div)

I have a basic html file which is attached to a java program. This java program updates the contents of part of the HTML file whenever the page is refreshed. I want to refresh only that part of the pa..

How to initialize a variable of date type in java?

import java.util.Date; Date firstDate; I don't know how to intialize the firstDate for example for String you say String line1="First line" but what is the format for date can you give me an e..

MySQL Select last 7 days

I read some Posts here and seems like nothing special but I can not still select the entries of the last days. SELECT p1.kArtikel, p1.cName, p1.cKurzBeschreibung, p1.dLetzteAktual..

Finding the next available id in MySQL

I have to find the next available id (if there are 5 data in database, I have to get the next available insert place which is 6) in a MySQL database. How can I do that? I have used MAX(id), but when ..

Python: Open file in zip without temporarily extracting it

How can I open files in a zip archive without extracting them first? I'm using pygame. To save disk space, I have all the images zipped up. Is it possible to load a given image directly from the zip ..

Execute Stored Procedure from a Function

I know this has been asked to death, and I know why SQL Server doesn't let you do it. But is there any workaround for this, other than using Extended Stored Procedures? And please don't tell me to c..

org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException:

I'm using the following jar files: dom4j-1.6.1.jar poi-3.9-20121203.jar poi-ooxml-3.9-20121203.jar poi-ooxml-schemas-3.9-20121203.jar xmlbeans-2.3.0.jar Code: package ExcelTest; import

Passing arrays as url parameter

What is the best way that I can pass an array as a url parameter? I was thinking if this is possible: $aValues = array(); $url = ''.$aValues; or how about this: $ur..

Rails ActiveRecord date between

I need to query comments made in one day. The field is part of the standard timestamps, is created_at. The selected date is coming from a date_select. How can I use ActiveRecord to do that? I need s..

How can I check whether a variable is defined in Node.js?

I am working on a program in node.js which is actually js. I have a variable : var query = azure.TableQuery... looks this line of the code is not executing some times. my question is : How can ..

How to remove all null elements from a ArrayList or String Array?

I try with a loop like that // ArrayList tourists for (Tourist t : tourists) { if (t != null) { t.setId(idForm); } } But it isn't nice. Can anyone suggest me a better solu..

Matplotlib (pyplot) savefig outputs blank image

I am trying to save plots I make using matplotlib; however, the images are saving blank. Here is my code: plt.subplot(121) plt.imshow(dataStack, plt.subplot(122) y = copy.deepcopy..

Open directory using C

I am accepting the path through command line input. When I do dir=opendir(args[1]); it doesn' t enter the loop...i.e dir==null... How do I pass the command line input to dir pointer? void main(i..

docker unauthorized: authentication required - upon push with successful login

While pushing the docker image (after successful login) from my host I am getting "unauthorized: authentication required". Details below. -bash-4.2# docker login --username=asamba --email=anand.sam..

How to clear all input fields in a specific div with jQuery?

I am trying to use jQuery to do a simple thing: clear the input fields of a group of input field within a div whenever the form loads, or if the user changes a picklist; but I'm having a devil of a ti..

How to configure PostgreSQL to accept all incoming connections

I've got a PostgreSQL data base that I'd like to configure to accept all incoming connections regardless of the source IP address. How can this be configured in the pg_hba.conf file? I'm using postgre..

Effect of using sys.path.insert(0, path) and sys.path(append) when loading modules

I was recently having a problem with a python ImportError, where the module was found when running on my local computer but not found on the CI server. I solved this problem by swapping sys.path.appen..

How do I redirect a user when a button is clicked?

I have a view with a button. When the user clicks the button I want them redirected to a data entry view. How do I accomplish this? I should mention the views are created, tested, and functioning. I c..

Difference between text and varchar (character varying)

What's the difference between the text data type and the character varying (varchar) data types? According to the documentation If character varying is used without length specifier, the type acc..

error C2065: 'cout' : undeclared identifier

I am working on the 'driver' part of my programing assignment and i keep getting this absurd error: error C2065: 'cout' : undeclared identifier I have even tried using the std::cout but i get an..

How to remove outliers in boxplot in R?

Possible Duplicate: Changing the outlier rule in a boxplot I need to visualize my result using box-plot. x<-rnorm(10000) boxplot(x,horizontal=TRUE,axes=FALSE) How can i filter outli..

Image height and width not working?

On this post I have set the image height and width and it's clearly seen in the HTML.. [url removed] But the browser or Wordpress is causing the image to stay same size. I want it to be smaller?..

Linux command to print directory structure in the form of a tree

Is there any linux command that I can call from a Bash script that will print the directory structure in the form of a tree, e.g., folder1 a.txt b.txt folder2 folder3 ..

How can I programmatically freeze the top row of an Excel worksheet in Excel 2007 VBA?

I am looking to programmatically freeze the top row of an Excel worksheet from VBA. The end goal is to produce the same effect as the View > Freeze Panes > Freeze Top Row command in Excel 2007 ..

Quick and easy file dialog in Python?

I have a simple script which parses a file and loads it's contents to a database. I don't need a UI, but right now I'm prompting the user for the file to parse using raw_input which is most unfriendly..

How to call loading function with React useEffect only once

The useEffect React hook will run the passed in function on every change. This can be optimized to let it call only when the desired properties change. What if I want to call an initialization functi..

Boto3 Error: botocore.exceptions.NoCredentialsError: Unable to locate credentials

When I simply run the following code, I always gets this error. s3 = boto3.resource('s3') bucket_name = "python-sdk-sample-%s" % uuid.uuid4() print("Creating new bucket with name:"..

Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ' '

I am trying to query from a temp table and i keep getting this message: Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ' '. Can somebody tell me what the problem is? Is it due to convert..

ASP.NET Forms Authentication failed for the request. Reason: The ticket supplied has expired

I am getting this error many times in the event log and users are logged out. Event code: 4005 Event message: Forms authentication failed for the request. Reason: The ticket supplied has expir..

How to write connection string in web.config file and read from it?

I'm trying to write Connection string to Web.config like this: <connectionStrings> <add name="Dbconnection" connectionString="Server=localhost; Database=OnlineShopping ; Integrated..

How to use DISTINCT and ORDER BY in same SELECT statement?

After executing the following statement: SELECT Category FROM MonitoringJob ORDER BY CreationDate DESC I am getting the following values from the database: test3 test3 bildung test4 test3 test2 ..

Java string replace and the NUL (NULL, ASCII 0) character?

Testing out someone elses code, I noticed a few JSP pages printing funky non-ASCII characters. Taking a dip into the source I found this tidbit: // remove any periods from first name e.g. Mr. John --..

How do I store an array in localStorage?

If I didn't need localStorage, my code would look like this: var names=new Array(); names[0]=prompt("New member name?"); This works. However, I need to store this variable in localStorage and it's..

How to print the value of a Tensor object in TensorFlow?

I have been using the introductory example of matrix multiplication in TensorFlow. matrix1 = tf.constant([[3., 3.]]) matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2) When I ..

PHP PDO with foreach and fetch

The following code: <?php try { $dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password); echo "Connection is successful!<br/>"; $sql = "SELECT * FROM users"; ..

Load arrayList data into JTable

I'm trying to set items from a method called FootballClub and so far it's fine. but then I created an arrayList from it and I somehow can't find a way to store this information into a JTable. The prob..

I can't access http://localhost/phpmyadmin/

Problem: I can't access localhost/phpmyadmin/ before I can access localhost/phpmyadmin/ but today when I'm trying to access this page I got weird page also I can access localhost/xampp/ without any..

Is it possible to set async:false to $.getJSON call

Is it possible to set async: false when calling $.getJSON() so that the call blocks rather than being asynchronous?..

UIDevice uniqueIdentifier deprecated - What to do now?

It has just come to light that the UIDevice uniqueIdentifier property is deprecated in iOS 5 and unavailable in iOS 7 and above. No alternative method or property appears to be available or forthcomin..

How to center a subview of UIView

I have a UIView inside a UIViewm and I want the inner UIView to be always centered inside the outer one, without it having to resize the width and height. I've set the struts and springs so that it's..

js 'types' can only be used in a .ts file - Visual Studio Code using @ts-check

I am starting to use TypeScript in a Node project I am working on in Visual Studio Code. I wanted to follow the "opt-in" strategy, similar to Flow. Therefore I put // @ts-check at the top of my .js fi..

How to write character & in android strings.xml

I wrote the following in the strings.xml file: <string name="game_settings_dragNDropMove_checkBox">Move by Drag&Drop</string> I got the following error: The reference to entity "Dr..

C++ cout hex values?

I want to do: int a = 255; cout << a; and have it show FF in the output, how would I do this?..

How to install CocoaPods?

I referred too many links and tried, but had no success. If any one has an idea then please please share with me. I read cocoa pods documents and many times tried to install but always failed because ..

Check whether a string contains a substring

How can I check whether a given string contains a certain substring, using Perl? More specifically, I want to see whether is present in the given string variable...

How to increase Heap size of JVM

I am getting the following error: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at SQLite.Vm.step(Native Method) at SQLite.Database.get_table(

Bash or KornShell (ksh)?

I am not new to *nix, however lately I have been spending a lot of time at the prompt. My question is what are the advantages of using KornShell (ksh) or Bash Shell? Where are the pitfalls of using on..

Can Rails Routing Helpers (i.e. mymodel_path(model)) be Used in Models?

Say I have a Rails Model called Thing. Thing has a url attribute that can optionally be set to a URL somewhere on the Internet. In view code, I need logic that does the following: <% if thing.url...

Android and setting width and height programmatically in dp units

I'm doing: button.setLayoutParams(new GridView.LayoutParams(65, 65)); According to the docs the units for the width and height (both 65 in the above) are "pixels". How do you force this to be device..

Check if element is visible in DOM

Is there any way that I can check if an element is visible in pure JS (no jQuery) ? So, for example, in this page: Performance Bikes, if you hover over Deals (on the top menu), a window of deals appe..

should use size_t or ssize_t

At my code, I do not use int or unsigned int. I only use size_t or ssize_t for portable. For example: typedef size_t intc; // (instead of unsigned int) typedef ssize_t uintc; // (instead of int)..

Multi-line string with extra space (preserved indentation)

I want to write some pre-defined texts to a file with the following: text="this is line one\n this is line two\n this is line three" echo -e $text > filename I'm expecting something like this: ..

View array in Visual Studio debugger?

Is it possible to view an array in the Visual Studio debugger? QuickWatch only shows the first element of the array...

How to calculate the sum of the datatable column in

I have a DataTable which has 5 columns: ID Name Account Number Branch Amount The DataTable contains 5 rows. How can I show the sum of the Amount Column in a Label Control as "Total Amount"?..

How do you use bcrypt for hashing passwords in PHP?

Every now and then I hear the advice "Use bcrypt for storing passwords in PHP, bcrypt rules". But what is bcrypt? PHP doesn't offer any such functions, Wikipedia babbles about a file-encryption utili..

Best Practice: Initialize JUnit class fields in setUp() or at declaration?

Should I initialize class fields at declaration like this? public class SomeTest extends TestCase { private final List list = new ArrayList(); public void testPopulateList() { //..

Return the most recent record from ElasticSearch index

I would like to return the most recent record (top 1) from ElasticSearch index similar to the sql query below; SELECT TOP 1 Id, name, title FROM MyTable ORDER BY Date DESC; Can this be done?..

Two arrays in foreach loop

I want to generate a selectbox using two arrays, one containing the country codes and another containing the country names. This is an example: <?php $codes = array('tn','us','fr'); $name..

Get a particular cell value from HTML table using JavaScript

I want to get each cell value from an HTML table using JavaScript when pressing submit button. How to get HTML table cell values?..

How to display activity indicator in middle of the iphone screen?

When we draw the image, we want to display the activity indicator. Can anyone help us?..

SSIS - Text was truncated or one or more characters had no match in the target code page - Special Characters

I have a text file with Vertical Bar{|} separated values and I am using a Flat File source to read the values which fails with the above error. I have a Flat File Connection Manager, where I set the ..

Php header location redirect not working

No idea why this is not working. Here is the code: if ((isset($_POST['cancel'])) && ($_POST['cancel'] == 'cancel')) { header('Location: page1.php'); echo $_POST['cancel']; } Instead.. page without a code behind

I have an ASP.Net page with a C# code behind. However, I've been asked to not use a code behind - so that it will be easier to deploy in SharePoint. Is there a way to include the C# code in the ASP..

How to send value attribute from radio button in PHP

I am struggling with sending the value of a radiobutton to an email. I have coded 2 radiobuttons, where I have set the first on to be default checked. The form and values work, however the radio but..

What's the best practice for primary keys in tables?

When designing tables, I've developed a habit of having one column that is unique and that I make the primary key. This is achieved in three ways depending on requirements: Identity integer column t..

How can I listen for keypress event on the whole page?

I'm looking for a way to bind a function to my whole page (when a user presses a key, I want it to trigger a function in my component.ts) It was easy in AngularJS with a ng-keypress but it does not w..

Can we overload the main method in Java?

Can we overload a main() method in Java?..

CSS property to pad text inside of div

Is there a way to give a div element some padding INSIDE its border? For example, currently all the text inside my main div element goes right to the edge of the element's border. I'd like, as a gener..

PHP memcached Fatal error: Class 'Memcache' not found

I've pasted the example from for using memcached in php and I'm getting: Fatal error: Class 'Memcache' not found I have this in my php.ini: [memcache] memcache.hash_strategy = "consiste..

How to fix: "No suitable driver found for jdbc:mysql://localhost/dbname" error when using pools?

I am trying to create a connection to my database, when I put test my code using the main method, it works seamlessly. However, when trying to access it through Tomcat 7, it fails with error: No sui..

How to format string to money

I have a string like 000000000100, which I would like to convert to 1.00 and vice versa. Leading zero will be remove, last two digit is the decimal. I give more example : 000000001000 <=> 10...

SQL sum with condition

I currently have a large SQL statement which i add the following line to in order to get the total cash for each transaction ID (which are unique): select sum(cash) from Table a where a.branch =

UnicodeDecodeError when reading CSV file in Pandas with Python

I'm running a program which is processing 30,000 similar files. A random number of them are stopping and producing this error... File "C:\Importer\src\dfman\", line 26, in import_..

Sending multiple data parameters with jQuery AJAX

I am sending an ajax request to a php file as shown here: function checkDB(code, userid) { $.ajax({ type: "POST", url: "<?php bloginfo('template_url'); ?>/profile/check_code.php", data..

File 'app/hero.ts' is not a module error in the console, where to store interfaces files in directory structure with angular2?

I am doing the angular2 tutorial at this address: I have put the hero interface in a single file under the app folder, in the console I have thi..

Excel plot time series frequency with continuous xaxis

I want to plot a time series frequency data similar to the below. I tried many types of charts but they all put the time (ie 08:00) exactly under data series column, I also tried to type 8-9 , 9-10, 1..

Delete with "Join" in Oracle sql Query

I am not deeply acquainted with Oracle Sql Queries, therefore I face a problem on deleting some rows from a table which must fulfill a constraint which includes fields of another (joining) table. In o..

Why do table names in SQL Server start with "dbo"?

At least on my local instance, when I create tables, they are all prefixed with "dbo.". Why is that?..

Missing include "bits/c++config.h" when cross compiling 64 bit program on 32 bit in Ubuntu

I am running the 32bit version of Ubuntu 10.10 and trying to cross compile to a 64 bit target. Based on my research, I have installed the g++-multilib package. The program is a very simple hello worl..

Is there a limit on number of tcp/ip connections between machines on linux?

I have a very simple program written in 5 min that opens a sever socket and loops through the request and prints to the screen the bytes sent to it. I then tried to benchmark how many connections I ..

How do I execute a stored procedure in a SQL Agent job?

I am using SQL Server 2008 and I need to run a SQL Job from SQL Server Agent. I am new to SQL Server Job and I want to execute a stored procedure regularly from a SQL Server Job. But I did not find wh..

How to encode Doctrine entities to JSON in Symfony 2.0 AJAX application?

I'm developing game app and using Symfony 2.0. I have many AJAX requests to the backend. And more responses is converting entity to JSON. For example: class DefaultController extends Controller { ..

Auto-indent spaces with C in vim?

I've been somewhat spoiled using Eclipse and java. I started using vim to do C coding in a linux environment, is there a way to have vim automatically do the proper spacing for blocks? So after ty..

MySQL Trigger: Delete From Table AFTER DELETE

Scope: Two tables. When a new patron is created, they have some information about them stored into a 2nd table (This was done using a trigger as well, it works as expected). Here's an example of my t..

Turning off hibernate logging console output

I'm using hibernate 3 and want to stop it from dumping all the startup messages to the console. I tried commenting out the stdout lines in but no luck. I've pasted my log file below. ..

CSS: Control space between bullet and <li>

I'd like to control how much horizontal space a bullet pushes its <li> to the right in an <ol> or <ul>. That is, instead of always having * Some list text goes here. I'd like..

$(window).width() not the same as media query

I am using Twitter Bootstrap on a project. As well as the default bootstrap styles I have also added some of my own //My styles @media (max-width: 767px) { //CSS here } I am also using jQuery ..

How to add items into a numpy array

I need to accomplish the following task: from: a = array([[1,3,4],[1,2,3]...[1,2,1]]) (add one element to each row) to: a = array([[1,3,4,x],[1,2,3,x]...[1,2,1,x]]) I have tried doing stuff lik..

How can the size of an input text box be defined in HTML?

Here is an HTML input text box: <input type="text" id="text" name="text_name" /> What are the options to define the size of the box? How can this be implemented in CSS?..

How to write a Python module/package?

I've been making Python scripts for simple tasks at work and never really bothered packaging them for others to use. Now I have been assigned to make a Python wrapper for a REST API. I have absolutely..

What is the Oracle equivalent of SQL Server's IsNull() function?

In SQL Server we can type IsNull() to determine if a field is null. Is there an equivalent function in PL/SQL?..

Python nonlocal statement

What does the Python nonlocal statement do (in Python 3.0 and later)? There's no documentation on the official Python website and help("nonlocal") does not work, either...

Sorting multiple keys with Unix sort

I have potentially large files that need to be sorted by 1-n keys. Some of these keys might be numeric and some of them might not be. This is a fixed-width columnar file so there are no delimiters. ..

top nav bar blocking top content of the page

I have this Twitter Bootstrap code <div class='navbar navbar-fixed-top'> <div class='navbar-inner'> <div class='container'> <a class='btn btn-navbar' data-ta..

MassAssignmentException in Laravel

I am a Laravel newbie. I want to seed my database. When I run the seed command I get an exception [Illuminate\Database\Eloquent\MassAssignmentException] username db:seed [--class[="..."]] [--d..

What is the use of a cursor in SQL Server?

I want to use a database cursor; first I need to understand what its use and syntax are, and in which scenario we can use this in stored procedures? Are there different syntaxes for different versions..

How to remove an element from a list by index

How do I remove an element from a list by index in Python? I found the list.remove method, but say I want to remove the last element, how do I do this? It seems like the default remove searches the l..

Execute a SQL Stored Procedure and process the results

In VB.NET, how do I do the following? Execute a Stored Procedure Read through the DataTable returned ..

Does uninstalling a package with "pip" also remove the dependent packages?

When you use pip to install a package, all the required packages will also be installed with it (dependencies). Does uninstalling that package also remove the dependent packages?..

how can get index & count in vuejs

I have code like this (JSFiddle) <li v-for="(itemObjKey, catalog) in catalogs">this index : {{itemObjKey}}</li> Output: this index: 0 this index: 1 My question is: How can I get va..

Save string to the NSUserDefaults?

How to save a string into the NSUserDefaults?..

Convert a char to upper case using regular expressions (EditPad Pro)

I wrote a regular expression in hope that I will be able to replace every match (that is just one char) to upper case char. I am using EditPad Pro (however I am willing to use any other tool that woul..

How to compare two dates?

How would I compare two dates to see which is later, using Python? For example, I want to check if the current date is past the last date in this list I am creating, of holiday dates, so that it will..

Center an element with "absolute" position and undefined width in CSS?

I need to place a div (with position:absolute;) element in the center of my window. But I am having problems doing so, because the width is unknown. I tried this. But it needs to be adjusted as the wi..

Call a method of a controller from another controller using 'scope' in AngularJS

I am trying to call a method of second controller in first controller by using scope variable. This is a method in my first controller: $scope.initRestId = function(){ var catapp = document.g..

Is there an easy way to convert jquery code to javascript?

Is there an easy way to convert jQuery code to regular javascript? I guess without having to access or understand the jQuery source code...

Amazon S3 boto - how to create a folder?

How can I create a folder under a bucket using boto library for Amazon s3? I followed the manual, and created the keys with permission, metadata etc, but no where in the boto's documentation it des..

How to put a jar in classpath in Eclipse?

Hi I am n00b in classpath and Ant. While reading the tutorial of GCM for Android I came across a line Step 1: Copy the gcm.jar file into your application classpath To write your Android applicati..

How to stick <footer> element at the bottom of the page (HTML5 and CSS3)?

When I use position relative with no content, footer goes up, with absolute with a lot of content, the footer goes down, and with fixed it is always there. Is there a easy way to get at the end of t..

Gradle - Move a folder from ABC to XYZ

Directory Structure: Project1/ABC/file1.txt I want the above ABC folder moved/renamed to XYZ (without leaving ABC there). How can I do this using Gradle. Seems like in Gradle: For a right hand pers..

how to run a winform from console application?

How do I create, execute and control a winform from within a console application?..

To delay JavaScript function call using jQuery

JavaScript: $(document).ready(function(){ function sample() { alert("This is sample function"); } $("#button").click(function(){ t = setTimeout(&q..

Concept of void pointer in C programming

Is it possible to dereference a void pointer without type-casting in the C programming language? Also, is there any way of generalizing a function which can receive a pointer and store it in a void p..

Google Drive as FTP Server

Is there a way to use Google Drive as an FTP Server? I mean I have host, username and password and using Filezilla I can access GDrive folders, upload and download data and automate backups with many..

Similarity String Comparison in Java

I want to compare several strings to each other, and find the ones that are the most similar. I was wondering if there is any library, method or best practice that would return me which strings are m..

How can I format bytes a cell in Excel as KB, MB, GB etc?

I have a value in a cell that's in bytes. But nobody can read 728398112238. I'd rather it say 678.37GB To write a formula to format it relatively easy (here's one:

How to check encoding of a CSV file

I have a CSV file and I wish to understand its encoding. Is there a menu option in Microsoft Excel that can help me detect it OR do I need to make use of programming languages like C# or PHP to deduc..

Calling an executable program using awk

I have a program in C that I want to call by using awk in shell scripting. How can I do something like this?..

How to sleep for five seconds in a batch file/cmd

Windows's Snipping tool can capture the screen, but sometimes I want to capture the screen after five seconds, such as taking an image being displayed by the webcam. (Run the script and smile at the c..

How do I increase memory on Tomcat 7 when running as a Windows Service?

I am trying to run Tomcat 7 as a Windows Service (XP and Windows 7). I see places to set the -Xmx and -Xms jvm args in catalina.bat, but I'm not sure how to do it when using $CATALINA_HOME/bin/servic..

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

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

Android- Error:Execution failed for task ':app:transformClassesWithDexForRelease'

The Problem is that i am able to run my app when i change to debug mode but it fails when i switch to release mode. Exception: **FAILURE: Build failed with an exception.** > Execution failed for ..

Ansible: Store command's stdout in new variable?

Inside my playbook I'd like to create a variable holding the output of an external command. Afterwards I want to make use of that variable in a couple of templates. Here are the relevant parts of t..

Android: textview hyperlink

I know that if you put a link in a textview it will work but if I want to display for example: google stackoverflow and not the whole link(just the tag) How do i make those links clickable?..