Questions Tagged with #Sharpdevelop

SharpDevelop (also styled as #develop) is a free and open source integrated development environment IDE for the Microsoft .NET, Mono, Gtk# and Glade# platforms, and supports development in C#, Visual Basic .NET, Boo, F#, IronPython and IronRuby programming languages.

Unable to connect to any of the specified mysql hosts. C# MySQL

I am getting the above error when I execute the code - MySqlConnection mysqlConn=new MySqlConnection("server=;uid=pankaj;port=3306;pwd=master;database=patholabs;"); mysqlConn.Open();..

C# - Fill a combo box with a DataTable

I'm used to work with Java where large amounts of examples are available. For various reasons I had to switch to C# and trying to do the following in SharpDevelop: // Form has a menu containing a com..

How to dynamically add a style for text-align using jQuery

I'm trying to correct the usual IE bugs around CSS 2.1 and need a way to alter an elements style properties to add a custom text-align style. Currently in jQuery you can do something like $(this).wi..

How to add screenshot to READMEs in github repository?

Is it possible to place a screenshot in README file in a GitHub repository? What's the syntax?..

How do I configure Maven for offline development?

Does maven require a connection to the internet at some point to be able to use it? Meaning specifically getting the internal maven plugins for compiling, cleaning, packaging, etc? ..

Swift - Split string over multiple lines

How could I split a string over multiple lines such as below? var text:String = "This is some text over multiple lines" ..

Java regex capturing groups indexes

I have the following line, typeName="ABC:xxxxx;"; I need to fetch the word ABC, I wrote the following code snippet, Pattern pattern4=Pattern.compile("(.*):"); matcher=pattern4.matcher(typeName);..

How to _really_ programmatically change primary and accent color in Android Lollipop?

First of all, this question asks a very similar question. However, my question has a subtle difference. What I'd like to know is whether it is possible to programmatically change the colorPrimary att..

Get current domain

I have my site on the server On this server I have two domains: and I would like to get the current domain using PHP, but if I use $_SERVER['HTTP_HOST'] th..

Java - How do I make a String array with values?

I know how to make an empty array, but how do I make a String array with values from the start?..

Generate a dummy-variable

I have trouble generating the following dummy-variables in R: I'm analyzing yearly time series data (time period 1948-2009). I have two questions: How do I generate a dummy variable for observati..

SQL Server: Error converting data type nvarchar to numeric

If I run the SQL query below; I get the following error: Error converting data type nvarchar to numeric. COLUMNA contains only numbers (negative and positive) including fields with maximal up t..

Passing multiple values for a single parameter in Reporting Services

I have several Multi-Select parameters in my report. I am trying to find a way to pass in multiple values for a single parameter in the web query string? If I pass in a single value, it works fine. T..

Get the week start date and week end date from week number

I have a query that counts member's wedding dates in the database. SELECT SUM(NumberOfBrides) AS [Wedding Count] , DATEPART( wk, WeddingDate) AS [Week Number] , DATEPART( year, WeddingDate) AS ..

.Net: How do I find the .NET version?

How do I find out which version of .NET is installed? I'm looking for something as simple as "java -version" that I can type at the command prompt and that tells me the current version(s) installed. ..

Rails - How to use a Helper Inside a Controller

While I realize you are supposed to use a helper inside a view, I need a helper in my controller as I'm building a JSON object to return. It goes a little like this: def xxxxx @comments =

Regular expression to extract URL from an HTML link

I’m a newbie in Python. I’m learning regexes, but I need help here. Here comes the HTML source: <a href="" target="_blank"></a> I’m trying to ..

Can grep show only words that match search pattern?

Is there a way to make grep output "words" from files that match the search expression? If I want to find all the instances of, say, "th" in a number of files, I can do: grep "th" * but the output..

How to use classes from .jar files?

I read the Java tutorials on Sun for JAR files, but I still can't find a solution for my problem. I need to use a class from a jar file called jtwitter.jar, I downloaded the file, and tried executing ..

Is there a way to delete created variables, functions, etc from the memory of the interpreter?

I've been searching for the accurate answer to this question for a couple of days now but haven't got anything good. I'm not a complete beginner in programming, but not yet even on the intermediate le..

Batch file to run a command in cmd within a directory

I want to have a batch file(must be placed on desktop) which does the following; opens cmd navigates to a directory, e.g. C:\activiti-5.9\setup runs a command within the directory, e.g. ant demo.sta..

How do I check if a number is positive or negative in C#?

How do I check if a number is positive or negative in C#?..

Get ASCII value at input word

I have a character: char ch='A' Give me method which converts char to ASCII or way which returns a ASCII NUMBER. Output : 65..

Delete an element in a JSON object

I am trying to loop through a list of objects deleting an element from each object. Each object is a new line. I am trying to then save the new file as is without the element contained within the obje..

How to set border's thickness in percentages?

How to set border-width of an element in percentages? I tried the syntax border-width:10%; But it doesn't work. The reason I want to set border-width in percentages is I have an element with width..

Read the current full URL with React?

How do I get the full URL from within a ReactJS component? I'm thinking it should be something like this.props.location but it is undefined..

Weird PHP error: 'Can't use function return value in write context'

I'm getting this error and I can't make head or tail of it. The exact error message is: Fatal error: Can't use function return value in write context in /home/curricle/public_html/descarga/in..

How can I load webpage content into a div on page load?

Without using iframes, is it possible to load the contents of <div id="siteloader"></div> With an external site e.g. When the page loads? - I know how to load contents..

How to get complete address from latitude and longitude?

I want to get following values from Latitude and Longitude in android Street Address City / State Zip Complete Address How to achieve this?..

jquery - Click event not working for dynamically created button

My requirement is to create number of buttons equal to the json array count. I was successful in creating buttons dynamically in jquery. But the method in .ready function of jquery is not called for t..

Handling the TAB character in Java

I'm going through a configuration file with a RandomAccessFile reader. I have a configuration option which is one (1) tab away from the start of the line. When my reader gets this line, would I be abl..

Copy data from one column to other column (which is in a different table)

I want to copy data from one column to another column of other table. How can I do that? I tried the following: Update tblindiantime Set CountryName =(Select contacts.BusinessCountry From contacts) ..

What is the best way to create and populate a numbers table?

I've seen many different ways to create and populate a numbers table. However, what is the best way to create and populate one? With "best" being defined from most to least important: Table create..

How can I center an image in Bootstrap?

I am struggling to center an image using only Bootstrap's CSS-classes. I already tried several things. One was adding Bootstrap CSS-class mx-auto to the img element, but it does nothing. Help is appr..

HTML5 image icon to input placeholder

I'd like to add an image icon to an input placeholder, like in this picture: Please note that this is a placeholder, so when the user starts typing, the icon also disappears. I came with the follow..

creating triggers for After Insert, After Update and After Delete in SQL

I am trying to create a trigger each time after data is inserted, updated or deleted. The trigger for inserting is working fine but i am having some issues with the Update and Delete. Here is After ..

Dead simple example of using Multiprocessing Queue, Pool and Locking

I tried to read the documentation at but I'm still struggling with multiprocessing Queue, Pool and Locking. And for now I was able to build the..

How to watch for form changes in Angular

In Angular, I might have a form that looks like this: <ng-form> <label>First Name</label> <input type="text" ng-model="model.first_name"> <label>Last Name&l..

sendmail: how to configure sendmail on ubuntu?

When I searched for configuring sendmail on ubuntu I din't get any clear answer, each of them assume I know what they are talking about, I just want basic configuration to enable email sending, basic..

Java: how to initialize String[]?

Error % javac variable errorSoon might not have been initialized errorSoon[0] = "Error, why?"; Code public class StringTest { public static voi..

How does one generate a random number in Apple's Swift language?

I realize the Swift book provided an implementation of a random number generator. Is the best practice to copy and paste this implementation in one's own program? Or is there a library that does thi..

jQuery issue - #<an Object> has no method

I've tried a veriety of jQuery plugins recently and I keep getting this error … (source: … regardless of what plugin I try to use. I've checked the links to the JS files w..

Invalid character in identifier

I am working on the letter distribution problem from HP code wars 2012. I keep getting an error message that says "invalid character in identifier". What does this mean and how can it be fix..

TypeError: $.browser is undefined

I am using msdropdown image combo box to create dropdown select options. when i run this code locally on my PC, everything works great. But when i run it on go daddy servers, the msdropdown becomes d..

What is the difference between dim and set in vba

Pardon me as am a newbie in VBA. Sometimes I use Dim r as Range r = Range("A1") Other times I use Set r = Range("A1") What is the difference? And when should I use what?..

To the power of in C?

So in python, all I have to do is print(3**4) Which gives me 81 How do I do this in C? I searched a bit and say the exp() function, but have no clue how to use it, thanks in advance..

Java variable number or arguments for a method

Is it possible to declare a method that will allow a variable number of parameters ? What is the symbolism used in the definition that indicate that the method should allow a variable number of param..

Deserializing a JSON file with JavaScriptSerializer()

the json file's structure which I will deserialize looks like below; { "id" : "1lad07", "text" : "test", "url" : "http:\/\/\/1lacuz", "width" : 220, "height" : 84, ..

Convert XML to JSON (and back) using Javascript

How would you convert from XML to JSON and then back to XML? The following tools work quite well, but aren't completely consistent: xml2json Has anyone encountered this situation before?..

MongoDb shuts down with Code 100

I followed the MongoDb Docs to setup my first MongoDb, When I start MongoDB using the command C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe I get the following error ..

Python sockets error TypeError: a bytes-like object is required, not 'str' with send function

I am trying to create a program that will open a port on the local machine and let others connect into it via netcat. My current code is. s = socket.socket() host = '' port = 12345 s.bind((h..

Adding an identity to an existing column

I need to change the primary key of a table to an identity column, and there's already a number of rows in table. I've got a script to clean up the IDs to ensure they're sequential starting at 1, wo..

Pandas - Get first row value of a given column

This seems like a ridiculously easy question... but I'm not seeing the easy answer I was expecting. So, how do I get the value at an nth row of a given column in Pandas? (I am particularly interested..

How do I download a file with Angular2 or greater

I have a WebApi / MVC app for which I am developing an angular2 client (to replace MVC). I am having some troubles understanding how Angular saves a file. The request is ok (works fine with MVC, and ..

Telnet is not recognized as internal or external command

I am trying to perform port forwarding to connect two emulators using TCP protocol on Windows. Although I have enabled TCP client program from control Panel, "telnet" command is not recognized in Comm..

MySQL count occurrences greater than 2

I have the following table structure + id + word + +------+--------+ The table gets filled with the words in lower cas of a given text, so the text Hello bye hello would result in + id + ..

How do you get the string length in a batch file?

There doesn't appear to be an easy way to get the length of a string in a batch file. E.g., SET MY_STRING=abcdefg SET /A MY_STRING_LEN=??? How would I find the string length of MY_STRING? Bonus p..

C# how to create a Guid value?

One field of our struct is Guid type. How to generate a valid value for it?.. - <customErrors mode="Off"/> error when trying to access working webpage

I have created an webpage and have uploaded it onto a webserver. However when I try to view the page remotely, I get errors about the customerror tag in the web.config file. The page works loc..

jQuery Validate - Enable validation for hidden fields

In the new version of jQuery validation plugin 1.9 by default validation of hidden fields ignored. I'm using CKEditor for textarea input field and it hides the field and replace it with iframe. The fi..

SQL Views - no variables?

Is it possible to declare a variable within a View? For example: Declare @SomeVar varchar(8) = 'something' gives me the syntax error: Incorrect syntax near the keyword 'Declare'. ..

Mongoose and multiple database in single node.js project

I'm doing a Node.js project that contains sub projects. One sub project will have one Mongodb database and Mongoose will be use for wrapping and querying db. But the problem is Mongoose doesn't all..

drag drop files into standard html file input

These days we can drag & drop files into a special container and upload them with XHR 2. Many at a time. With live progress bars etc. Very cool stuff. Example here. But sometimes we don't want th..

How to automate drag & drop functionality using Selenium WebDriver Java

How to automate drag & drop functionality using Selenium WebDriver in java?..

What's the difference between an id and a class?

What's the difference between <div class=""> and <div id=""> when it comes to CSS? Is it alright to use <div id="">? I see different developers doing this in both ways, and since I'..

StringIO in Python3

I am using Python 3.2.1 and I can't import the StringIO module. I use io.StringIO and it works, but I can't use it with numpy's genfromtxt like this: x="1 3\n 4.5 8" numpy.genfromtxt(io.Stri..

Create a simple Login page using eclipse and mysql

I have created a simple login page in which user will give an username and password. After clicking on submit button it will show welcome user. But it is not giving any result This is my index page ..

ERROR Source option 1.5 is no longer supported. Use 1.6 or later

It all happens when I was trying to build a springboot application by ./mvnw clean install When I first run the install command, it runs into following problem. [INFO] ------------------------------..

SQL for ordering by number - 1,2,3,4 etc instead of 1,10,11,12

I’m attempting to order by a number column in my database which has values 1-999 When I use ORDER_BY registration_no ASC I get…. 1 101 102 103 104 105 106 107 108 109 11 110 Etc… So it a..

How can I scale an image in a CSS sprite

In this article,, it talks about how can I crop off a smaller image from 1 bigger image. Can you please tell me if it is possible/how I can crop off a smaller image..

Visual Studio Code - Target of URI doesn't exist 'package:flutter/material.dart'

I've just setup my Macbook for flutter development, So I downloaded flutter sdk, and placed it in my Documents. After, I setup my path variable to work with flutter in my command line. I execute th..

jQuery 'input' event

I've never heard of an event in jQuery called input till I saw this jsfiddle. Do you know why it's working? Is it an alias for keyup or something? $(document).on('input', 'input:text', function() {}..

How can I check if an array contains a specific value in php?

I have a PHP variable of type Array and I would like find out if it contains a specific value and let the user know that it is there. This is my array: Array ( [0] => kitchen [1] => bedroom [2]..

NullPointerException in Java with no StackTrace

I've had instances of our Java code catch a NullPointerException, but when I try to log the StackTrace (which basically ends up calling Throwable.printStackTrace() ), all I get is: java.lang.NullPoin..

Python subprocess.Popen "OSError: [Errno 12] Cannot allocate memory"

Note: This question was originally asked here but the bounty time expired even though an acceptable answer was not actually found. I am re-asking this question including all details provided in the or..

How to Calculate Execution Time of a Code Snippet in C++

I have to compute execution time of a C++ code snippet in seconds. It must be working either on Windows or Unix machines. I use code the following code to do this. (import before) clock_t startTime..

Removing "http://" from a string

I have a PHP script that removes the "http://" from user input url strings. My Script: $url= ""; $url = str_replace('http://', '', $url); Result: $url= techcrunch.c..

sass css: target parent class from child

I am using sass and found a problem. This is an example of what I am trying to do: .message-error { background-color: red; p& { background-color: yellow } } Expected cs..

How can I get the source code of a Python function?

Suppose I have a Python function as defined below: def foo(arg1,arg2): #do something with args a = arg1 + arg2 return a I can get the name of the function using foo.func_name. How can I..

How may I reference the script tag that loaded the currently-executing script?

How can I reference the script element that loaded the javascript that is currently running? Here's the situation. I have a "master" script being loaded high in the page, first thing under the HEAD t..

Creating default object from empty value in PHP?

I see this error only after upgrading my PHP environment to PHP 5.4 and beyond. The error points to this line of code: Error: Creating default object from empty value Code: $res->success = ..

Reading value from console, interactively

I thought to make an simple server http server with some console extension. I found the snippet to read from command line data. var i = rl.createInterface(process.stdin, process.stdout, null); i...

show/hide html table columns using css

I want to display a basic html table with controls to toggle showing/hiding of additional columns: <table id="mytable"> <tr> <th>Column 1</th> <th class..

How to change the project in GCP using CLI commands

How can i change the current running project to another project in GCP (Google Cloud Platform) account using cli commands other than using gcloud init manually. $gcloud projects list will list the pr..

What's the difference between Visual Studio Community and other, paid versions?

What's missing in Visual Studio Community 2015? They say it's full-featured and free, but if that's the case, then why do/will they still sell Visual Studio Ultimate 2015 or Visual Studio Enterprise 2..

Mongoose: findOneAndUpdate doesn't return updated document

Below is my code var mongoose = require('mongoose'); mongoose.connect('mongodb://localhost/test'); var Cat = mongoose.model('Cat', { name: String, age: {type: Number, default: 20}, creat..

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

What are the differences between the BLOB and TEXT datatypes in MySQL?

What is blob and what is text? What are the differences? When do I need to use blob and when do I need text as data type? Because for blob and text, there are mediumblob == mediumtext, smallblob == ..

How to display loading image while actual image is downloading

Sometimes images take some time to render in the browser. I want to show a busy image while the actual image is downloading, and when the image is downloaded, the busy image is removed and the actual ..

How to convert an array of key-value tuples into an object

I have an array: [ [ 'cardType', 'iDEBIT' ], [ 'txnAmount', '17.64' ], [ 'txnId', '20181' ], [ 'txnType', 'Purchase' ], [ 'txnDate', '2015/08/13 21:50:04' ], [ 'respCode', '0' ], [ 'isoC..

Combining two expressions (Expression<Func<T, bool>>)

I have two expressions of type Expression<Func<T, bool>> and I want to take to OR, AND or NOT of these and get a new expression of the same type Expression<Func<T, bool>> expr..

How to save CSS changes of Styles panel of Chrome Developer Tools?

How to save CSS changes of Styles panel of Google Chrome Developer Tools? At tool's website it's mentioned that we can see all change in resource panel But I'm working locally on a CSS file but c..

What .NET collection provides the fastest search

I have 60k items that need to be checked against a 20k lookup list. Is there a collection object (like List, HashTable) that provides an exceptionly fast Contains() method? Or will I have to write my ..

Scanner is skipping nextLine() after using next() or nextFoo()?

I am using the Scanner methods nextInt() and nextLine() for reading input. It looks like this: System.out.println("Enter numerical value"); int option; option = input.nextInt(); // Read numeric..

Rename a table in MySQL

Renaming a table is not working in MySQL RENAME TABLE group TO member; The error message is #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL se..

jQuery click events firing multiple times

I'm attempting to write a video poker game in Javascript as a way of getting the basics of it down, and I've run into a problem where the jQuery click event handlers are firing multiple times. They'r..

Installing mysql-python on Centos

I'm trying to get the MySQL-python lib installed on centos 5.5. I ran sudo yum install MySQL-python but then when I tried: import MySQLdb I get this error: Traceback (most recent call last): ..

Node.js - get raw request body using Express

When I use Express, and my code is: app.use(express.bodyParser()); How would I get the raw request body?..

Convert list of ints to one number?

I have a list of integers that I would like to convert to one number like: numList = [1, 2, 3] num = magic(numList) print num, type(num) >>> 123, <type 'int'> What is the best way t..

Add a row number to result set of a SQL query

I have a simple select statement. I want to add a temporary column which will number the rows in my result set. I tried this - declare @num int set @num = 0; select t.A, t.B, t.C, (@count + 1) as nu..

How to connect a Windows Mobile PDA to Windows 10

Does anyone know how I can get a Windows Mobile 6.5 PDA to connect up to a Windows 10 PC? Before upgrading the PC from Window 8.1 I was able to use Windows Mobile Device Center to link up to the PDA ..

how to check if item is selected from a comboBox in C#

I'm pretty new here. I have a form, and want to check if the user filled it in correctly. In the form there's a combo box; how can I build the "if" statement for checking whether the user picked an ..

Align the form to the center in Bootstrap 4

I am trying to align the form to the center and keep it responsive. I have tried several ways but no success. I am trying to center all the text and the form. I am using Bootstrap v4. I am not sure if..

How can I wrap or break long text/word in a fixed width span?

I want to create a span with a fixed width that when I type any thing in the span like <span>lgasdfjksdajgdsglkgsadfasdfadfasdfadsfasdfasddkgjk</span>, a long string of non-spaced text, th..

swift 3.0 Data to String?

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {} I want deviceToken to string but: let str = String.init(data: deviceToken, enc..

Oracle 12c Installation failed to access the temporary location

I have Windows 8.1 64-bit OS running on 64-bit architecture. I am installing a fresh copy of Oracle 12C, means I haven't installed any version before on my system. During the installation, I encounte..

jQuery click events not working in iOS

Second update: Looks like one of my functions (resetFigures) was preventing the event handler, so moving that to the end of the bind function sorted it out. Update: I realized after some basic testin..

String to decimal conversion: dot separation instead of comma

I have a string read from a textbox. It contains a comma for decimal separation. I have NumberFormatInfo.CurrencyDecimalSeparator set to , (comma) but when I convert the string to decimal Convert.ToD..

Defining array with multiple types in TypeScript

I have an array of the form: [ 1, "message" ]. How would I define this in TypeScript?..

What is the correct way to start a mongod service on linux / OS X?

I've installed mongodb and have been able to run it, work with it, do simple DB read / write type stuff. Now I'm trying to set up my Mac to run mongod as a service. I get "Command not found" in resp..

How to stick a footer to bottom in css?

I am having the classic problem for the positioning of a Footer on the bottom of the browser. I've tried methods including but to no good ..

How to validate an e-mail address in swift?

Does anyone know how to validate an e-mail address in Swift? I found this code: - (BOOL) validEmail:(NSString*) emailString { if([emailString length]==0){ return NO; } NSString ..

Is it possible to stop JavaScript execution?

Is it possible in some way to stop or terminate JavaScript in a way that it prevents any further JavaScript-based execution from occuring, without reloading the browser? I am thinking of a JavaScript..

how to convert String into Date time format in JAVA?

How to convert a string in the form of 03/24/2013 21:54 into a Date object in java?..

Getting "NoSuchMethodError: org.hamcrest.Matcher.describeMismatch" when running test in IntelliJ 10.5

I'm using JUnit-dep 4.10 and Hamcrest 1.3.RC2. I've created a custom matcher that looks like the following: public static class MyMatcher extends TypeSafeMatcher<String> { @Override pr..

Writing a dictionary to a csv file with one line for every 'key: value'

I've got a dictionary: mydict = {key1: value_a, key2: value_b, key3: value_c} I want to write the data to a file dict.csv, in this style: key1: value_a key2: value_b key3: value_c I wrote: impo..

how to show progress bar(circle) in an activity having a listview before loading the listview with data

I have a ListView in my second activity.OnItemClick of it I called a webservice and trying to fetch data. And after that I am moving to third activity which also have a ListView having description of ..

How do I get data from a table?

How do I pull data (string) from a column called "Limit" in a table ("displayTable") in Javascript? var table = document.getElementById('displayTable'); var rowCount =

how to inherit Constructor from super class to sub class

How to inherit the constructor from a super class to a sub class?..

Where/How to getIntent().getExtras() in an Android Fragment?

With Activities, I used to do this: In Activity 1: Intent i = new Intent(getApplicationContext(), MyFragmentActivity.class); i.putExtra("name", items.get(arg2)); i.p..

Python PDF library

What Python PDF libraries are there? I need to make some PDF with many grids, and I'm looking for a library that allows to manage pages (multi-page). The library should calculate when the page is end..

How do I delete files programmatically on Android?

I'm on 4.4.2, trying to delete a file (image) via uri. Here's my code: File file = new File(uri.getPath()); boolean deleted = file.delete(); if(!deleted){ boolean deleted2 = file.getCanonicalFi..

How to cut first n and last n columns?

How can I cut off the first n and the last n columns from a tab delimited file? I tried this to cut first n column. But I have no idea to combine first and last n column cut -f 1-10 -d "<CTR>v..

Plot two graphs in same plot in R

I would like to plot y1 and y2 in the same plot. x <- seq(-2, 2, 0.05) y1 <- pnorm(x) y2 <- pnorm(x, 1, 1) plot(x, y1, type = "l", col = "red") plot(x, y2, type = "l", col = "green") But ..

Factory Pattern. When to use factory methods?

When is it a good idea to use factory methods within an object instead of a Factory class?..

How to return data from promise

I need to get the out of the promise so it can be returned by the enclosing function. I know, I probably can't do it the way I've coded it because of normal JavaScript scope. Is there an..

PHP Echo a large block of text

Im new to PHP and I can't figure out what the rules are for using the echo function. For example, if I need to echo a large block of css/js, do I need to add echo to each line of text or is there a wa..

ERROR : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

While connecting .net to sybase server I got this error message: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified This has worked properly before. Syst..

How to create a readonly textbox in ASP.NET MVC3 Razor

How do I create a readonly textbox in ASP.NET MVC3 with the Razor view engine? Is there an HTMLHelper method available to do that? Something like the following? @Html.ReadOnlyTextBoxFor(m => m.u..

Angular 4 HttpClient Query Parameters

I have been looking for a way to pass query parameters into an API call with the new HttpClientModule's HttpClient and have yet to find a solution. With the old Http module you would write something l..

JavaScript: Global variables after Ajax requests

the question is fairly simple and technical: var it_works = false; $.post("some_file.php", '', function(data) { it_works = true; }); alert(it_works); # false (yes, that 'alert' has to be her..

How to generate a create table script for an existing table in phpmyadmin?

How can I generate a create table script for an existing table in phpmyadmin? ..

Retrieving a List from a in Java 8

I was playing around with Java 8 lambdas to easily filter collections. But I did not find a concise way to retrieve the result as a new list within the same statement. Here is my most concise approach..

SQL update from one Table to another based on a ID match

I have a database with account numbers and card numbers. I match these to a file to update any card numbers to the account number, so that I am only working with account numbers. I created a view li..

Manifest Merger failed with multiple errors in Android Studio

So, I am a beginner into Android and Java. I just began learning. While I was experimenting with Intent today, I incurred an error. Error:Execution failed for task ':app:processDebugManifest'. > M..

Bootstrap modal not displaying

I've copied and pasted the example code from twitter bootstrap to create a basic modal window in my Rails 3.2 app: <!-- Modal --> <div id="myModal" class="modal hide fade" tabindex="-1" role..

How can I select random files from a directory in bash?

I have a directory with about 2000 files. How can I select a random sample of N files through using either a bash script or a list of piped commands?..

How to create Drawable from resource

I have an image res/drawable/test.png (R.drawable.test). I want to pass this image to a function which accepts Drawable, e.g. mButton.setCompoundDrawables(). So how can I convert an image resource to..

how to open a page in new tab on button click in

I want to open a page in new tab of browser on button click. I have searched a lot on google but i couldn't find anything. Here is my button. <asp:Button ID="btnNewEntry" runat="Server" CssCl..

Creating a Custom Event

Can a custom event be created for any object method? To do this do I just use the following syntax?: myObject.myMethod +=new EventHandler(myNameEvent); The following code has prompted this question..

How can I remove specific rules from iptables?

I am hosting special HTTP and HTTPS services on the ports 8006 and 8007 respectively. I use iptables to "activate" the server; i.e. to route the incoming HTTP and HTTPS ports: iptables -A INPUT -i et..

What is recursion and when should I use it?

One of the topics that seems to come up regularly on mailing lists and online discussions is the merits (or lack thereof) of doing a Computer Science Degree. An argument that seems to come up time and..

How to check if a specific key is present in a hash or not?

I want to check whether the "user" key is present or not in the session hash. How can I do this? Note that I don't want to check whether the key's value is nil or not. I just want to check whether th..

How can I make my string property nullable?

I want to make the Middle Name of person optional. I have been using code first approach. For integer data type its easy just by using ? operator to make in nullable. I am looking for a way to ..

How to get css background color on <tr> tag to span entire row

I have tried everything I can think of in css in order to get a background color to span an entire table row (<tr> tag) But I keep getting a white border around each cell. CSS (excerpt): /*al..

How can I plot a histogram such that the heights of the bars sum to 1 in matplotlib?

I'd like to plot a normalized histogram from a vector using matplotlib. I tried the following: plt.hist(myarray, normed=True) as well as: plt.hist(myarray, normed=1) but neither option produces..

How to add app icon within phonegap projects?

I created a new phonegap (v 3.0.0-0.14.0) project with default config.xml and then added iOS and Android platforms. The config contains all the paths to all platform icons. I have overwritten the de..

Sorting a vector of custom objects

How does one go about sorting a vector containing custom (i.e. user defined) objects. Probably, standard STL algorithm sort along with a predicate (a function or a function object) which would operate..

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

How to use string.replace() in python 3.x

The string.replace() is deprecated on python 3.x. What is the new way of doing this?..

"unexpected token import" in Nodejs5 and babel?

In js file, i used import to instead of require import co from 'co'; And tried to run it directly by nodejs since it said import is 'shipping features' and support without any runtime flag (https:/..

PostgreSQL create table if not exists

In a MySQL script you can write: CREATE TABLE IF NOT EXISTS foo ...; ... other stuff ... and then you can run the script many times without re-creating the table. How do you do this in PostgreSQL..

Adding Git-Bash to the new Windows Terminal

I'm trying to add a new terminal (Git Bash) to the new Windows Terminal, however I can't get it to work. I tried changing the commandline property in the profiles array to git-bash.exe but no luck. ..

Check if a record exists in the database

I am using these lines of code to check if the record exists or not. SqlCommand check_User_Name = new SqlCommand("SELECT * FROM Table WHERE ([user] = '" + txtBox_UserName.Text + "') ", conn); int Us..

How to Execute a Python File in Notepad ++?

I prefer using Notepad ++ for developing, How do I execute the files in Python through Notepad++?..

Which keycode for escape key with jQuery

I have two functions. When enter is pressed the functions runs correctly but when escape is pressed it doesn't. What's the correct number for the escape key? $(document).keypress(function(e) { ..

Metadata file '.dll' could not be found

I am working on a WPF, C# 3.0 project, and I get this error: Error 1 Metadata file 'WORK=- \Tools\VersionManagementSystem\BusinessLogicLayer\bin\Debug \BusinessLogicLayer.dll' could not be found C:\-..

C read file line by line

I wrote this function to read a line from a file: const char *readLine(FILE *file) { if (file == NULL) { printf("Error: file pointer is null."); exit(1); } int maximumLi..

Java: How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

I have some code that uses JAXB API classes which have been provided as a part of the JDK in Java 6/7/8. When I run the same code with Java 9, at runtime I get errors indicating that JAXB classes can..

Escape double quote character in XML

Is there an escape character for a double quote in xml? I want to write a tag like: <parameter name="Quote = " "> but if I put ", then that means string has ended. I need something like thi..

Convert a positive number to negative in C#

You can convert a negative number to positive like this: int myInt = System.Math.Abs(-5); Is there an equivalent method to make a positive number negative?..

how to toggle attr() in jquery

I have a simple add attribute function: $(".list-toggle").click(function() { $(".list-sort").attr('colspan', 6); }); My question is: how can I turn this into a toggle, so colspan="6" is removed..

Iterate through every file in one directory

How do I write a loop in ruby so that I can execute a block of code on each file? I'm new to ruby, and I've concluded that the way to do this is a do each loop. The ruby file will be executed from a ..

How to create Temp table with SELECT * INTO tempTable FROM CTE Query

I have a MS SQL CTE query from which I want to create a temporary table. I am not sure how to do it as it gives an Invalid Object name error. Below is the whole query for reference SELECT * INTO TEM..

TLS 1.2 not working in cURL

I am having trouble curling an HTTPS url that uses TLS1.2, in my curl operation I post my login data into the website and save it in cookiefile. The error message I am getting is this error:1407743..

Command to collapse all sections of code?

In Visual Studio is there a command to collapse/expand all the sections of code in a file?..

make: *** [ ] Error 1 error

I am trying to compile a Pro*C file on gcc and I am getting this error : make: *** [MedLib_x.o] Error 1 This is the command printed by make: /usr/bin/gcc -g -fPIC -m64 -DSS_64BIT_SERVER -I/hom..

Best algorithm for detecting cycles in a directed graph

What is the most efficient algorithm for detecting all cycles within a directed graph? I have a directed graph representing a schedule of jobs that need to be executed, a job being a node and a depen..

null terminating a string

gcc 4.4.4 c89 What is the standard way to null terminate a string? When I use the NULL I get a warning message. *dest++ = 0; *dest++ = '\0'; *dest++ = NULL; /* Warning: Assignment takes integer fr..

Fatal error: Call to undefined function imap_open() in PHP

I am trying to access my gmail account through my localhost. However, I am getting the response: Fatal error: Call to undefined function imap_open() This is my code: $hostname = '{

App crashing when trying to use RecyclerView on android 5.0

I'm trying to mess with the new RecyclerView and whenever I try to run it, my app immediately crashes. It gives me NullPointerException for trying to access methods from

How to enable file upload on React's Material UI simple input?

I am creating a simple form to upload file using electron-react-boilerplate with redux form & material ui. The problem is that I do not know how to create input file field because material ui doe..

Error: Cannot find module 'webpack'

I'm just getting started with webpack and am having difficulty getting the multiple-entry-points sample to build. The webpack.config.js file in the example includes the line var CommonsChunkPlugin ..

Xcode Objective-C | iOS: delay function / NSTimer help?

So I'm developing my first iOS application and I need help.. Simple program for now, I have about 9 buttons and when I press the first button, or any button, I just want the first button to highlight..

TypeScript function overloading

Section 6.3 of the TypeScript language spec talks about function overloading and gives concrete examples on how to implement this. However if I try something like this: export class LayerFactory { ..

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

Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists

I am getting this error - D:\Projects\wamp\www\REPO [master]> git pull origin master Warning: Permanently added ',' (RSA) to the list of known hosts. ERROR: Repository not..

Facebook Open Graph not clearing cache

I'm having troubles with my meta tags with Open Graph. It seems as though Facebook is caching old values of my meta tags. Old values for Attributes og:title and og:url are still used, even though I ha..

Install IPA with iTunes 11

I have an IPA signed for ad-hoc distribution. I can install it fine with Xcode Organizer by dragging it to the device. It also worked with iTunes <=10 by dragging onto the device name. I'd like to ..

What's your most controversial programming opinion?

This is definitely subjective, but I'd like to try to avoid it becoming argumentative. I think it could be an interesting question if people treat it appropriately. The idea for this question came fr..

What is ROWS UNBOUNDED PRECEDING used for in Teradata?

I am just starting on Teradata and I have come across an Ordered Analytical Function called "Rows unbounded preceding" in Teradata. I tried several sites to learn about the function but all of them us..

What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)?

Let's assume an iteration in which we call a function without a return value. The way I think my program should behave is explained in this pseudocode: for element in some_list: foo(element) def..

How do you determine what technology a website is built on?

Quite often I come across a nice looking or functional website, and wonder what technology was used to create it. What techniques are available to figure out what a particular website was built with? ..

Converting string to integer

PrinterLabel = Printer + PrinterNumber If Floors = 1 And (PrinterLabel) > 127 Then Wscript.Echo "Invalid Printer11 Selection " Wscript.Quit End If If Floors = 2 And PrinterLabel >..

LINQ select one field from list of DTO objects to array

I have DTO class that defines order line like this: public class Line { public string Sku { get; set; } public int Qty { get; set; } } A list of type Line is populated like so: List<..

How to resize image (Bitmap) to a given size?

How to resize image (Bitmap) to for example 800*480 programatically ? I have retrieved a picture in my app which is ~1MB and I need to scale it down to 800*480 I have loaded that picture and compresse..

Maven not found in Mac OSX mavericks

After upgrading my Mac OSX 10.8 to 10.9, Maven not found in the /usr/share path but its installed in 10.8. when I try this command: $ maven -version got this result -bash: mvn: command not f..

Removing duplicate values from a PowerShell array

How can I remove duplicates from a PowerShell array? $a = @(1,2,3,4,5,5,6,7,8,9,0,0) ..

Eclipse error: R cannot be resolved to a variable

I am getting this classic error in Eclipse IDE. I am bored of Eclipse's bugs. They driving me mad. I almost tried everything which suggested as solution (by Googling). None of them worked. My projec..

Check if decimal value is null

I would like to check if the decimal number is NULL or it has some value, since the value is assigned from database in class object: public decimal myDecimal{ get; set; } and then I have myDecima..

Mapping object to dictionary and vice versa

Are there any elegant quick way to map object to a dictionary and vice versa? Example: IDictionary<string,object> a = new Dictionary<string,object>(); a["Id"]=1; a["Name&quo..

How to store date/time and timestamps in UTC time zone with JPA and Hibernate

How can I configure JPA/Hibernate to store a date/time in the database as UTC (GMT) time zone? Consider this annotated JPA entity: public class Event { @Id public int id; @Temporal(Tempo..

Why is my CSS bundling not working with a bin deployed MVC4 app?

I have bin deployed an MVC4 application to my hosting provider, based on advice given here and one or two on-the-fly fixes, but the most immediately apparent problem is that the bundling for css doesn..

How do I make a semi transparent background?

I need to make a white background 50% transparent without affecting anything else. How do I do it?..

How to get your Netbeans project into Eclipse

I want to get my NetBeans project to Eclipse. It's a web application project. I imported war files into Eclipse but I am not able to get the Java files and the war files are giving me many errors. Wh..

Android AudioRecord example

I am designing an Android app and I need to implement an AudioRecord class to record the user's sound. After some research (that didn't provide enough information) and few failed attempts, I was wonde..

How to round a floating point number up to a certain decimal place?

Suppose I have 8.8333333333333339, and I want to convert it to 8.84. How can I accomplish this in Python? round(8.8333333333333339, 2) gives 8.83 and not 8.84. I am new to Python or programming in ge..

How to overwrite the output directory in spark

I have a spark streaming application which produces a dataset for every minute. I need to save/overwrite the results of the processed data. When I tried to overwrite the dataset

How do you execute SQL from within a bash script?

I have some SQL scripts that I'm trying to automate. In the past I have used SQL*Plus, and called the sqlplus binary manually, from a bash script. However, I'm trying to figure out if there's a way t..

Getting date format m-d-Y H:i:s.u from milliseconds

I am trying to get a formatted date, including the microseconds from a UNIX timestamp specified in milliseconds. The only problem is I keep getting 000000, e.g. $milliseconds = 1375010774123; $d = dat..

Compare two data.frames to find the rows in data.frame 1 that are not present in data.frame 2

I have the following 2 data.frames: a1 <- data.frame(a = 1:5, b=letters[1:5]) a2 <- data.frame(a = 1:3, b=letters[1:3]) I want to find the row a1 has that a2 doesn't. Is there a built in fun..

Shorthand for if-else statement

I have some code with a lot of if/else statements similar to this: var name = "true"; if (name == "true") { var hasName = 'Y'; } else if (name == "false") { var hasName = 'N'; }; But is th..