Questions Tagged with #Tiers

Azure SQL Database "DTU percentage" metric

With the new Azure SQL Database tier structure, it seems important to monitor your database "DTU" usage to know whether to upgrade or downgrade to another tier. When reading Azure SQL Database Servic..

Bootstrap Align Image with text

I am trying to align an image on the left side with text using boostrap, and when page is viewed on mobile devices the images becomes centred on top of the text ! <div class="container"> <di..

C# Collection was modified; enumeration operation may not execute

Possible Duplicate: Collection was modified; enumeration operation may not execute HI there, I am create an project estimation program and am getting the following error: C# Collection was..

How to parse XML using shellscript?

I would like to know what would be the best way to parse an XML file using shellscript ? Should one do it by hand ? Does third tiers library exist ? If you already made it if you could let me know..

Explain the different tiers of 2 tier & 3 tier architecture?

I am not able to understand which elements are called as first tier, second tier & third tier & where they reside. Can they reside on same machine or different machine. Which tier reside on wh..

What's the difference between "Layers" and "Tiers"?

What's the difference between "Layers" and "Tiers"?..

How do I add a margin between bootstrap columns without wrapping

My layout currently looks like this In the center column, I want to add a small margin between each Server Div. But, if I add a margin to the CSS, it ends up line wrapping and looking like this ..

How to access URL segment(s) in blade in Laravel 5?

I have a url : http://localhost:8888/projects/oop/2 I want to access the first segment --> projects I've tried <?php echo $segment1 = Request::segment(1); ?> I see nothing print out in my..

Setting Remote Webdriver to run tests in a remote computer using Java

I was trying to setup remote webdriver to run my tests in remote computer, as my application is deployed to my localhost. Using Selenium RC I used host address to run those tests and it worked fine; b..

How to Apply Mask to Image in OpenCV?

I want to apply a binary mask to a color image. Please provide a basic code example with proper explanation of how the code works. Also, is there some option to apply a mask permanently so all functio..

How do I convert a String to a BigInteger?

I'm trying to read some really big numbers from standard input and add them together. However, to add to BigInteger, I need to use BigInteger.valueOf(long);: private BigInteger sum = BigInteger.valu..

DateTimePicker time picker in 24 hour but displaying in 12hr?

