Questions Tagged with #Incomplete type

In the C and C++ languages, an incomplete type is "lacking sufficient information to determine the size of objects of that type." (Examples: variable-length arrays, forward declarations of `struct`s, and the `void` type.)

jQuery duplicate DIV into another DIV

Need some jquery help copying a DIV into another DIV and hoping that this is possible. I have the following HTML: <div class="container"> <div class="button"></div> </div&g..

An item with the same key has already been added

I get this error whenever I submit the form also the action method is not being called because of this: An item with the same key has already been added. And the exception details: [Argument..

Simple PHP form: Attachment to email (code golf)

Imagine a user that would like to put a form on their website that would allow a website visitor to upload a file and a simple message, which will immediately be emailed (ie, the file is not stored on..

"Could not find a version that satisfies the requirement opencv-python"

I am struggling with Jetson TX2 board (aarch64). I need to install python wrapper for OpenCV. I can do: $ sudo apt-get install python-opencv But I cannot do: $ sudo pip install opencv-python I..

shell init issue when click tab, what's wrong with getcwd?

once i click Tab on bash, the error message will appear, what's wrong? symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory symlink-ho..

Get screenshot on Windows with Python?

I am creating a Beta Testers reporting module so they can send in thier comments on my software, but I would like to have the option to include a screenshot with the report. How do I take a screenshot..

How to get keyboard input in pygame?

I am making a game in pygame 1.9.2. It's a faily simple game in which a ship moves between five columns of bad guys who attack by moving slowly downward. I am attempting to make it so that the ship mo..

WooCommerce - get category for product page

For my WC product pages, I need to add a class to the body tag so that I can perform some custom styling. Here's the function I'm creating for this... function my_add_woo_cat_class($classes) { $..

Multiple github accounts on the same computer?

Trying to work on both my actual "work" repos, and my personal repos on git hub, from my computer. The work account was set up first, and everything works flawlessly. My personal account, ho..

Taking the record with the max date

Let's assume I extract some set of data. i.e. SELECT A, date FROM table I want just the record with the max date (for each value of A). I could write SELECT A, col_date FROM TABLENAME t_ext W..

Error: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'

I recently upgraded/updated Entity Framework in an old project from version 4 or 5 to version 6. Now I get this exception: An exception of type 'System.InvalidOperationException' occurred in Ent..

How do I convert a string to a double in Python?

I would like to know how to convert a string containing digits to a double...

Background position, margin-top?

I currently have my background set to top right as: #thedivstatus { background-image: url("imagestatus.gif"); background-position: right top; background-repeat: no-repeat; } BUT! I need..

Get the current URL with JavaScript?

All I want is to get the website URL. Not the URL as taken from a link. On the page loading I need to be able to grab the full, current URL of the website and set it as a variable to do with as I plea..

How to declare a variable in SQL Server and use it in the same Stored Procedure

Im trying to get the value from BrandID in one table and add it to another table. But I can't get it to work. Anybody know how to do it right? CREATE PROCEDURE AddBrand AS DECLARE @BrandName nvarch..

Copy an entire worksheet to a new worksheet in Excel 2010

I have found similar questions that deal with copying an entire worksheet in one workbook and pasting it to another workbook, but I am interested in simply copying an entire worksheet and pasting it t..

check if file exists on remote host with ssh

I would like to check if a certain file exists on the remote host. I tried this: $ if [ ssh user@localhost -p 19999 -e /home/user/Dropbox/path/Research_and_Development/Puffer_and_Traps/Repeaters_Netw..

How can I use Google's Roboto font on a website?

I want to use Google's Roboto font on my website and I am following this tutorial: I have downloaded the file which has a f..

How do I get textual contents from BLOB in Oracle SQL

I am trying to see from an SQL console what is inside an Oracle BLOB. I know it contains a somewhat large body of text and I want to just see the text, but the following query only indicates that the..

How to correctly get image from 'Resources' folder in NetBeans

I have a Java Project in NetBeans 7.0. I want to add some image to some label dynamically. The image will differ depending on the state of the program. I put one such image, 'filling.jpg', in the 'r..

Using Application context everywhere?

In an Android app, is there anything wrong with the following approach: public class MyApp extends { private static MyApp instance; public MyApp() { instance..

Waiting until the task finishes

How could I make my code wait until the task in DispatchQueue finishes? Does it need any CompletionHandler or something? func myFunction() { var a: Int? DispatchQueue.main.async { va..

How to create roles in ASP.NET Core and assign them to users?

I am using the ASP.NET Core default website template and have the authentication selected as "Individual User Accounts". How can I create roles and assign it to users so that I can use the r..

How to output JavaScript with PHP

I am new to PHP. I need to output the following JavaScript with PHP. This is my code: <html> <body> <?php echo "<script type="text/javascript">"; echo "document.write("Hello Wor..

DatabaseError: current transaction is aborted, commands ignored until end of transaction block?

I got a lot of errors with the message : "DatabaseError: current transaction is aborted, commands ignored until end of transaction block" after changed from python-psycopg to python-psycopg2 as Dja..

Could not load type from assembly error

I have written the following simple test in trying to learn Castle Windsor's Fluent Interface: using NUnit.Framework; using Castle.Windsor; using System.Collections; using Castle.MicroKernel.Registra..

Code formatting shortcuts in Android Studio for Operation Systems

I have started developing with Android Studio. In Eclipse I was using Ctrl + Shift + F, but in Android Studio it does not work. It will be different. How can I jump to any method in a .java file? I w.. Connection refused

I'm trying to implement a TCP connection, everything works fine from the server's side but when I run the client program (from client computer) I get the following error: C..

port 8080 is already in use and no process using 8080 has been listed

I am trying to start Tomcat from Eclipse, but a problem occured: Port 8080 required by Tomcat v6.0 Server at localhost is already in use. The server may already be running in another process, or..

How can I convert an RGB image into grayscale in Python?

I'm trying to use matplotlib to read in an RGB image and convert it to grayscale. In matlab I use this: img = rgb2gray(imread('image.png')); In the matplotlib tutorial they don't cover it. They ju..

Count number of lines in a git repository

How would I count the total number of lines present in all the files in a git repository? git ls-files gives me a list of files tracked by git. I'm looking for a command to cat all those files. Some..

How to get PID of process I've just started within java program?

I've started a process with following code ProcessBuilder pb = new ProcessBuilder("cmd", "/c", "path"); try { Process p = pb.start(); } catch (IOException ex) {} Now I need to know..

List(of String) or Array or ArrayList

Hopefully a simple question to most programmers with some experience. What is the datatype that lets me do this? Dim lstOfStrings as *IDK* Dim String0 As String = "some value" Dim String1 As Strin..

How to use delimiter for csv in python

I'm having trouble with figuring out how to use the delimiter for csv.writer in Python. I have a csv file in which the strings separated by commas are in single cell and I need to have each word in ea..

Override console.log(); for production

I'm fairly new to Javascript development so this might be a real newbie question. I've got a sencha-touch application riddled with console.log(); for debugging purposes. I've got chirpy doing all of..

How to re-sign the ipa file?

How do I sign the .ipa file with a provisioning profile after I generate an IPA like the following with a different provision profile? I would like to sign the IPA with an ad-hoc provisioning profile ..

Creating a BAT file for python script

How can I create a simple BAT file that will run my python script located at C:\

Array Index Out of Bounds Exception (Java)

Here is my code: public class countChar { public static void main(String[] args) { int i; String userInput = new String(); userInput = Input.getString("Please enter a se..

Using msbuild to execute a File System Publish Profile

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

How to draw circle in html page?

How do you draw a circle using HTML5 and CSS3? Is it also possible to put text inside?..

Authentication versus Authorization

What's the difference in context of web applications? I see the abbreviation "auth" a lot. Does it stand for auth-entication or auth-orization? Or is it both?..

How to make sure you don't get WCF Faulted state exception?

I am getting this exception: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. The WCF service us..

How to use ArgumentCaptor for stubbing?

In Mockito documentation and javadocs it says It is recommended to use ArgumentCaptor with verification but not with stubbing. but I don't understand how ArgumentCaptor can be used for stubbing..

Why is it important to override GetHashCode when Equals method is overridden?

Given the following class public class Foo { public int FooId { get; set; } public string FooName { get; set; } public override bool Equals(object obj) { Foo fooItem = obj as..

Bold black cursor in Eclipse deletes code, and I don't know how to get rid of it

When I edit code in the middle of statements, it replaces the current code around it. I cannot find a way to replace this with a normal cursor that only inserts data instead of replacing it. Is that f..

How can I convert IPV6 address to IPV4 address?

I have application that uses IPv4 addresses (it stores them as long), so it only understands IPv4 addresses. Is it possible to convert IPv6 address to IPv4 with Java?..

JSTL if tag for equal strings

I've got a variable from an object on my JSP page: <%= ansokanInfo.getPSystem() %> The value of the variable is NAT which is correct and I want to apply certain page elements for this value. H..

Merging Cells in Excel using C#

I have a database which contains 5 tables. Each table contains 24 rows and each row contains 4 columns. I want to display these records in Excel sheet. The heading of each table is the name of the ta..

text box input height

I made the size of the box bigger. it look bigger int the dream weaver design view but does not seem to work in the browsers. <input type="text" **height="60%"** name=" item" align="left" /> ..

Blur effect on a div element

Is it possible to add a gaussian blur on div element? If yes, how I can do this?..

Now() function with time trim

So the function =Now() there a way I can use this and only get the date, not the time? or is there just a function for this idea?..

How to remove files that are listed in the .gitignore but still on the repository?

I have some files in my repository that should be ignored, i added them to the .gitignore but, of course, they are not removed from my repository. So my question is, is there a magic command or scrip..

.attr('checked','checked') does not work

I am trying to check radio. Neither the following works: [edit] $('selector').attr('checked','checked'); $('selector').attr('checked',true); The two alert() in the following code show "1" and "a",..

What is the HTML tabindex attribute?

What is the tabindex attribute used for in HTML?..

How do I bind a WPF DataGrid to a variable number of columns?

My WPF application generates sets of data which may have a different number of columns each time. Included in the output is a description of each column that will be used to apply formatting. A simp..

Bootstrap $('#myModal').modal('show') is not working

I'm not sure why but all the modal functions are not working with me. I checked the version and the load they are fine. I keep getting this error message: Uncaught TypeError: $(...).modal is not a..

Convert txt to csv python script

I have a .txt file with this inside - 2.9,Gardena CA What I'm trying to do is convert that text into a .csv (table) using a python script: import csv import itertools with open('log.txt', 'r') as ..

Setting new value for an attribute using jQuery

I am trying to set a new vale of a custom attribute of a div using attr(). I found out it can be done using .attr( attributeName, value ), but when I try it it's not working. Here is the part of my c..

ORA-01950: no privileges on tablespace 'USERS'

I'm getting this error: ORA-01950: no privileges on tablespace 'USERS' I have a default tablespace and I'm able to create tables, however, they do not show at the objects tab in Toad. I cannot i..

How to convert milliseconds to "hh:mm:ss" format?

I'm confused. After stumbling upon this thread, I tried to figure out how to format a countdown timer that had the format hh:mm:ss. Here's my attempt - //hh:mm:ss String.format("%02d:%02d:%02d", ..

How much overhead does SSL impose?

I know there's no single hard-and-fast answer, but is there a generic order-of-magnitude estimate approximation for the encryption overhead of SSL versus unencrypted socket communication? I'm talking ..

Create an empty object in JavaScript with {} or new Object()?

There are two different ways to create an empty object in JavaScript: var objectA = {} var objectB = new Object() Is there any difference in how the script engine handles them? Is there any reason ..

How to prevent auto-closing of console after the execution of batch file

What command can I put at the end of a batch file to prevent auto-closing of the console after the execution of the file?..

Replace all particular values in a data frame

Having a data frame, how do I go about replacing all particular values along all rows and columns. Say for example I want to replace all empty records with NA's (without typing the positions): df <..

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

How to get method parameter names?

Given the Python function: def a_method(arg1, arg2): pass How can I extract the number and names of the arguments. I.e., given that I have a reference to func, I want the func.[something] to re..

Convert pandas timezone-aware DateTimeIndex to naive timestamp, but in certain timezone

You can use the function tz_localize to make a Timestamp or DateTimeIndex timezone aware, but how can you do the opposite: how can you convert a timezone aware Timestamp to a naive one, while preservi..

"The POM for ... is missing, no dependency information available" even though it exists in Maven Repository

Problem: A dependency will not download even though I copied it from the Maven Repository. When I hover over the dependency in Eclipse, it warns: "Maven Missing artifact org.raml:jaxrs-code-generato..

How can one run multiple versions of PHP 5.x on a development LAMP server?

I need to test my PHP applications with multiple versions of PHP 5.x, such as PHP 5.0.0 and PHP 5.2.8. Is there a way that I can configure a development LAMP server so I can quickly test applications..

How to maintain state after a page refresh in React.js?

Lets say I have code that sets state for a select box chosen on the previous page: this.setState({selectedOption: 5}); Is there any way to have this.state.selectedOption populated with 5 after a pa..

Setting transparent images background in IrfanView

I have some PNG images which consist of a black shape and a transparent background. Unfortunately, IrfanView shows transparent background as black color, so I see just black on black. I've found in Ir..

notifyDataSetChanged example

I'm trying to use in my Android Application the notifyDataSetChanged() method for an ArrayAdapter but it doesn't work for me. I found as answer here, that notifyDataSetChanged() should run in the ma..

Best way to center a <div> on a page vertically and horizontally?

Best way to center a <div> element on a page both vertically and horizontally? I know that margin-left: auto; margin-right: auto; will center on the horizontal, but what is the best way to do i..

Differentiate between function overloading and function overriding

Differentiate between function overloading and function overriding in C++?..

Remove commas from the string using JavaScript

I want to remove commas from the string and calculate those amount using JavaScript. For example, I have those two values: 100,000.00 500,000.00 Now I want to remove commas from those string a..

Overlay a background-image with an rgba background-color

I have a div with a background-image. I want to overlay the background-image with an rgba color (rgba(0,0,0,0.1)) when the user hovers the div. I was wondering if there's a one-div solution (i.e. not..

In TensorFlow, what is the difference between and Tensor.eval()?

TensorFlow has two ways to evaluate part of graph: on a list of variables and Tensor.eval. Is there a difference between these two?..

Pandas DataFrame concat vs append

I have a list of 4 pandas dataframes containing a day of tick data that I want to merge into a single data frame. I cannot understand the behavior of concat on my timestamps. See details below: data ..

How do DATETIME values work in SQLite?

I’m creating Android apps and need to save date/time of the creation record. The SQLite docs say, however, "SQLite does not have a storage class set aside for storing dates and/or times" and it's "c..

How to get the first word in the string

text is : WYATT - Ranked # 855 with 0.006 % XAVIER - Ranked # 587 with 0.013 % YONG - Ranked # 921 with 0.006 % YOUNG - Ranked # 807 with 0.007 % I want to get only ..

Is there a TRY CATCH command in Bash

I'm writing a shell script and need to check that a terminal app has been installed. I want to use a TRY/CATCH command to do this unless there is a neater way...

Pass object to javascript function

I have recently been messing around with jQuery on my website, and I have a fairly limited knowledge of Javascript. I am beginning to like the jQuery ability to pass variables to a jQuery function ins..

How to extract elements from a list using indices in Python?

If you have a list in python, and want to extract elements at indices 1, 2 and 5 into a new list, how would you do this? This is how I did it, but I'm not very satisfied: >>> a [10, 11, 12,..

What's the correct way to communicate between controllers in AngularJS?

What's the correct way to communicate between controllers? I'm currently using a horrible fudge involving window: function StockSubgroupCtrl($scope, $http) { $scope.subgroups = []; $scope.ha..

How to use `@ts-ignore` for a block

The // @ts-ignore comment enables the Typescript compiler to ignore the line below it. How can one ignore a whole block of code with Typescript?..

.NET Core vs Mono

What is the difference between .NET Core and Mono? I found a statement on the official site that said: "Code written for it is also portable across application stacks, such as Mono." My goal is to u..

When to use static keyword before global variables?

Can someone explain when you're supposed to use the static keyword before global variables or constants defined in header files? For example, lets say I have a header file with the line: const floa..

How do I call a SQL Server stored procedure from PowerShell?

I have a large CSV file and I want to execute a stored procedure for each line. What is the best way to execute a stored procedure from PowerShell?..

Copying files from server to local computer using SSH

I am having trouble copying files from a remote server using SSH. Using PuTTY I log in to the server using SSH. Once I find the file I would like to copy over to my computer, I use the command: scp u..

How to split elements of a list?

I have a list: my_list = ['element1\t0238.94', 'element2\t2.3904', 'element3\t0139847'] How can I delete the \t and everything after to get this result: ['element1', 'element2', 'element3'] ..

aspx page to redirect to a new page

What is the code required to redirect the browser to a new page with an ASPX page? I have tried this on my page default.aspx : <% Response.Redirect("new.aspx", true); %> or <%@ Response...

How do you say not equal to in Ruby?

This is a much simpler example to what I'm trying to do in my program but is the similar idea. In an if statement how do I say say not equal to? Is != correct? def test vara = 1 varb = 2 if va..

Sql error on update : The UPDATE statement conflicted with the FOREIGN KEY constraint

I have a table called patient_address, which reference a PK key in patient table. But if i try to run one of the following statements : update patient set id_no='7008255601088' where id_no='800825560..

mysql query result in php variable

Is there any way to store mysql result in php variable? thanks $query = "SELECT username,userid FROM user WHERE username = 'admin' "; $result=$conn->query($query); then I want to print selected ..

How can I disable a button on a jQuery UI dialog?

How do I go about disabling a button on the jQuery UI dialog. I can't seem to find this in any of the documentation in the link above. I have 2 buttons on the modal confirmation ("Confirm" and "Cance..

Select distinct values from a table field

I'm struggling getting my head around the Django's ORM. What I want to do is get a list of distinct values within a field on my table .... the equivalent of one of the following: SELECT DISTINCT myfie..

In plain English, what does "git reset" do?

I have seen interesting posts explaining subtleties about git reset. Unfortunately, the more I read about it, the more it appears that I don't understand it fully. I come from a SVN background and Gi..

Code snippet or shortcut to create a constructor in Visual Studio

What is the code snippet or shortcut for creating a constructor in Visual Studio? Visual Studio 2010 and C#...

What are metaclasses in Python?

In Python, what are metaclasses and what do we use them for?..

MVC ajax post to controller action method

I've been looking at the question here: MVC ajax json post to controller action method but unfortunately it doesn't seem to be helping me. Mine is pretty much the exact same, except my method signatur..

Permutations between two lists of unequal length

I’m having trouble wrapping my head around a algorithm I’m try to implement. I have two lists and want to take particular combinations from the two lists. Here’s an example. names = ['a', 'b'] n..

Search in lists of lists by given index

I have a list of two-item lists and need to search for things in it. If the list is: list = [['a','b'], ['a','c'], ['b','d']] I can search for a pair easily by doing ['a','b'] in list Now, is there ..

Python update a key in dict if it doesn't exist

I want to insert a key-value pair into dict if key not in dict.keys(). Basically I could do it with: if key not in d.keys(): d[key] = value But is there a better way? Or what's the pythonic sol..

How to store standard error in a variable

Let's say I have a script like the following: echo "This Is Error" 1>&2 echo "This Is Output" And I have another shell script: ./ | sed 's/Output/Usel..

How can I show an image using the ImageView component in javafx and fxml?

I suppose it's a very simple thing but I just can't get behind it. All I want is to show an image over an ImageView linked to fxml. Here is my code: package application; import; import..

Difference between angle bracket < > and double quotes " " while including header files in C++?

Possible Duplicate: What is the difference between #include <filename> and #include “filename”? What is the difference between angle bracket < > and double quotes " " while ..

Java code for getting current time

I am searching code in java for fetching or synchronizing my local PC system time into my application...

counting number of directories in a specific directory

How to count the number of folders in a specific directory. I am using the following command, but it always provides an extra one. find /directory/ -maxdepth 1 -type d -print| wc -l For example, i..

jquery live hover

I'm using the following jquery code to show a contextual delete button only for table rows we are hovering with our mouse. This works but not for rows that have been added with js/ajax on the fly... ..

Are PostgreSQL column names case-sensitive?

I have a db table say, persons in Postgres handed down by another team that has a column name say, "first_Name". Now am trying to use PG commander to query this table on this column-name. select * fr..

How to call window.alert("message"); from C#?

I have my own exception based on some condition and want to raise an alert when control comes in this catch block catch (ApplicationException ex) { //want to call window.alert function here } ..

Postman - How to see request with headers and body data with variables substituted

I am using the Postman Chrome plugin to invoke HTTP requests for software testing. I use the Environments feature with Environment and Global Variables to substitute variables in my requests headers a..

Only one expression can be specified in the select list when the subquery is not introduced with EXISTS

My query is as follows, and contains a subquery within it: select count(distinct dNum) from myDB.dbo.AQ where A_ID in (SELECT DISTINCT TOP (0.1) PERCENT A_ID, COUNT(DISTINCT dNum) ..

GridView Hide Column by code

I want to hide ID column in my GridView, I knew the code GridView1.Columns[0].Visible = false; but the surprise was that my count property for my GridView columns is 0 !!! while I can see data in ..

Why doesn't logcat show anything in my Android?

Why doesn't logcat show anything in my Android (while developing apps with Eclipse)? It just doesn't print anything. It's empty...

Python 3 - Encode/Decode vs Bytes/Str

I am new to python3, coming from python2, and I am a bit confused with unicode fundamentals. I've read some good posts, that made it all much clearer, however I see there are 2 methods on python 3, t..

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

How to sort with lambda in Python

In Python, I am trying to sort by date with lambda. I can't understand my error message. The message is: <lambda>() takes exactly 1 argument (2 given) The line I have is a = sorted(a, lambd..

How to update RecyclerView Adapter Data?

Trying to figure out what is the issue with updating RecyclerView's Adapter. After I get a new List of products, I tried to: Update the ArrayList from the fragment where recyclerView is created, s..

What is the most efficient way to deep clone an object in JavaScript?

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but that's non-standard and only supported by Firefox. I've done things like obj = JSON.parse(..

MySQL limit from descending order

Is it available to write a query to use same "LIMIT (from), (count)", but get result in backwards? In example if I have 8 rows in the table and I want to get 5 rows in two steps I would: first step q..

PostgreSQL how to see which queries have run

I have a PostgreSQL DB at my computer and I have an application that runs queries on it. How can I see which queries has run on my DB? I use a Linux computer and pgadmin...

Change priorityQueue to max priorityqueue

I have priority queue in Java of Integers: PriorityQueue<Integer> pq= new PriorityQueue<Integer>(); When I call pq.poll() I get the minimum element. Question: how to change the code t..

How can I pass command-line arguments to a Perl program?

I'm working on a Perl script. How can I pass command line parameters to it? Example: "string1" "string2" ..

Benefits of using the conditional ?: (ternary) operator

What are the benefits and drawbacks of the ?: operator as opposed to the standard if-else statement. The obvious ones being: Conditional ?: Operator Shorter and more concise when dealing with direc..

Ruby on Rails. How do I use the Active Record .build method in a :belongs to relationship?

I have been unable to find any documentation on the .build method in Rails (i am currently using 2.0.2). Through experimentation it seems you can use the build method to add a record into a has_many ..

Creating a pandas DataFrame from columns of other DataFrames with similar indexes

I have 2 DataFrames df1 and df2 with the same column names ['a','b','c'] and indexed by dates. The date index can have similar values. I would like to create a DataFrame df3 with only the data from co..

What are invalid characters in XML

I am working with some XML that holds strings like: <node>This is a string</node> Some of the strings that I am passing to the nodes will have characters like &, #, $, etc.: <no..

Retrieving Android API version programmatically

Is there any way to get the API version that the phone is currently running?..

Printing all properties in a Javascript Object

I am following a code academy tutorial and i am finding this difficult. The assignment is the following: Use a for-in loop to print out all the properties of nyc. var nyc = { fullName: "New..

setting request headers in selenium

I'm attempting to set the request header 'Referer' to spoof a request coming from another site. We need the ability test that a specific referrer is used, which returns a specific form to the user, ot..

How to put img inline with text

I have this code: <div class = "content-dir-item"> <p>Text input</p> <img src="./images/email.png" class = "mail" alt="img-mail" /> </div> I would put img inli..

Which Protocols are used for PING?

Okay, I know that the answer to this question is ICMP - all my textbooks are saying so, the Internet is saying so, everyone is saying so... except for my TA. According to this TA ping is used not only..

Spring Data JPA Update @Query not updating?

I have an update query: @Modifying @Transactional @Query("UPDATE Admin SET firstname = :firstname, lastname = :lastname, login = :login, superAdmin = :superAdmin, preferenceAdmin = :preferenceAdmin, ..

How can I get the current class of a div with jQuery?

Using jQuery, how can I get the current class of a div called div1?..

How to update a single library with Composer?

I need to install only 1 package for my SF2 distribution (DoctrineFixtures). When I run php composer.phar update I get - Updating twig/twig (dev-master 39d94fa => v1.13.0) The package h..

How to convert an address into a Google Maps Link (NOT MAP)

After looking (Googling) on the web for a while, I can find nothing that takes an address like: 1200 Pennsylvania Ave SE, Washington, District of Columbia, 20003 and converts it into a clickable li..

Why is using onClick() in HTML a bad practice?

I have heard many times that using JavaScript events, such as onClick(), in HTML is a bad practice, because it's not good for semantics. I would like to know what the downsides are and how to fix the ..

Randomize a List<T>

What is the best way to randomize the order of a generic list in C#? I've got a finite set of 75 numbers in a list I would like to assign a random order to, in order to draw them for a lottery type ap..

How to convert an Image to base64 string in java?

It may be a duplicate but i am facing some problem to convert the image into Base64 for sending it for Http Post. I have tried this code but it gave me wrong encoded string. public static void main(..

PDF Parsing Using Python - extracting formatted and plain texts

I'm looking for a PDF library which will allow me to extract the text from a PDF document. I've looked at PyPDF, and this can extract the text from a PDF document very nicely. The problem with this is..

How do I find my host and username on mysql?

I need to open my database through PHP. But I need to know my username and the name of my host (e.g. localhost), and I don't know them. When I used mysql and did my database, it just asked me directly..

Mask output of `The following objects are masked from....:` after calling attach() function

I wonder if there is a way to mask the long list output of The following objects are masked from XXX(position 11): every time I call attach() function? ..

Using "-Filter" with a variable

I try to filter out something like this: Get-ADComputer -Filter {name -like "chalmw-dm*" -and Enabled -eq "true"} ... This works like a charm and gets exactly what I want... Now I want the "name -..

IIS7 folder permissions for web application

I am using windows authentication without impersonation on my company's intranet website with IIS7. Under IIS7, what account is used to access the folder which contains my web app using these setting..

if, elif, else statement issues in Bash

I can't seem to work out what the issue with the following if statement is in regards to the elif and then. Keep in mind the printf is still under development I just haven't been able to test it yet i..

How to keep a VMWare VM's clock in sync?

I have noticed that our VMWare VMs often have the incorrect time on them. No matter how many times I reset the time they keep on desyncing. Has anyone else noticed this? What do other people do to ke..

Is there StartsWith or Contains in t sql with variables?

I am trying to detect if the server is running Express Edition. I have the following t sql. DECLARE @edition varchar(50); set @edition = cast((select SERVERPROPERTY ('edition')) as varchar) print ..

Margin-Top not working for span element?

Can someone tell me what I coded wrong? Everything is working, the only thing is that there is no margin at the top. HTML: <div id="contact_us"> <!-- BEGIN CONTACT US --> <span clas..

How to sort List of objects by some property

I have simple class public class ActiveAlarm { public long timeStarted; public long timeEnded; private String name = ""; private String description = ""; private String event; ..

How to save a base64 image to user's disk using JavaScript?

I have converted the source content from the <img> html tag to a base64String using JavaScript. The image was displayed clearly. Now I want to save that image to user's disk using javascript. &..

Converting milliseconds to minutes and seconds with Javascript

Soundcloud's API gives the duration of it's tracks as milliseconds. JSON looks like this: "duration": 298999 I've tried many functions I found on here to no avail. I'm just looking for something to..

<img>: Unsafe value used in a resource URL context

Since upgrading to the latest Angular 2 release candidate, my img tags: <img class='photo-img' [hidden]="!showPhoto1" src='{{theMediaItem.photoURL1}}'> are throwing a browser error: ORIGI..

Facebook development in localhost

Just wanted to know if there is any way I could develop Facebook applications in localhost. ..

list.clear() vs list = new ArrayList<Integer>();

Which one of the 2 options is better and faster to clear an ArrayList, and why? list.clear() or list = new ArrayList<Integer>(); It happens that I have to, at random times, clear all entr..

Specifying and saving a figure with exact size in pixels

Say I have an image of size 3841 x 7195 pixels. I would like to save the contents of the figure to disk, resulting in an image of the exact size I specify in pixels. No axis, no titles. Just the imag..

How to define two angular apps / modules in one page?

I'm trying to add two angular apps / modules to one page. In the fiddles below you can see that always only the first module, referenced in the html code, will work correctly, whereas the second is no..

Remove padding or margins from Google Charts

_x000D_ _x000D_ // Load the Visualization API and the piechart package._x000D_ google.load('visualization', '1.0', {'packages':['corechart']});_x000D_ _x000D_ // Set a callback to run when the Google ..

How to retrieve Key Alias and Key Password for signed APK in android studio(migrated from Eclipse)

I have an android app currently published in Google Play which I update periodically. I follow the following process to sign the app before a new push: Press right-mouse on the project, the 'Android..

Check Whether a User Exists

I want to create a script to check whether a user exists. I am using the logic below: # getent passwd test > /dev/null 2&>1 # echo $? 0 # getent passwd test1 > /dev/null 2&>1 # ec..

Center an item with position: relative

I've got a menu that appears on hover over an absolutely positioned div. All of the menu items have to be relatively positioned because the absolutely div will appear multiple times on a page and will..

SQLAlchemy insert or update example

In Python, using SQLAlchemy, I want to insert or update a row. I tried this: existing = db.session.query(Toner) for row in data: new = Toner(row[0], row[1], row[2]) It does not work. How do I..

Prevent double submission of forms in jQuery

I have a form that takes a little while for the server to process. I need to ensure that the user waits and does not attempt to resubmit the form by clicking the button again. I tried using the follow..

Join vs. sub-query

I am an old-school MySQL user and have always preferred JOIN over sub-query. But nowadays everyone uses sub-query, and I hate it; I don't know why. I lack the theoretical knowledge to judge for my..

I am trying to integrate Google sign in, in my app, I added these libraries: compile '' compile '' ..

Version of Apache installed on a Debian machine

How can I check which version of Apache is installed on a Debian machine? Is there a command for doing this?..

What is Ruby's double-colon `::`?

What is this double-colon ::? E.g. Foo::Bar. I found a definition: The :: is a unary operator that allows: constants, instance methods and class methods defined within a class or module, to be a..

SQL Bulk Insert with FIRSTROW parameter skips the following line

I can't seem to figure out how this is happening. Here's an example of the file that I'm attempting to bulk insert into SQL server 2005: ***A NICE HEADER HERE*** 0000001234|SSNV|00013893-03JUN09 00..

Git Stash vs Shelve in IntelliJ IDEA

I am very unfamiliar with the shelve aspect of Git. If stash is used to put aside unfinished work what is shelve then? What would you use it for? For example on Update Project (from VCS menu) one wil..

Getting the source of a specific image element with jQuery

I have many image elements and want to get a specific image's source where the alternative text is "example". I tried this: var src = $('.conversation_img').attr('src'); but I can't get the one I ..

JSP : JSTL's <c:out> tag

Writing a JSP page, what exactly does the <c:out> do? I've noticed that the following both has the same result: <p>The person's name is <c:out value="${}" /></p> &l..

Javascript - validation, numbers only

I'm trying to get my login form to only validate if only numbers were inputted. I can it to work if the input is only digits, but when i type any characters after a number, it will still validate etc...

Remove Select arrow on IE

I have select element, i want to remove the arrow, then i can add other icon.. i can do that for Firefox Safari and Chrome, but this didn't work on IE9. .styled-select select { border: 0 !import..

Achieving white opacity effect in html/css

is there a way to achieve this effect in a cross-browser compatible way without having to prepare separated images? Basically the frame on which text lays has a white overlay of 50% opacity.. I would..

Get the client IP address using PHP

I want to get the client IP address who uses my website. I am using the PHP $_SERVER superglobal: $_SERVER['REMOTE_ADDR']; But I see it can not give the correct IP address using this. I get my IP a..

Editing the date formatting of x-axis tick labels in matplotlib

I am looking to edit the formatting of the dates on the x-axis. The picture below shows how they appear on my bar graph by default. I would like to remove the repetition of 'Dec' and '2012' and just h..

How to convert a JSON string to a dictionary?

I want to make one function in my swift project that converts String to Dictionary json format but I got one error: Cannot convert expression's type (@lvalue NSData,options:IntegerLitralConvertibl..

Simple jQuery, PHP and JSONP example?

I am facing the same-origin policy problem, and by researching the subject, I found that the best way for my particular project would be to use JSONP to do cross-origin requests. I've been reading th..

jQuery - disable selected options

Need to disable already selected options in select box using jQuery. I'd like it to grey out like asmselect. Test my example here. //JS $("#theSelect").change(function(){ var value = $("..

What tools do you use to test your public REST API?

Looking for tools use to test REST API. So far I'm only aware of SoapUI. I've tried SOAPUI but - at least in a mac - it's terrible. Wondering what people are using to test their own APIs...

Why dict.get(key) instead of dict[key]?

Today, I came across the dict method get which, given a key in the dictionary, returns the associated value. For what purpose is this function useful? If I wanted to find a value associated with a ke..

How can I wait In Node.js (JavaScript)? l need to pause for a period of time

I'm developing a console script for personal needs. I need to be able to pause for an extended amount of time, but, from my research, Node.js has no way to stop as required. It’s getting hard to rea..

How do I put an image into my picturebox using ImageLocation?

I have created a picturebox within my panel and I would like to fill it up with an image locally. this is what I have done so far and the following code is just a small part of my panel creation code..

Which data type for latitude and longitude?

I am newbie to PostgreSQL and PostGIS. I want to store latitude and longitude values in PostgreSQL 9.1.1 database table. I will calculate distance between two points, find nearer points by using this..

Using WGET to run a cronjob PHP

I tried to do a cron and run a url every 5 mintues. I tried to use WGET however I dont want to download the files on the server, all I want is just to run it. This is what I used (crontab): */5 * *..

How to write to an existing excel file without overwriting data (using pandas)?

I use pandas to write to excel file in the following fashion: import pandas writer = pandas.ExcelWriter('Masterfile.xlsx') data_filtered.to_excel(writer, "Main", cols=['Diff1', 'Diff2']) writer.s..

What does CultureInfo.InvariantCulture mean?

I have a string of text like so: var foo = "FooBar"; I want to declare a second string called bar and make this equal to first and fourth character of my first foo, so I do this like so: var bar =..

How to check if a date is greater than another in Java?

I am working on a Java application which generates a report for a duration entered by a user in the command line. The user needs to enter the dates in the following format: dd-MM-yyyy > java repor..

Getting the count of unique values in a column in bash

I have tab delimited files with several columns. I want to count the frequency of occurrence of the different values in a column for all the files in a folder and sort them in decreasing order of coun..

How to query a CLOB column in Oracle

I'm trying to run a query that has a few columns that are a CLOB datatype. If i run the query like normal, all of those fields just have (CLOB) as the value. I tried using DBMS_LOB.substr(column) and..

Is key-value pair available in Typescript?

Is key,value pair available in typescript? If yes how to do that. Can anyone provide sample example links...

How to view the current heap size that an application is using?

I think I increased my heap size to 1 GB in NetBeans since I changed the config to look like this: netbeans_default_options="-J-Xmx1g ...... After I restarted NetBeans, can I be sure that my app is..

How to pass a user / password in ansible command

I want to use Ansible as part of another Python software. in that software I have a hosts list with their user / password. Is there a way to pass the user / pass of the SSH connection to the Ansible..

How to emulate a BEFORE INSERT trigger in T-SQL / SQL Server for super/subtype (Inheritance) entities?

This is on Azure. I have a supertype entity and several subtype entities, the latter of which needs to obtain their foreign keys from the primary key of the super type entity on each insert. In Oracl..

How is VIP swapping + CNAMEs better than IP swapping + A records?

I'm in the middle of updating my DNS setup to use all CNAMEs instead of A records, because I need support for VIP swaps between Staging and Production. I can't use A records for this because that put..

How do I activate a Spring Boot profile when running from IntelliJ?

I have 5 environments: - local (my development machine) - dev - qc - uat - live - staging I want different application properties to be used for each environment, so I have the following prop..

Reading all files in a directory, store them in objects, and send the object

I do not know if this is possible, but here goes. And working with callbacks makes it even more difficult. I have a directory with html files that I want to send back to the client in Object chunks w..

Get img src with PHP

I would like to get the SRC attribute into a variable in this example: <img border="0" src="/images/image.jpg" alt="Image" width="100" height="100" /> So for example - I would like to get a v..

Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3

I can't get rid of this error! I have tried all sorts of things like clearing Derived Data(Preferences->Locations->click gray arrow to open Derived Data folder in Finder->right-click, move to trash..

How to split and modify a string in NodeJS?

I have a string : var str = "123, 124, 234,252"; I want to parse each item after split and increment 1. So I will have: var arr = [124, 125, 235, 253 ]; How can I do that in NodeJS?..