Questions Tagged with #Amazon sns

Amazon Simple Notification Service (Amazon SNS) is a web service that makes it easy to set up, operate, and send notifications from the cloud. It provides developers with a highly scalable, flexible, and cost-effective capability to publish messages from an application and immediately deliver them to subscribers or other applications. It is designed to make web-scale computing easier for developers.

What is the difference between Amazon SNS and Amazon SQS?

When would I use SNS versus SQS, and why are they always coupled together?..

Query Mongodb on month, day, year... of a datetime

I'm using mongodb and I store datetime in my database in this way for a date "17-11-2011 18:00" I store: date = datetime.datetime(2011, 11, 17, 18, 0) db.mydatabase.mycollection.insert({"date" : dat..

bootstrap datepicker change date event doesnt fire up when manually editing dates or clearing date

<script type="text/javascript"> // When the document is ready $(document).ready(function () { $('.datepicker').datepicker({ format: "yyyy-mm-dd", }).on('chang..

UITextField text change event

How can I detect any text changes in a textField? The delegate method shouldChangeCharactersInRange works for something, but it did not fulfill my need exactly. Since until it returns YES, the textFie..

Does java have a int.tryparse that doesn't throw an exception for bad data?

Possible Duplicate: Java: Good way to encapsulate Integer.parseInt() how to convert a string to float and avoid using try/catch in java? C# has Int.TryParse: Int32.TryParse Method (String..

Using fonts with Rails asset pipeline

