Questions Tagged with #Encoder

FlutterError: Unable to load asset

This is the folder structure of my app .idea .vscode android build fonts Oxygen-Bold.tff Oxygen-Light.tff Oxygen-Regular.tff images pizza0.png pizza1.png ios lib ui home.dart main.dart test ..

LabelEncoder: TypeError: '>' not supported between instances of 'float' and 'str'

I'm facing this error for multiple variables even treating missing values. For example: le = preprocessing.LabelEncoder() categorical = list(df.select_dtypes(include=['object']).columns.values) for c..

TypeError: Object of type 'bytes' is not JSON serializable

I just started programming Python. I want to use scrapy to create a bot,and it showed TypeError: Object of type 'bytes' is not JSON serializable when I run the project. import json import codecs c..

Angular 2 http post params and body

I'm trying to do an api call from my angular app. What I want to do is send a post request to the api with a command param. I have done a lot of server side testing as well as going through the outgoi..

Python "TypeError: unhashable type: 'slice'" for encoding categorical data

I am getting TypeError: unhashable type: 'slice' when executing the below code for encoding categorical data in Python. Can anyone please help? # Importing the libraries import numpy as np imp..

How to save final model using keras?

I use KerasClassifier to train the classifier. The code is below: import numpy from pandas import read_csv from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scik..

iloc giving 'IndexError: single positional indexer is out-of-bounds'