I'm using the bootstrap ready date time picker from and it's working nicely but for one issue. I have a picker setup just from time as so: $(functi..

Fastest way to check if a file exist using standard C++/C++11/C?

I would like to find the fastest way to check if a file exist in standard C++11, C++, or C. I have thousands of files and before doing something on them I need to check if all of them exist. What can ..

How does Zalgo text work?

I've seen weirdly formatted text called Zalgo like below written on various forums. It's kind of annoying to look at, but it really bothers me because it undermines my notion of what a character is su..

Triggering change detection manually in Angular

I'm writing an Angular component that has a property Mode(): string. I would like to be able to set this property programmatically not in response to any event. The problem is that in the absence of..

The client and server cannot communicate, because they do not possess a common algorithm - ASP.NET C# IIS TLS 1.0 / 1.1 / 1.2 - Win32Exception

I have an issue with a C# PayTrace Gateway. The below code was working fine until yesterday when I believe they turned off SSL3 due to the Poodle Exploit. When running the code below we got the follow..

How to get Real IP from Visitor?

I'm using this PHP code to get a visitor's IP address: <?php echo $_SERVER['REMOTE_ADDR']; ?> But, I can't get the real IP address from visitors when they are using a proxy. Is there any way ..

Is there any way of configuring Eclipse IDE proxy settings via an autoproxy configuration script?

I am behind a firewall which uses autoproxy configuration script. I am able to browse the internet when I enable the autoproxy url in most browsers I use (IE 7, IE 8, FF, Chrome). For your reference t..

How to check what version of jQuery is loaded?

How do I check which version of jQuery is loaded on the client machine? The client may have jQuery loaded but I don't know how to check it. If they have it loaded how do I check the version and the pr..

Search of table names

I use the following to search for strings in my stored procedures: use DBname SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%xxx%' Is it easy to amend the above so that i..

Swing/Java: How to use the getText and setText string properly

I'm trying to make input nameField appear in a Label called label1 after a Button called button1 is clicked. Right now it says: 'txt' and I understand why. But I don't know how I can use the string! C..

How do I tell if an object is a Promise?

Whether it's an ES6 Promise or a bluebird Promise, Q Promise, etc. How do I test to see if a given object is a Promise?..

SQLite select where empty?

In SQLite, how can I select records where some_column is empty? Empty counts as both NULL and ""...

Clone only one branch

I would like to know how I could clone only one branch instead of cloning the whole Git repository...

Accessing localhost of PC from USB connected Android mobile device

I have an android device (Samsung galaxy tab) connected to my PC via USB . I want to use WebServices and run a web page which is located on my local xampp server of my PC on my android device . I ca..

How to do a subquery in LINQ?

Here's an example of the query I'm trying to convert to LINQ: SELECT * FROM Users WHERE Users.lastname LIKE '%fra%' AND Users.Id IN ( SELECT UserId FROM CompanyRolesToUsers ..

SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

I just installed Ubuntu 16.04 and installed web server on it. Everything works well, but I cannot access database. Even if I create new user and grant all privileges, I can't create database In PHP I'..

Get the last item in an array

Here is my JavaScript code so far: var linkElement = document.getElementById("BackButton"); var loc_array = document.location.href.split('/'); var newT = document.createTextNode(unescape(capWords(loc..

jquery ajax get responsetext from http url

Neither: var response = $.ajax({ type: "GET", url: "", async: false, success : function() { alert (this); } }); Nor: var response2 = $.get("ht..

ImportError: cannot import name

I have two files and from flask import Flask from mod_login import mod_login app = Flask(__name__) app.config.update( USERNAME='admin', PASSWORD='default' ) mod..

Detect if a Form Control option button is selected in VBA

I have a code that work just fine using ActiveX option buttons. However, I want the macro to run on a Mac as well so I am trying to replace my ActiveX controls with form controls. With ActiveX, all I ..

Append String in Swift

I am new to iOS. I am currently studying iOS using Objective-C and Swift. To append a string in Objective-C I am using following code: NSString *string1 = @"This is"; NSString *string2 = @"Swift L..

How is Pythons glob.glob ordered?

I have written the following Python code: #!/usr/bin/python # -*- coding: utf-8 -*- import os, glob path = '/home/my/path' for infile in glob.glob( os.path.join(path, '*.png') ): print infile N..

How to access a dictionary key value present inside a list?

Suppose I have the following list: list = [{'a': 1, 'b': 2}, {'c': 3, 'd': 4}, {'e': 5, 'f': 6}] How do I access a particular value of key say d?..

Error: JavaFX runtime components are missing, and are required to run this application with JDK 11

I'm trying to run the sample JavaFX project using IntelliJ but it fails with the exception : Error: JavaFX runtime components are missing, and are required to run this application I have downloaded..

Python: avoid new line with print command

I've started programming today and have this issue with Python. It's pretty dumb but I can't figure out how to do it. When I use the print command, it prints whatever I want and then goes to a differe..

How to sort a list of strings numerically?

I know that this sounds trivial but I did not realize that the sort() function of Python was weird. I have a list of "numbers" that are actually in string form, so I first convert them to ints, then a..

How to submit a form with JavaScript by clicking a link?

Instead of a submit button I have a link: <form> <a href="#"> submit </a> </form> Can I make it submit the form when it is clicked?..

Android center view in FrameLayout doesn't work

I have a FrameLayout in which I have 2 controls: - a custom view which draws a image and some text on it - a textview with a text I want to center both in the FrameLayout but I can't manage to do it..

jquery function val() is not equivalent to "$(this).value="?

When I try to set a text input to blank (when clicked) using $(this).value="", this does not work. I have to use $(this).val(''). Why? What is the difference? What is the mechanism behind the val fun..

Write HTML file using Java

I want my Java application to write HTML code in a file. Right now, I am hard coding HTML tags using class. For Example: BufferedWriter bw = new BufferedWriter(new FileWriter(f..

Use a list of values to select rows from a pandas dataframe

Lets say I have the following pandas dataframe: df = DataFrame({'A' : [5,6,3,4], 'B' : [1,2,3, 5]}) df A B 0 5 1 1 6 2 2 3 3 3 4 5 I can subset based on a specific value..

"Unable to acquire application service" error while launching Eclipse

When ever I try to launch my eclipse I am getting the following exception an its not coming up. java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.cor..

Whoops, looks like something went wrong. Laravel 5.0

I installed Laravel 5.0 properly by cloning in git, and composer install, when I ran it to browser http://localhost/laravel/public/, it says "Whoops, looks like something went wrong." I did not ..

Iterate two Lists or Arrays with one ForEach statement in C#

This just for general knowledge: If I have two, let's say, List, and I want to iterate both with the same foreach loop, can we do that? Edit Just to clarify, I wanted to do this: List<String>..

SQL to Entity Framework Count Group-By

I need to translate this SQL statement to a Linq-Entity query... SELECT name, count(name) FROM people GROUP by name ..

How to make a browser display a "save as dialog" so the user can save the content of a string to a file on his system?

How can I make a browser display a "save as dialog" so the user can save the content of a string to a file on his system? For example: var myString = "my string with some stuff"; save_to_filesystem(..

Is there a way to specify a max height or width for an image?

I'd like to have an image to have either a height of 725 or a width of 500 and maintain it's aspect ratio. When I have images with a height of over 725 and thinner than 500 they get stretched out to ..

printf() prints whole array

Let's assume I have the following code in my C program: #include <stdio.h> void PrintSomeMessage( char *p ); int main(int argc, char *argv[]) { char arr[10] = "hello"; PrintSomeMessa..

"SMTP Error: Could not authenticate" in PHPMailer

I'm using PHPMailer in a Simple Script For Send Email's Through Gmail, and I'm getting an "Unknown Error" (At least for me!): SMTP Error: Could not authenticate. Error: SMTP Error: Could not a..

URL encode sees “&” (ampersand) as “&amp;” HTML entity

I am encoding a string that will be passed in a URL (via GET). But if I use escape, encodeURI or encodeURIComponent, & will be replaced with %26amp%3B, but I want it to be replaced with %26. What ..

How can you use php in a javascript function

<html> <?php $num = 1; echo $num; ?> <input type="button" name="lol" value="Click to increment" onclick="Inc()" /> &..

How do I call a function twice or more times consecutively?

Is there a short way to call a function twice or more consecutively in Python? For example: do() do() do() maybe like: 3*do() ..

How to determine the longest increasing subsequence using dynamic programming?

I have a set of integers. I want to find the longest increasing subsequence of that set using dynamic programming...

Simulate low network connectivity for Android

I would like to test my application for cases of low network connectivity. Except standing in the elevator, what is the best way to do this? I've tried wrapping my phone in an aluminum foil, but it di..

.NET Global exception handler in console application

Question: I want to define a global exception handler for unhandled exceptions in my console application. In, one can define one in global.asax, and in windows applications /services, one can ..

How to fluently build JSON in Java?

I'm thinking of something like: String json = new JsonBuilder() .add("key1", "value1") .add("key2", "value2") .add("key3", new JsonBuilder() .add("innerKey1", "value3")) .toJson(); Whic..

How to assign name for a screen?

I'm using the screen multiplexer tool on the command shell and open a lot of screens. I then forget which process ID associates with which task. I would like to set a name for a screen but can't find..

How to validate domain name in PHP?

Is it possible without using regular expression? For example, I want to check that a string is a valid domain: domain-name abcd example Are valid domains. These are invalid of course: domaia@name..

mappedBy reference an unknown target entity property

I am having an issue in setting up a one to many relationship in my annotated object. I have the following: @MappedSuperclass public abstract class MappedModel { @Id @GeneratedValue(strategy..

C# Java HashMap equivalent

Coming from a Java world into a C# one is there a HashMap equivalent? If not what would you recommend?..

Passing multiple argument through CommandArgument of Button in

I have a gridview with multiple rows, each has a Update button and I need to pass 2 values when someone clicks on Update button. Aside from packing the arguments inside CommandArgument separated by c..

Reading string by char till end of line C/C++

How to read a string one char at the time, and stop when you reach end of line? I'am using fgetc function to read from file and put chars to array (latter will change array to malloc), but can't figur..

IllegalStateException: Can not perform this action after onSaveInstanceState with ViewPager

I'm getting user reports from my app in the market, delivering the following exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at

How does Facebook disable the browser's integrated Developer Tools?

So apparently because of the recent scams, the developer tools is exploited by people to post spam and even used to "hack" accounts. Facebook has blocked the developer tools, and I can't even use the ..

Docker build gives "unable to prepare context: context must be a directory: /Users/tempUser/git/docker/Dockerfile"

I have a Dockerfile that is supposed to build an Ubuntu image. But whenever I run docker build -t ubuntu-test:latest ./Dockerfile it shows the following error on the console unable to prepare contex..

What does -> mean in C++?

Possible Duplicates: What is the difference between the dot (.) operator and -> in C++? What is the arrow operator (->) synonym for in C++? The header says it all. What does -> me..

Can't ping a local VM from the host

My work laptop is is a member of a domain (the OS is Windows 8). Created a new VM, locally on this laptop (using built-in Hyper-V). DHCP is provided by the domain and all IP addresses are assigned by ..

LISTAGG in Oracle to return distinct values

I am trying to use the LISTAGG function in Oracle. I would like to get only the distinct values for that column. Is there a way in which I can get only the distinct values without creating a function ..

expected assignment or function call: no-unused-expressions ReactJS

class Game extends Component { constructor() { super() this.state = { speed: 0 } //firebaseInit() } render() { return ( <div> <h1>T..

Installing a plain plugin jar in Eclipse 3.5

Since Eclipse 3.5 there seems to be no option to have drop a plugin jar ( not a feature ) in the Eclipse base directory and have it picked up at next startup. Is there any possiblity to have plain pl..

Update records using LINQ

I need to set a value in a table for a subset of rows. In SQL, I would do this: UPDATE dbo.Person SET is_default = 0 WHERE person_id = 5 Is there a way to do this in LINQ? I currently use the: va..

Select records from NOW() -1 Day

Is there a way in a MySQL statement to order records (through a date stamp) by >= NOW() -1 so all records from the day before today to the future are selected?..

I want to load another HTML page after a specific amount of time

I have one html page "form1.html" which has an animated image. I want to load another page "form2.html" after 5 seconds. How do I do this?..

Why does git say "Pull is not possible because you have unmerged files"?

When I try to pull in my project directory in the terminal, I see the following error: harsukh@harsukh-desktop:~/Sites/branch1$ git pull origin master U app/config/app.php U app/config/database.php U..

How do I create a MongoDB dump of my database?

What command do I use and run?..

Buiding Hadoop with Eclipse / Maven - Missing artifact

I am trying to import cloudera's org.apache.hadoop:hadoop-client:2.0.0-cdh4.0.0 from cdh4 maven repo in a maven project in eclipse 3.81, m2e plugin, with oracle's jdk 1.7.0_05 on win7 using <depe..

How do I convert a single character into it's hex ascii value in python

I am interested in taking in a single character, c = 'c' # for example hex_val_string = char_to_hex_string(c) print hex_val_string output: 63 What is the simplest way of going about this? Any pr..

How to downgrade Xcode to previous version?

I have to use Xcode occasionally, and have now come across a problem where I've upgraded to Xcode 4.6, but another piece of software I'm using doesn't support it, so I need to go back to Xcode 4.5. I..

Elastic Search: how to see the indexed data

I had a problem with ElasticSearch and Rails, where some data was not indexed properly because of attr_protected. Where does Elastic Search store the indexed data? It would be useful to check if the ..

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

How can I split a string with a string delimiter?

I have this string: My name is Marco and I'm from Italy I'd like to split it, with delimiter is Marco and, so I should get an array with My name at [0] and I'm from Italy at [1]. How can I do i..

How do I encode a JavaScript object as JSON?

Is there a good way to encode a JavaScript object as JSON? I have a list of key value pairs...where the name is from a checkbox, and the value is either true or false based on whether the box is chec..

Generating Unique Random Numbers in Java

I'm trying to get random numbers between 0 and 100. But I want them to be unique, not repeated in a sequence. For example if I got 5 numbers, they should be 82,12,53,64,32 and not 82,12,53,12,32 I use..

How to delete a column from a table in MySQL

Given the table created using: CREATE TABLE tbl_Country ( CountryId INT NOT NULL AUTO_INCREMENT, IsDeleted bit, PRIMARY KEY (CountryId) ) How can I delete the column IsDeleted?..

How to catch curl errors in PHP

I am using PHP curl functions to post data to the web server from my local machine. My code is as follows: $c = curl_init(); curl_setopt($c, CURLOPT_URL, $url); curl_setopt($c, CURLOPT_RETURNTRANSFER..

How do I get the current date and time in PHP?

Which PHP function can return the current date/time?..

"React.Children.only expected to receive a single React element child" error when putting <Image> and <TouchableHighlight> in a <View>

I have the following render method in my React Native code: render() { const {height, width} = Dimensions.get('window'); return ( <View style={styles.container}> <Image..

AngularJS $location not changing the path

I'm having an issue with changing the URL of the page after a form has been submitted. Here's the flow of my app: Routes are set, URL is recognized to some form page. Page loads, controller sets va..

How do I enumerate through a JObject?

I'm trying to determine how to access the data that is in my JObject and I can't for the life of me determine how to use it. JObject Object = (JObject)Response.Data["my_key"]; I can print it to the..

iOS 11, 12, and 13 installed certificates not trusted automatically (self signed)

On our internal network, we use a self-signed CA certificate. This has worked fine for years, in both Safari and our iOS product, all the way through iOS 10. We simply install the CA certificate on an..

oracle varchar to number

How do i convert a oracle varchar value to number eg table - exception exception_value 555 where exception_value is a varchar type I would like to test the value of exception_value column select..

Transparent scrollbar with css

Now use this code (and many variations of this), but scroll track get dark-grey color, something like #222222 or near this. Find many examples, but all of them give same result. Opera, Chrome and Fire..

Dynamic SELECT TOP @var In SQL Server

How can I have a dynamic variable setting the amount of rows to return in SQL Server? Below is not valid syntax in SQL Server 2005+: DECLARE @count int SET @count = 20 SELECT TOP @count * FROM SomeT..

Delete file from internal storage

I'm trying to delete images stored in internal storage. I've come up with this so far: File dir = getFilesDir(); File file = new File(dir, id+".jpg"); boolean deleted = file.delete(); And this is f..

Java Wait for thread to finish

I have a thread downloading data and I want to wait until the download is finished before I load the data. Is there a standard way of doing this? More Info: I have a Download class that gets data f..

JAX-WS - Adding SOAP Headers

I am trying to create a standalone client to consume some web services. I must add my username and password to the SOAP Header. I tried adding the credentials as follows: OTSWebSvcsService service =..

How do I resolve the " Address already in use: JVM_Bind" error?

In Eclipse, I got this error: run: [java] Error creating the server socket. [java] Oct 04, 2012 5:31:38 PM cascadas.ace.AceFactory bootstrap [java] SEVERE: Failed to create world : jav..

Attempt to invoke virtual method 'void android.widget.Button.setOnClickListener(android.view.View$OnClickListener)' on a null object reference

The problem is as follows. I have a login activity (in Android Studio) which worked fine a few days before. I don't remember changing anything but when I run this one the previous time the app closed ..

maven command line how to point to a specific settings.xml for a single command?

Is it possible to point to a specific settings file in order to override the default settings.xml being used by maven for a single command? Example: mvn clean install -Dparam # -> pass specific se..

How to export JSON from MongoDB using Robomongo

So I do not know much about MongoDB. I have RoboMongo using which I connect to a MongoDB. What I need to do is this - there is a collection in that MongoDB. I want to export the data from that collect..

Make the size of a heatmap bigger with seaborn

I create a heatmap with seaborn df1.index = pd.to_datetime(df1.index) df1 = df1.set_index('TIMESTAMP') df1 = df1.resample('30min').mean() ax = sns.heatmap(df1.iloc[:, 1:6:], annot=True, linewidths=..

Why is char[] preferred over String for passwords?

In Swing, the password field has a getPassword() (returns char[]) method instead of the usual getText() (returns String) method. Similarly, I have come across a suggestion not to use String to handle ..

How can I make a HTML a href hyperlink open a new window?

This is my code: <a href="" onClick="window.location.href='';return false;" target="_blank">test</a> When you click it, it takes you to Yahoo bu..

socket.emit() vs. socket.send()

What's the difference between these two? I noticed that if I changed from socket.emit to socket.send in a working program, the server failed to receive the message, although I don't understand why. ..

Replacing .NET WebBrowser control with a better browser, like Chrome?

Is there any relatively easy way to insert a modern browser into a .NET application? As far as I understand, the WebBrowser control is a wrapper for IE, which wouldn't be a problem except that it lo..

XSLT string replace

I don't really know XSL but I need to fix this code, I have reduced it to make it simpler. I am getting this error Invalid XSLT/XPath function on this line <xsl:variable name="text" select=..

Failed to load ApplicationContext for JUnit test of Spring controller

I want to write a test case to check my controller (getPersons). This is a server side code. I have confusion what should i put inside @ContextConfiguration(locations={"file:src/main/webapp/WEB-INF/ap..

Best way to work with transactions in MS SQL Server Management Studio

Let's say I have an SQL statement that's syntactically and semantically correct so it executes. In Management Studio (or any other query tool) how can I test SQL statements, and if I notice that the..

Choose folders to be ignored during search in VS Code

Right now when I use ?+O to search for files, the fuzzy matching appears to operate over all files in the current project. Unfortunately, this includes a number of files from build and vendor director..

How can I make setInterval also work when a tab is inactive in Chrome?

I have a setInterval running a piece of code 30 times a second. This works great, however when I select another tab (so that the tab with my code becomes inactive), the setInterval is set to an idle s..

Can I set state inside a useEffect hook

Lets say I have some state that is dependent on some other state (eg when A changes I want B to change). Is it appropriate to create a hook that observes A and sets B inside the useEffect hook? Wi..

JavaScript equivalent to printf/String.Format

I'm looking for a good JavaScript equivalent of the C/PHP printf() or for C#/Java programmers, String.Format() (IFormatProvider for .NET). My basic requirement is a thousand separator format for numb..

How to get All input of POST in Laravel

I am using Laravel 5 and trying to get all input of POST variable in controller like this- public function add_question() { return Request::all(); } So, I am getting this errors- What I am d..

Navigation bar with UIImage for title

I want to customize my app's look by using a logo image as the navigation bar's title, instead of plain text. When I use this code let logo = UIImage(named: "logo.png") self.navigationItem.titleView ..

Getting Java version at runtime

I need to work around a Java bug in JDK 1.5 which was fixed in 1.6. I'm using the following condition: if (System.getProperty("java.version").startsWith("1.5.")) { ... } else { ... } Will t..

Windows batch script launch program and exit console

I have a batch script that I use to launch a program, such as notepad.exe. When I double click on this batch file, notepad starts normally, but the black window of the cmd who launched notepad.exe rem..

"Bitmap too large to be uploaded into a texture"

I'm loading a bitmap into an ImageView, and seeing this error. I gather this limit relates to a size limit for OpenGL hardware textures (2048x2048). The image I need to load is a pinch-zoom image of a..

Getting the URL of the current page using Selenium WebDriver

I'm attempting to get the URL of the currently open page. I am using Selenium WebDriver and Java. I am accessing the current URL via: WebDriver driver = new WebDriver(); String url = driver.getCurr..

In CSS Flexbox, why are there no "justify-items" and "justify-self" properties?

Consider the main axis and cross axis of a flex container:                        &..

How to set value to variable using 'execute' in t-sql?

DECLARE @dbName nvarchar(128) = 'myDb' DECLARE @siteId int exec ('SELECT TOP 1 @siteId = Id FROM ' + @dbName + '..myTbl') select @siteId When I run the script above I get the following error Msg..

Git asks for username every time I push

Whenever I try to push into my repo git asks for both username & password. I have no problem in re-entering my password each time but the problem is in entering username. I use https to clone my..

How to detect if JavaScript is disabled?

There was a post this morning asking about how many people disable JavaScript. Then I began to wonder what techniques might be used to determine if the user has it disabled. Does anyone know of some..

YouTube API to fetch all videos on a channel

We need a video list by channel name of YouTube (using the API). We can get a channel list (only channel name) by using the below API:

What happens to a declared, uninitialized variable in C? Does it have a value?

If in C I write: int num; Before I assign anything to num, is the value of num indeterminate?..

Android: keeping a background service alive (preventing process death)

I have a service that is defined as: public class SleepAccelerometerService extends Service implements SensorEventListener Essentially, I am making an app that monitors accelerometer activity for v..

Convert list to array in Java

How can I convert a List to an Array in Java? Check the code below: ArrayList<Tienda> tiendas; List<Tienda> tiendasList; tiendas = new ArrayList<Tienda>(); Resources res = this.g..

Imitating a blink tag with CSS3 animations

I really want to make a piece of text blink the old-school style without using javascript or text-decoration. No transitions, only *blink*, *blink*, *blink*! EDIT: This is different from that que..

PHP Function Comments

Just a quick question: I've seen that some PHP functions are commented at the top, using a format that is unknown to me: /** * * Convert an object to an array * * @param object $object The ob..

VSCode cannot find module '@angular/core' or any other modules

My project was generated with Angular CLI version 1.2.6. I can compile the project and it works fine, but I always get error in VSCode telling me: cannot find module '@angular/core' cannot find modu..

How to add a list item to an existing unordered list?

I have code that looks like this: <div id="header"> <ul class="tabs"> <li><a href="/user/view"><span class="tab">Profile</span></a></li> ..

Custom height Bootstrap's navbar

I want a header with a height of 150px which contains a navbar. The navbar should be vertically centered in the header. HTML: <header> <div class="navbar navbar-static-top"> ..

Refused to display 'url' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'

<script async="" defer="" src="//"></script> Screenshot of the error: and I'm getting Refused to display 'https:/..

How to make/get a multi size .ico file?

I simply want to have an .ico file that has multiple sizes of the icon image contained within it. I'd like it for use in a cross-platform desktop application (so that, e.g. on Windows, the 16x16 size..

ReferenceError: variable is not defined

I met this issue sometimes but still don't know what causes it. I have this script in the page: $(function(){ var value = "10"; }); But the browser says "ReferenceError: value is not defined"...

How to retrieve the dimensions of a view?

I have a view made up of TableLayout, TableRow and TextView. I want it to look like a grid. I need to get the height and width of this grid. The methods getHeight() and getWidth() always return 0. ..

How to downgrade to older version of Gradle

I have in my .gradle folder, a 2.4 folder which is the version of gradle. I want to downgrade to 2.2.1, because I need to use Gradle plugin 1.0.1. I already try to change by: distributionUrl=https://..

How to change environment's font size?

Is there a way to change the environment font size in Visual Studio Code? Stuff like IntelliSense box, debug panel, file names, etc. I know how to change the editor's font size but I cannot figure ou..

Java String to JSON conversion

i am getting data from restful api in String variable now i want to convert to JSON object but i am having problem while conversion it throws exception .Here is my code : URL url = new URL("SOME URL"..

How to downgrade tensorflow, multiple versions possible?

I have tensorflow 1.2.1 installed, and I need to downgrade it to version 1.1 to run a specific tutorial. What is the safe way to do it? I am using windows 10, python 3.5. Tensorflow was installed with..

Disable browser 'Save Password' functionality

One of the joys of working for a government healthcare agency is having to deal with all of the paranoia around dealing with PHI (Protected Health Information). Don't get me wrong, I'm all for doing e..

Java decimal formatting using String.format?

I need to format a decimal value into a string where I always display at lease 2 decimals and at most 4. So for example "34.49596" would be "34.4959" "49.3" would be "49.30" Can this be done usi..

Consider marking event handler as 'passive' to make the page more responsive

I am using hammer for dragging and it is getting choppy when loading other stuff, as this warning message is telling me. Handling of 'touchstart' input event was delayed for X ms due to main thr..

Conditional statement in a one line lambda function in python?

Apologies if this has been asked before, but I couldn't see it anywhere. Essentially I've come across a scenario where i need to make use of an if statement inside a lambda function. What makes it di..

How to install packages offline?

What's the best way to download a python package and it's dependencies from pypi for offline installation on another machine? Is there any easy way to do this with pip or easy_install? I'm trying to i..

How to examine processes in OS X's Terminal?

I’d like to view information for processes running in OS X. Running ps in the terminal just lists the open Terminal windows. How can I see all processes that are running? Say I’m running a web br..

How to place a file on classpath in Eclipse?

As this documentation says, "For example if you place this file on your classpath", but how can I place the .properties file on my classpath if I am using Eclipse?..

When & why to use delegates?

I'm relatively new in C#, & I'm wondering when to use Delegates appropriately. they are widely used in events declaration, but when should I use them in my own code and why are they useful? why no..

How do you change video src using jQuery?

How do you change the src of a HTML5 video tag using jQuery? I got this HTML: <div id="divVideo"> <video controls> <source src="test1.mp4" type="video/mp4" /> </video>..

Convert timestamp to date in Oracle SQL

How can we convert timestamp to date? The table has a field, start_ts which is of the timestamp format: '05/13/2016 4:58:11.123456 PM' I need to query the table and find the maximum and min timest..

How to declare empty list and then add string in scala?

I have code like this: val dm = List[String]() val dk = List[Map[String,Object]]() ..... dm.add("text") dk.add(Map("1" -> "ok")) but it throws runtime java.lang.UnsupportedOperationException...

Permission denied for relation

I tried to run simple sql command: select * from site_adzone; and I got this error ERROR: permission denied for relation site_adzone What could be the problem here? I tried also to do select f..

How to find out mySQL server ip address from phpmyadmin

I have access to my server's phpmyadmin. But how can I find that mysql's Ip address from phpmyadmin. My webserver and mysql is using different IPs. Is there any way to find this out?..

How to change int into int64?

Im trying to convert an integer into an integer64 in go but im having no luck. Anyone know an easy way to do this?..

React onClick function fires on render

I pass 2 values to a child component: List of objects to display delete function. I use a .map() function to display my list of objects(like in the example given in react tutorial page), but th..

Google API authentication: Not valid origin for the client

When making an auth request to the Google API (gapi), it's returning false on the checkOrigin. I have removed any client id's or anything that would link directly to my account and replaced it with a..

SelectedValue vs SelectedItem.Value of DropDownList

I'm working on an old project written and then patched by several people over the years. At some places they have used SelectedValue property and other places they used SelectedItem.Value. Question: ..

Converting an array to a function arguments list

Is it possible to convert an array in JavaScript into a function argument sequence? Example: run({ "render": [ 10, 20, 200, 200 ] }); function run(calls) { var app = .... // app is retrieved from ..

What is the question mark for in a Typescript parameter name

export class Thread { id: string; lastMessage: Message; name: string; avatarSrc: string; constructor(id?: string, name?: string, avatarSrc?: string) { this.i..

How to convert a Bitmap to Drawable in android?

How can I convert a Bitmap image to Drawable ?..

android EditText - finished typing event

I want to catch an event when the user finishes editing EditText. How can it be done?..

Linq where clause compare only date value without time value

var _My_ResetSet_Array = _DB .tbl_MyTable .Where(x => x.Active == true && x.DateTimeValueColumn <= DateTime.Now) .Select(x => x); Upper query is working correct...

When do I use the PHP constant "PHP_EOL"?

When is it a good idea to use PHP_EOL? I sometimes see this in code samples of PHP. Does this handle DOS/Mac/Unix endline issues?..

Connection refused to MongoDB errno 111

I have a Linode server running Ubuntu 12.04 LTS and MongoDB instance (service is running and CAN connect locally) that I can't connect to from an outside source. I have added these two rules to my IP..

How to implement HorizontalScrollView like Gallery?

I want to implement Horizontal ScrollView with some features of Gallery, In Gallery the scroll made at some distance it arrange in pair, i.e If we have three images shown in screen, clicking last im..

How can I create a copy of an object in Python?

I would like to create a copy of an object. I want the new object to possess all properties of the old object (values of the fields). But I want to have independent objects. So, if I change values of ..

how to always round up to the next integer

i am trying to find total pages in building a pager on a website (so i want the result to be an integer. i get a list of records and i want to split into 10 per page (the page count) when i do this:..

python's re: return True if string contains regex pattern

I have a regular expression like this: regexp = u'ba[r|z|d]' Function must return True if word contains bar, baz or bad. In short, I need regexp analog for Python's 'any-string' in 'text' How ca..

Output a NULL cell value in Excel

Possible Duplicate: Return empty cell from formula in Excel I have an IF statement. If a cell = n, then do something, else output NULL =IF(A1=5, "Success", NULL) // #NAME? =IF(A1=5, "Suc..

Converting .NET DateTime to JSON

Possible Duplicate: How to format a JSON date? My webs service is returning a DateTime to a jQuery call. The service returns the data in this format: /Date(1245398693390)/ How can I conv..

Standard deviation of a list

I want to find mean and standard deviation of 1st, 2nd,... digits of several (Z) lists. For example, I have A_rank=[0.8,0.4,1.2,3.7,2.6,5.8] B_rank=[0.1,2.8,3.7,2.6,5,3.4] C_Rank=[1.2,3.4,0.5,0.1,2.5..

Change URL parameters

I have this URL: site.fwx?position=1&archiveid=5000&columns=5&rows=20&sorting=ModifiedTimeAsc what I need is to be able to change the 'rows' url param value to something i specify, ..

Using group by and having clause

Using the following schema: Supplier (sid, name, status, city) Part (pid, name, color, weight, city) Project (jid, name, city) Supplies (sid, pid, jid**, quantity) Get supplier numbers and names f..

A Java collection of value pairs? (tuples?)

I like how Java has a Map where you can define the types of each entry in the map, for example <String, Integer>. What I'm looking for is a type of collection where each element in the collect..

HttpClient not supporting PostAsJsonAsync method C#

I am trying to call a web API from my web application. I am using .Net 4.5 and while writing the code I am getting the error HttpClient does not contain a definition PostAsJsonAsync method. Below is ..

How to make a HTTP request using Ruby on Rails?

I would like to take information from another website. Therefore (maybe) I should make a request to that website (in my case a HTTP GET request) and receive the response. How can I make this in Ruby..

Finding the source code for built-in Python functions?

Is there a way to see how built in functions work in python? I don't mean just how to use them, but also how were they built, what is the code behind sorted or enumerate etc...?..

Send response to all clients except sender

To send something to all clients, you use: io.sockets.emit('response', data); To receive from clients, you use: socket.on('cursor', function(data) { ... }); How can I combine the two so that w..

MySQL Install: ERROR: Failed to build gem native extension

I'm trying to get MySQL installed to the latest version due to some installation going wrong somewhere along the line. I run the command gem install mysql and I receive the following: Building na..

AttributeError: Module Pip has no attribute 'main'

I am trying to build the python api for an open source project called Zulip and I keep running into the same issue as indicated by the screenshot below. I am running python3 and my pip version is 10...

Aesthetics must either be length one, or the same length as the dataProblems

I would like to make a plot with X values as a subset of the measurement and Y-values as another subset of the measured data. In the example as below, I have 4 products p1, p2, p3 and p4. Each are pr..

Bundle ID Suffix? What is it?

I'm new to the iPhone submission process. Apple asks for the Bundle ID Suffix. What is this? Not sure what to put here and what the significance of it is...

How to get 30 days prior to current date?

I have a start calendar input box and an end calendar input box. We want defaults start calendar input box 30 days prior to current date and the end calendar input box to be the current date. Here is ..

String comparison using '==' vs. 'strcmp()'

It seems that PHP's === operator is case sensitive. So is there a reason to use strcmp()? Is it safe to do something like the following? if ($password === $password2) { ... } ..

Check if a class `active` exist on element with jquery

Check if a class active exist on an li with a class menu For example <li class="menu active">something...</li> ..

Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154

I developed a Windows service using C#.NET to generate PDF report. To generate PDF file I am using a third party dll. The application is running in my Windows XP platform. When I deployed the service ..

Linux delete file with size 0

How do I delete a certain file in linux if its size is 0. I want to execute this in an crontab without any extra script. l filename.file | grep 5th-tab | not eq 0 | rm Something like this?..

javax.el.PropertyNotFoundException: Property 'foo' not found on type com.example.Bean

I have results from Query query = session.createQuery("From Pool as p left join fetch p.poolQuestion as s"); query and I would like to display it on JSP. I have loop: <c:forEach items="${pools..

How to print a list with integers without the brackets, commas and no quotes?

This is a list of Integers and this is how they are printing: [7, 7, 7, 7] I want them to simply print like this: 7777 I don't want brackets, commas or quotes. What to do?..

Function to convert column number to letter?

Does anyone have an Excel VBA function which can return the column letter(s) from a number? For example, entering 100 should return CV...

Javascript change date into format of (dd/mm/yyyy)

How can I convert the following date format below (Mon Nov 19 13:29:40 2012) into: dd/mm/yyyy <html> <head> <script type="text/javascript"> function test(){ ..

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

GSON - Date format

I'm trying to have a custom date format in Gson output, but .setDateFormat(DateFormat.FULL) doesn't seem to work and it the same with .registerTypeAdapter(Date.class, new DateSerializer()). It's like..

XML Serialize generic list of serializable objects

Can I serialize a generic list of serializable objects without having to specify their type. Something like the intention behind the broken code below: List<ISerializable> serializableList = n..

How to remove and clear all localStorage data

I need to clear all data i set into localStorage. By this, I mean completely reset localStorage to null when users remove their accounts. How can i do that with a simple function? I tried this: fu..

Difference between app.use and app.get in express.js

I'm kind of new to express and node.js, and I can't figure out the difference between app.use and app.get. It seems like you can use both of them to send information. For example: app.use('/',functio..

Is it possible to create a remote repo on GitHub from the CLI without opening browser?

I created a new local Git repository: ~$ mkdir projectname ~$ cd projectname ~$ git init ~$ touch file1 ~$ git add file1 ~$ git commit -m 'first commit' Is there any git command to create a new rem..

How do I limit the number of results returned from grep?

I would like to say 10 lines max from grep. I don't want my computer to work hard. I want it to stop after 10 results found by grep. Is it possible?..

error: use of deleted function

I've been working on some C++ code that a friend has written and I get the following error that I have never seen before when compiling with gcc4.6: error: use of deleted function ‘GameFSM_<std..

Set Encoding of File to UTF8 With BOM in Sublime Text 3

When I open a file in Sublime Text 3, at the bottom I have an option to set the Character Encoding as shown in the screenshot. There is the option to set it to UTF-8 , which after doing some resear..

Symfony - generate url with parameter in controller

I want to generate a Url directly in my controller. I want to user a url defined in my routing.yml file that needs a parameter. I've found that code in the Cookbook (Routage section) : $params = $ro..

Codeigniter's `where` and `or_where`

I'm trying to specify a query in my model $this->db ->select('*') ->from('library') ->where('library.rating >=', $form['slider']) ->where('library.vo..

How do I stretch a background image to cover the entire HTML element?

I'm trying to get a background image of a HTML element (body, div, etc.) to stretch its entire width and height. Not having much luck. Is it even possible or do I have to do it some other way besides..

form serialize javascript (no framework)

Wondering is there a function in javascript without jquery or any framework that allows me to serialize the form and access the serialized version?..

SELECT from nothing?

Is it possible to have a statement like SELECT "Hello world" WHERE 1 = 1 in SQL? The main thing I want to know, is can I SELECT from nothing, ie not have a FROM clause...