Questions Tagged with #Vmime

OS X cp command in Terminal - No such file or directory

this might be one of those days my brain just does not work, or i'm incredibly dumb. i've been trying to copy files (which are actually directories .app, .bundle, etc.) but consistently get an error '..

How do I open multiple instances of Visual Studio Code?

Today Microsoft released the Visual Studio Code file/folder editor. The first limitation is it appears to be a single-instance application. Is there a way of getting multiple instances, or otherwise..

Is there a timeout for idle PostgreSQL connections?

1 S postgres 5038 876 0 80 0 - 11962 sk_wai 09:57 ? 00:00:00 postgres: postgres my_app ::1(45035) idle 1 ..

ImportError: No module named sklearn.cross_validation

I am using python 2.7 in Ubuntu 14.04. I installed scikit-learn, numpy and matplotlib with these commands: sudo apt-get install build-essential python-dev python-numpy \ python-numpy-dev python-scip..

Pass a String from one Activity to another Activity in Android

This is my string: private final String easyPuzzle ="630208010200050089109060030"+ "008006050000187000060500900"+ "090070106810020005..

How can I uninstall Ruby on ubuntu?

How can I uninstall Ruby 1.9.2dev (2010-07-02) [i486-linux] on ubuntu? Need to reinstall - please help..

Show a number to two decimal places

What's the correct way to round a PHP string to two decimal places? $number = "520"; // It's a string from a database $formatted_number = round_to_2dp($number); echo $formatted_number; The output..

Calling async method synchronously

I have an async method: public async Task<string> GenerateCodeAsync() { string code = await GenerateCodeService.GenerateCodeAsync(); return code; } I need to call this method from a s..

Select SQL Server database size

how can i query my sql server to only get the size of database? I used this : use "MY_DB" exec sp_spaceused I got this : database_name database_size unallocated space My_DB 17899...

How to filter multiple values (OR operation) in angularJS

I want to use the filter in angular and want to filter for multiple values, if it has either one of the values then it should be displayed. I have for example this structure: An object movie which..

What is Python Whitespace and how does it work?

I've been searching google and this website for some time now, but I just can't seem to find a straight answer on the subject. What is whitespace in Python? I know it's something to do with indentin..

JSONObject - How to get a value?

I'm using a java class on The following is my code snippet: String jsonResult = UtilMethods.getJSON(this.jsonURL, null); json = new JSONObject(jsonRes..

ORA-01652 Unable to extend temp segment by in tablespace

I am creating a table like create table tablename as select * for table2 I am getting the error ORA-01652 Unable to extend temp segment by in tablespace When I googled I usually found ORA-01652 ..

Looping through array and removing items, without breaking for loop

I have the following for loop, and when I use splice() to remove an item, I then get that 'seconds' is undefined. I could check if it's undefined, but I feel there's probably a more elegant way to do..

SQL update statement in C#

I have table "Student" P_ID LastName FirstName Address City 1 Hansen Ola 2 Svendson Tove 3 Petterson Kari 4 Nilsen Johan..

error: member access into incomplete type : forward declaration of

I have two classes in the same .cpp file: // forward class B; class A { void doSomething(B * b) { b->add(); } }; class B { void add() { ... } }; The forward do..

How to get memory available or used in C#

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

How to determine the installed webpack version

Especially during the transition from webpack v1 to v2, it would be important to programmatically determine what webpack version is installed, but I cannot seem to find the appropriate API...

how to use math.pi in java

I am having problems converting this formula V = 4/3 p r^3. I used Math.PI and Math.pow, but I get this error: ';' expected Also, the diameter variable doesn't work. Is there an error there? im..

jQuery Upload Progress and AJAX file upload

It seems like I have not clearly communicated my problem. I need to send a file (using AJAX) and I need to get the upload progress of the file using the Nginx HttpUploadProgressModule. I need a good s..

concatenate two database columns into one resultset column

I use the following SQL to concatenate several database columns from one table into one column in the result set: SELECT (field1 + '' + field2 + '' + field3) FROM table1 When one of the fields is nu..

How to resolve a Java Rounding Double issue

Seems like the subtraction is triggering some kind of issue and the resulting value is wrong. double tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d; 78.75 = 787.5 * 10.0/100d ..

Fast way to discover the row count of a table in PostgreSQL

I need to know the number of rows in a table to calculate a percentage. If the total count is greater than some predefined constant, I will use the constant value. Otherwise, I will use the actual num..

Does return stop a loop?

