Questions Tagged with #Mde

Error : Program type already present: android.support.design.widget.CoordinatorLayout$Behavior

I am getting the following error while building the project. haven't used CoordinatorLayout in this project. just added as a dependency in build.gradle : I am using Android Studio 3.2 Canary 4. Log..

java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex in Android Studio 3.0

This is my app level gradle file: apply plugin: 'com.android.application' android { compileSdkVersion 26 buildToolsVersion '27.0.0' useLibrary 'org.apache.http.legacy' defaultCon..

Android Studio 3.0 Execution failed for task: unable to merge dex

android studio was getting build error while build execution with following: Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. java.lang.RuntimeExceptio..

Unable to merge dex

I have Android Studio Beta. I created a new project with compile my old modules but when I tried launching the app it did not launch with the message: Error:Execution failed for task ':app:transformD..

How to change the integrated terminal in visual studio code or VSCode

I want to change integrated terminal to CMDER i use Vscode on windows 8.1 i checked the doc and also preference file but i got confuse so from following lines which line will change it // Externa..

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

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

ImportError: No module named google.protobuf

I am following this guide (https://developers.google.com/protocol-buffers/docs/pythontutorial) and using the exact sample of addressbook.proto. Post the content of compiler generated addressbook_pb2...

IE and Edge fix for object-fit: cover;

I'm using object-fit: cover; in my CSS for images on a specific page, because they need to stick on the same height. It works great in most browsers. But when scaling my browser in IE or Edge, the i..

android : Error converting byte to dex

So, I am getting the following error while running the project after upgrading build.gradle (Project) from dependencies { classpath 'com.android.tools.build:gradle:2.0.0-alpha2' // N..

npm install -g less does not work: EACCES: permission denied

I'm trying to set up less on phpstorm so I can compile .less files to .css on save. I have installed node.js and the next step (according to this https://www.jetbrains.com/webstorm/help/transpiling-sa..

Recyclerview inside ScrollView not scrolling smoothly

For my app I am using a RecyclerView inside a ScrollView where the RecyclerView has a height based on its content using this library. Scrolling is working but it's not working smoothly when I scroll o..

LocalDate to java.util.Date and vice versa simplest conversion?

Is there a simple way to convert a LocalDate (introduced with Java 8) to java.util.Date object? By 'simple', I mean simpler than this: Date date = Date.from(localDate.atStartOfDay(ZoneId.systemD..

Can't get private key with openssl (no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY)

I have a .key file, when I do openssl rsa -text -in file.key I get unable to load Private Key 140000419358368:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: ANY PRI..

Error 405 (Method Not Allowed) Laravel 5

Im trying to do a POST request with jQuery but im getting a error 405 (Method Not Allowed), Im working with Laravel 5 THis is my code: jQuery <script type="text/javascript"> $(document).r..

How can a divider line be added in an Android RecyclerView?

I am developing an android application where I am using RecyclerView. I need to add a divider in RecyclerView. I tried to add - recyclerView.addItemDecoration(new DividerItemDecoration(getActiv..

Hadoop cluster setup - java.net.ConnectException: Connection refused

I want to setup a hadoop-cluster in pseudo-distributed mode. I managed to perform all the setup-steps, including startuping a Namenode, Datanode, Jobtracker and a Tasktracker on my machine. Then I tr..

Why can I not create a wheel in python?

Here are the commands I am running: $ python setup.py bdist_wheel usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-c..

AttributeError: 'str' object has no attribute

I'm pretty new to python programming and I wanted to try my hand at a simple text adventure game, but I've immediately stumbled on a roadblock. class userInterface: def __init__(self, roomID, roo..

Why do multiple-table joins produce duplicate rows?

Let's say I have three tables A, B, and C. Each has two columns: a primary key and some other piece of data. They each have the same number of rows. If I JOIN A and B on the primary key, I should end ..

Saving binary data as file using JavaScript from a browser

I am working on a business application using angularJS. One of my service method returning me a byte[] (inclding PDF file content) now i need to download this file as PDF to client machine using JavaS..

javax.xml.bind.UnmarshalException: unexpected element. Expected elements are (none)

I am getting this error, while unmarshalling a string. I have created Java files using JAXB. JAXBContext jaxbContext = JAXBContext.newInstance(DocumentType.class); Unmarshaller unmarshaller = jaxbCon..

SQL Query - SUM(CASE WHEN x THEN 1 ELSE 0) for multiple columns

I'm looking to see if there is a better approach to the query below. What I'm trying to do is create a summary report, compiling stats by date. SELECT CAST(Detail.ReceiptDate AS DATE) AS 'DATE' , S..

How to display errors for my MySQLi query?

I am using the following script to process a form to add info to my website. The problem I am having is when I submit the form nothing gets submitted to the database, and there are no errors. How can ..

Using msbuild to execute a File System Publish Profile

I have a c# .Net 4.0 project created with VS2010 and now being accessed with VS2012. I'm trying to publish only the needed files from this website to a destination location (C:\builds\MyProject[Files..

XML Schema Validation : Cannot find the declaration of element

I am still a bit new to XML Schema etc. and have been working to develop some XML, Schema and a Stylesheet (XSLT). I have made reasonable progress, but then realized that my Schema had stopped working..

SQL Server stored procedure creating temp table and inserting value

I am trying to select values from different table and inset it in to the temporary table. I need a identity field in the temporary table. When I try to execute the following code it throws an error: ..

Android + Pair devices via bluetooth programmatically

I want to discover bluetooth devices in range, list and pair to them on click. I used following code but its just closing application when I click on device name which I want to pair. I want to know ..

cvc-elt.1: Cannot find the declaration of element 'MyElement'

I'm trying to validate a really simple xml using xsd, but for some reason I get this error. I'll really appreciate if someone can explain me why. XML File <?xml version="1.0" encoding="utf-8"?>..

Why can I ping a server but not connect via SSH?

When I ping my server, it responds: user@localhost:~$ ping my.server PING my.server (111.111.111.11) 56(84) bytes of data. 64 bytes from my.server (111.111.111.11): icmp_req=1 ttl=42 time=38.4 ms 64 ..

Importing xsd into wsdl

This is my current configuration: XSD <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns="http://stock.com/schemas/services/stock" xmlns:tns="http://stock.com/schemas/services/sto..

How to convert image into byte array and byte array to base64 String in android?

Can someone tell me the code to convert image into byte array and that byte array into base64 string. i write the below code not getting proper result . String filepath = "/sdcard/Image/ic_launcher..

configure: error: C compiler cannot create executables

I've checked a number of similar questions on stackoverflow but haven't found an answer yet. I'm trying to install memcached on Lion OSX as shown here. Here's what I'm getting: j-court-demones-macb..

Download file inside WebView

I have a webview in my Android Application. When user goes to webview and click a link to download a file nothing happens. URL = "my url"; mWebView = (WebView) findViewById(R.id.webview); mWebView.s..

Working with Enums in android

I am almost done with a calculation activity I am working with in android for my app. I try to create a Gender Enum, but for some reason getting Syntax error, insert "EnumBody" to complete EnumDeclara..

How to make an element in XML schema optional?

So I got this XML schema: <?xml version="1.0"?> <xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:eleme..

How to pass html string to webview on android

Hi I am parsing xml and then loading it to web view, after parsing I am creating four strings so that I could append all string to one view. I am able to get two views on the web view but not the firs..

C# Iterate through Class properties

I'm currently setting all of the values of my class object Record. This is the code that I'm using to populate the record at the moment, property by property. // Loop through each field in the resul..

Configuring ObjectMapper in Spring

my goal is to configure the objectMapper in the way that it only serialises element which are annotated with @JsonProperty. In order to do so I followed this explanation which says how to configurate..

Unable to update the EntitySet - because it has a DefiningQuery and no <UpdateFunction> element exist

I am using Entity Framework 1 with .net 3.5. I am doing something simple like this: var roomDetails = context.Rooms.ToList(); foreach (var room in roomDetails) { room.LastUpdated = DateT..

JAXB :Need Namespace Prefix to all the elements

I am Using Spring WebServiceTemplate to make webservice call which uses JAXB to generate request XML. My requirement needs all the elements (including root) to have a namespace prefix (there is only a..

Checking if a variable is initialized

Seems like this would be a duplicate, but maybe it is just so obvious it hasn't been asked... Is this the proper way of checking if a variable (not pointer) is initialized in a C++ class? class MyCl..

Add "Appendix" before "A" in thesis TOC

I am required to insert the word Appendix before the letter A in my dissertation Table of Contents as follows: Appendix A (title for appendix A) but the latex thesis cls file I use generates only th..

Google Gson - deserialize list<class> object? (generic type)

I want to transfer a list object via Google Gson, but I don't know how to deserialize generic types. What I tried after looking at this (BalusC's answer): MyClass mc = new Gson().fromJson(result, n..

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

Arithmetic operation resulted in an overflow. (Adding integers)

I can't understand this error: In this call to method SetVolume, Volume = 2055786000 and size = 93552000. Volume is an Integer property, and size is also Integer, as you can see. The class is a pa..

How to simulate a button click using code?

How can I trigger a button click event using code in Android? I want to trigger the button click programmatically when some other event occurs. Same Problem I am Facing public void onDateSelectedBu..

Get Enum from Description attribute

Possible Duplicate: Finding an enum value by its Description Attribute I have a generic extension method which gets the Description attribute from an Enum: enum Animal { [Description("..

What exactly is OAuth (Open Authorization)?

What exactly is OAuth (Open Authorization)? I have gleaned some information from OAuth Twitter Tutorial: What is OAuth And What It Means To You What is OAuth But I want to learn and know more. I..

Passing arguments to AsyncTask, and returning results

I have an application that does some long calculations, and I would like to show a progress dialog while this is done. So far I have found that I could do this with threads/handlers, but didn't work, ..

Simple conversion between java.util.Date and XMLGregorianCalendar

I'm looking for a simple method of converting between java.util.Date and javax.xml.datatype.XMLGregorianCalendar in both directions. Here is the code that I'm using now: import java.util.Gregoria..

How to Load RSA Private Key From File

I am working on a test harness for a SAML 1.1 Assertion Consumer Service. The test must generate a signed SAMLResponse and submit it to the ACS encoded in Base64. The ACS must be able to verify the ..

Custom Drawable for ProgressBar/ProgressDialog

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

How to get C# Enum description from value?

I have an enum with Description attributes like this: public enum MyEnum { Name1 = 1, [Description("Here is another")] HereIsAnother = 2, [Description("Last one")] LastOne = 3 } ..

The remote server returned an error: (407) Proxy Authentication Required

I'm getting this error when I call a web service: "The remote server returned an error: (407) Proxy Authentication Required". I get the general idea and I can get the code to work by adding myProxy..

Android TextView Text not getting wrapped

Can anyone tell me what's going wrong with the text? Text longer than one line doesn't wrap to the next line but goes beyond the screen. Following is the code: <LinearLayout xmlns:android="http:/..

How to make a smooth image rotation in Android?

I'm using a RotateAnimation to rotate an image that I'm using as a custom cyclical spinner in Android. Here's my rotate_indefinitely.xml file, which I placed in res/anim/: <?xml version="1.0" enc..

What does elementFormDefault do in XSD?

What does elementFormDefault do, and when should it be used? So I found some definitions for elementFormDefault values: qualified - elements and attributes are in the targetNamespace of the s..

Java substring: 'string index out of range'

I'm guessing I'm getting this error because the string is trying to substring a null value. But wouldn't the ".length() > 0" part eliminate that issue? Here is the Java snippet: if (itemdescripti..

Is it possible to specify proxy credentials in your web.config?

I need to configure a website to access a webservice on another machine, via a proxy. I can configure the website to use a proxy, but I can't find a way of specifying the credentials that the proxy r..

Laravel Check If Related Model Exists

I have an Eloquent model which has a related model: public function option() { return $this->hasOne('RepairOption', 'repair_item_id'); } public function setOptionArrayAttribute($values) { ..

How to get screen dimensions as pixels in Android

I created some custom elements, and I want to programmatically place them to the upper right corner (n pixels from the top edge and m pixels from the right edge). Therefore I need to get the screen wi..

How to save a Python interactive session?

I find myself frequently using Python's interpreter to work with databases, files, etc -- basically a lot of manual formatting of semi-structured data. I don't properly save and clean up the useful b..

How to remove MySQL completely with config and library files?

So far I've tried the following commands: sudo apt-get remove mysql-server mysql-client mysql-common sudo apt-get purge mysql-server mysql-client mysql-common sudo apt-get autoremove But whenever I..

"Sources directory is already netbeans project" error when opening a project from existing sources

I've installed NetBeans 6.9.1 and installed few updates for it. Then I've created a new project from existing sources. After a few changes I've closed it. And now I am having an error, when trying to..

How to connect to a secure website using SSL in Java with a pkcs12 file?

I have a pkcs12 file. I need to use this to connect to a webpage using https protocol. I came across some code where in order to connect to a secure web page i need to set the following system propert..

WebDriver: check if an element exists?

How to check if an element exist with web driver? Is using a try catch really the only possible way? boolean present; try { driver.findElement(By.id("logoutLink")); present = true; } catch (No..

C# List<string> to string with delimiter

Is there a function in C# to quickly convert some collection to string and separate values with delimiter? For example: List<string> names --> string names_together = "John, Anna, Monica"..

extract month from date in python

I have a column of dates in the format 2010-01-31. I can extract the year using #extracting year year = df["date"].values year = [my_str.split("-")[0] for my_str in year] df["year"] = year I'm tryi..

`require': no such file to load -- mkmf (LoadError)

I was trying to install rails on Ubuntu Natty Narwhal 11.04, using ruby1.9.1. I installed ruby using apt-get install ruby1.9.1-full which contains the dev package. I googled the error and all have su..

How do I flush the cin buffer?

How do I clear the cin buffer in C++?..

Set database timeout in Entity Framework

My command keeps timing out, so I need to change the default command timeout value. I've found myDb.Database.Connection.ConnectionTimeout, but it's readonly. How can I set the command timeout in Ent..

Display/Print one column from a DataFrame of Series in Pandas

I created the following Series and DataFrame: import pandas as pd Series_1 = pd.Series({'Name': 'Adam','Item': 'Sweet','Cost': 1}) Series_2 = pd.Series({'Name': 'Bob','Item': 'Candy','Cost': 2}) Ser..

how to add script src inside a View when using Layout

I want to include a javascript reference like: <script src="@Url.Content("~/Scripts/jqueryFoo.js")" type="text/javascript"></script> If I have a Razor View, what is the proper way to in..

How to change the map center in Leaflet.js

The following code initializes a leaflet map. The initialize function centers the map based on user location. How do I change the center of the map to a new position after calling the initialize funct..

How to create a Custom Dialog box in android?

I want to create a custom dialog box like below I have tried the following things. I created a subclass of AlertDialog.Builder and used a custom Title and Custom Content View and used that but t..

How to display a pdf in a modal window?

I have a modal window, which contains an anchor text. When i click on this link, it must call a pdf housed somewhere else and display it in a pop up . How can I do that ? Kindly help ...

Format number to 2 decimal places

I would like to know how can I output a number with 2 decimal places, without rounding the original number. For example: 2229,999 -> 2229,99 I already tried: FORMAT(2229.999, 2) CONVERT(2229.9..

how to set ASPNETCORE_ENVIRONMENT to be considered for publishing an asp.net core application?

when i publish my asp.net core web application to my local file system, it always takes the production-config and the ASPNETCORE_ENVIRONMENT variable with the value = "Production". how and where do i..

How do I find numeric columns in Pandas?

Let's say df is a pandas DataFrame. I would like to find all columns of numeric type. Something like: isNumeric = is_numeric(df) ..

How to override and extend basic Django admin templates?

How do I override an admin template (e.g. admin/index.html) while at the same time extending it (see https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-vs-replacing-an-admin-template)..

CSV new-line character seen in unquoted field error

the following code worked until today when I imported from a Windows machine and got this error: new-line character seen in unquoted field - do you need to open the file in universal-newline mode? i..

How to open a page in a new window or tab from code-behind

So I have a webapplication where I select a value from a dropdownlist. When this value is selected, I want to load another page in a new window. I tried this: ScriptManager.RegisterStartupScript(Pag..

LaTeX package for syntax highlighting of code in various languages

I am looking for a LaTeX package that does syntax highlighting on code. For example, right now I use the verbatim block to write code: \begin{verbatim} <html> <head> ..

How do I get interactive plots again in Spyder/IPython/matplotlib?

I upgraded from Python(x,y) 2.7.2.3 to 2.7.6.0 in Windows 7 (and was happy to see that I can finally type function_name? and see the docstring in the Object Inspector again) but now the plotting doesn..

How to increment variable under DOS?

I've spent the past 3hrs trying to work this out but just couldn't find a solution. Here's my batch script: if NOT Exist Counter.txt GOTO START Type c:\counter.txt if %COUNTER% EQU %Cycles% goto Pass..

How to get address location from latitude and longitude in Google Map.?

So I have latitude and longitude Like 44.4647452 and 7.3553838. I need to get address like: Milan, Italy, str. Kennedy 89. How I can do it?..

Configuring angularjs with eclipse IDE

I want to start using AngularJs and Java Spring for development purpose.I am using Eclipse as IDE . I want to configure my Eclipse to have these frameworks working seamlessly. I know I may be asking ..

How to read multiple Integer values from a single line of input in Java?

I am working on a program and I want to allow a user to enter multiple integers when prompted. I have tried to use a scanner but I found that it only stores the first integer entered by the user. For ..

How to finish Activity when starting other activity in Android?

I have problems to finish the activity before. I want to start another activity and finish the current activity. When I used finish it didn't exit the current activity. How can I exit the activity ..

Loop Through All Subfolders Using VBA

I'm looking for a VBA script that will loop through all subfolders of a specified folder. When I say all subfolders, I mean each folder inside the specified folder, and each folder inside of that, and..

CSS triangle custom border color

Attempting to use a custom hex color for my css triangle (border). However since it uses border properties I am unsure how to go about doing this. I would like to steer clear of javascript and css3 si..

List all devices, partitions and volumes in Powershell

I have multiple volumes (as nearly everybody nowadays): on Windows they end up specified as C:, D: and so on. How do I list these all like on a Unix machine with "ls /mnt/" with Powershell? ..

Is there a command line utility for rendering GitHub flavored Markdown?

I'm wondering if there is a command line utility for taking a GitHub flavored Markdown file and rendering it to HTML. I'm using a GitHub wiki to create website content. I've cloned the repository on ..

Combination of async function + await + setTimeout

I am trying to use the new async features and I hope solving my problem will help others in the future. This is my code which is working: async function asyncGenerator() { // other code whi..

How to get the HTML's input element of "file" type to only accept pdf files?

is there any way that html element file <input name="file1" type="file" style="width:300px"> only accept PDF files and when we browse its only show PDF files... Thanks..

How to set background color in jquery

How to set background color of td in jQuery? e.g $(this).css({**BackgroundColor:Red**}) Thanks..

I have created a table in hive, I would like to know which directory my table is created in?

I have created a table in hive, I would like to know which directory my table is created in? I would like to know the path.....

What is the main difference between PATCH and PUT request?

I am using a PUT request in my Rails application. Now, a new HTTP verb, PATCH has been implemented by browsers. So, I want to know what the main difference between PATCH and PUT requests are, and when..

Deleting multiple elements from a list

Is it possible to delete multiple elements from a list at the same time? If I want to delete elements at index 0 and 2, and try something like del somelist[0], followed by del somelist[2], the second ..

Get request URL in JSP which is forwarded by Servlet

How can I get request URL in JSP which is forwarded by Servlet? If I run following code in JSP, System.out.println("servlet path= " + request.getServletPath()); System.out.println("request URL= " + ..

How to install mechanize for Python 2.7?

I saved mechanize in my Python 2.7 directory. But when I type import mechanize into the Python shell, I get an error message that reads: Traceback (most recent call last): File "<pyshell#0>",..

PHP Fatal error: Uncaught exception 'Exception'

I'm playing around with exceptions in PHP. For example, I have a script that reads a $_GET request and loads a file; If the file doesn't exists, an new exception should be thrown: if ( file_exists( $..

Get day of week using NSDate

I created a method that is supposed to take in a string in "YYYY-MM-DD" form and spit out an int that represents the dates position in relation to the week it is in (regardless if it overlaps between ..

What is "origin" in Git?

When I run: git push origin branchname What exactly is origin and why do I have to type it before the branch name?..

What does it mean if a Python object is "subscriptable" or not?

Which types of objects fall into the domain of "subscriptable"?..

How to use terminal commands with Github?

I have forked a private repository (an iPhone project) as follows: cd nameofdirectory git init git clone forkedURL Now I want to push the changes done by me to my forked repository so that the main..

How to start nginx via different port(other than 80)

Hi I am a newbie on nginx, I tried to set it up on my server(running Ubuntu 4), which already has apache running. So after I apt-get install it, I tried to start nginx. Then I get the message like t..

Python ValueError: too many values to unpack

I am getting that exception from this code: class Transaction: def __init__ (self): self.materials = {} def add_material (self, m): self.materials[m.type + m.purity] = m ..

Fuzzy matching using T-SQL

I have a table Persons with personaldata and so on. There are lots of columns but the once of interest here are: addressindex, lastname and firstname where addressindex is a unique address drilled dow..

Android: How do I get string from resources using its name?

I would like to have 2 languages for the UI and separate string values for them in my resource file res\values\strings.xml: <string name="tab_Books_en">Books</string> <string name="..

How do I move files in node.js?

How can I move files (like mv command shell) on node.js? Is there any method for that or should I read a file, write to a new file and remove older file?..

How do I use regex in a SQLite query?

I'd like to use a regular expression in sqlite, but I don't know how. My table has got a column with strings like this: "3,12,13,14,19,28,32" Now if I type "where x LIKE '3'" I also get the rows whic..

Node.js check if file exists

How do i check the existence of a file? In the documentation for the module fs there's a description of the method fs.exists(path, callback). But, as I understand, it checks for the existence of only..

Background color in input and text fields

I would like to change the color background in the text and input fields of a form, but when I do this it also affects the submit button! Could it be done in some other way that does not affect the bu..

SSL error : routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

I have a large number of file download links in a txt file. I am trying to write a python script to download all the files at once, but I end up with the following error: SSLError: [Errno 1] _ssl.c:4..

pip install failing with: OSError: [Errno 13] Permission denied on directory

pip install -r requirements.txt fails with the exception below OSError: [Errno 13] Permission denied: '/usr/local/lib/.... What's wrong and how do I fix this? (I am trying to setup Django) Installing..

"Permission Denied" trying to run Python on Windows 10

Seems as though an update on Windows 10 overnight broke Python. Just trying to run python --version returned a "Permission Denied" error. None of the three updates; KB4507453, KB4506991, or KB4509096..

Check table exist or not before create it in Oracle

Trying to check is table exist before create in Oracle. Search for most of the post from Stackoverflow and others too. Find some query but it didn't work for me. IF((SELECT count(*) FROM dba_tables w..

Java. Implicit super constructor Employee() is undefined. Must explicitly invoke another constructor

Hello I'm new to Java, I'm getting this error in my production worker class. My Production worker constructor says explicitly invoke another constructor. I don't know what to do?. import java.util.Da..

Validate fields after user has left a field

With AngularJS, I can use ng-pristine or ng-dirty to detect if the user has entered the field. However, I want to do client-side validation only after the user has left the field area. This is because..

How to remove whitespace from a string in typescript?

In my angular 5 project, with typescript I am using the .trim() function on a string like this, But it is not removing the whitespace and also not giving any error. this.maintabinfo = this.inner_vie..

How to create a sleep/delay in nodejs that is Blocking?

I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need..

How do I convert an integer to binary in JavaScript?

I’d like to see integers, positive or negative, in binary. Rather like this question, but for JavaScript...

Where can I set environment variables that crontab will use?

I have a crontab running every hour. The user running it has environment variabless in the .bash_profile that work when the user runs the job from the terminal, however, obviously these don't get pick..

HTML: How to create a DIV with only vertical scroll-bars for long paragraphs?

I want to show terms and condition note on my website. I dont want to use text field and also dont want to use my whole page. I just want to display my text in selected area and want to use only verti..

How to change the ROOT application?

I'm trying to change the default application of a Tomcat 6 webserver to a different application than "ROOT" (inside webapps folder). What is the best way to do this?..

how to modify the size of a column

I created the table Test_Project2 in Oracle SQL Developer. After that I realized that the column proj_name is of a small size, so I decided to modify the column using the follwoing statement ALTER TA..

How to fit in an image inside span tag?

I have an image inside a span tag. But the problem is the image doesn't fit inside the span tag. Instead a part of the image goes out of the span tag. <span style="padding-right:3px; padd..

Specifying a custom DateTime format when serializing with Json.Net

I am developing an API to expose some data using ASP.NET Web API. In one of the API, the client wants us to expose the date in yyyy-MM-dd format. I don't want to change the global settings (e.g. Glob..

How do I filter query objects by date range in Django?

I've got a field in one model like: class Sample(models.Model): date = fields.DateField(auto_now=False) Now, I need to filter the objects by a date range. How do I filter all the objects that ..

How to hide Table Row Overflow?

I have some html tables where the textual data is too large to fit. So, it expands the cell vertically to accommodate for this. So now rows that have the overflow are twice as tall as rows with smal..

TypeError: a bytes-like object is required, not 'str' in python and CSV

TypeError: a bytes-like object is required, not 'str' getting above error while Executing below python code to save the HTML table data in Csv file. don't know how to get rideup.pls help me. im..

File path for project files?

I am working on a media player in C# but when I want to make my test I have a problem. I have to create a new object song with the following path: @"C:\Users\Jesus Antonio\Desktop\JukeboxV2.0\Jukebo..

How to create a JSON object

I am trying to create an JSON object out of a PHP array. The array looks like this: $post_data = array('item_type_id' => $item_type, 'string_key' => $string_key, 'string_value' => $s..

Use bash to find first folder name that contains a string

I would like to do this in Bash: in the current directory, find the first folder that contains "foo" in the name I've been playing around with the find command, but a little confused. Any suggesti..

How to run only one task in ansible playbook?

Is there a way to only run one task in ansible playbook? For example, in roles/hadoop_primary/tasks/hadoop_master.yml. I have "start hadoop job tracker services" task. Can I just run that o..

excel VBA run macro automatically whenever a cell is changed

Is there a simple way to get Excel to automatically execute a macro whenever a cell is changed? The cell in question would be in Worksheet("BigBoard").Range("D2") What I thought would be a simple Go..

Insert an item into sorted list in Python

I'm creating a class where one of the methods inserts a new item into the sorted list. The item is inserted in the corrected (sorted) position in the sorted list. I'm not allowed to use any built-in l..

How can I convert a string to an int in Python?

The output I'm getting for my little example app is the following: Welcome to the Calculator! Please choose what you'd like to do: 0: Addition 1: Subtraction 2: Multiplication 3: Division 4: Quit App..

Oracle: SQL select date with timestamp

I have the following data: SQL> select * from booking_session; BK_ID|BK_DATE -----|------------------------- 1|18-MAR-12 10.00.00.000000 2|18-MAR-12 10.25.00.000000 3|18-MAR-12 10.30...

If file exists then delete the file

I have a vbscript that is used to rename files. What I need to implement into the script is something that deletes the "new file" if it already exists. For example: I have a batch of files that are ..

Redeploy alternatives to JRebel

JRebel allows for newly compiled code to be redeployed without restarting the application. I am wondering if there are any alternative (free?). The FAQ page answers this question, but I am sure it'..

IndentationError: unindent does not match any outer indentation level

When I compile the Python code below, I get IndentationError: unindent does not match any outer indentation level import sys def Factorial(n): # Return factorial result = 1 for i in ..

Why is it OK to return a 'vector' from a function?

Please consider this code. I have seen this type of code several times. words is a local vector. How is it possible to return it from a function? Can we guarantee it will not die? std::vector<st..

Maven error in eclipse (pom.xml) : Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4

I wanna make web project using the Maven to import automatically all libraries that I need, so I chose "maven-archetype-webpp" after that I got this error on pom.xml file : Description Resource Pat..

How to add text to a WPF Label in code?

I feel stupid but cannot find out how to add a text to a WPF Label control in code. Like following for a TextBlock: DesrTextBlock.Text = "some text"; What is equivalent property in Label for doing ..

Should I initialize variable within constructor or outside constructor

When I use Java based on my C++ knowledge, I love to initialize variable using the following way. public class ME { private int i; public ME() { this.i = 100; } } After some t..

How to return value from function which has Observable subscription inside?

I dont know how to extract value from Observable to be returned by function in which Observable is present. I need just a value from it to be returned, nothing else. Current version which works func..

In Java how does one turn a String into a char or a char into a String?

Is there a way to turn a char into a String or a String with one letter into a char (like how you can turn an int into a double and a double into an int)? (please link to the relevant documentation if..

How to SELECT based on value of another SELECT

I have a table that looks something like this: Name Year Value A 2000 5 A 2001 3 A 2002 7 A 2003 1 B 2000 6 B 2001 1 B 2002 8..

How to set ChartJS Y axis title?

I am using Chartjs for showing diagrams and I need to set title of y axis, but there are no information about it in documentation. I need y axis to be set like on picture, or on top of y axis so som..

How to customize <input type="file">?

Is it possible to change the appearance of <input type="file">? ..

Can someone explain how to append an element to an array in C programming?

If I want to append a number to an array initialized to int, how can I do that? int arr[10] = {0, 5, 3, 64}; arr[] += 5; //Is this it?, it's not working for me... I want {0,5, 3, 64, 5} in the end...

How to remove border from specific PrimeFaces p:panelGrid?

I have difficulty in removing border from a specific PrimeFaces <p:panelGrid>. <p:panelGrid styleClass="companyHeaderGrid"> <p:row> <p:column> Some tag..

Background service with location listener in android

I am creating a background service that will run in its own process. It should allow me to listen if the device location has changed. I should be able to change criteria like the distance moved befor..

Regex that accepts only numbers (0-9) and NO characters

I need a regex that will accept only digits from 0-9 and nothing else. No letters, no characters. I thought this would work: ^[0-9] or even \d+ but these are accepting the characters : ^,$,(,)..

Excel VBA calling sub from another sub with multiple inputs, outputs of different sizes

I would like to call a sub from another sub inside in the same module. The first sub would be my main code and there I would call the second subroutine. Second subroutine receives multiple inputs as i..

How to iterate through a list of objects in C++

I'm very new to C++ and struggling to figure out how I should iterate through a list of objects and access there members. I've been trying this where data is the list and student a class. std::list&..

Quotation marks inside a string

I need some help from you guys. I have a string name = "john" But I want to save this String name as "john", including ""(quotations) String name = ""john""; String name1 = "[john]" Can some one ..

Generating random strings with T-SQL

If you wanted to generate a pseudorandom alphanumeric string using T-SQL, how would you do it? How would you exclude characters like dollar signs, dashes, and slashes from it?..

PowerShell equivalent to grep -f

I'm looking for the PowerShell equivalent to grep --file=filename. If you don't know grep, filename is a text file where each line has a regular expression pattern you want to match. Maybe I'm missin..

How can I shrink the drawable on a button?

how can I make the drawable on a button smaller? The icon is too big, actually higher than the button. This is the code I am using: <Button android:background="@drawable/red_button" an..

Tomcat Server Error - Port 8080 already in use

I received the following error while attempting to execute a Servlet program in Eclipse Mars EE. 'Starting Tomcat v8.0 Sever at localhost' has encountered a problem. Port 8080 required by To..

Difference between "this" and"super" keywords in Java

What is the difference between the keywords this and super? Both are used to access constructors of class right? Can any of you explain?..

Vagrant error : Failed to mount folders in Linux guest

I have some issues with Vagrant shared folders, my base system is Ubuntu 13.10 desktop. I do not understand why I have this error is something that is not right configured ? Is a NFS issue or Virtual..

How to calculate the IP range when the IP address and the netmask is given?

When a IP-Range is written as aaa.bbb.ccc.ddd/netmask (CIDR Notation) I need to calculate the first and the last included ip address in this range with C#. Example: Input: 192.168.0.1/25 Result: 19..

How do I read input character-by-character in Java?

I am used to the c-style getchar(), but it seems like there is nothing comparable for java. I am building a lexical analyzer, and I need to read in the input character by character. I know I can use ..

Trying to fire the onload event on script tag

I'm trying to load a set of scripts in order, but the onload event isn't firing for me. var scripts = [ '//cdnjs.cloudflare.com/ajax/libs/less.js/1.3.3/less.min.js', '//cdnjs.clou..

Loading a .json file into c# program

I am trying to move my website from XML based config files to JSON based ones. Is there a way to load in a .json file in so that it turns into the object? I have been searching the web and I cannot fi..

C++ program converts fahrenheit to celsius

Can someone help me understand why this gives an output of 0? #include <iostream> using namespace std; int main() { ..

How to set cellpadding and cellspacing in table with CSS?

Can someone tell me how to change table cellpadding and cellspacing like you can do it in html with: <table cellspacing="0" cellpadding="0"> But how is it done with css?..

Add item to array in VBScript

How do you add an item to an existing array in VBScript? Is there a VBScript equivalent to the push function in Javascript? i.e. myArray has three items, "Apples", "Oranges", and "Bananas" and I wa..

How do I make a composite key with SQL Server Management Studio?

How do I make a composite key with SQL Server Management Studio? I want two INT columns to form the identity (unique) for a table..

How to Make A Chevron Arrow Using CSS?

Ok, so everyone knows you can make a triangle using this: #triangle { width: 0; height: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; border-bottom:..

Obtaining only the filename when using OpenFileDialog property "FileName"

I am trying to include only the filename of the file I've selected in the OpenFileDialog in the label1.Text property, but I haven't found a solution yet. I know I could use a method from the string cl..

Automatically create an Enum based on values in a database lookup table?

How do I automatically create an enum and subsequently use its values in C# based on values in a database lookup table (using enterprise library data layer)? For example, If I add a new lookup value ..

How can one print a size_t variable portably using the printf family?

I have a variable of type size_t, and I want to print it using printf(). What format specifier do I use to print it portably? In 32-bit machine, %u seems right. I compiled with g++ -g -W -Wall -Werr..

Why is it common to put CSRF prevention tokens in cookies?

I'm trying to understand the whole issue with CSRF and appropriate ways to prevent it. (Resources I've read, understand, and agree with: OWASP CSRF Prevention CHeat Sheet, Questions about CSRF.) As I..

How do I cancel an HTTP fetch() request?

There is a new API for making requests from JavaScript: fetch(). Is there any built in mechanism for canceling these requests in-flight?..

How to transfer data from JSP to servlet when submitting HTML form

I have a JSP page with an HTML form: <form action="SERVLET"> <input type="text" name="name"/><br> <input type="text" name="group"/> <input type="text" n..

{"<user xmlns=''> was not expected.} Deserializing Twitter XML

I'm pulling in the XML from Twitter via OAuth. I'm doing a request to http://twitter.com/account/verify_credentials.xml, which returns the following XML: <?xml version="1.0" encoding=&quo..

Android Camera Preview Stretched

I've been working on making my custom camera activity on Android, but when rotating the camera, the aspect ratio of the surface view gets messed up. In my oncreate for the activity, I set the framela..

Import/Index a JSON file into Elasticsearch

I am new to Elasticsearch and have been entering data manually up until this point. For example I've done something like this: $ curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{ "user" : ..

jquery UI dialog: how to initialize without a title bar?

Is it possible to open a jQuery UI Dialog without a title bar?..

How to determine whether a year is a leap year?

I am trying to make a simple calculator to determine whether or not a certain year is a leap year. By definition, a leap year is divisible by four, but not by one hundred, unless it is divisible by ..

Why is this program erroneously rejected by three C++ compilers?

I am having some difficulty compiling a C++ program that I've written. This program is very simple and, to the best of my knowledge, conforms to all the rules set forth in the C++ Standard. I've rea..

How to sum data.frame column values?

I have a data frame with several columns; some numeric and some character. How to compute the sum of a specific column? I’ve googled for this and I see numerous functions (sum, cumsum, rowsum, rowS..

LINQ extension methods - Any() vs. Where() vs. Exists()

Unfortunately the names of these methods make terrible search terms, and I've been unable to find a good resource that explains the difference between these methods--as in when to use each. Thanks. ..

When should an IllegalArgumentException be thrown?

I'm worried that this is a runtime exception so it should probably be used sparingly. Standard use case: void setPercentage(int pct) { if( pct < 0 || pct > 100) { throw new Illegal..

Where does SVN client store user authentication data?

I am trying to simulate a problem we have with a particular domain ID which has issues accessing a subversion repository. Towards this, I tried a svn checkout with the option --username domain\proble..

Compiling/Executing a C# Source File in Command Prompt

How do you compile and execute a .cs file from a command-prompt window?..

What is the best way to repeatedly execute a function every x seconds?

I want to repeatedly execute a function in Python every 60 seconds forever (just like an NSTimer in Objective C). This code will run as a daemon and is effectively like calling the python script every..

Why is it string.join(list) instead of list.join(string)?

This has always confused me. It seems like this would be nicer: my_list = ["Hello", "world"] print(my_list.join("-")) # Produce: "Hello-world" Than this: my_list = ["Hello", "world"] print("-".joi..

Custom Python list sorting

I was refactoring some old code of mine and came across of this: alist.sort(cmp_items) def cmp_items(a, b): if a.foo > b.foo: return 1 elif a.foo == b.foo: return 0 el..

How to remove a TFS Workspace Mapping?

I had a project in tfs within a team project then we moved the project to a different location in another team project. I had configured Jenkins to connect to the team project and build my solution b..

submit a form in a new tab

I'd like (just to test some functions, after I'll avoid this behaviour) to load the page called by submit on a new tab : is it possible?..

Use CSS3 transitions with gradient backgrounds

I'm trying to transition on hover with css over a thumbnail so that on hover, the background gradient fades in. The transition isn't working, but if I simply change it to an rgba() value, it works fin..

How to bundle vendor scripts separately and require them as needed with Webpack?

I'm trying to do something that I believe should be possible, but I really can't understand how to do it just from the webpack documentation. I am writing a JavaScript library with several modules th..

How to find out if an item is present in a std::vector?

All I want to do is to check whether an element exists in the vector or not, so I can deal with each case. if ( item_present ) do_this(); else do_that(); ..

jQuery Datepicker onchange event issue

I have a JS code in which when you change a field it calls a search routine. The problem is that I can't find any jQuery events that will fire when the Datepicker updates the input field. For some re..

How to pass parameters in GET requests with jQuery

How should I be passing query string values in a jQuery Ajax request? I currently do them as follows but I'm sure there is a cleaner way that does not require me to encode manually. $.ajax({ url:..

How do you find the current user in a Windows environment?

When running a command-line script, is it possible to get the name of the current user?..

What's the difference between compiled and interpreted language?

After reading some material on this subject I'm still not sure what the difference between a compiled language and an interpreted language is. I was told this is one of the differences between Java an..

Updating Python on Mac

I wanted to update my python 2.6.1 to 3.x on mac but i was wondering if its possible to do it using terminal or i have to download the installer from python website? The reason why i am asking this ..

Best Free Text Editor Supporting *More Than* 4GB Files?

I am looking for a text editor that will be able to load a 4+ Gigabyte file into it. Textpad doesn't work. I own a copy of it and have been to its support site, it just doesn't do it. Maybe I need ..

Oracle SQL convert date format from DD-Mon-YY to YYYYMM

I have a to compare dates in 2 tables but the problem is that one table has the date in DD-Mon-YY format and the other in YYYYMM format. I need to make both of them YYYYMM for the comparison. I need..

Random record from MongoDB

I am looking to get a random record from a huge (100 million record) mongodb. What is the fastest and most efficient way to do so? The data is already there and there are no field in which I can gene..

Add hover text without javascript like we hover on a user's reputation

In stackoverflow, when we hover on a user's reputation we see a text. I have seen this at many places and the source code tells me that it can be done without js. And i tried and got only this- <..

Suppress command line output

I have a simple batch file like this: echo off taskkill /im "test.exe" /f > nul pause If "test.exe" is not running, I get this message: ERROR: The process "test.exe" not found. Why does this..

Get class list for element with jQuery

Is there a way in jQuery to loop through or assign to an array all of the classes that are assigned to an element? ex. <div class="Lorem ipsum dolor_spec sit amet">Hello World!</div> I..

Difference between string and text in rails?

I'm making a new web app using Rails, and was wondering, what's the difference between string and text? And when should each be used?..

Get the IP address of the machine

This Question is almost the same as the previously asked Get the IP Address of local computer-Question. However I need to find the IP address(es) of a Linux Machine. So: How do I - programmatically i..

Redis - Connect to Remote Server

I've just install Redis succesfully using the instructions on the Quick Start guide on http://redis.io/topics/quickstart on my Ubuntu 10.10 server. I'm running the service as dameon (so it can be run..

SQL Server Script to create a new user

I want to write a script to create a admin user ( with abcd password ) in SQL Server Express. Also I want to assign this user admin full rights...

Conversion failed when converting the varchar value 'simple, ' to data type int

I am struggling for a few days with this issue and I can't figure out how can I fix it. I would like to group by my table on values 1,2,3,4,5 so I have created a temporary table with this values. No..

Can you style html form buttons with css?

I don't like the default button style. It's really boring. I am using <input type="submit"> type buttons. Can I style these somehow in css? If not, the other way of doing it i guess would be..

How to remove all leading zeroes in a string

If I have a string 00020300504 00000234892839 000239074 how can I get rid of the leading zeroes so that I will only have this 20300504 234892839 239074 note that the number above was generated r..

Check if option is selected with jQuery, if not select a default

Using jQuery, how do you check if there is an option selected in a select menu, and if not, assign one of the options as selected. (The select is generated with a maze of PHP functions in an app I ju..

JavaScript - get the first day of the week from current date

I need the fastest way to get the first day of the week. For example: today is the 11th of November, and a Thursday; and I want the first day of this week, which is the 8th of November, and a Monday. ..

Multiple HttpPost method in Web API controller

I am starting to use MVC4 Web API project, I have controller with multiple HttpPost methods. The Controller looks like the following: Controller public class VTRoutingController : ApiController { ..

Can I do Android Programming in C++, C?

Can I do Android programming in C++, C? If the answer is "yes" then please tell how? And what's the procedure to set up? I don't know Obj-C, Java, but well-versed in C, C++, Flash AS3, SDK released b..

InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately

Tried to perform REST GET through python requests with the following code and I got error. Code snip: import requests header = {'Authorization': 'Bearer...'} url = az_base_url + az_subscription_id +..

How to Import Excel file into mysql Database from PHP

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

How to find the UpgradeCode and ProductCode of an installed application in Windows 7

I have an application installed on my machine. I also have its source code but somehow the ProductCode and UpgradeCode of this application were changed. Now I want to get the UpgradeCode and ProductC..

How to save Excel Workbook to Desktop regardless of user?

I have an Excel Workbook that on Form Button click I need to save a copy of the workbook to the user's Desktop. Originally everything was going to be on a shared Network folder, but now I have about ..

How can bcrypt have built-in salts?

Coda Hale's article "How To Safely Store a Password" claims that: bcrypt has salts built-in to prevent rainbow table attacks. He cites this paper, which says that in OpenBSD's implementati..

Strip HTML from strings in Python

from mechanize import Browser br = Browser() br.open('http://somewebpage') html = br.response().readlines() for line in html: print line When printing a line in an HTML file, I'm trying to find a ..

Reset input value in angular 2

I have the following input field : <input mdInput placeholder="Name" #filterName name="filterName" > I want to clear value on click of clear button : <button (click)="clearFilters()">C..

How to add Certificate Authority file in CentOS 7

I am trying to add certificate Authority (CA) file name - ca.crt to /etc/ssl/certs, for that I followed this article. I copied my ca.crt file to /etc/pki/ca-trust/source/anchors/ and run the command..

type object 'datetime.datetime' has no attribute 'datetime'

I have gotten the following error: type object 'datetime.datetime' has no attribute 'datetime' On the following line: date = datetime.datetime(int(year), int(month), 1) Does anybody know the ..

CSS table column autowidth

Given the following how do i make my last column auto size to its content? (The last column should autosize-width to the content. Suppose i have only 1 li element it should shrink vs. having 3 li elem..

Difference of keywords 'typename' and 'class' in templates?

For templates I have seen both declarations: template < typename T > template < class T > What's the difference? And what exactly do those keywords mean in the following example (take..

PHP multidimensional array search by value

I have an array where I want to search the uid and get the key of the array. Examples Assume we have the following 2-dimensional array: $userdb = array( array( 'uid' => '100', ..

The type java.lang.CharSequence cannot be resolved in package declaration

I get 2 classes in package P. Interface class A and its implementation class B. In the file with class B I get the following error: The type java.lang.CharSequence cannot be resolved. It is indirectl..

What is the simplest way to get indented XML with line breaks from XmlDocument?

When I build XML up from scratch with XmlDocument, the OuterXml property already has everything nicely indented with line breaks. However, if I call LoadXml on some very "compressed" XML (no line bre..

What does an exclamation mark mean in the Swift language?

The Swift Programming Language guide has the following example: class Person { let name: String init(name: String) { self.name = name } var apartment: Apartment? deinit { println("\(..

Keyboard shortcut to "untab" (move a block of code to the left) in eclipse / aptana?

Well, hopefully the question is self-explanatory. It's so easy to select a block of code and tab out, but how about the reverse? Currently, I just search & replace for whitespace at the beginnin..

How to use absolute path in twig functions

I have an application with Symfony2 (2.2). When I want to send a mail, I'm having trouble with the paths, which are all relative paths and obviously aren't working inside emails for rendering the pat..

How do I connect to an MDF database file?

I'm experimenting in connecting a C# app to an MDF database for the first time, and I need a little help .. I made a small MDF database file in Visual Studio 2010, then created another project and im..

How can I add a vertical scrollbar to my div automatically?

I want to add a vertical scrollbar to my <div>. I've tried overflow: auto, but it is not working. I've tested my code in Firefox and Chrome. I'm pasting the div style code here: float: left; ..

How to perform a mysqldump without a password prompt?

I would like to know the command to perform a mysqldump of a database without the prompt for the password. REASON: I would like to run a cron job, which takes a mysqldump of the database once everyda..

Showing all errors and warnings

UPDATE 2: I have now removed the following from the .php file: <?php error_reporting( E_ALL ); ?> I have set display_erros in php.ini as follows: display_errors = On Error reporting is..

MySQL - Select the last inserted row easiest way

I simply need to select the last entered row specified by condition, e.g: SELECT ID from bugs WHERE user=Me I need to return only the very last ID entered by user 'Me'. Is there a simple way to do ..

How to implement a material design circular progress bar in android

I want to make a material design circular progress bar like the one in Inbox by Gmail android app. How do I achieve this (in pre-lollipop devices)? Am trying to achieve a similar effect like this. Inb..

Convert a list to a dictionary in Python

Let's say I have a list a in Python whose entries conveniently map to a dictionary. Each even element represents the key to the dictionary, and the following odd element is the value for example, a ..

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

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

.NET code to send ZPL to Zebra printers

Is there a way to send ZPL (Zebra Programming Language) to a printer in .NET? I have the code to do this in Delphi, but it is not pretty and I would rather not try to recreate it in .NET as it is...

"Cannot verify access to path (C:\inetpub\wwwroot)", when adding a virtual directory

I am trying to set up IIS web services and ASP.NET services on Windows Server 2008 R2. The physical directory was created, but I cannot get it to work. This is a fresh IIS Role installation. The se..

Passing multiple values to a single PowerShell script parameter

I have a script to which I pass server name(s) in $args. This way I can do stuff to this (these) server(s) using foreach: .\script.ps1 host1 host2 host3 foreach ($i in $args) { Do-Stuff $i } ..

Substring with reverse index

How can I extract "456" from "xxx_456" where xxx is of indefinite length?..

Error CS1705: "which has a higher version than referenced assembly"

I've been looking into this for a bit now and haven't gotten it resolved. I get the following error message: Compiler Error Message: CS1705: Assembly 'My.Model, Version=1.1.4422.23773, Culture=neutra..

How to play ringtone/alarm sound in Android

I have been looking everywhere how to play a ringtone/alarm sound in Android. I press a button and I want to play a ringtone/alarm sound. I could not find an easy, straightforward sample. Yes, I alr..

How to get file path from OpenFileDialog and FolderBrowserDialog?

Hey there i started learning C# a few days ago and I'm trying to make a program that copies and pastes files (and replaces if needed) to a selected directory but I don't know how to get the directory ..

How to multiply a BigDecimal by an integer in Java

How do you multiply a BigDecimal by an integer in Java? I tried this but its not correct. import java.math.BigDecimal; import java.math.MathContext; public class Payment { int itemCost; int ..

Centering FontAwesome icons vertically and horizontally

I'm currently using FontAwesome, and am having a really hard time centering the icons both vertically and horizontally in their container. I have tried doing it via positioning and ran into issues bc..

Python: Remove division decimal

I have made a program that divides numbers and then returns the number, But the thing is that when it returns the number it has a decimal like this: 2.0 But I want it to give me: 2 so is there a..

Android Service Stops When App Is Closed

I am starting a service from my main Android activity as follows: final Context context = base.getApplicationContext(); final Intent intent = new Intent(context, MyService.class); startService(intent..

Read XML file into XmlDocument

I am very new to C#. I have XML file (text.xml). I want to read that in XmlDocument and store the stream in string variable...

Single vs double quotes in JSON

My code: import simplejson as json s = "{'username':'dfdsfdsf'}" #1 #s = '{"username":"dfdsfdsf"}' #2 j = json.loads(s) #1 definition is wrong #2 definition is right I heard that in Python that ..