I have some fonts being configured in my Scss file like so: @font-face { font-family: 'Icomoon'; src: asset-url('icoMoon.eot?#iefix', font) format('embedded-opentype'), asset-url('icoMoon...

gulp command not found - error after installing gulp

I've installed gulp both globally and locally using npm install gulp npm install gulp -g npm install gulp-util npm install gulp-util -g When try to run gulp i get 'gulp' is not recognized as an ..


I have the following SQL query: IF EXISTS(SELECT * FROM component_psar WHERE tbl_id = '2' AND row_nr = '1') UPDATE component_psar SET col_1 = '1', col_2 = '1', col_3 = '1', col_4 = '1', col..

How to check if a function exists on a SQL database

I need to find out if a function exists on a database, so that I can drop it and create it again. It should basically be something like the following code that I use for stored procedures: IF EXISTS ..

Random row selection in Pandas dataframe

Is there a way to select random rows from a DataFrame in Pandas. In R, using the car package, there is a useful function some(x, n) which is similar to head but selects, in this example, 10 rows at ra..

How to continue a Docker container which has exited

Consider: docker run -it centos /bin/bash I pressed Ctrl+D to exit it. I want to continue to run this container, but I found I can't. The only method is docker commit `docker ps -q -l` my_image ..

Count the occurrences of DISTINCT values

I am trying to find a MySQL query that will find DISTINCT values in a particular field, count the number of occurrences of that value and then order the results by the count. example db id n..

Qt: resizing a QLabel containing a QPixmap while keeping its aspect ratio

I use a QLabel to display the content of a bigger, dynamically changing QPixmap to the user. It would be nice to make this label smaller/larger depending on the space available. The screen size is not..

Using $setValidity inside a Controller

I am trying to do some validation on file change. Here is my code: View/Template <input type="file" name="file" id="file" onchange="angular.element(this).scope().setFile(this)" r..

IntelliJ IDEA JDK configuration on Mac OS

I am using IntelliJ IDEA 10. Every time when I create a new project, it is asking me to choose JDK for this project. Anyone know how I can configure it and make it easy to use?..

The type or namespace name 'System' could not be found

I have the following errors (and more) in all my views (*.cshtml) when opening my project in Visual Studio 2015 Professional. Error CS0246 The type or namespace name 'System' could not be found ..

Get git branch name in Jenkins Pipeline/Jenkinsfile

I've create a jenkins pipeline and it is pulling the pipeline script from scm. I set the branch specifier to 'all', so it builds on any change to any branch. How do I access the branch name causing ..

Nested routes with react router v4 / v5

I am currently struggling with nesting routes using react router v4. The closest example was the route config in the React-Router v4 Documentation. I want to split my app in 2 different parts. A f..

LINUX: Link all files from one to another directory

I want to link ( ln -s ) all files that are in /mnt/usr/lib/ into /usr/lib/ There are lots of files, how can it be done quickly? :)..

How to get first/top row of the table in Sqlite via Sql Query

I need to fetch the first/top row of a table in a Sqlite database. But my program throws an SQLException "Sqlite Syntax Error: Syntax error near '1' " for the query that I am using: SELECT TOP 1 * ..

NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack

I'm trying to summarize my knowledge about the most popular JavaScript package managers, bundlers, and task runners. Please correct me if I'm wrong: npm & bower are package managers. They just d..

What does "<>" mean in Oracle

What does <> mean in SQL language: Sample code is as follows SELECT ordid, prodid, qty FROM item WHERE prodid IN (SELECT prodid FROM item WHE..

Swift: Reload a View Controller

I need to refresh a view controller when a certain button is tapped. Simply activating viewDidLoad() does not seem to be working for what I need to do. However, when I leave the view controller then c..

How to import local packages in go?

I am new to go and working on an example code that I want to localize. In the original main.go import statement it was: import ( "log" "net/http" "

Create a button programmatically and set a background image

When I try creating a button and setting a background image in Swift: let button = UIButton.buttonWithType(UIButtonType.System) as UIButton button.frame = CGRectMake(100, 100, 100, 100) but..

How to setup Tomcat server in Netbeans?

I googled a bit and found that it can be done by services--->servers--->add new, but when I try to add new Tomcat server this way, it doesn't appear in the list. Actually nothing is displayed to sele..

How to form tuple column from two columns in Pandas

I've got a Pandas DataFrame and I want to combine the 'lat' and 'long' columns to form a tuple. <class 'pandas.core.frame.DataFrame'> Int64Index: 205482 entries, 0 to 209018 Data columns: Month..

SVG fill color transparency / alpha?

Is it possible to set a transparency or alpha level on SVG fill colours? I've tried adding two values to the fill tag (changing it from fill="#044B94" to fill="#044B9466"), but this doesn't work...

Calling a Fragment method from a parent Activity

I see in the Android Fragments Dev Guide that an "activity can call methods in a fragment by acquiring a reference to the Fragment from FragmentManager, using findFragmentById() or findFragmentByTag()..

time.sleep -- sleeps thread or process?

In Python for *nix, does time.sleep() block the thread or the process?..

How to figure out the SMTP server host?

I am using SMTP to send emails by PHP. My client has a shared hosting. I created an email account there. There is no information available about what will be the SMTP server for this account. I have..

Opening a folder in explorer and selecting a file

I'm trying to open a folder in explorer with a file selected. The following code produces a file not found exception: System.Diagnostics.Process.Start( "explorer.exe /select," + listView1...

How can I get the height and width of an uiimage?

From the URL Image in Mail I'm adding image to mail view. It will show full image. But I want to calculate, proportionally change the height and width of the image. How can I get the height and widt..

Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

In ASP.NET MVC, what is the difference between: Html.Partial and Html.RenderPartial Html.Action and Html.RenderAction ..

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

Xcode 10, Command CodeSign failed with a nonzero exit code

Everytime I build console is showing this message. CodeSign /Users/admin/Desktop/AppStoreBuild/Project201/build/Debug-iphonesimulator/ (in target: Desker) cd /Users/admin/Desktop/..

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

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

Make an HTTP request with android

I have searched everywhere but I couldn't find my answer, is there a way to make a simple HTTP request? I want to request a PHP page / script on one of my websites but I don't want to show the webpage..

jQuery: find element by text

Can anyone tell me if it's possible to find an element based on its content rather than by an id or class? I am attempting to find elements that don't have distinct classes or id's. (Then I then need..

Best/Most Comprehensive API for Stocks/Financial Data

What is the most recommended free/public API for accessing financial market stats and stock quotes (preferrably real-time quotes)? I'm not too picky about how it's exposed (SOAP, REST, some proprietar..

How to make parent wait for all child processes to finish?

I'm hoping someone could shed some light on how to make the parent wait for ALL child processes to finish before continuing after the fork. I have cleanup code which I want to run but the child proces..

MySQL Insert with While Loop

I'm trying to create a bunch of records in my MySQL database. This is a one time creation so I am not trying to create a stored procedure. Here is my code: BEGIN SET i = 2376921001; WHILE (i <= ..


Am I correct in understanding that CREATE OR REPLACE basically means "if the object exists, drop it, then create it either way?" If so, what am I doing wrong? This works: CREATE TABLE foo (id NUM..

invalid byte sequence for encoding "UTF8"

I'm trying to import some data into my database. So I've created a temporary table, create temporary table tmp(pc varchar(10), lat decimal(18,12), lon decimal(18,12), city varchar(100), prov varchar(..

How to write a JSON file in C#?

I need to write the following data into a text file using JSON format in C#. The brackets are important for it to be valid JSON format. [ { "Id": 1, "SSN": 123, "Message": "whatever" ..

How to use in jQuery :not and hasClass() to get a specific element without a class

I have this line of code: $('#sitesAccordion .groupOfSites').click(function() { var lastOpenSite = $(this).siblings().hasClass(':not(.closedTab)'); console.log(lastOpenSite); }); I get "fal..

How can I add items to an empty set in python

I have the following procedure: def myProc(invIndex, keyWord): D={} for i in range(len(keyWord)): if keyWord[i] in invIndex.keys(): D.update(invIndex[query[i]]) ..

jQuery getJSON save result into variable

I use getJSON to request a JSON from my website. It works great, but I need to save the output into another variable, like this: var myjson= $.getJSON("", function..

convert string to specific datetime format?

String "2011-05-19 10:30:14" To Thu May 19 10:30:14 UTC 2011 How can I convert specific string to this Date format ?..

d3 add text to circle

I am trying to add some text into circle. I have been following example from a mbostock tutorial, but wasn't able to get the right output. The code snippet is: var data; var code; d3.json("/json/tr..

Copy Files from Windows to the Ubuntu Subsystem

I have enabled developer mode and installed Bash on Ubuntu on Windows. My home directory can be found under %localappdata%\Lxss\home\<ubuntu.username>\, i have created a sub-directory called Pi..

How to turn off magic quotes on shared hosting?

I want to turn off PHP's magic quotes. I don't have access to php.ini. When I tried to add php_flag magic_quotes_gpc off to my .htaccess file, I get a 500 internal server error. This is what my .hta..

How to push elements in JSON from javascript array

I want to add javascript array values into JSON values object. The other element is also replaced my element like recipients, subject, message. I got Json like: Below is my code. var BODY = { ..

Abstract methods in Java

I want to write an abstract method but the compiler persistently gives this error: abstract methods cannot have a body I have a method like this: public abstract boolean isChanged() { retur..

How to add a "open git-bash here..." context menu to the windows explorer?

How to add a context (aka right click) menu to the windows explorer that, when clicked, opens the git-bash console in the current explorer folder?..

Set content of HTML <span> with Javascript

In a webpage I am calling a WebService that gives me an integer value. I need to display this value in a block of text. I am currently using an HTML <span>. So far, I've found two methods of ..

Which method performs better: .Any() vs .Count() > 0?

in the System.Linq namespace, we can now extend our IEnumerable's to have the Any() and Count() extension methods. I was told recently that if i want to check that a collection contains 1 or more ite..

Fixed GridView Header with horizontal and vertical scrolling in

I want to fix(Freeze) gridview header while vertical scrolling. I also want to fix first column while horizontal scrolling. I want this in both chrome and IE...

Regex pattern including all special characters

I want to write a simple regular expression to check if in given string exist any special character. My regex works but I don't know why it also includes all numbers, so when I put some number it retu..

Get row-index values of Pandas DataFrame as list?

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

How do you Sort a DataTable given column and direction?

I need to resort, in memory, a DataTable based on a column and direction that are coming from a GridView. The function needs to look like this: public static DataTable resort(DataTable dt, string col..

search in java ArrayList

I'm trying to figure out the best way to search a customer in an ArrayList by its Id number. The code below is not working; the compiler tells me that I am missing a return statement. Customer findCu..

Regular expression for exact match of a string

I want to match two passwords with regular expression. For example I have two inputs "123456" and "1234567" then the result should be not match (false). And when I have entered "123456" and "123456" t..

How do I redirect users after submit button click?

How do I redirect users after submit button click? My javascript isn't working: Javascript <script type="text/javascript" language="javascript"> function redirect() { window.location.href=..

Restart container within pod

I have a pod test-1495806908-xn5jn with 2 containers. I'd like to restart one of them called container-test. Is it possible to restart a single container within a pod and how? If not, how do I restart..

How can I tell when a MySQL table was last updated?

In the footer of my page, I would like to add something like "last updated the xx/xx/200x" with this date being the last time a certain mySQL table has been updated. What is the best way to do that? ..

Ruby on Rails generates model field:type - what are the options for field:type?

I'm trying to generate a new model and forget the syntax for referencing another model's ID. I'd look it up myself, but I haven't figured out, among all my Ruby on Rails documentation links, how to fi..

How can I remove all objects but one from the workspace in R?

I have a workspace with lots of objects and I would like to remove all but one. Ideally I would like to avoid having to type rm(obj.1, obj.2... obj.n). Is it possible to indicate remove all objects..

How do I parse JSON with Ruby on Rails?

I'm looking for a simple way to parse JSON, extract a value and write it into a database in Rails. Specifically what I'm looking for, is a way to extract shortUrl from the JSON returned from the bit...

Android Error - Open Failed ENOENT

I am trying to save some block coverage using an array of integers that simply saves the number of times a block is executed. For some reason, though, when I try and write to some files that I created..

How to auto-generate a C# class file from a JSON string

Given the following JSON object, form = { "name": "", "address": { "street": "", "city": "", "province": "", "postalCode": "", "country": "" }, "phoneDay": "", "phoneCel..

Make Https call using HttpClient

I have been using HttpClient for making WebApi calls using C#. Seems neat & fast way compared to WebClient. However I am stuck up while making Https calls. How can I make below code to make Https..

How can you float: right in React Native?

I have an element that I want to float right, for example <View style={{width: 300}}> <Text style={{backgroundColor: "#DDD"}}>Hello</Text> </View> How can the Text be floa..

How do I make a text input non-editable?

So I have a text input <input type="text" value="3" class="field left"> Here is my CSS for it background:url("images/number-bg.png") no-repeat scroll 0 0 transparent; border:0 none; color:#F..

SQL Switch/Case in 'where' clause

I tried searching around, but I couldn't find anything that would help me out. I'm trying to do this in SQL: declare @locationType varchar(50); declare @locationID int; SELECT column1, column2 FROM..

Edit a text file on the console using Powershell

I'm trying to figure out the easiest way to edit text files in the console (PowerShell in my case). I'm using Windows 7 64 bit. It galls me that I can't just type edit filename.txt to edit a file. T..

Java: Clear the console

Can any body please tell me what code is used for clear screen in Java? For example in C++ system("CLS"); What code is used in Java for clear screen? Thanks!..

getMinutes() 0-9 - How to display two digit numbers?

var date = "2012-01-18T16:03"; var date = new Date(date); console.log(date.getMinutes()); console.log(date.getMinutes().length) This returns 3. How do I make it return '03'? Why does .length re..

How do I get my solution in Visual Studio back online in TFS?

I had my solution in Visual Studio 2012 (which is under TFS source control) open and the TFS server (2010) was down. When I then made a change to one of the files and attempted to save it I got a prom..

How to use local docker images with Minikube?

I have several docker images that I want to use with minikube. I don't want to first have to upload and then download the same image instead of just using the local image directly. How do I do this? S..

iPhone app signing: A valid signing identity matching this profile could not be found in your keychain

I'm pulling my hair out over this. I just downloaded the iPhone 3.0 SDK, but now I can't get my provisioning profiles to work. Here is what I have tried: Delete all provisioning profiles Delete logi..

How to send JSON instead of a query string with $.ajax?

Can someone explain in an easy way how to make jQuery send actual JSON instead of a query string? $.ajax({ url : url, dataType : 'json', // I was pretty sure this would do the trick ..

Postgresql: error "must be owner of relation" when changing a owner object

What is the grant option/trick I need to give to the current user ("userA") to allow him to change a object's owner which belongs by another user ("userC")? More precisely, the contact table is owned..

How do I rename a column in a database table using SQL?

If I wish to simply rename a column (not change its type or constraints, just its name) in an SQL database using SQL, how do I do that? Or is it not possible? This is for any database claiming to su..

MessageBodyWriter not found for media type=application/json

I am facing issues while consuming JAX-RS services as JSON. Below I have added my code. This is my service class: //Sets the path to base URL + /hello @Path("/hello") @Consumes(MediaType.APPLICATI..

How to obtain the last path segment of a URI

I have as input a string that is a URI. how is it possible to get the last path segment (that in my case is an id)? This is my input URL: String uri = "http://base_path/some_segment/id" and..

Cannot implicitly convert type 'string' to 'System.Threading.Tasks.Task<string>'

I am new to asynchronous programming, so after going through some async sample codes, I thought of writing a simple async code I created a simple Winform application and inside the Form I wrote the f..

Using If else in SQL Select statement

I have a select statement which will return 2 columns. ID | IDParent Then in my program I have to test if IDParent is < 1 then use ID ELSE use IDParent Is there a way to use an If Else like con..

CORS error :Request header field Authorization is not allowed by Access-Control-Allow-Headers in preflight response

I am trying to send the request from one localhost port to the another. I am using angularjs on the frontend and node on the backend. Since it is CORS request, In node.js, i am using res.header('Ac..

Parse JSON response using jQuery

I'm dealing with a JSON Response in one of my applications. I have established a connection using jsonp successfully. But I'm not able to parse my response. Code: <script type='text/javascript'&g..

How to Configure SSL for Amazon S3 bucket

I am using an Amazon S3 bucket for uploading and downloading of data using my .NET application. Now my question is: I want to access my S3 bucket using SSL. Is it possible to implement SSL for an Amaz..

Java: Casting Object to Array type

I am using a web service that returns a plain object of the type "Object". Debug shows clearly that there is some sort of Array in this object so I was wondering how I can cast this "Object" to an Arr..

How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?

Wireless debugging was recently added as a feature in Xcode 9, iOS 11, and tvOS 11. Apple TV 4K doesn't have a USB port, so it requires wireless debugging. How do you perform this wireless debugging i..

Boxplot in R showing the mean

Does anybody know of a way of generating a boxplot in R with a line (or another symbol) in the value corresponding to the mean? Thank you!..

How to compare two columns in Excel (from different sheets) and copy values from a corresponding column if the first two columns match?

I'm trying to compare column a in Sheet 1 with column a in Sheet 2, then copy corresponding values in column b from sheet 1 to column b in Sheet 2 (where the column a values match). I've been trying t..

How to get current SIM card number in Android?

I want to know user mobile number in Android. I used this code but I'm not getting number. TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String n = tm...

make a phone call click on a button

I'm trying to make a call when I press a button in android ((Button)findViewById( OnClickListener() { @Override public void onClick(View v) { String phno=..

Android Reading from an Input stream efficiently

I am making an HTTP get request to a website for an android application I am making. I am using a DefaultHttpClient and using HttpGet to issue the request. I get the entity response and from this obt..

Pandas group-by and sum

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

How do you create different variable names while in a loop?

For example purposes... for x in range(0,9): string'x' = "Hello" So I end up with string1, string2, string3... all equaling "Hello"..

Set value to currency in <input type="number" />

I am trying to format a number input by the user into currency using javascript. This works fine on <input type="text" />. However, on <input type="number" /> I cannot seem to be able to s..

How do you automatically set the focus to a textbox when a web page loads?

How do you automatically set the focus to a textbox when a web page loads? Is there an HTML tag to do it or does it have to be done via Javascript?..

How to make google spreadsheet refresh itself every 1 minute?

My google spreadsheet is using GOOGLEFINANCE('symbol','price) function to retrieve stock prices of my portfolio. Unfortunately, I have to refresh manually now. How can I make the spreadsheet refresh i..

I want my android application to be only run in portrait mode?

I want my android application to be only run in portrait mode? How can I do that?..

The easiest way to replace white spaces with (underscores) _ in bash

recently I had to write a little script that parsed VMs in XenServer and as the names of the VMs are mostly with white spaces in e.g Windows XP or Windows Server 2008, I had to trim those white spaces..

Random number c++ in some range

Possible Duplicate: Generate Random numbers uniformly over entire range I want to generate the random number in c++ with in some range let say i want to have number between 25 and 63. How ..

Self-references in object literals / initializers

Is there any way to get something like the following to work in JavaScript? var foo = { a: 5, b: 6, c: this.a + this.b // Doesn't work }; In the current form, this code obviously throw..

JavaScript variable assignments from tuples

In other languages like Python 2 and Python 3, you can define and assign values to a tuple variable, and retrieve their values like this: tuple = ("Bob", 24) name, age = tuple print(name) #..

Writing a VLOOKUP function in vba

I'm trying to lookup a value on a spreadsheet within a table array using the VLOOKUP function in my vba code. I don't know how to write it correctly. Here is the normal VLOOKUP formula with all the ..

How to select a single field for all documents in a MongoDB collection?

In my MongoDB, I have a student collection with 10 records having fields name and roll. One record of this collection is: { "_id" : ObjectId("53d9feff55d6b4dd1171dd9e"), "name" : "Swati", ..

Is there a better way to do optional function parameters in JavaScript?

I've always handled optional parameters in JavaScript like this: function myFunc(requiredArg, optionalArg){ optionalArg = optionalArg || 'defaultValue'; // Do stuff } Is there a better way to ..

SQL multiple columns in IN clause

If we need to query a table based on some set of values for a given column, we can simply use the IN clause. But if query need to be performed based on multiple columns, we could not use IN clause(g..

How to get named excel sheets while exporting from SSRS

Whenever a single page report is exported to excel, sheet in excel is named by the report name. If a report has multiple pages, the sheets are named as sheet1, sheet2,.... Is there any way to specify ..

bootstrap popover not showing on top of all elements

I'm working on a bootstrap site and after updating to bootstrap 2.2 from 2.0 everything worked except the popover. The popovers still show up fine, but they don't show up on top of all other elements..

How to create module-wide variables in Python?

Is there a way to set up a global variable inside of a module? When I tried to do it the most obvious way as appears below, the Python interpreter said the variable __DBNAME__ did not exist. ... __DB..

Getting the location from an IP address

I want to retrieve information like the city, state, and country of a visitor from their IP address, so that I can customize my web page according to their location. Is there a good and reliable way t..

Omit rows containing specific column of NA

I want to know how to omit NA values in a data frame, but only in some columns I am interested in. For example, DF <- data.frame(x = c(1, 2, 3), y = c(0, 10, NA), z=c(NA, 33, 22)) but I only wa..

How can I test that a variable is more than eight characters in PowerShell?

How do test if the number of characters in $dbUserName is more than eight characters? I have been unable to locate a command or series of commands that will let me do this. I have only been able to f..

Calling Objective-C method from C++ member function?

I have a class (EAGLView) which calls a member function of a C++ class without problems. Now, the problem is that I need to call in that C++ class a objective-C function [context renderbufferStorage:G..

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

Convert DataTable to CSV stream

Currently have a DataTable, but wish to stream it to the user via a WebHandler. FileHelpers has CommonEngine.DataTableToCsv(dt, "file.csv"). However it saves it to a file. How can I save it to a strea..

Increasing the timeout value in a WCF service

How do I increase the default timeout to larger than 1 minute on a WCF service?..

Can't connect to MySQL server on '' (10061) (2003)

I know this question was asked a lot before but I tried some of the solutions which were given and nothing worked.. I have downloaded MySQL Workbench 6.1 on my windows 7 x64 and now as I want to star..

Bootstrap modal in React.js

I need to open a Bootstrap Modal from clicking on a button in a Bootstrap navbar and other places (to show data for a component instance, ie. providing "editing" functionality), but I don't know how t..

Input button target="_blank" isn't causing the link to load in a new window/tab

I have an HTML file with an input button. This is only an example button, but it's including all necessary info of code: <input type="button" onClick="parent.location=''..

How to resolve TypeError: can only concatenate str (not "int") to str

I decided to make some kind of secret code for testing purposes with Unicode. I've done that by adding numbers to Unicode so it would be kind of secret. I've been getting this error, but I don't know..

If Radio Button is selected, perform validation on Checkboxes

I'm trying to work this form so when the first radio button is selected, run a certain validation. When the second radio button is selected, run a different validation, etc. Currently using Alerts to ..

How do you overcome the HTML form nesting limitation?

I know that XHTML doesn't support nested form tags and I have already read other answers here on Stack Overflow regarding this subject, but I still haven't figured out an elegant solution to the probl..

How to set character limit on the_content() and the_excerpt() in wordpress

How do I set a character limit on the_content() and the_excerpt() in wordpress? I have only found solutions for the word limit - I want to be able to set an exact amount characters of outputted...

Eclipse "Server Locations" section disabled and need to change to use Tomcat installation

I have set up a dynamic web project in Eclipse with a Tomcat 5.5 installation. I want to be to set the server to us the Tomcat installation instead of the workspace metadata location, but when Eclips..

JS search in object values

I have an array of homogeneous objects like so; [ { "foo" : "bar", "bar" : "sit" }, { "foo" : "lorem", "bar" : "ipsum" }, { "foo" : "dolor", "bar" : "amet" } ] I..

How to round up a number in Javascript?

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

Formatting floats without trailing zeros

How can I format a float so that it doesn't contain trailing zeros? In other words, I want the resulting string to be as short as possible. For example: 3 -> "3" 3. -> "3" 3.0 -> "3" 3.1 -&..

Transform char array into String

I have a function that returns a char array and I want that turned into a String so I can better process it (compare to other stored data). I am using this simple for that should work, but it doesn't ..

Copy directory to another directory using ADD command

I have read however I met a problem. I want to copy the local directory go to docker /user/local/ I tried: ADD go /usr/local/ and: ADD /go/ /usr/l..

$watch an object

I want to watch for changes in a dictionary, but for some reason watch callback is not called. Here is a controller that I use: function MyController($scope) { $scope.form = { name: 'my ..

What is REST? Slightly confused

I was under the assumption that REST was a web service but it seems that I am incorrect in thinking this - so, what is REST? I've read through Wikipedia but still cant quite wrap my head around it. W..

Scrollbar without fixed height/Dynamic height with scrollbar

I have this HTML structure: <div id="body"> <div id="head"> <p>Dynamic height without scrollbar</p> </div> <div id="content"> <p>..

How to get current user, and how to use User class in MVC5?

How can I get the id of the currently logged in user in MVC 5? I tried the StackOverflow suggestions, but they seem to be not for MVC 5. Also, what is the MVC 5 best practice of assigning stuff to t..

Using iFrames In ASP.NET

I have an website with a master-page, can I use the iframe so my .aspx pages will load inside the iframes. (Meaning it wont load the master-page) Kinda like my iframe will be the contentplace..

Using IF..ELSE in UPDATE (SQL server 2005 and/or ACCESS 2007)

I need to set a query like below: UPDATE XXXXXX IF column A = 1 then set column B = 'Y' ELSE IF column A = 2 then set column C = 'Y' ELSE IF column A = 3 then set column D = 'Y' and so on and so..

How do I center content in a div using CSS?

How do I center content in a div both horizontally and vertically?..

How to delete the top 1000 rows from a table using Sql Server 2008?

I have a table in SQL Server. I would like to delete the top 1000 rows from it. However, I tried this, but I instead of just deleting the top 1000 rows it deleted all the rows in the table. Here is..

Go test string contains substring

How do I check if a string is a substring of another string in Go? For example, I want to check someString.contains("something")...

Visual Studio 2013 error MS8020 Build tools v140 cannot be found

I had previously been using VS2013 express without issue, but suddenly it began crashing whenever I tried edit the code while it ran existing code fine. I tried uninstalling and switching over to VS2..

TypeScript hashmap/dictionary interface

I'm new to using TypeScript and I'm trying to implement a hashmap/dictionary interface. So far I have export interface IHash { [details: string] : string; } I'm having some trouble understandi..

Subtract days from a DateTime

I have the following code in my C# program. DateTime dateForButton = DateTime.Now; dateForButton = dateForButton.AddDays(-1); // ERROR: un-representable DateTime Whenever I run it, I get the fo..

PostgreSQL delete all content

Hello I want to delete all data in my postgresql tables, but not the table itself. How could I do this?..

android adb turn on wifi via adb

My phone has been locked (too many pattern attempts). To unlock I need to enter username and password on my gmail account. This is the only way I can unlock it. I cant launch any activities, even to t..

DateTimePicker: pick both date and time

Is it possible to use DateTimePicker (Winforms) to pick both date and time (in the dropdown)? How do you change the custom display of the picked value? Also, is it possible to enable the user to type ..

What does "Object reference not set to an instance of an object" mean?

I am receiving this error and I'm not sure what it means? Object reference not set to an instance of an object. ..

Linking dll in Visual Studio

How can I add a .dll in Visual Studio 2010? I just cannot find the option there...

Commenting code in Notepad++

I'm using Notepad++ as an editor to write programs in Python. It might sound daft but I looked around in the editor and could not find any means (not the manual way but something like in Emacs) to do ..

Set color of text in a Textbox/Label to Red and make it bold in C#

I want a text color to be red in color on certain condition. Here is how i want to get it done. string minusvalue = TextBox1.Text.ToString(); if (Convert.ToDouble(minusvalue) < 0) { // set colo..

How to use jQuery to select a dropdown option?

I was wondering if it’s possible to get jQuery to select an <option>, say the 4th item, in a dropdown box? <select> <option></option> <option></option> ..

Invoke native date picker from web-app on iOS/Android

I'm trying to explore the posibilities with running a native web-app on different platforms using HTML5. Currently, an <input type="date">field just opens the standard soft keyboard on Android a..

How do I rename a MySQL schema?

Possible Duplicate: how does one rename a schema in MySQL Is there a MySQL statement for renaming a schema? I know about RENAME {DATABASE | SCHEMA} db_name TO new_db_name;, but that stateme..

Sort objects in ArrayList by date?

Every example I find is about doing this alphabetically, while I need my elements sorted by date. My ArrayList contains objects on which one of the datamembers is a DateTime object. On DateTime I can..

How to change the color of a CheckBox?

How do I change the default CheckBox color in Android? By default the CheckBox color is green, and I want to change this color. If it is not possible please tell me how to make a custom CheckBox?..

C# get string from textbox

I am just a noob in C#, and I've got this question to ask you. I have here a form that asks for login details. It has two textfields: Username Password What I want is to get the strings entered ..

SVG gradient using CSS

I'm trying to get a gradient applied to an SVG rect element. Currently, I'm using the fill attribute. In my CSS file: rect { cursor: pointer; shape-rendering: crispEdges; fill: #a71a2e; ..

How to use a link to call JavaScript?

How to use a link to call JavaScript code?..

Jquery bind double click and single click separately

Is there something in jquery that would allow me to differentiate between behavior on double click and single click? When I bind both to same element only the single click gets executed. Is there a ..

VSCode Change Default Terminal

I am using Visual Studio Code on my Windows 10 PC. I want to change my default terminal from Windows PowerShell to Bash on Ubuntu (on Windows). How can I do that?..

Android WebView not loading URL

I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(; webView.setWebViewClient(new HostsWebClient()); webView.getSettings().setPluginStat..

How to redirect to action from JavaScript method?

I have an input type="button" <input type="button" name="DeleteJob" runat="server" value="Löschen" onclick="DeleteJob()" /> and JavaScript method: function DeleteJob() { if (confirm("D..

Show SOME invisible/whitespace characters in Eclipse

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

How can I set the max-width of a table cell using percentages?

<table> <tr> <td>Test</td> <td>A long string blah blah blah</td> </tr> </table> <style> td{max-width:67%;} </style> The above does not wo..

Sorting arrays in javascript by object key value

How would you sort this array with these objects by distance. So that you have the objects sorted from smallest distance to biggest distance ? Object { distance=3388, duration="6 mins", from="Lenchen..

How to align iframe always in the center

I have an iframe surrounded by div element and I am simply trying to position it always in the center. here is my jsfiddle effort : jsfiddle and trully believe that someone could help because I am s..

Search a whole table in mySQL for a string

I'm trying to search a whole table in mySQL for a string. I want to search all fields and all entrees of a table, returning each full entry that contains the specified text. I can't figure out how ..

How do I list all files of a directory?

How can I list all files of a directory in Python and add them to a list?..

Versioning SQL Server database

I want to get my databases under version control. Does anyone have any advice or recommended articles to get me started? I'll always want to have at least some data in there (as alumb mentions: user..

How To Use DateTimePicker In WPF?

I have no idea how to use the DateTimePicker control in WPF. It is not available in the Toolbox...

Angular2 If ngModel is used within a form tag, either the name attribute must be set or the form

I am getting this error from Angular 2 core.umd.js:5995 EXCEPTION: Uncaught (in promise): Error: Error in app/model_exposure_currencies/model_exposure_currencies.component.html:57:18 caused by: If ng..

NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle

In my AppDelegate there is a problem I do not understand. RootViewController initially called ViewController and I changed it name. The application is formed by many ViewController then I have introdu..

Are there such things as variables within an Excel formula?

I hate repeating functions, particularly in Excel formulas. Is there any way that I can avoid something like: =IF( VLOOKUP(A1, B:B, 1, 0) > 10, VLOOKUP(A1, B:B, 1, 0) - 10, VLOOKUP(A1, B:B, 1, 0)..

"Post Image data using POSTMAN"

I am trying to POST data to my API. I have a model with an image field where: image = models.ImageField() I have an image on my local box, which I am trying to send. Am I sending it correctly? { ..

Where can I read the Console output in Visual Studio 2015

I am new to C# and downloaded the free version of Microsoft Visual Studio 2015. To write a first program, I created a Windows Forms Application. Now I use Console.Out.WriteLine() to print some tes..

How do I get the last character of a string using an Excel function?

How do I get the last character of a string using an Excel function?..

Change the content of a div based on selection from dropdown menu

Is there a simple way, using JavaScript, to dynamically show/hide content in a <div> based on the users selection from a drop down menu? For example, if a user selects option 1 then I would like..

How to filter empty or NULL names in a QuerySet?

I have first_name, last_name & alias (optional) which I need to search for. So, I need a query to give me all the names that have an alias set. Only if I could do: Name.objects.filter(alias!="")..

Try-catch speeding up my code?

I wrote some code for testing the impact of try-catch, but seeing some surprising results. static void Main(string[] args) { Thread.CurrentThread.Priority = ThreadPriority.Highest; Process.Ge..

HTML to PDF with Node.js

I'm looking to create a printable pdf version of my website webpages. Something like express.render() only render the page as pdf Does anyone know a node module that does that ? If not, how would yo..

define() vs. const

In PHP, when do you use define('FOO', 1); and when do you use const FOO = 1; ? What are the main differences between those two?..

SQL LIKE condition to check for integer?

I am using a set of SQL LIKE conditions to go through the alphabet and list all items beginning with the appropriate letter, e.g. to get all books where the title starts with the letter "A": SELECT *..

Is there a way to make mv create the directory to be moved to if it doesn't exist?

So, if I'm in my home directory and I want to move foo.c to ~/bar/baz/foo.c , but those directories don't exist, is there some way to have those directories automatically created, so that you would on..

how to inherit Constructor from super class to sub class

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

What is phtml, and when should I use a .phtml extension rather than .php?

I'm wondering what the difference between .phtml and .php files is, and when to use one over the other...

How to write data with FileOutputStream without losing old data?

If you work with FileOutputStream methods, each time you write your file through this methods you've been lost your old data. Is it possible to write file without losing your old data via FileOutputSt..

What is javax.inject.Named annotation supposed to be used for?

I am trying to understand the javax.inject package and I am not clear what the javax.inject.Named annotation is supposed to be used for. The Javadoc does not explain the the idea behind it. Javadoc ..

JavaScript: How to find out if the user browser is Chrome?

I need some function returning a boolean value to check if the browser is Chrome. How do I create such functionality?..

What's the PowerShell syntax for multiple values in a switch statement?

I basically want to do this: switch($someString.ToLower()) { "y", "yes" { "You entered Yes." } default { "You entered No." } } ..

What's the difference between implementation and compile in Gradle?

After updating to Android Studio 3.0 and creating a new project, I noticed that in build.gradle there is a new way to add new dependencies instead of compile there is implementation and instead of tes..

ASP.NET Web API application gives 404 when deployed at IIS 7

I have an ASP.NET Web API which works fine when running on "IIS Express" with localhost:1783 But when I uncross the "Use IIS Express" and then press "Create Virtual Directory"... ...I just get 4..

Relative URLs in WordPress

I've always found it frustrating in WordPress that images, files, links, etc. are inserted into WordPress with an absolute URL instead of relative URL. A relative url is much more convenient for switc..

What do numbers using 0x notation mean?

What does a 0x prefix on a number mean? const int shared_segment_size = 0x6400; It's from a C program. I can't recall what it amounts to and particularly what the letter x means...

SVN Error - Not a working copy

Recently our svn server was changed and we did a svn switch. Since the working copy had a huge amount of unversioned resources, the working copy got locked and we started switching folder by folder f..

jQuery removing '-' character from string

I have a string "-123445". Is it possible to remove the '-' character from the string? I have tried the following but to no avail: $mylabel.text("-123456"); $mylabel.text().replace('-', ''); ..

Objective-C: Extract filename from path string

When I have NSString with /Users/user/Projects/thefile.ext I want to extract thefile with Objective-C methods. What is the easiest way to do that?..

How to access custom attributes from event object in React?

React is able to render custom attributes as described at If you want to use a custom attribute, you should prefix it with data-. <..