Suppose I have a loop like this: for (var i = 0; i < SomeArrayOfObject.length; i++) { if (SomeArray[i].SomeValue === SomeCondition) { var SomeVar = SomeArray[i].SomeProperty; return ..

Get list from pandas DataFrame column headers

I want to get a list of the column headers from a pandas DataFrame. The DataFrame will come from user input so I won't know how many columns there will be or what they will be called. For example, if..

SQL query for extracting year from a date

I am trying to create a query that gets only the year from selected dates. I.e. select ASOFDATE from PSASOFDATE; returns 11/15/2012, but I want only 2012. How can I get only the year? I know the YEAR ..

Setting the default active profile in Spring-boot

I want my default active profile to be production if is not set. I tried the following in my but it did't work: spring.profiles.default=production S..

datetime datatype in java

Which data type can I use in Java to hold the current date as well as time?. I want to store the datetime in a db as well as having a field in the java bean to hold that. is it java.util.Date ?..

What is the "Upgrade-Insecure-Requests" HTTP header?

I made a POST request to a HTTP (non-HTTPS) site, inspected the request in Chrome's Developer Tools, and found that it added its own header before sending it to the server: Upgrade-Insecure-Requests:..

LDAP server which is my base dn

Hello I'm trying to use my ldap test server in order to authenticate users in openca. I'm currently connecting through phpldapadmin with : Login DN : cn=admin,dc=example,dc=com Password : mypas..

Emulate a 403 error page

I know you can send a header that tells the browser this page is forbidden like: header('HTTP/1.0 403 Forbidden'); But how can I also display the custom error page that has been created on the serv..

Batch / Find And Edit Lines in TXT file

I want to create a batch while which finds specific lines in a batch file and are able to edit these lines. Example: //TXT FILE// ex1 ex2 ex3 ex4 i want to let the batch file find 'ex3' and edit ..

Converting JavaScript object with numeric keys into array

I have an object like this coming back as a JSON response from the server: {"0":"1","1":"2","2":"3","3":"4"} I want to convert it into a JavaScript array like this: ["1","2","3","4"] Is there a ..

Counting the number of elements in array

I am looking to count the number of entries I have in an array in Twig. This is the code I've tried: {%for nc in notcount%} {{ nc|length }} {%endfor%} This however only produces the length of the s..

CSS: 100% width or height while keeping aspect ratio?

Currently, with STYLE, I can use width: 100% and auto on the height (or vice versa), but I still can't constrain the image into a specific position, either being too wide or too tall, respectively. A..

Correct Way to Load Assembly, Find Class and Call Run() Method

Sample console program. class Program { static void Main(string[] args) { // ... code to build dll ... not written yet ... Assembly assembly = Assembly.LoadFile(@"C:\dyn.dll")..

The type or namespace name could not be found

I have a C# solution with several projects in Visual Studio 2010. One is a test project (I'll call it "PrjTest"), the other is a Windows Forms Application project (I'll call it "PrjForm"). There is a..

Jquery get form field value

I am using a jquery template to dynamically generate multiple elements on the same page. Each element looks like this <div id ="DynamicValueAssignedHere"> <div class="something">Hello..

jQuery using append with effects

How can I use .append() with effects like show('slow') Having effects on append doesn't seem to work at all, and it give the same result as normal show(). No transitions, no animations. How can I a..

What is the best way to initialize a JavaScript Date to midnight?

What is the simplest way to obtain an instance of new Date() but set the time at midnight?..

Storing images in SQL Server?

I have made a small demo site and on it I am storing images within a image column on the sql server. A few questions I have are... Is this a bad idea? Will it affect performance on my site when it ..

How to Convert Int to Unsigned Byte and Back

I need to convert a number into an unsigned byte. The number is always less than or equal to 255, and so it will fit in one byte. I also need to convert that byte back into that number. How would I d..

Remove all newlines from inside a string

I'm trying to remove all newline characters from a string. I've read up on how to do it, but it seems that I for some reason am unable to do so. Here is step by step what I am doing: string1 = "Hello..

Pandas read_csv from url

I'm trying to read a csv-file from given URL, using Python 3.x: import pandas as pd import requests url = "" s = requests.get(url..

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

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

How to save data in an android app

I recently coded an Android app. It's just a simple app that allows you to keep score of a basketball game with a few simple counter intervals. I'm getting demand to add a save feature, so you can sav..

Return only string message from Spring MVC 3 Controller

Can any one tell me how I can return string message from controller? If i just return a string from a controller method then spring mvc treating it as a jsp view name...

What does servletcontext.getRealPath("/") mean and when should I use it

In the following snippet: ServletContext context = request.getServletContext(); String path = context.getRealPath("/"); What does / in the method getRealPath() represent? When should I use it?..

.Net picking wrong referenced assembly version

I just copied an existing project to a brand new machine to start developing on it and have run into a problem with the version of one of my referenced assemblies (a telerik DLL as it happens). The p..

How to split data into training/testing sets using sample function

I've just started using R and I'm not sure how to incorporate my dataset with the following sample code: sample(x, size, replace = FALSE, prob = NULL) I have a dataset that I need to put into a tr..

Assign value from successful promise resolve to external variable

I have a pretty silly problem. Consider the following: vm.feed = getFeed().then(function(data) {return data;}); getFeed() returns a $q deferred promise (I am on angular) that resolves successfully...

Replace Default Null Values Returned From Left Outer Join

I have a Microsoft SQL Server 2008 query that returns data from three tables using a left outer join. Many times, there is no data in the second and third tables and so I get a null which I think is ..

error: request for member '..' in '..' which is of non-class type

I have a class with two constructors, one that takes no arguments and one that takes one argument. Creating objects using the constructor that takes one argument works as expected. However, if I crea..

Checking if a worksheet-based checkbox is checked

I'm trying to use an IF-clause to determine whether my checkbox, named "Check Box 1", is checked. My current code: Sub Button167_Click() If ActiveSheet.Shapes("Check Box 1") = True Then Range("Y12..

Is there an alternative to string.Replace that is case-insensitive?

I need to search a string and replace all occurrences of %FirstName% and %PolicyAmount% with a value pulled from a database. The problem is the capitalization of FirstName varies. That prevents me fro..

XmlSerializer giving FileNotFoundException at constructor

An application I've been working with is failing when I try to serialize types. A statement like XmlSerializer lizer = new XmlSerializer(typeof(MyType)); produces: System.IO.FileNotFoundException..

Print the contents of a DIV

Whats the best way to print the contents of a DIV?..

Java: Find .txt files in specified folder

Is there a built in Java code that will parse a given folder and search it for .txt files? ..

python 2.7: cannot pip on windows "bash: pip: command not found"

I am trying to install the SciPy stack located at [I am only allowed 2 links; trying to use them wisely]. I realize that there are much easier ways to do this, but I ..

Importing xsd into wsdl

This is my current configuration: XSD <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns="" xmlns:tns="

Regex for string not ending with given suffix

I have not been able to find a proper regex to match any string not ending with some condition. For example, I don't want to match anything ending with an a. This matches b ab 1 This doesn't match..

Java: How to get input from System.console()

I am trying to use Console class to get input from user but a null object is returned when I call System.console(). Do I have to change anything before using System.console? Console co=System.console..

MySQL select where column is not empty

In MySQL, can I select columns only where something exists? For example, I have the following query: select phone, phone2 from jewishyellow.users where phone like '813%' and phone2 I'm trying to ..

Hot to get all form elements values using jQuery?

Here is the HTML code: <!DOCTYPE html><html xmlns='' > <head> <title>HTML Form Builder</title> <link href='css/font1.css' rel='styl..

Set an empty DateTime variable

I would declare an empty String variable like this: string myString = string.Empty; Is there an equivalent for a 'DateTime' variable ? Update : The problem is I use this 'DateTime' as a param..

What is the use of rt.jar file in java?

Possible Duplicate: Why do we use rt.jar in a java project? I am very confused to knowing about rt.jar file. What is the role of rt.jar file or use of rt.jar file in java?? Tha..

Multiple models in a view

I want to have 2 models in one view. The page contains both LoginViewModel and RegisterViewModel. e.g. public class LoginViewModel { public string Email { get; set; } public string Password ..

Maximize a window programmatically and prevent the user from changing the windows state

How do I maximize a window programmatically so that it cannot be resized once it reaches the maximized state (for example, maximize Internet Explorer and see it)? I set FormWindowState property..

np.mean() vs np.average() in Python NumPy?

I notice that In [30]: np.mean([1, 2, 3]) Out[30]: 2.0 In [31]: np.average([1, 2, 3]) Out[31]: 2.0 However, there should be some differences, since after all they are two different functions. Wh..

Check if character is number?

I need to check whether justPrices[i].substr(commapos+2,1). The string is something like: "blabla,120" In this case it would check whether '0' is a number. How can this be done?..

Uncaught SoapFault exception: [HTTP] Error Fetching http headers

I'm trying to create a soap connection to Magento's web services, however I'm getting an error when I try and create an instance of the soap client class. I can view the wsdl file in firefox without ..

How to Convert Boolean to String

I have a Boolean variable which I want to convert to a string: $res = true; I need the converted value to be of the format: "true" "false", not "0" "1" $converted_res = "true"; $converted_res = "f..

Mongodb: Failed to connect to, reason: errno:10061

Here is my mongod.cfg file: bind_ip = dbpath = C:\mongodb\data\db logpath = C:\mongodb\log\mongo-server.log verbose=v Here is my mongod service command: mongod -f c:\mongodb\mongod.cfg -..

makefile:4: *** missing separator. Stop

This is my makefile: all:ll ll:ll.c gcc -c -Wall -Werror -02 c.c ll.c -o ll $@ $< clean : \rm -fr ll When I try to make clean or make make, I get this error: :makefile:4: *** mis..

html "data-" attribute as javascript parameter

Lets say I have this: <div data-uid="aaa" data-name="bbb", data-value="ccc" onclick="fun(,,"> And this: function fun(one, two, three) { //som..

Which Radio button in the group is checked?

Using WinForms; Is there a better way to find the checked RadioButton for a group? It seems to me that the code below should not be necessary. When you check a different RadioButton then it knows whic..

Is an entity body allowed for an HTTP DELETE request?

When issuing an HTTP DELETE request, the request URI should completely identify the resource to delete. However, is it allowable to add extra meta-data as part of the entity body of the request?..

Form Validation With Bootstrap (jQuery)

Can someone please help me with this code? I am using bootstrap for the form and trying to validate it with jQuery. Unfortunately, the form validation isn't telling me what I'm doing wrong. I got the ..

How to create radio buttons and checkbox in swift (iOS)?

I am developing an app that allows to do survey. My layout is generated from XML based questions. I need to create radio buttons (single choice) and checkboxes (multiple answers). I did not find any..

ng if with angular for string contains

I have the following Angular code: <li ng-repeat="select in Items"> <foo ng-repeat="newin select.values"> {{new.label}}</foo> How can I use an ng-if con..

Where is Java Installed on Mac OS X?

I just downloaded Java 7u17 on Mac OS 10.7.5 from here and then successfully installed it. In order to do some JNI programming, I need to know where Java installed on my Mac. I thought that inside t..

How to get size in bytes of a CLOB column in Oracle?

How do I get the size in bytes of a CLOB column in Oracle? LENGTH() and DBMS_LOB.getLength() both return number of characters used in the CLOB but I need to know how many bytes are used (I'm dealing ..

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

How to delete a record by id in Flask-SQLAlchemy

I have users table in my MySql database. This table has id, name and age fields. How can I delete some record by id? Now I use the following code: user = User.query.get(id) db.session.delete(user) ..

What is HTTP "Host" header?

Given that the TCP connection is already established when the HTTP request is sent, the IP address and port are implicitly known -- a TCP connection is an IP + Port. So, why do we need the Host header..

How to check sbt version?

How do I check which version of sbt I'm running? I have the bash file set up that uses sbt-launch.jar, and it works, but $ sbt version only shows the "project version" (0.1) and $ sbt --ve..

Rails: Can't verify CSRF token authenticity when making a POST request

I want to make POST request to my local dev, like this:'http://localhost:3000/fetch_heroku', :body => {:type => 'product'},) However, from the server console ..

How to use GROUP BY to concatenate strings in MySQL?

Basically the question is how to get from this: foo_id foo_name 1 A 1 B 2 C to this: foo_id foo_name 1 A B 2 C ..

how do you view macro code in access?

I have a Microsoft Access database and there is a macro there. How do I view the code of the macro?..

Using CSS how to change only the 2nd column of a table

Using css only, how can I override the css of only the 2nd column of a table. I can get to all of the columns using: .countTable table table td I can not get to the html on this page to modify it..

SQL Server: UPDATE a table by using ORDER BY

I would like to know if there is a way to use an order by clause when updating a table. I am updating a table and setting a consecutive number, that's why the order of the update is important. Using t..

How to split a string between letters and digits (or between digits and letters)?

I'm trying to work out a way of splitting up a string in java that follows a pattern like so: String a = "123abc345def"; The results from this should be the following: x[0] = "123"; x[1] = "abc"; ..

Hidden Columns in jqGrid

Is there any way to hide a column in a jqGrid table, but have it show as read-only when the row is edited in the form editor modal dialog?..

How to initialize an array of objects in Java

I want to initialize an array of Player objects for a BlackJack game. I've read a lot about various ways to initialize primitive objects like an array of ints or an array of strings but I cannot take ..

Video format or MIME type is not supported

This is the relevant code to run video: <video id="video" src="videos/clip.mp4" type='video/mp4' controls='controls'> Your brwoser doesn't seems to support video tag </video> This ..

MySQL PHP - SELECT WHERE id = array()?

Possible Duplicate: MySQL query using an array Passing an array to mysql I have an array in PHP: $array = array(1, 4, 5, 7); As you can see, I have an array of different values, but I ..

How to check empty DataTable

I have a DataSet where I need to find out how many rows has been changed using the following code: dataTable1 = dataSet1.Tables["FooTable"].GetChanges(); foreach (DataRow dr in dataTable1) { // ....

How can I get the request URL from a Java Filter?

I am trying to write a filter that can retrieve the request URL, but I'm not sure how to do so. Here is what I have so far: import javax.servlet.*; import javax.servlet.http.HttpServletRequest; impo..

How do I loop through a list by twos?

I want to loop through a Python list and process 2 list items at a time. Something like this in another language: for(int i = 0; i < list.length(); i+=2) { // do something with list[i] and list..

Why does DEBUG=False setting make my django Static Files Access fail?

Am building an app using Django as my workhorse. All has been well so far - specified db settings, configured static directories, urls, views etc. But trouble started sneaking in the moment I wanted t..

Plot width settings in ipython notebook

I've got the following plots: It would look nicer if they have the same width. Do you have any idea how to do it in ipython notebook when I am using %matplotlib inline? UPDATE: To generate both f..

Could not autowire field in spring. why?

I keep getting this error, and can't figure out why.. yes I know there many people had similar issues, but reading the answers they got, does not solve my problem. org.springframework.beans.factor..

How to push a docker image to a private repository

I have a docker image tagged as me/my-image, and I have a private repo on the dockerhub named me-private. When I push my me/my-image, I end up always hitting the public repo. What is the exact syntax..

Getting "java.nio.file.AccessDeniedException" when trying to write to a folder

For some reason I keep getting java.nio.file.AccessDeniedException every time I try to write to a folder on my computer using a java webapp on Tomcat. This folder has permissions set to full control f..

How to convert IPython notebooks to PDF and HTML?

I want to convert my ipython-notebooks to print them, or simply send them in html format. I have noticed that there exists a tool to do that already, nbconvert. Although I have downloaded it, I have n..

Convert wchar_t to char

I was wondering is it safe to do so? wchar_t wide = /* something */; assert(wide >= 0 && wide < 256 &&); char myChar = static_cast<char>(wide); If I am pretty sure the w..

How to set thousands separator in Java?

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

Convert string to a variable name

I am using R to parse a list of strings in the form: original_string <- "variable_name=variable_value" First, I extract the variable name and value from the original string and convert the value..

Android : How to read file in bytes?

I am trying to get file content in bytes in Android application. I have get the file in SD card now want to get the selected file in bytes. I googled but no such success. Please help Below is the cod..

How to import csv file in PHP?

I am very new to web development. In fact, I am just starting to learn. Can somebody please give a complete but very simple example on how to import CSV file in PHP? I tried the one I got from the in..

Android Studio Gradle: Error:Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package

I am trying to upgrade my google play services dependencies to 8.4.0 by following the example Google gives here, but I am getting the following error ('com.example.exampleapp' is a replacement for my ..

How to Fill an array from user input C#?

What would be the best way to fill an array from user input? Would a solution be showing a prompt message and then get the values from from the user?..

Get source jar files attached to Eclipse for Maven-managed dependencies

I am using Maven (and the Maven Eclipse Integration) to manage the dependencies for my Java projects in Eclipse. The automatic download feature for JAR files from the Maven repositories is a real time..

How do I keep jQuery UI Accordion collapsed by default?

I am working with jQuery UI Accordion and it works great, but I would like to have the accordion stay closed unless it I click on it. I am using this code right now, which allows be to toggle it clos..

Setting CSS pseudo-class rules from JavaScript

I'm looking for a way to change the CSS rules for pseudo-class selectors (such as :link, :hover, etc.) from JavaScript. So an analogue of the CSS code: a:hover { color: red } in JS. I couldn't find ..

Rename a file in C#

How do I rename a file using C#?..

How do I include the string header?

I'm trying to learn about strings, but different sources tell my to include different headers. Some say to use <string.h>, but others mention "apstring.h". I was able to do some basic stuff wi..

Run a command shell in jenkins

I'm trying to execute a command shell in Jenkins, I'm working on Windows 7. In the console output I have this: Building in workspace C:\Program Files (x86)\Jenkins\workspace\test [test] $ sh -xe C:\W..

Put quotes around a variable string in JavaScript

I have a JavaScript variable: var text = "" Text can be multiple links. How can I put '' around the variable string? I want the strings to, for example, look like this: "'http:/..

AngularJS : How to watch service variables?

I have a service, say: factory('aService', ['$rootScope', '$resource', function ($rootScope, $resource) { var service = { foo: [] }; return service; }]); And I would like to use foo to c..

How can I kill whatever process is using port 8080 so that I can vagrant up?

On MacOSX, I'm using Packer to build a Vagrant box so I need to continually bring it up and tear it down. I'm attempting to 'vagrant up', and receive the standard error because the port is in use: "..

Type safety: Unchecked cast

In my spring application context file, I have something like: <util:map id="someMap" map-class="java.util.HashMap" key-type="java.lang.String" value-type="java.lang.String"> <entry key="..

How to get a list of column names

Is it possible to get a row with all column names of a table like this? |id|foo|bar|age|street|address| I don't like to use Pragma table_info(bla)...

How to easily duplicate a Windows Form in Visual Studio?

How can I easily duplicate a C#/VB Form in Visual Studio? If I copy & paste in the Solution Explorer, it uses the same class internally and gets messed up. How do you do it? ..

How to export a mysql database using Command Prompt?

I have a database that is quite large so I want to export it using Command Prompt but I don't know how to. I am using WAMP...

Git - Ignore files during merge

I have a repo called myrepo on the remote beanstalk server. I cloned it to my local machine. Created two additional branches: staging and dev. Pushed these branches to remote as well. Now: local ..

Spring Boot application as a Service

How to configure nicely Spring Boot application packaged as executable jar as a Service in the Linux system? Is this recommended approach, or should I convert this app to war and install it into Tomca..

Value of type 'T' cannot be converted to

This is likely a a novice question, but google surprisingly did not provide an answer. I have this rather artificial method T HowToCast<T>(T t) { if (typeof(T) == typeof(string)) { ..

Convert ascii char[] to hexadecimal char[] in C

I am trying to convert a char[] in ASCII to char[] in hexadecimal. Something like this: hello --> 68656C6C6F I want to read by keyboard the string. It has to be 16 characters long. This is my code..

Could not open input file: artisan

When trying to create a new laravel project, The following error appears on the CLI: Could not open input file: artisan Script php artisan clear-compiled handling the post-install-cmd event returned ..

TypeError: 'float' object is not callable

I am trying to use values from an array in the following equation: for x in range(len(prof)): PB = 2.25 * (1 - math.pow(math.e, (-3.7(prof[x])/2.25))) * (math.e, (0/2.25))) When I run I receive..

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 create multiple page app using react

I have created a single page web app using react js. I have used webpack to create bundle of all components. But now I want to create many other pages. Most of pages are API call related. i.e. in the ..

base 64 encode and decode a string in angular (2+)

How to encode or decode a string in angular 2 with base64 ??? My front-end tool is Angular 2. I had a password string, before passing it to API I need to base64 encode. Since in service base64 encoded..

Should have subtitle controller already set Mediaplayer error Android

Whenever I play a media, it shows a warning in DDMS Should have subtitle controller already set MY CODE: private void start() { mediaPlayer.start(); mediaPlayer.setOnCompletionListener(ne..

Write a file in UTF-8 using FileWriter (Java)?

I have the following code however, I want it to write as a UTF-8 file to handle foreign characters. Is there a way of doing this, is there some need to have a parameter? I would real..

How to force a UIViewController to Portrait orientation in iOS 6

As the ShouldAutorotateToInterfaceOrientation is deprecated in iOS 6 and I used that to force a particular view to portrait only, what is the correct way to do this in iOS 6? This is only for one are..

Python spacing and aligning strings

I am trying to add spacing to align text in between two strings vars without using " " to do so Trying to get the text to look like this, with the second column being aligned. Location: 10-10..

Replace words in a string - Ruby

I have a string in Ruby: sentence = "My name is Robert" How can I replace any one word in this sentence easily without using complex code or a loop?..

After updating Entity Framework model, Visual Studio does not see changes

If I do any changes to my EF 5.0 model, VS does not seem to see the changes. I have tried adding a new table, which shows up fine in the model, but then if I try to use it somewhere the table does not..

Angular 5 Reactive Forms - Radio Button Group

I have 2 radio buttons, I'm using reactive forms and I have added the form controls within my component. The issue I am facing is that the name attribute has to be the same as the formControlName. Whe..

Returning JSON from PHP to JavaScript?

I have a PHP script that's being called through jQuery AJAX. I want the PHP script to return the data in JSON format to the javascript. Here's the pseudo code in the PHP script: $json = "{"; foreach(..

Create view with primary key?

I create a view with following codes SELECT CONVERT(NVARCHAR, YEAR(okuma_tarihi)) + 'T1' AS sno, YEAR(okuma_tarihi) AS Yillar, SUM(toplam_kullanim_T1) AS TotalUsageValue, 'T1' AS UsageTyp..

How to get just the date part of getdate()?

I have a SQL table that has a CreationDate field. I have getdate() in the computed column specification formula. I would like to know how to get just the date portion, that is, '2012-08-24' instead ..

Hidden TextArea

In html for textbox it can be hidden by using <input type="hidden" name="hide"/> but for TextArea if I want to hide how should I use? Anyone help me please, Thanks,..

Referencing Row Number in R

How do I reference the row number of an observation? For example, if you have a data.frame called "data" and want to create a variable data$rownumber equal to each observation's row number, how would ..

Conditional formatting, entire row based

I've searched and read through answers related to conditional formatting, but I can't seem to get mine to work, so maybe I'm doing something wrong. I have a worksheet for work. It contains a list of ..

How to round up a number in Javascript?

I want to use Javascript to round up a number. Since the number is currency, I want it to round up like in these examples (2 decimal points): 192.168 => 192.20 192.11 => 192.20 192.21 => 192.30 19..

Disable LESS-CSS Overwriting calc()

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

Understanding __get__ and __set__ and Python descriptors

I am trying to understand what Python's descriptors are and what they are useful for. I understand how they work, but here are my doubts. Consider the following code: class Celsius(object): def _..

Get row-index values of Pandas DataFrame as list?

I'm probably using poor search terms when trying to find this answer. Right now, before indexing a DataFrame, I'm getting a list of values in a column this way... list = list(df['column']) ...the..

How to remove trailing whitespace in code, using another script?

Something like: import fileinput for lines in fileinput.FileInput("test.txt", inplace=1): lines = lines.strip() if lines == '': continue print lines But nothing is being printed on std..

annotation to make a private method public only for test classes

Who has a solution for that common need. I have a class in my application. some methods are public, as they are part of the api, and some are private, as they for internal use of making the internal..

What is the difference between a "function" and a "procedure"?

Generally speaking, we all hear about the functions or procedures in programming languages. However, I just found out that I use these terms almost interchangeably (which is probably very wrong). So,..

javac error: Class names are only accepted if annotation processing is explicitly requested

I get this error when I compile my java program: error: Class names, 'EnumDevices', are only accepted if annotation processing is explicitly requested 1 error Here is the java code (I'm running t..

Should I use @EJB or @Inject

I have found this question: What is the difference between @Inject and @EJB but I did not get any wiser. I have not done Java EE before nor do I have experience with dependency injection so I do not u..

Hiding a sheet in Excel 2007 (with a password) OR hide VBA code in Excel

I found a way to hide Excel sheets which is as follows: set the visibility of the sheet to VeryHidden in the VBAProject properties and then password protect VBAProject properties. This is great, but ..

Java random number with given length

I need to genarate a random number with exactly 6 digits in Java. I know i could loop 6 times over a randomicer but is there a nother way to do this in the standard Java SE ? EDIT - Follow up questio..

Can't find AVD or SDK manager in Eclipse

Seems like I'm having some problems after updating my android sdk tools and platform-tools using the sdk manager. The problem is that, after updating, I found that the avd or sdk options in the window..

Django - "no module named"

I get the following error when trying to run Django from the command line. File, line 8, in <module>      from import execute_from_command_line ImportError:..

How do I iterate over an NSArray?

I'm looking for the standard idiom to iterate over an NSArray. My code needs to be suitable for OS X 10.4+...

Return the characters after Nth character in a string

I need help! Can someone please let me know how to return the characters after the nth character? For example, the strings I have is "001 baseball" and "002 golf", I want my code to return baseball a..

Add button to a layout programmatically

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

how to add or embed CKEditor in php page

how to add or embed CKEditor in php page, I downloaded and extracted the zip file into root of the directory and also called on my page <?php require("ckeditor/ckeditor.php"); ?> gave the te..

CSS - make div's inherit a height

I'm trying to make a box with rounded corners where the height and width of the div depends on the content, so it's automatically adjust to it... You can see the example here:

Get value of c# dynamic property via string

I'd like to access the value of a dynamic c# property with a string: dynamic d = new { value1 = "some", value2 = "random", value3 = "value" }; How can I get the value of d.value2 ("random") if I onl..

ServletContext.getRequestDispatcher() vs ServletRequest.getRequestDispatcher()

why getRequestDispatcher(String path) of the ServletRequest interface cannot extend outside the current servlet context where as getRequestDispatcher(String path) of the ServletCon..

How do I use System.getProperty("line.separator").toString()?

I have a Tab-delimited String (representing a table) that is passed to my method. When I print it to the command line, it appears like a table with rows: The comma..

Backporting Python 3 open(encoding="utf-8") to Python 2

I have a Python codebase, built for Python 3, which uses Python 3 style open() with encoding parameter: with open(fname, "rt..

INSERT INTO a temp table, and have an IDENTITY field created, without first declaring the temp table?

I need to select a bunch of data into a temp table to then do some secondary calculations; To help make it work more efficiently, I would like to have an IDENTITY column on that table. I know I could..

How do I set up CLion to compile and run?

I just downloaded CLion from because I just love the rest of their products. However, I'm having problems configuring it. I'm not able to compile and run my application (a s..

Why doesn't margin:auto center an image?

<html> <head> <title>Test</title> </head> <body> <div> <img src="queuedError.jpg" style="margin:auto; width:200px;" /> </div> <..

OpenCV in Android Studio

I want to use OpenCV library in my app with Android Studio. I followed instructions found here but I get error Configuration with name 'default' not found What can be wrong? I use Android Stud..

Overriding css style?

I look on Stack Overflow, and didn't find the solution, I know how to override style if style exists, just change its property. But now I have a strange style to override Here is an example of what ..

How can I write a byte array to a file in Java?

How to write a byte array to a file in Java?..

How can I disable the Maven Javadoc plugin from the command line?

In pom.xml I have declaration like this <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> &l..

Javascript to export html table to Excel

I need to export the html table in my page to an Excel when user clicks 'Export' button. Now, I found a solution here on stack overflow that works in Firefox. Export dynamic html table to excel in ja..

Pure Javascript listen to input value change

Is there any way I can create a constant function that listens to an input, so when that input value changes, something is triggered immediately? I am looking for something using pure javascript, no ..

PHP to write Tab Characters inside a file?

How do i simply write out a file including real tabs inside? tab means real tab which is not the spaces. How to write the tab or what is the character for real tab? For example here: $chunk = "a,b,c..

show all tables in DB2 using the LIST command

This is embarrassing, but I can't seem to find a way to list the names of the tables in our DB2 database. Here is what I tried: root@VO11555:~# su - db2inst1 root@VO11555:~# . ~db2inst1/sqllib/db2pro..

How to put a jpg or png image into a button in HTML

I want a button with an image in it. I am using this: <input type="submit" name="submit" src="images/stack.png" /> But it does not show the image. I want the whole button to be the image...

Is returning out of a switch statement considered a better practice than using break?

Option 1 - switch using return: function myFunction(opt) { switch (opt) { case 1: return "One"; case 2: return "Two"; case 3: return "Three"; default: retur..

React-Redux: Actions must be plain objects. Use custom middleware for async actions

Unhandled Rejection (Error): Actions must be plain objects. Use custom middleware for async actions. I wanted to add comments with every posts. So when fetch posts are run I want to call fetch co..

Is there a way to collapse all code blocks in Eclipse?

Eclipse has that "+/-" on the left to expand and collapse blocks of code. I've got tens of thousands of lines to go through and would really like to just collapse everything, and selectively expand b..

What to do about Eclipse's "No repository found containing: ..." error messages?

I'm running Eclipse's Helios EE bundle on Linux to which I added the subversive plugins, the m2e Maven integration and the Mylin connector for Trac. For the last couple of weeks I've been trying to in..

How to access the content of an iframe with jQuery?

How can I access the content of an iframe with jQuery? I tried doing this, but it wouldn't work: iframe content: <div id="myContent"></div> jQuery: $("#myiframe").find("#myContent") How..

HttpUtility does not exist in the current context

I get this error when compiling a C# application. Looks like a trivial error, but I can't get around it. My setup is Windows 7 64 bit. Visual-Studio 2010 C# express B2Rel. I added a reference to Sys..

<button> vs. <input type="button" />. Which to use?

When looking at most sites (including SO), most of them use: <input type="button" /> instead of: <button></button> What are the main differences between the two, if any? Are t..

How to get distinct values for non-key column fields in Laravel?

This might be quite easy but have no idea how to. I have a table that can have repeated values for a particular non-key column field. How do I write a SQL query using Query Builder or Eloquent that w..

Git push won't do anything (everything up-to-date)

I'm trying to update a Git repository on GitHub. I made a bunch of changes, added them, committed then attempted to do a git push. The response tells me that everything is up to date, but clearly it's..

How should I store GUID in MySQL tables?

Do I use varchar(36) or are there any better ways to do it?..

Regex to replace everything except numbers and a decimal point

I have a text field that needs to remain only text or decimal. Here is the code that I'm currently using to replace everything except numbers and a decimal point. Issue is, I can't figure out a regex ..

Override valueof() and toString() in Java enum

The values in my enum are words that need to have spaces in them, but enums can't have spaces in their values so it's all bunched up. I want to override toString() to add these spaces where I tell it ..

Returning null in a method whose signature says return int?

public int pollDecrementHigherKey(int x) { int savedKey, savedValue; if (this.higherKey(x) == null) { return null; // COMPILE-TIME ERROR } ..

QComboBox - set selected item based on the item's data

What would be the best way of selecting an item in a QT combo box out of a predefined list of enum based unique values. In the past I have become accustomed to .NET's style of selection where the ite..

How to embed HTML into IPython output?

Is it possible to embed rendered HTML output into IPython output? One way is to use from IPython.core.display import HTML HTML('<a href="">link</a>') or (IPython mult..

No ConcurrentList<T> in .Net 4.0?

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

Delete empty lines using sed

I am trying to delete empty lines using sed: sed '/^$/d' but I have no luck with it. For example, I have these lines: xxxxxx yyyyyy zzzzzz and I want it to be like: xxxxxx yyyyyy zzzzzz ..

How can I use grep to show just filenames on Linux?

How can I use grep to show just file-names (no in-line matches) on Linux? I am usually using something like: find . -iname "*php" -exec grep -H myString {} \; How can I just get the file-names (wi..

JavaScript to scroll long page to DIV

I have a link on a long HTML page. When I click it, I wish a div on another part of the page to be visible in the window by scrolling into view. A bit like EnsureVisible in other languages. I've ch..