I am trying to encode some information to read into a Machine Learning model using the following import numpy as np import pandas as pd import matplotlib.pyplot as py Dataset = pd.read_csv('filenam..

How do I get rid of the b-prefix in a string in python?

A bunch of the tweets I am importing are having this issue where they read b'I posted a new photo to Facebook' I gather the b indicates it is a byte. But this is proving problematic because in my ..

How to convert an Image to base64 string in java?

It may be a duplicate but i am facing some problem to convert the image into Base64 for sending it for Http Post. I have tried this code but it gave me wrong encoded string. public static void main(..

disabling spring security in spring boot app

I have a spring boot web app with spring security configured. I want to disable authentication for a while (until needed). I add this to the security.basic.enable: false ..

How do I enable logging for Spring Security?

I am setting up Spring Security to handle logging users in. I have logged in as a user, and am taken to an Access Denied error page upon successful login. I don't know what roles my user has actually ..

How to fix Invalid AES key length?

I am working on a text encryption and decryption project (following Struts 2) Whenever I enter the password and the plain text I get a Invalid AES Key Length error. The Service Class package

Spring boot - Not a managed type

I use Spring boot+JPA and having a problem while starting the service. Caused by: java.lang.IllegalArgumentException: Not an managed type: class com.nervytech.dialer.domain.PhoneSettings at org.h..

Base64: java.lang.IllegalArgumentException: Illegal character

I'm trying to send a confirmation email after user registration. I'm using the JavaMail library for this purpose and the Java 8 Base64 util class. I'm encoding user emails in the following way: byte..

Label encoding across multiple columns in scikit-learn

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

java IO Exception: Stream Closed

This is the code I currently have: public class FileStatus extends Status{ FileWriter writer; public FileStatus(){ try { writer = new FileWriter("status.txt",true); } catch (IOExcepti..

UnicodeDecodeError: 'utf8' codec can't decode byte 0xa5 in position 0: invalid start byte

I am using Python-2.6 CGI scripts but found this error in server log while doing json.dumps(), Traceback (most recent call last): File "/etc/mongodb/server/cgi-bin/", line 135, .. no protocol on URL based on a string modified with URLEncoder

So I was attempting to use this String in a URL :-

How To Inject AuthenticationManager using Java Configuration in a Custom Filter

I'm using Spring Security 3.2 and Spring 4.0.1 I'm working on converting an xml config into a Java config. When I annotate AuthenticationManager with @Autowired in my Filter, I'm getting an exception..

How can I send large messages with Kafka (over 15MB)?

I send String-messages to Kafka V. 0.8 with the Java Producer API. If the message size is about 15 MB I get a MessageSizeTooLargeException. I have tried to set message.max.bytesto 40 MB, but I still ..

How to get coordinates of an svg element?

I am using d3 to draw a line from a relative svg position and hence want to access the coordinates of the element itself. I tried something like this (where "this" refers to the element) .attr("x1",..

Cutting the videos based on start and end time using ffmpeg

I tried to cut the video using the start and end time of the video by using the following command ffmpeg -ss 00:00:03 -t 00:00:08 -i movie.mp4 -acodec copy -vcodec copy -async 1 cut.mp4 By using t..

Toggle visibility property of div

I have an HTML 5 video in a div. I then have a custom play button - that works fine. And I have the video's visibility set to hidden on load and visible when the play button is clicked, how do I retur..

How to use new PasswordEncoder from Spring Security

As of Spring Security 3.1.4.RELEASE, the old has been deprecated in favour of

Removing fields from struct or hiding them in JSON Response

I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the..

javax.crypto.IllegalBlockSizeException : Input length must be multiple of 16 when decrypting with padded cipher

I'm getting a decrypting error in java class: javax.crypto.IllegalBlockSizeException : Input length must be multiple of 16 when decrypting with padded cipher. What can I do to solve this probl..

SeekBar and media player in android

I have a simple player and recorder. Everything works great but have a one problem. I want to add seek bar to see progress in playing record and use this seek bar to set place from player should play..

Output Django queryset as JSON

I want to serialize my queryset, and I want it in a format as this view outputs: class JSONListView(ListView): queryset = Users.objects.all() def get(self, request, *args, **kwargs): ..

The content type application/xml;charset=utf-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8)

I trying to consume a WCF web service using stand alone application. I am able to view this service using Internet Explorer also able to view in Visual studio service references. This is the error I..

python encoding utf-8

I am doing some scripts in python. I create a string that I save in a file. This string got lot of data, coming from the arborescence and filenames of a directory. According to convmv, all my arboresc..

Uri not Absolute exception getting while calling Restful Webservice

The below code snippet is using to call my web service using restful API. ClientConfig config = new DefaultClientConfig(); Client client = Client.create(config); String uri= "https://127.0.0...

How do I fix the error "Only one usage of each socket address (protocol/network address/port) is normally permitted"?

I've done a lot of googling but not had much luck with my issues. I am new to network programming and trying to learn, I've attempted to set up a simple server & client that communicate (following..

HttpWebRequest-The remote server returned an error: (400) Bad Request

I am getting The remote server returned an error: (400) Bad Request error while running the following code. I am trying to upload xml file on the http server. My xml file contains tag for the username..

Encoding as Base64 in Java

I need to encode some data in the Base64 encoding in Java. How do I do that? What is the name of the class that provides a Base64 encoder? I tried to use the sun.misc.BASE64Encoder class, without s..

Loading and parsing a JSON file with multiple JSON objects

I am trying to load and parse a JSON file in Python. But I'm stuck trying to load the file: import json json_data = open('file') data = json.load(json_data) Yields: ValueError: Extra data: line 2 ..

ffmpeg - Converting MOV files to MP4

I have just installed ffmpeg and I am trying to encode all my uploaded videos to .mp4 file. Most of the users currently upload .mov and I want to convert every video to .mp4. I am running the command..

The type or namespace name does not exist in the namespace 'System.Web.Mvc'

Buiding MVC3 solution went well but have got an error in browser: Compiler Error Message: CS0234: The type or namespace name 'Html' does not exist in the namespace 'System.Web.Mvc' (are you missing a..

json.dump throwing "TypeError: {...} is not JSON serializable" on seemingly valid object?

Background: I am writing a python program which should manage my music files. It crawls directories and puts the files and their meta data (via mutagen), encoded in JSON, in a file as a simple "databa..

Java URL encoding of query string parameters

Say I have a URL and I have a query entered by the user such as: random word £500 bank $ I want the result to be a properly encoded URL:

Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

I am developing an application with Hibernate and I get an Exception when I connect with database. The exception is: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTupli..

Use ffmpeg to add text subtitles

I am trying to add text subtitles to an .mp4 container using ffmpeg: ffmpeg -i input.mp4 -i -map 0.0 -map 0.1 -map 1.0 output.mp4 When I am trying to run this line, it gives me an error :..

How to convert String to DOM Document object in java?

I have a case like getting an XML and convert the XML elements to document object and getting the element values and attributes which i have been created already Here is the piece of code i have trie..

How to JSON serialize sets?

I have a Python set that contains objects with __hash__ and __eq__ methods in order to make certain no duplicates are included in the collection. I need to json encode this result set, but passing ev..

Get Base64 encode file-data from Input Form

I've got a basic HTML form from which I can grab a bit of information that I'm examining in Firebug. My only issues is that I'm trying to base64 encode the file data before it's sent to the server whe..

Encoding Javascript Object to Json string

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

How long to brute force a salted SHA-512 hash? (salt provided)

Here is an algorithm in Java: public String getHash(String password, String salt) throws Exception { String input = password + salt; MessageDigest md = MessageDigest.getInstance(SHA-512); ..

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

InvalidKeyException : Illegal Key Size - Java code throwing exception for encryption class - how to fix?

I've been trying to get some working Java code to use for encrypting Paypal buttons. This is no easy task! Even when I get some code, from Paypal, I'm faced with errors..ugh.. So here is what I have ..

javascript object max size limit

I'm trying to pass a JavaScript variable to the server-side using jquery.ajax method. I'm trying to create a json string, but when the length of variable reaches 10000, no more data is appended to th..

How can I configure Logback to log different levels for a logger to different destinations?

How can I configure Logback to log different levels for a logger to different destinations? For example, given the following Logback configuration, will Logback record INFO messages to STDOUT and ERR..

How to screenshot website in JavaScript client-side / how Google did it? (no need to access HDD)

I'm working on web application that needs to render a page and make a screenshot on the client (browser) side. I don't need the screenshot to be saved on the local HDD though, just kept it in RAM an..

import sun.misc.BASE64Encoder results in error compiled in Eclipse

For this two imports; import sun.misc.BASE64Encoder; import sun.misc.BASE64Decoder; I got this error: Access restriction: The type BASE64Decoder is not accessible due to restriction on required li..

Encoding URL query parameters in Java

How does one encode query parameters to go on a url in Java? I know, this seems like an obvious and already asked question. There are two subtleties I'm not sure of: Should spaces be encoded on th..

WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding

I've got a WCF Service running on my local IIS server. I've added it as a service reference to a C# Website Project and it adds fine and generates the proxy classes automatically. However, when I try..

URLEncoder not able to translate space character

I am expecting System.out.println("Hello World", "UTF-8")); to output: Hello%20World (20 is ASCII Hex code for space) However, what I get is: Hello+World Am I using ..

Process.start: how to get the output?

I would like to run an external command line program from my Mono/.NET app. For example, I would like to run mencoder. Is it possible: To get the command line shell output, and write it on my text ..

How to change root logging level programmatically for logback

I have the following logback.xml file: <configuration debug="true"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>%d{HH:mm:ss.SS..

URL encoding in Android

How do you encode a URL in Android? I thought it was like this: final String encodedURL = URLEncoder.encode(urlAsString, "UTF-8"); URL url = new URL(encodedURL); If I do the above, the http:// in ..

How should I escape strings in JSON?

When creating JSON data manually, how should I escape string fields? Should I use something like Apache Commons Lang's StringEscapeUtilities.escapeHtml, StringEscapeUtilities.escapeXml, or should I us..

QR Code encoding and decoding using zxing

Okay, so I'm going to take the off chance that someone here has used zxing before. I'm developing a Java application, and one of the things it needs to do is encode a byte array of data into a QR Code..

How to store custom objects in NSUserDefaults

Alright, so I've been doing some poking around, and I realize my problem, but I don't know how to fix it. I have made a custom class to hold some data. I make objects for this class, and I need to t..

Java: how to use UrlConnection to post request with authorization?

I would like to generate POST request to a server which requires authentication. I tried to use the following method: private synchronized String CreateNewProductPOST (String urlString, String encode..

c# Image resizing to different size while preserving aspect ratio

I'm trying to resize an image while preserving the aspect ratio from the original image so the new image doesn't look squashed. eg: Convert a 150*100 image into a 150*150 image. The extra 50 pi..

Java: Converting String to and from ByteBuffer and associated problems

I am using Java NIO for my socket connections, and my protocol is text based, so I need to be able to convert Strings to ByteBuffers before writing them to the SocketChannel, and convert the incoming ..

In a URL, should spaces be encoded using %20 or +?

In a URL, should I encode the spaces using %20 or +? For example, in the following example, which one is correct? Our company is lean..

Using Python to execute a command on every file in a folder

I'm trying to create a Python script that would : Look into the folder "/input" For each video in that folder, run a mencoder command (to transcode them to something playable on my phone) Once menco..

A generic error occurred in GDI+, JPEG Image to MemoryStream

This seems to be a bit of an infamous error all over the web. So much so that I have been unable to find an answer to my problem as my scenario doesn't fit. An exception gets thrown when I save the im..

How to include header files in GCC search path?

I have the following code in a sample file: #include "SkCanvas.h" #include "SkDevice.h" #include "SkGLCanvas.h" #include "SkGraphics.h" #include "SkImageEncoder.h" #include "SkPaint.h" #include "SkPi..

Reading a UTF8 CSV file with Python

I am trying to read a CSV file with accented characters with Python (only French and/or Spanish characters). Based on the Python 2.5 documentation for the csvreader (

HTTP URL Address Encoding in Java

My Java standalone application gets a URL (which points to a file) from the user and I need to hit it and download it. The problem I am facing is that I am not able to encode the HTTP URL address prop..

Java equivalent to JavaScript's encodeURIComponent that produces identical output?

I've been experimenting with various bits of Java code trying to come up with something that will encode a string containing quotes, spaces and "exotic" Unicode characters and produce output that's id..

Java - Convert String to valid URI object

I am trying to get a object from a String. The string has some characters which will need to be replaced by their percentage escape sequences. But when I use URLEncoder to encode the Stri..

How to Count Duplicates in List with LINQ

I have a list of items John ID Matt ID John ID Scott ID Matt ID John ID Lucas ID I want to shove them back into a list like so which also means I want to sort by the highest number of duplicates. ..

How do I encode URI parameter values?

I want to send a URI as the value of a query/matrix parameter. Before I can append it to an existing URI, I need to encode it according to RFC 2396. For example, given the input:

Use of Greater Than Symbol in XML

I had created the xml document with xml version="1.0". In that document I need to use the greater than symbol > and less than symbol <. How should I include those symbols? It's not working. &.. is deprecated, what should I use instead?

I get the following warning when using warning: [deprecation] encode(java.lang.String) in has been deprecated What should I be using instead?..

What is cardinality in Databases?

I have been searching all over the internet but I couldn't seem to find an answer that I can understand. So kindly, if somebody could explain to me with the help of examples what is cardinality in da..

How to count number of unique values of a field in a tab-delimited text file?

I have a text file with a large amount of data which is tab delimited. I want to have a look at the data such that I can see the unique values in a column. For example, Red Ball 1 Sold Blue Bat..

Difficulty with ng-model, ng-repeat, and inputs

I am trying to allow the user to edit a list of items by using ngRepeat and ngModel. (See this fiddle.) However, both approaches I've tried lead to bizarre behavior: one doesn't update the model, and ..

Detect if HTML5 Video element is playing

I've looked through a couple of questions to find out if an HTML5 element is playing, but can't find the answer. I've looked at the W3 documentation and it has an event named "playing" but I can't see..

Java 8 optional: ifPresent return object orElseThrow exception

I'm trying to make something like this: private String getStringIfObjectIsPresent(Optional<Object> object){ object.ifPresent(() ->{ String result = "result"; ..

$http get parameters does not work

Does anyone know why this does not work? $http .get('accept.php', { source: link, category_id: category }) .success(function (data, status) { $scope.info_show = da..

How do I make a PHP form that submits to self?

How do I make a self-posting/self-submitting form, i.e. a form that submits the results to itself, instead of submitting to another form?..

Is there an easy way to check the .NET Framework version?

The problem is that I need to know if it's version 3.5 SP 1. Environment.Version() only returns 2.0.50727.3053. I found this solution, but I think it will take much more time than it's worth, so I'm ..

How to check if one DateTime is greater than the other in C#

I have two DateTime objects: StartDate and EndDate. I want to make sure StartDate is before EndDate. How is this done in C#?..

How to generate auto increment field in select query

For example I have a table with 2 columns, first_name and last_name with these values Ali Khani Elizabette Amini Britney Spears ,... I want to write a select query that generate ..

Error QApplication: no such file or directory

I have installed C++SDK that have Qt but when I try compiling a code linking QApplication it gives me the error: Error QApplication: no such file or directory How do I link these libraries? I searc..

Html code as IFRAME source rather than a URL

This standard code for an IFRAME, is there a way to replace the src URL with Just html code? so my problem is simple, I have a page it loads an HTML body from MYSQL I want to present that code in a fr..

How to disassemble a memory range with GDB?

I'm trying to disassemble a program to see a syscall assembly instruction (the INT instruction, I believe) and the handler with GDB and have written a little program (see below) for it that opens and ..

Oracle database: How to read a BLOB?

I'm working with an Oracle database, and I would like to read the contents of a BLOB. How do I do this? When I do a simple select statement, it merely returns "(BLOB)" (without the quotes). How do I..

Access item in a list of lists

If I have a list of lists and just want to manipulate an individual item in that list, how would I go about doing that? For example: List1 = [[10,13,17],[3,5,1],[13,11,12]] What if I want to take..

Android soft keyboard covers EditText field

Is there a way to make the screen scroll to allow the text field to be seen?..

Integer.toString(int i) vs String.valueOf(int i)

I am wondering why the method String.valueOf(int i) exists ? I am using this method to convert int into String and just discovered the Integer.toString(int i) method. After looking the implementation..

OperationalError: database is locked

I have made some repetitive operations in my application (testing it), and suddenly I’m getting a weird error: OperationalError: database is locked I've restarted the server, but the error persi..

Configure DataSource programmatically in Spring Boot

With Spring Boot I can instantiate a JdbcTemplate with the following: Code: @Autowired private JdbcTemplate jdbcTemplate; Properties: spring.datasource.url=jdbc:postgresql://my_url:my_port/my_oth..

How to avoid 'undefined index' errors?

I am working through some code done by a previous developer. I'm pretty new to PHP so I am wondering if there is any well known pattern or solution to this problem. Basically the original author does ..

Adding open/closed icon to Twitter Bootstrap collapsibles (accordions)

I've set up this simple version of the Bootstrap accordion: Simple accordion: Currently the icon only points down, but does anyone know what JS would be needed to ..

Android dex gives a BufferOverflowException when building

When compiling a specific Android project, and only on my Windows machine, I get a java.nio.BufferOverflowException during from dex. The problem occurs both when using Eclipse and when using Ant. The..

Add CSS to <head> with JavaScript?

Is there a way to add css from a string in the javascript file to the head of a document with javascript? Let's say we have a webpage, which has a lightbox script, this script requires a css file to ..

Static array vs. dynamic array in C++

What is the difference between a static array and a dynamic array in C++? I have to do an assignment for my class and it says not to use static arrays, only dynamic arrays. I've looked in the book an..

Using Server.MapPath() inside a static field in ASP.NET MVC

I'm building an ASP.NET MVC site where I'm using Lucene.Net for search queries. I asked a question here about how to properly structure Lucene.Net usage in an ASP.NET MVC application and was told that..

How to amend older Git commit?

I have made 3 git commits, but have not been pushed. How can I amend the older one (ddc6859af44) and (47175e84c) which is not the most recent one? $git log commit f4074f289b8a49250b15a4f25ca4b4601745..

Fill formula down till last row in column

I'm trying to draw down the formula that's in cell M3 to the end of the data set. I'm using column L as my base to determine the last cell with data. My formula is a concatenation of two cells with a..

How to insert an item into an array at a specific index (JavaScript)?

I am looking for a JavaScript array insert method, in the style of: arr.insert(index, item) Preferably in jQuery, but any JavaScript implementation will do at this point...

Google Maps Api v3 - find nearest markers

When i click on map, which will be best way to find nearest marker or markers? is there some functions in api that will help me to do that? it's google map api v3...

Placeholder Mixin SCSS/CSS

I'm trying to create a mixin for placeholders in sass. This is the mixin I've created. @mixin placeholder ($css) { ::-webkit-input-placeholder {$css} :-moz-placeholder {$css} ::-moz..

Find an element in DOM based on an attribute value

Can you please tell me if there is any DOM API which search for an element with given attribute name and attribute value: Something like: doc.findElementByAttribute("myAttribute", "aValue"); ..

Automatic exit from Bash shell script on error

I've been writing some shell script and I would find it useful if there was the ability to halt the execution of said shell script if any of the commands failed. See below for an example: #!/bin/bash ..

How to convert string to integer in C#

How do I convert a string to an integer in C#?..

Gson library in Android Studio

Can someone give me step by step guide to add the Gson library to an Android project? I tried the JSON built-in library but that seems to be a bit tedious right now. I saw a couple of examples based..

Delete everything in a MongoDB database

I'm doing development on MongoDB. For totally non-evil purposes, I sometimes want to blow away everything in a database—that is, to delete every single collection, and whatever else might be lying a..

Unresponsive KeyListener for JFrame

I'm trying to implement a KeyListener for my JFrame. On the constructor, I'm using this code: System.out.println("test"); addKeyListener(new KeyListener() { public void keyPressed(KeyEvent e) { S..

C# HttpWebRequest The underlying connection was closed: An unexpected error occurred on a send

I've been Googling and trying all the solutions I could find or think of myself. The site I'm trying to load is running TLS1.2 as is a few other sites I tried to test with to make sure it wasn't a TLS..

What's the point of the X-Requested-With header?

JQuery and other frameworks add the following header: X-Requested-With: XMLHttpRequest Why is this needed? Why would a server want to treat AJAX requests differently than normal requests? UPDAT..

How to validate IP address in Python?

What's the best way to validate that an IP entered by the user is valid? It comes in as a string...

How to set a radio button in Android

I have an app that uses radio buttons. The default for this button is set in the main.xml file, ie: android:id="@+id/rb_sat1E" android:checked="true" In the Java file I have: final RadioButton ra..

No connection could be made because the target machine actively refused it (PHP / WAMP)

Note: I realise this could be seen as a duplicate but i have looked at the other responses and they didn't fix the problem for me. I have recently installed Zend Studio and Zend Server with the mys..

jQuery: count number of rows in a table

How do I count the number of tr elements within a table using jQuery? I know there is a similar question, but I just want the total rows...

How to create a TextArea in Android

How do I display a TextArea for my android project? From xml, the only choice is TextField, multi lined. But thats editable. I need a TextArea which is only for displaying messages/text can't be edit/..

javascript : sending custom parameters with but its not working

<html> <head> <script> function open_win() {"http://localhost:8080/login","mywindow") } </script> </head> <body> <input type="button" value="Op..

How to fix ReferenceError: primordials is not defined in node

I have installed node modules by npm install, then I tried to do gulp sass-watch in command prompt. After that I got the below response. [18:18:32] Requiring external module babel-register fs.js:27 c..

Simple way to encode a string according to a password?

Does Python have a built-in, simple way of encoding/decoding strings using a password? Something like this: >>> encode('John Doe', password = 'mypass') 'sjkl28cn2sx0' >>> decode('s..

Convert list into a pandas data frame

I am trying to convert my output into a pandas data frame and I am struggling. I have this list my_list = [1,2,3,4,5,6,7,8,9] I want to create a pandas data frame that would have 3 columns and thre..

HTML - how can I show tooltip ONLY when ellipsis is activated

I have got a span with dynamic data in my page, with ellipsis style. .my-class { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; width: 71px; } <span id="myId" class="m..

Reset Windows Activation/Remove license key

I'm having a hard time finding and answer to this. If I had to hypotheitcally remove the Windows license key from a VM that's been specifically setup for a partner, and it needs to be removed before t..

jquery mobile background image

I am building a jQuery mobile site, and I am trying to insert a scalable image into the background, which would adjust to screen size of the phone. This is my code: <!DOCTYPE html> <html>..

Safe navigation operator (?.) or (!.) and null property paths

In Angular 2 templates safe operator ?. works, but not in component.ts using TypeScript 2.0. Also, safe navigation operator (!.) doesn't work. For example: This TypeScript if (a!.b!.c) { } compiles t..

Passing bash variable to jq

I have written a script to retrieve certain value from file.json. It works if I provide the value to jq select, but the variable doesn't seem to work (or I don't know how to use it). #!/bin/sh #this..

What data type to use in MySQL to store images?

I need to store image and resume of user in the data base. I am using mysql data base and php5. I need to know which data types I should use. And also how do I set a limit (maximum size) for upload..

How to execute an .SQL script file using c#

I'm sure this question has been answered already, however I was unable to find an answer using the search tool. Using c# I'd like to run a .sql file. The sql file contains multiple sql statements, so..

Which JDK version (Language Level) is required for Android Studio?

I am a new comer to the android world and with a .NET background. I am trying to install the Android Studio but I am having a mismatch on about the JDK version required for developing Andr..

Navigation Controller Push View Controller

Question How to navigate from one view controller to another simply using a button's touch up inside event? More Info What I tried in a sample project, in steps, was: Create the sample single vie..

Make the current commit the only (initial) commit in a Git repository?

I currently have a local Git repository, which I push to a Github repository. The local repository has ~10 commits, and the Github repository is a synchronised duplicate of this. What I'd like to d..

How do you calculate the variance, median, and standard deviation in C++ or Java?

Possible Duplicate: Simple statistics - Java packages for calculating mean, standard deviation, etc I have a vector of some doubles (1.1,2,3,5). How can I calculate the variance, median, an..

Get Wordpress Category from Single Post

I'm finishing up a WP theme, and I'm on the single.php template. I'm having some issues because I need to access the parent category that a post is in in order to display certain images and XML conten..

Change background color on mouseover and remove it after mouseout

I have table which class is forum. My jquery code: <script type="text/javascript"> $(document).ready(function() { $('.forum').bind("mouseover", function(){ var color = ..

window.close() doesn't work - Scripts may close only the windows that were opened by it

I'm having a problem always when I'm trying to close a window through the window.close() method of the Javascript, while the browser displays the below message on the console: "Scripts may close only..

Export and import table dump (.sql) using pgAdmin

I have pgAdmin version 1.16.1 So, for exporting table dumm I do: Right click on table, then in menu click on backup, then in Format choice Plain and save file as some_name.sql Then I remove table..

Auto-indent in Notepad++

We always write code like this formal: void main(){ if(){ if() } But when I use Notepad++, the display is: void main(){ if(){ if() } How do I use Notepad++ to auto indent? Thanks ..

Replace multiple strings with multiple other strings

I'm trying to replace multiple words in a string with multiple other words. The string is "I have a cat, a dog, and a goat." However, this does not produce "I have a dog, a goat, and a cat", but inst..

Calculating frames per second in a game

What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number c..

"getaddrinfo failed", what does that mean?

File "C:\Python27\lib\", line 224, in meth return getattr(self._sock,name)(*args) gaierror: [Errno 11004] getaddrinfo failed Getting this error when launching the hello world sample..

How to store images in mysql database using php

How can i store and display the images in a MySQL database. Till now i have only written the code to get the images from the user and store them in a folder, the code that i wrote till now is: HTML FI..

How to use ESLint with Jest

I'm attempting to use the ESLint linter with the Jest testing framework. Jest tests run with some globals like jest, which I'll need to tell the linter about; but the tricky thing is the directory ..

Conditional Formatting using Excel VBA code

I have Range object called DistinationRange which contains reference to range B3:H63 I want to apply the following two conditional formatting rules using Excel VBA code dynamically. (Because the rang..

submit the form using ajax

I'm developing an application (a kind of social network for my university). I need to add a comment (insert a row in a specific database). To do this, I have a HTML form in my html page with various f..

Can I change the viewport meta tag in mobile safari on the fly?

I have an AJAX app built for mobile Safari browser that needs to display different types of content. For some content, I need user-scalable=1 and for other ones, I need user-scalable=0. Is there a w..

Find (and kill) process locking port 3000 on Mac

How do I find (and kill) processes that listen to/use my tcp ports? I'm on mac os x. Sometimes, after a crash or some bug, my rails app is locking port 3000. I can't find it using ps -ef... When doi..

How to get memory available or used in C#

How can I get the available RAM or memory used by the application? ..

jQuery $("#radioButton").change(...) not firing during de-selection

About a month ago Mitt’s question went unanswered. Sadly, I’m running into the same situation now. Here’s the situation: I’m using jQuery to c..

SVN Repository on Google Drive or DropBox

Is it possible to setup SVN repo/server on google drive or dropbox etc? I want to put my PhD project under version control. The data has to stay private and only accessible to me and my supervisors...

Python BeautifulSoup extract text between element

I try to extract "THIS IS MY TEXT" from the following HTML: <html> <body> <table> <td class="MYCLASS"> <!-- a comment --> <a hef="xy">Text</a>..

Comparing results with today's date?

Is there a way to use the Now() function in SQL to select values with today's date? I was under the impression Now() would contain the time as well as date, but today's date would have the time set ..

Display List in a View MVC

I'm trying to display the list I made in my view but keep getting : "The model item passed into the dictionary is of type 'System.Collections.Generic.List1[System.String]', but this dictionary require..

Timestamp Difference In Hours for PostgreSQL

Is there a TIMESTAMPDIFF() equivalent for PostgreSQL? I know I can subtract two timestamps to get a postgresql INTERVAL. I just want the difference between the two timestamps in in hours represent..

JavaFX Location is not set error message

I have problem when trying to close current scene and open up another scene when menuItem is selected. My main stage is coded as below: public void start(Stage primaryStage) throws Exception { pr..

How to apply style classes to td classes?

what I am trying to find out is the proper syntax to apply some style to each individual td in my table below: <section id="shows"> <!-- HTML5 section tag for the shows 'section' --..

How to get JSON response from http.Get

I'm trying read JSON data from web, but that code returns empty result. I'm not sure what I'm doing wrong here. package main import "os" import "fmt" import "net/http" import "io/ioutil" import "enc..

MS-access reports - The search key was not found in any record - on save

Occasionally my MS Access reports: The search key was not found in any record After this happens the solution is to close Access, compact and repair the backend and then delete the record. Wha..

Local package.json exists, but node_modules missing

I am trying to start a Redux application I just cloned from a GitHub repository. I tried to run it with the following command npm start I am getting this error > [email protected] start ..

Two color borders

Client wants two color borders for an embossed look. Can I do this on one element? I was hoping to avoid stacking two DOM elements with individual borders...

how to get param in method post spring mvc?

I'm using spring mvc. And I can't get param from url when method = post. But when I change method to GET, so I can get all param. This is my form: <form method="POST" action="http://localhost:808..

Check a radio button with javascript

For some reason, I can't seem to figure this out. I have some radio buttons in my html which toggles categories: <input type="radio" name="main-categories" id="_1234" value="1234" /> // All &l..

Convert list to tuple in Python

I'm trying to convert a list to a tuple. Most solutions on Google offer the following code: l = [4,5,6] tuple(l) However, the code results in an error message when I run it: TypeError: 'tuple' objec..

VBA paste range

I have simple goal of copying range and pasting it into another spreadsheet. The following code below gives copies, but does not paste. Sub Normalize() Dim Ticker As Range Sheets("Sheet1")...

Can't change z-index with JQuery

I, for some reason, can't change the zIndex of an element using jQuery. I've searched all of this website and Google but couldn't find the right answer. I am trying to put my element in front of ano..

Which websocket library to use with Node.js?

Currently there is a plethora of websocket libraries for node.js, the most popular seem to be:

How to create a printable Twitter-Bootstrap page

I'm using Twitter-Bootstrap and I need to be able to print the page the way it looks on the browser. I'm able to print other pages made with Twitter-Bootstrap just fine but I can't seem to print my pa..

Best C# API to create PDF

Can you recomend any PDF API for C#. Free is the best, but I don't mind paying for it...

Trim a string based on the string length

I want to trim a string if the length exceeds 10 characters. Suppose if the string length is 12 (String s="abcdafghijkl"), then the new trimmed string will contain "abcdefgh..". How can I achieve th..

How to delete mysql database through shell command

I use the pylons and sqlalchemy. I constantly update the schema files and delete and recreate the database so that new schema can be made. Every time I do this by opening the MySql Query Browser and..

Using NOT operator in IF conditions

Is it really a good practice to avoid using NOT operator in IF conditions in order to make your code better readable? I heard the if (doSomething()) is better then if (!doSomething())...

C++ obtaining milliseconds time on Linux -- clock() doesn't seem to work properly

On Windows, clock() returns the time in milliseconds, but on this Linux box I'm working on, it rounds it to the nearest 1000 so the precision is only to the "second" level and not to the milliseconds .. ValueError: could not convert string to float

Given is a simple CSV file: A,B,C Hello,Hi,0 Hola,Bueno,1 Obviously the real dataset is far more complex than this, but this one reproduces the error. I'm attempting to build a random forest classi..

webpack is not recognized as a internal or external command,operable program or batch file

I am Learning React.js and i am using windows 8 OS.i have navigate to my root folder 1.Created the package.json file by npm init 2. install webpack by npm install -S webpack has been down..

How to create a library project in Android Studio and an application project that uses the library project

I'm new to the gradle build system and IntelliJ. So how do I create an Android Library Project (e.g. com.myapp.lib1) and the application project (e.g. and make the build system include..

How do I test for an empty JavaScript object?

After an AJAX request, sometimes my application may return an empty object, like: var a = {}; How can I check whether that's the case?..

How to position two elements side by side using CSS

I want to position a paragraph to the right of an <iframe> of a Google map. I do not know how to show my code, so here is a screenshot of what I want: ..

Validating a Textbox field for only numeric input.

I have created a form-based program that needs some input validation. I need to make sure the user can only enter numeric values within the distance Textbox. So far, I've checked that the Textbox ha..

Oracle DB : java.sql.SQLException: Closed Connection

Reasons for java.sql.SQLException: Closed Connection from Oracle?? java.sql.SQLException: Closed Connection at oracle.jdbc.driver.DatabaseError.throwSqlException( ..

How do you read CSS rule values with JavaScript?

I would like to return a string with all of the contents of a CSS rule, like the format you'd see in an inline style. I'd like to be able to do this without knowing what is contained in a particular r..

CSS full screen div with text in the middle

I have a css class defined so I can make a div to use all the browser's viewport, the rule is the following: .fullscreenDiv { background-color: #e8e8e8; width: 100%; height: auto; bot..

Visual studio code terminal, how to run a command with administrator rights?

The new version 1.2.0 include a terminal, but when I try to install any pack with node I get the npm ERR! code EPERM that I usually solve right clicking and running it as administrator. So how I do th..

Show/hide div if checkbox selected

I need a page with checkboxes and visible div if at minimum 1 is checked. Here I got page that if i check checkbox, the div will show. It's okay and works correctly. When I check 3 checkboxes and ..

HTML CSS Button Positioning

I have 4 buttons in a header div. I have placed them all using margins top and left in css so they are all next to each other in one line. Nothing fancy. Now I'm trying to do an action when the butto..

Get and Set Screen Resolution

How can I collect and change screen resolution using Visual C#?..

force css grid container to fill full screen of device

How do I force a css grid container take the full width and height of the device screen for a single page app? Modified example is from Mozilla: Firefox documentation _x000D_ _x000D_ .wrapper {_x000D..

What is the MySQL JDBC driver connection string?

I am new to JDBC and I am trying to make a connection to a MySQL database. I am using Connector/J driver, but I cant find the JDBC connection string for my Class.forName() method...

Why do we usually use || over |? What is the difference?

I'm just wondering why we usually use logical OR || between two booleans not bitwise OR |, though they are both working well. I mean, look at the following: if(true | true) // pass if(true | fals..

substring of an entire column in pandas dataframe

I have a pandas dataframe "df". In this dataframe I have multiple columns, one of which I have to substring. Lets say the column name is "col". I can run a "for" loop like below and substring the colu..

Https Connection Android

I am doing a https post and I'm getting an exception of ssl exception Not trusted server certificate. If i do normal http it is working perfectly fine. Do I have to accept the server certificate someh..

How to write a PHP ternary operator

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

Tainted canvases may not be exported

I want to save my canvas to a img. I have this function: function save() { document.getElementById("canvasimg").style.border = "2px solid"; var dataURL = canvas.toDataURL(); document.getE..

Angular js init ng-model from default values

Say you have a form that has values loaded from database. How do you initialize ng-model? Example: <input name="card[description]" ng-model="card.description" value="Visa-4242"> In my contr..

How to force table cell <td> content to wrap?

Heres the entire page * wrappable is defined in a main.css file /* Wrappable cell * Add this class to make sure the text in a cell will wrap. * By default, data_table tds do not wrap. */ td.wrappable..

How do you fade in/out a background color using jquery?

How do I fade in text content with jQuery? The point is to draw the user's attention to the message...

jQuery get html of container including the container itself

How do i get the html on '#container' including '#container' and not just what's inside it. <div id="container"> <div id="one">test 1 </div> <div id="two">test 2 </div&g..

Detect page change on DataTable

With DataTable I can order, list, do pagination but I want to detect when the pagination changes, I've seen the API but the only one I can do is change the page but no detect this change...

How do I send an HTML email?

I have successfully sent email in my web application using JMS, but the result only displays in plain text. I want the content to be able to display html. How do I do it? Here is roughly what I have: ..

What does "exec sp_reset_connection" mean in Sql Server Profiler?

Trying to understand what Sql Profiler means by emitting "sp_reset_connection". I have the following, "exec sp_reset_connection" line followed by BatchStarting and Completed, RPC:Completed exe..

How to set maximum height for table-cell?

I got a table-cell with fixed width and height and if text is too large, cell size should remain the same and text should be hidden by overflow:hidden. div { display: table-cell height: 100px; ..

Delete all rows in an HTML table

How can I delete all rows of an HTML table except the <th>'s using Javascript, and without looping through all the rows in the table? I have a very huge table and I don't want to freeze the UI w..

Usage of MySQL's "IF EXISTS"

Here are two statements that I'd like to work, but which return error messages: IF EXISTS (SELECT * FROM gdata_calendars WHERE `group` = ? AND id = ?) SELECT 1 ELSE SELECT 0 and IF ((SELECT COUNT..

`ui-router` $stateParams vs. $state.params

With ui-router, it's possible to inject either $state or $stateParams into a controller to get access to parameters in the URL. However, accessing parameters through $stateParams only exposes paramete..

Push git commits & tags simultaneously

I'm aware of the reason that git push --tags is a separate operation to plain old git push. Pushing tags should be a conscious choice since you don't want accidentally push one. That's fine. But is th..

Convert String into a Class Object

I am storing a class object into a string using toString() method. Now, I want to convert the string into that class object. How to do that? Please help me with source code...

Space between two divs

My issue is that I have two (or more) divs of the same class, that need to be spaced from each other. I cannot directly use margins however, as the last or first element would also have the margin app..

How to avoid the "divide by zero" error in SQL?

I have this error message: Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered. What is the best way to write SQL code so that I will never see this error message again? I coul..

How to style input and submit button with CSS?

I'm learning CSS. How to style input and submit button with CSS? I'm trying create something like this but I have no idea how to do <form action="#" method="post"> Name <input type="tex..

How to scroll to bottom in a ScrollView on activity startup

I am displaying some data in a ScrollView. On activity startup (method onCreate) I fill the ScrollView with data and want to scroll to the bottom. I tried to use getScrollView().fullScroll(ScrollView..

Change color of bootstrap navbar on hover link?

I want to know how to change the color of the links when you hover over them in the nav bar, as currently they are an ugly color. Thanks for any suggestions? HTML: <div class="container"> ..

CSS: image link, change on hover

I have an image that is a link. I want to show a different image when the user hovers over the link. Currently I'm using this code: <a href="" title="Twitter link"> <d..

How to get the Facebook user id using the access token

I have a Facebook desktop application and am using the Graph API. I am able to get the access token, but after that is done - I don't know how to get the user's ID. My flow is like this: I send t..

Flexbox: 4 items per row

I'm using a flex box to display 8 items that will dynamically resize with my page. How do I force it to split the items into two rows? (4 per row)? Here is a relevant snip: (Or if you prefer jsfiddl..

How would you make two <div>s overlap?

I need two divs to look a bit like this: | | ---| LOGO |------------------------ | |_______________| LINKS | | CONTENT ..

What programming languages can one use to develop iPhone, iPod Touch and iPad (iOS) applications?

What programming languages can one use to develop iPhone, iPod Touch and iPad (iOS) applications? Also are there plans in the future to expand the amount of programming languages that iOS will suppor..

std::queue iteration

I need to iterate over std::queue. says: By default, if no container class is specified for a particular queue class, the standard container class template deque is used. So ca..

How do I convert this list of dictionaries to a csv file?

I have a list of dictionaries that looks something like this: toCSV = [{'name':'bob','age':25,'weight':200},{'name':'jim','age':31,'weight':180}] What should I do to convert this to a csv file that..

Rename a column in MySQL

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

Remove object from a list of objects in python

In Python, how can I remove an object from array of objects? Like this: x = object() y = object() array = [x,y] # Remove x I've tried array.remove() but it only works with a value, not a specific l..

Javascript: Load an Image from url and display

I want to preface this with the fact that I am very very new to JavaScript. I appreciate your patience with me. I'm trying to create a script that allows a user to input a name into a text-area, pres..

C++ Matrix Class

In C, if I wanted to create a matrix struct, I would use: struct matrix { int col, row; double data[1]; // I want the matrix entries stored // right after this struct } Then I..

Openstreetmap: embedding map in webpage (like Google Maps)

Is there a way to embed/mashup the OpenStreetMap in your page (like the way Google Maps API works)? I need to show a map inside my page with some markers and allow dragging/zooming around, maybe rout..

Pandas group-by and sum

I am using this data frame: Fruit Date Name Number Apples 10/6/2016 Bob 7 Apples 10/6/2016 Bob 8 Apples 10/6/2016 Mike 9 Apples 10/7/2016 Steve 10 Apples 10/7/2016 Bob 1 Orang..

Can't use modulus on doubles?

I have a program in C++ (compiled using g++). I'm trying to apply two doubles as operands to the modulus function, but I get the following error: error: invalid operands of types 'double' and 'dou..

Why are C++ inline functions in the header?

NB This is not a question about how to use inline functions or how they work, more why they are done the way they are. The declaration of a class member function does not need to define a function as..

Jenkins Pipeline Wipe Out Workspace

We are running Jenkins 2.x and love the new Pipeline plugin. However, with so many branches in a repository, disk space fills up quickly. Is there any plugin that's compatible with Pipeline that I..

What is the difference between using constructor vs getInitialState in React / React Native?

I've seen both used interchangeably. What are the main use cases for both? Are there advantages / disadvantages? Is one a better practice?..

How do I get Month and Date of JavaScript in 2 digit format?

When we call getMonth() and getDate() on date object, we will get the single digit number. For example : For january, it displays 1, but I need to display it as 01. How to do that?..

Passing variables in remote ssh command

I want to be able to run a command from my machine using ssh and pass through the environment variable $BUILD_NUMBER Here's what I'm trying: ssh [email protected] '~/tools/ $BUILD_NUMBER'..

INNER JOIN vs LEFT JOIN performance in SQL Server

I've created SQL command that uses INNER JOIN on 9 tables, anyway this command takes a very long time (more than five minutes). So my folk suggested me to change INNER JOIN to LEFT JOIN because the pe..

How do you get a query string on Flask?

Not obvious from the flask documention on how to get the query string. I am new, looked at the docs, could not find! So @app.route('/') @app.route('/data') def data(): query_string=?????? ..

How to get coordinates of an svg element?

I am using d3 to draw a line from a relative svg position and hence want to access the coordinates of the element itself. I tried something like this (where "this" refers to the element) .attr("x1",..

Using scanner.nextLine()

I have been having trouble while attempting to use the nextLine() method from java.util.Scanner. Here is what I tried: import java.util.Scanner; class TestRevised { public void menu() { ..

Adding ASP.NET MVC5 Identity Authentication to an existing project

I have seen lots of similar pages on the web, but most of them use a new project instead of an existing one, or don't have the necessary features. So, I have an existing MVC 5 project and want to inte..

build maven project with propriatery libraries included

How to create maven pom, which will make project buildable, can I include propriatery jars with my project directly without having to take them from repository? anyone did this before ? EDIT : I do..

How do I include a path to libraries in g++

I am trying to include the path to extra libraries in my makefile, but I can't figure out how to get the compiler to use that path. so far I have: g++ -g -Wall testing.cpp fileparameters.cpp main.cp..

How to identify if a webpage is being loaded inside an iframe or directly into the browser window?

I am writing an iframe based facebook app. Now I want to use the same html page to render the normal website as well as the canvas page within facebook. I want to know if I can determine whether the p..

SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81

I am currently new to robot framework.I am currently using latest window version of chrome and chromedriver which is 80 but when i try to run the test it gives the message "SessionNotCreatedException:..

Add text to textarea - Jquery

How can I add text from a DIV to a textarea? I have this now: $('.oquote').click(function() { $('#replyBox').slideDown('slow', function() { var quote = $('.container').text(); ..

Using dig to search for SPF records

I am using dig installed on my machine to search for SPF records for a particular domain. Is there a way to search a particular DNS server for the SPF records? For example, will the following work? ..

Open text file and program shortcut in a Windows batch file

I have two files in the same folder that I'd like to run. One is a .txt file, and the other is the program shortcut to an .exe. I'd like to make a batch file in the same location to open the text file..

Finding row index containing maximum value using R

Given the following matrix lets assume I want to find the maximum value in column two: mat <- matrix(c(1:3,7:9,4:6), byrow = T, nc = 3) mat [,1] [,2] [,3] [1,] 1 2 3 [2,] 7 8 ..

Calculating average of an array list?

I'm trying to use the below code to calculate the average of a set of values that a user enters and display it in a jTextArea but it does not work properly. Say, a user enters 7, 4, and 5, the program..

Filter dataframe rows if value in column is in a set list of values

I have a Python pandas DataFrame rpt: rpt <class 'pandas.core.frame.DataFrame'> MultiIndex: 47518 entries, ('000002', '20120331') to ('603366', '20091231') Data columns: STK_ID ..

HTTP Request in Kotlin

I'm completely new to Kotlin. I want to do a login validation using POST method and to get some information using GET method. I've URL, server Username and Password already of my previous project. I d..

Send a base64 image in HTML email

Using a rich-text editor, our users can drag and drop a saved image from their desktop to the editor. The image appears and displays properly in the web page after they submit. Since the image is not..

How do emulators work and how are they written?

How do emulators work? When I see NES/SNES or C64 emulators, it astounds me. Do you have to emulate the processor of those machines by interpreting its particular assembly instructions? What else..

What's the difference between ASCII and Unicode?

What's the exact difference between Unicode and ASCII? ASCII has a total of 128 characters (256 in the extended set). Is there any size specification for Unicode characters?..

Can an html element have multiple ids?

I understand that an id must be unique within an HTML/XHTML page. My question is, for a given element, can I assign multiple ids to it? <div id="nested_element_123 task_123"></div> I r..

Check if datetime instance falls in between other two datetime objects

I would like to know a simple algorithm to check if the given instance of datetime lies between another two instances in C#. Note: I skimmed though this How do I check if a given datetime object is &q..

Retrieving Android API version programmatically

Is there any way to get the API version that the phone is currently running?..

Multiple submit buttons in the same form calling different Servlets

First, here is the code: <form action="FirstServlet" method="Post"> Last Name: <input type="text" name="lastName" size="20"> <br><br> <input type="submit" value..

SQL Server copy all rows from one table into another i.e duplicate table

I want to keep a table as history and replace it with an empty one. How can I do this through Management Studio?..

Find methods calls in Eclipse project

I have a class X containing method myMethod(). I would like to find locations in all projects in my current workspace where this myMethod() is being called. I cannot use any search functions as there ..

How to make Bootstrap carousel slider use mobile left/right swipe

DEMO JSSFIDDLE <div class="col-md-4"> <!--Carousel--> <div id="sidebar-carousel-1" class="carousel slide" data-ride="carousel"> <ol class="carou..

How to get different colored lines for different plots in a single figure?

I am using matplotlib to create the plots. I have to identify each plot with a different color which should be automatically generated by Python. Can you please give me a method to put different colo..

Class vs. static method in JavaScript

I know this will work: function Foo() {}; = function () { alert('hello~\n'); }; var a = new Foo;; // 'hello~\n' But if I want to call // this will not w..

CSS: stretching background image to 100% width and height of screen?

I have an image called myImage.jpg. This is my CSS: body { background-image:url("../images/myImage.jpg"); background-repeat: no-repeat; background-size: 100% 100%; } For some reason, wh..

ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file

When i use the command C:\>keytool -list -alias androiddebugkey -keystore .android\debug.keystore -storepass android -keypass android I get this error: 'keytool' i..

C++ correct way to return pointer to array from function

I am fairly new to C++ and have been avoiding pointers. From what I've read online I cannot return an array but I can return a pointer to it. I made a small code to test it and was wondering if this w..

c++ custom compare function for std::sort()

I want to create custom compare function for std::sort(), to sort some key-value pairs std::pair Here is my function template <typename K, typename V> int comparePairs(const void* left, cons..

Node/Express file upload

I'm using node v0.10.26 and express v4.2.0 and I'm pretty new to node. I've been beating my head against my desk for the past three or so hours trying to get a file upload form working with node. At..

Why does configure say no C compiler found when GCC is installed?

I am trying to make Sphinx from source on a 32-bit CentOS 6 VPS. When I run this command: ./configure --prefix=/usr/local/sphinx I get this error output: checking build environment --------------..

Android - java.lang.SecurityException: Permission Denial: starting Intent

I have a library (jar) on build path of my project. The project accesses the MainActivity in the jar, using the following intent: final Intent it = new Intent(); it.setClassName("com.example.lib", "c..

How to manage exceptions thrown in filters in Spring?

I want to use generic way to manage 5xx error codes, let's say specifically the case when the db is down across my whole spring application. I want a pretty error json instead of a stack trace. For ..

Convert list to dictionary using linq and not worrying about duplicates

I have a list of Person objects. I want to convert to a Dictionary where the key is the first and last name (concatenated) and the value is the Person object. The issue is that I have some duplicated..

Locate Git installation folder on Mac OS X

I'm just curious, Where Git get installed (via DMG) on Mac OS X file system?..


I have the following table but unsure of whether it is possible to pivot this and retain all the labels. RATIO RESULT SCORE GRADE Current Ratio 1.294 60 Good Gearing R..

Is there a printf converter to print in binary format?

I can print with printf as a hex or octal number. Is there a format tag to print as binary, or arbitrary base? I am running gcc. printf("%d %x %o\n", 10, 10, 10); //prints "10 A 12\n" print("%b\n..

PYTHONPATH vs. sys.path

Another developer and I disagree about whether PYTHONPATH or sys.path should be used to allow Python to find a Python package in a user (e.g., development) directory. We have a Python project with a ..

Escape invalid XML characters in C#

I have a string that contains invalid XML characters. How can I escape (or remove) invalid XML characters before I parse the string?..

How can I debug a Perl script?

When I run a Perl script, how can I debug it? For example, in ksh I add the -x flag. But how I do the same in Perl?..

php timeout - set_time_limit(0); - don't work

I'm having a problem with my PHP file that takes more than 30 seconds to execute. After searching, I added set_time_limit(0); at the start of the code,cbut the file still times out with a 500 error a..

How do I get the different parts of a Flask request's url?

I want to detect if the request came from the localhost:5000 or host and what path was requested. How do I get this information about a Flask request?..

How to fix HTTP 404 on Github Pages?

Here is my GitHub repository on the gh-pages branch. Everything looks good, I have my index.html, my CSS, JS and pictures folders. But when I access I get HTTP 404 not foun..