Questions Tagged with #Position

Position refers to the location of an element relative to its container, typically on the horizontal and vertical axes.

c# datatable insert column at position 0

does anyone know the best way to insert a column in a datatable at position 0?..

Using Position Relative/Absolute within a TD?

I have the following code: <td style="position: relative; min-height: 60px; vertical-align: top;"> Contents of table cell, variable height, could be more than 60px; <div style="posi..

RecyclerView - Get view at particular position

I have an activity with a RecyclerView and an ImageView. I am using the RecyclerView to show a list of images horizontally. When I click on an image in the RecyclerView the ImageView in the activity s..

How to find index of STRING array in Java from a given value?

I wanted to know if there's a native method in array for Java to get the index of the table for a given value ? Let's say my table contains these strings : public static final String[] TYPES = { ..

Set the absolute position of a view

Is it possible to set the absolute position of a view in Android? (I know that there is an AbsoluteLayout, but it's deprecated...) For example, if I have a 240x320px screen, how could I add an ImageV..

Iframe positioning

This is iframe code of google translate. <div id="contentframe" style="top: 160px; left: 0px;"> <iframe src="/translate_p?hl=en&amp;ie=UTF8&amp;prev=_t&amp;sl=auto&amp;tl=en&..

How to overlay one div over another div

I need assistance with overlaying one individual div over another individual div. My code looks like this: <div class="navi"></div> <div id="infoi"> <img src="info_icon2.png..

Make absolute positioned div expand parent div height

As you can see in the CSS below, I want child2 to position itself before child1. This is because the site I'm currently developing should also work on mobile devices, on which the child2 should be at ..

css absolute position won't work with margin-left:auto margin-right: auto

Say you have the following css applied to a div tag .divtagABS { position: absolute; margin-left: auto; margin-right:auto; } the margin-left and margin-right does not take effect bu..

Get max and min value from array in JavaScript

I am creating the following array from data attributes and I need to be able to grab the highest and lowest value from it so I can pass it to another function later on. var allProducts = $(products)...

scrollTop jquery, scrolling to div with id?

So this is the current code I have $(document).ready(function() { $('.abouta').click(function(){ $('html, body').animate({scrollTop:308}, 'slow'); return false; }); $('.po..

Google Chrome default opening position and size

I am quite a highly OCD and lazy person and currently, I noticed that everyday late at night when I’m doing some work, I leave my Google Chrome split to the right of the screen and some document on ..

Set The Window Position of an application via command line

I have an application which start in 0x0 position of my desktop. I want to open it in center of my desktop. I do not want to open it and use a move command to move it into center, just want my app to ..

How do I get the coordinate position after using jQuery drag and drop?

How do I get the coordinate position after using jQuery drag and drop? I want to save the coordinate to a database, so that next time I visit, the item will be in that position. For example, x: 520px..

Logo image and H1 heading on the same line

I want to create my first web page but I encountered a problem. I have the following code: <img src="img/logo.png" alt="logo" /> <h1>My website name</h1> I'd like to know how to ..

Center a 'div' in the middle of the screen, even when the page is scrolled up or down?

I have in my page a button which when clicked displays a div (popup style) in the middle of my screen. I am using the following CSS to center the div in the middle of the screen: .PopupPanel { b..

Slide right to left?

How can I have a div go from collapsed to expanded (and vice versa), but do so from right to left? Most everything I see out there is always left to right...

CSS: Position loading indicator in the center of the screen

How can I position my loading indicator in the center of the screen. Currently I'm using a little placeholder and it seems to work fine. However, when I scroll down, the loading indicator stays right ..

How to set iPhone UIView z index?

I want to move one view on top of another, how can I know the z index of the view, and how to move on to top?..

Fixed position but relative to container

I am trying to fix a div so it always sticks to the top of the screen, using: position: fixed; top: 0px; right: 0px; However, the div is inside a centered container. When I use position:fixed it fi..

How to get mouse position in jQuery without mouse-events?

I would like to get current mouse position but I don't want to use: $(document).bind('mousemove',function(e){ $("#log").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); }); because..

rotate image with css

I would like to rotate an image by 90 degrees with CSS only. I can do the rotation, but then the position of the image is not what it should be. First, it will overlay some other elements in the same..

Position: absolute and parent height?

I have some containers and their children are only absolute / relatively positioned. How to set containers height so their children will be inside of them? Here's the code: HTML <section id="foo..

Retrieve the position (X,Y) of an HTML element relative to the browser window

I want to know how to get the X and Y position of HTML elements such as img and div in JavaScript relative to the browser window...

How to position the Button exactly in CSS

I have been trying to make a simple site like this. However , I do now realize that I am bad at CSS Positioning for the button never does show up as intended. As you might have guessed , I want the bu..

React Native absolute positioning horizontal centre

It seems that with position:absolute in use an element cannot be centred using justifyContent or alignItems. There's a workaround to use marginLeft but does not display the same for all devices even u..

How does the "position: sticky;" property work?

I want to make the navigation bar stick to the top of the viewport once a user scrolls the page, but it's not working and I have no clue why. If you can please help, here is my HTML and CSS code: _x00..

Insert node at a certain position in a linked list C++

I'm trying to insert a node at a certain position. In my code, the numbers with position 1 is only being inserted (basically at the beginning of the linked list) and it is not inserting any data with ..

Using jquery to get element's position relative to viewport

What's the proper way to get the position of an element on the page relative to the viewport (rather than the document). jQuery.offset function seemed promising: Get the current coordinates of the..

How to position three divs in html horizontally?

I am creating a sample website which has three divisions horizontally. I want the left most div to be 25% width, the middle one to be 50% width, and right to be 25% width so that the divisions fill al..

css - position div to bottom of containing div

How can i position a div to the bottom of the containing div? <style> .outside { width: 200px; height: 200px; background-color: #EEE; /*to make it visible*/ } .inside { position..

HTML CSS Button Positioning

I have 4 buttons in a header div. I have placed them all using margins top and left in css so they are all next to each other in one line. Nothing fancy. Now I'm trying to do an action when the butto..

How to set JFrame to appear centered, regardless of monitor resolution?

While working with Java, I find it hard to position my main window in the center of the screen when I start the application. Is there any way I can do that? It doesn't have to be vertically centered,..

RecyclerView - How to smooth scroll to top of item on a certain position?

On a RecyclerView, I am able to suddenly scroll to the top of a selected item by using: ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(position, 0); However, thi..

Float right and position absolute doesn't work together

I want a div to be always at the right of its parent div, so I use float:right. It works. But I also want it to not affect other content when inserted, so I use position:absolute. Now float:right do..

Float a DIV on top of another DIV

I was recently assigned the job of copying a JS popup our previous web developer made. I've got it very similar yet there's one thing I can't get, for the close button (X) to float over the popup in t..

Get position/offset of element relative to a parent container?

I'm used to working with jQuery. In my current project however I use zepto.js. Zepto doesn't provide a position() method like jQuery does. Zepto only comes with offset(). Any idea how I can retrieve ..

SVG Positioning

I'm having a play with SVG and am having a few problems with positioning. I have a series of shapes which are contained in the g group tag. I was hoping to use it like a container, so I could set its ..

Check if element is visible on screen

Possible Duplicate: jQuery - Check if element is visible after scroling I'm trying to determine if an element is visible on screen. In order to to this, I'm trying to find the element's ver..

Display Images Inline via CSS

I have three images that I want to display in a single row next to each other. Here is the HTML: <div id="client_logos"> <img style="display: inline; margin: 0 5px;" title="heartica_logo" s..

jQuery UI dialog box not positioned center screen

I have a jQuery dialog box that is meant to position in the middle of the screen. However, it seems slightly off-center vertically. Here is the code: $('#add_box').dialog({ autoOpen: true, ..

How to position the div popup dialog to the center of browser screen?

I need to position div popup to the center of browser screen ( no matter what size the screen is). And I want to keep the position as absolute as I don't want to move the popup down when I scroll down..

How to use "svn export" command to get a single file from the repository?

How can I use the svn export command to get a single file from the repository? I've tried this: svn export e:\repositories\process\test.txt c:\ But I get this error: svn: e:\repositories\proce..

How to get the new value of an HTML input after a keypress has modified it?

I have an HTML input box <input type="text" id="foo" value="bar"> I've attached a handler for the 'keyup' event, but if I retrieve the current value of the input box during the event handler,..

How do I put text on ProgressBar?

I have used ProgressBar Control in my c# desktop application.I have used it in a thread other then the thread in which control has been declared.Its working Fine. Now I am wondering how i can show som..

How to execute Python scripts in Windows?

I have a simple script blah.py (using Python 2): import sys print sys.argv[1] If I execute my script by: python c:/..../blah.py argument It prints argument but if I execute script by: blah.py a..

Create parameterized VIEW in SQL Server 2008

Can we create parameterized VIEW in SQL Server 2008. Or Any other alternative for this ?..

What exactly does an #if 0 ..... #endif block do?

In C/C++ What happens to code placed between an #if 0/#endif block? #if 0 //Code goes here #endif Does the code simply get skipped and therefore does not get executed?..

Can you "compile" PHP code and upload a binary-ish file, which will just be run by the byte code interpreter?

I know that PHP is compiled to byte code before it is run on the server, and then that byte code can be cached so that the whole script doesn't have to be re-interpreted with every web access. But ca..

What does this symbol mean in IntelliJ? (red circle on bottom-left corner of file name, with 'J' in it)

Under the target folder in IntelliJ for a Java project I created, I have a few java source files in the package. Beside each file the 'J' icon has a red circle with a line through it. What does that..

Carriage return and Line feed... Are both required in C#?

When inserting a new line character into a string I have usually done this: str = "First line\nSecond line"; In C#, is this the standard practice? Should I also include the 'carriage return' charac..

How do I properly force a Git push?

I've set up a remote non-bare "main" repo and cloned it to my computer. I made some local changes, updated my local repository, and pushed the changes back to my remote repo. Things were fine up to th..

Shortest way to print current year in a website

I need to update a few hundred static HTML pages that have the copyright date hard coded in the footer. I want to replace it with some JavaScript that will automatically update each year. Currently I..

Using VBA code, how to export Excel worksheets as image in Excel 2003?

Please suggest the better way of exporting range of data from excel worksheets as image either in .jpeg or .png or in .gif...

SQL split values to multiple rows

I have table : id | name 1 | a,b,c 2 | b i want output like this : id | name 1 | a 1 | b 1 | c 2 | b ..

Calculating Covariance with Python and Numpy

I am trying to figure out how to calculate covariance with the Python Numpy function cov. When I pass it two one-dimentional arrays, I get back a 2x2 matrix of results. I don't know what to do with ..

How to set connection timeout with OkHttp

I am developing app using OkHttp library and my trouble is I cannot find how to set connection timeout and socket timeout. OkHttpClient client = new OkHttpClient(); Request request = new Request.Bui..

Disable ONLY_FULL_GROUP_BY

I accidentally enabled ONLY_FULL_GROUP_BY mode like this: SET sql_mode = 'ONLY_FULL_GROUP_BY'; How do I disable it?..

How to safely open/close files in python 2.4

I'm currently writing a small script for use on one of our servers using Python. The server only has Python 2.4.4 installed. I didn't start using Python until 2.5 was out, so I'm used to the form: ..

Checking if jquery is loaded using Javascript

I am attempting to check if my Jquery Library is loaded onto my HTML page. I am checking to see if it works, but something is not right. Here is what I have: <html xmlns="http://www.w3.org/1999/..

Find intersection of two nested lists?

I know how to get an intersection of two flat lists: b1 = [1,2,3,4,5,9,11,15] b2 = [4,5,6,7,8] b3 = [val for val in b1 if val in b2] or def intersect(a, b): return list(set(a) & set(b)) pri..

How do I pass named parameters with Invoke-Command?

I have a script that I can run remotely via Invoke-Command Invoke-Command -ComputerName (Get-Content C:\Scripts\Servers.txt) ` -FilePath C:\Scripts\ArchiveEventLogs\ver5\ArchiveEventLo..

How to declare variable and use it in the same Oracle SQL script?

I want to write reusable code and need to declare some variables at the beginning and reuse them in the script, such as: DEFINE stupidvar = 'stupidvarcontent'; SELECT stupiddata FROM stupidtable WHE..

Delete specific values from column with where condition?

I want to delete specific values/data from one column with the WHERE condition. Putting in another way, I don't want to delete the complete row. Is it possible?..

Iterating over dictionaries using 'for' loops

I am a bit puzzled by the following code: d = {'x': 1, 'y': 2, 'z': 3} for key in d: print (key, 'corresponds to', d[key]) What I don't understand is the key portion. How does Python recognize t..

How to convert Blob to String and String to Blob in java

I'm trying to get string from BLOB datatype by using Blob blob = rs.getBlob(cloumnName[i]); byte[] bdata = blob.getBytes(1, (int) blob.length()); String s = new String(bdata); It is working fine b..

Matplotlib: "Unknown projection '3d'" error

I just installed matplotlib and am trying to run one of there example scripts. However I run into the error detailed below. What am I doing wrong? from mpl_toolkits.mplot3d import axes3d import matp..

Recyclerview inside ScrollView not scrolling smoothly

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

Submit button doesn't work

I have a form with <input type="submit". In chrome submit doesn't do anything. On a "network" in tab in developer tools I see nothing. No errors in developer tools either. Meanwhile, if I do save a..

ObservableCollection not noticing when Item in it changes (even with INotifyPropertyChanged)

Does anyone know why this code doesn't work: public class CollectionViewModel : ViewModelBase { public ObservableCollection<EntityViewModel> ContentList { get { return _conten..

What is the Python equivalent of static variables inside a function?

What is the idiomatic Python equivalent of this C/C++ code? void foo() { static int counter = 0; counter++; printf("counter is %d\n", counter); } specifically, how does one implement th..

How to increase font size in NeatBeans IDE?

I just bought a new monitor that's rather large and I am having a lot of trouble reading the text on my editor. I tried increasing the font size the usual way by going to Tools >> Options >> Fonts &a..

Populating a dictionary using for loops (python)

I'm trying to create a dictionary using for loops. Here is my code: dicts = {} keys = range(4) values = ["Hi", "I", "am", "John"] for i in keys: for x in values: dicts[i] = x print(dicts)..

CSS background-image - What is the correct usage?

What is the correct usage of the CSS background-image property? The key things I am trying to understand is Does it need to be in quotes i.e.: background-image: url('images/slides/background.jpg'); ..

What is the correct Performance Counter to get CPU and Memory Usage of a Process?

How can I get the CPU and Memory usage of a particular process using the .NET PerformanceCounter class? And also what is the difference between Processor\% Processor Time and Process\% Processor Tim..

Get exit code of a background process

I have a command CMD called from my main bourne shell script that takes forever. I want to modify the script as follows: Run the command CMD in parallel as a background process (CMD &). In the m..

How to redirect the output of an application in background to /dev/null

I would like to redirect the output generated from a background application in Linux to /dev/null. I am using kate text editor and it prints all the debug messages on the terminal which I would like ..

Check if a number has a decimal place/is a whole number

I am looking for an easy way in JavaScript to check if a number has a decimal place in it (in order to determine if it is an integer). For instance, 23 -> OK 5 -> OK 3.5 -> not OK 34.345 -&..

How to convert date to timestamp in PHP?

How do I get timestamp from e.g. 22-09-2008?..

Convert R vector to string vector of 1 element

Im working with the programming language R now. I have a vector: a <- c("aa", "bb", "cc") And I want to paste these to a system command, I'm trying it this way now: args <- paste(a, sep=" ")..

PHP cURL not working - WAMP on Windows 7 64 bit

I got my WAMP installed on my windows 7 64bit. cURL is not working, but still I got it enabled from the WAMP tray. I have also uncommented extension=php_curl.dll in php.ini for both the PHP and Apach..

php return 500 error but no error log

I am having an issue when I have a php application that is returning an internal server error (500) however nothing is showing up in the error log. Now I know there are error with what I am trying to..

Difference between a theta join, equijoin and natural join

I'm having trouble understanding relational algebra when it comes to theta joins, equijoins and natural joins. Could someone please help me better understand it? If I use the = sign on a theta join is..

How to unnest a nested list

Possible Duplicate: Making a flat list out of list of lists in Python I am trying to find an easy way to turn a multi dimensional (nested) python list into a single list, that contains all ..

SQL How to replace values of select return?

In my database (MySQL) table, has a column with 1 and 0 for represent true and false respectively. But in SELECT, I need it replace for true or false for printing in a GridView. How to I make my SEL..

Graphical DIFF programs for linux

I really like Araxis Merge for a graphical DIFF program for the PC. I have no idea what's available for linux, though. We're running SUSE linux on our z800 mainframe. I'd be most grateful if I could ..

Determine project root from a running node.js application

Is there a better way than process.cwd() to determine the root directory of a running node.js process? Something like the equivalent of Rails.root, but for Node.js. I'm looking for something that is a..

c# open file with default application and parameters

The most easy way to open a file with the default application is: System.Diagnostics.Process.Start(@"c:\myPDF.pdf"); However, I would like to know if exists a way to set parameters to the default a..

ERROR 1064 (42000) in MySQL

I am trying to populate a new MySQL empty database with a db dump created from MS SQL Azure database, and I get the following error ERROR 1064 (42000) at line 1: You have an error in your SQL synt..

How do I format {{$timestamp}} as MM/DD/YYYY in Postman?

In Postman, the dynamic variable {{$timestamp}} inserts the current Unix Time Stamp into a request. (Represented as the number of seconds since January 1, 1970) "currentTime": "1510934784" However,..

How to parse float with two decimal places in javascript?

I have the following code. I would like to have it such that if price_result equals an integer, let's say 10, then I would like to add two decimal places. So 10 would be 10.00. Or if it equals 10.6 wo..

Save bitmap to file function

I'm trying to save a bitmap to file and a specific directly using a function I've created. It's not working. It crashes after bitmap.compress part (before here3). File dir = new File(filepath); ..

How to write to file in Ruby?

I need to read the data out of database and then save it in a text file. How can I do that in Ruby? Is there any file management system in Ruby?..

Left padding a String with Zeros

I've seen similar questions here and here. But am not getting how to left pad a String with Zero. input: "129018" output: "0000129018" The total output length should be TEN...

How to extract text from an existing docx file using python-docx

I'm trying to use python-docx module (pip install python-docx) but it seems to be very confusing as in github repo test sample they are using opendocx function but in readthedocs they are using Docume..

How to use clock() in C++

How do I call clock() in C++? For example, I want to test how much time a linear search takes to find a given element in an array...

Adding git branch on the Bash command prompt

I tried adding the git branch I'm currently working on (checked-out) on the bash prompt without success.. (while keeping my current path which shows the active directory/file intact) I have a .bashrc..

How to append elements at the end of ArrayList in Java?

I am wondering, how do I append an element to the end of an ArrayList in Java? Here is the code I have so far: public class Stack { private ArrayList<String> stringList = new ArrayList<..

Getting the last n elements of a vector. Is there a better way than using the length() function?

If, for argument's sake, I want the last five elements of a 10-length vector in Python, I can use the "-" operator in the range index so: >>> x = range(10) >>> x [0, 1, 2, 3, 4, 5, ..

Get path to execution directory of Windows Forms application

I would like to get the path to the execution directory of a Windows Forms application. (That is, the directory in which the executable is located.) Does anyone know of a built-in method in .NET to d..

Insert php variable in a href

I am planning to insert a PHP variable which holds the directory path for a file stored on my Windows machine. How can I include this variable in the a href tag inside my php script such that when the..

What is the method for converting radians to degrees?

I run into this occasionally and always forget how to do it. One of those things that pop up ever so often. Also, what's the formula to convert angles expressed in radians to degrees and back again?..

How do I read an image file using Python?

How do I read an image file and decode it using Python?..

Docker - a way to give access to a host USB or serial device?

Last time I checked, Docker didn't have any means to give container access to host serial or USB port. Is there a trick which allows doing that?..

Angular - Use pipes in services and components

In AngularJS, I am able to use filters (pipes) inside of services and controllers using syntax similar to this: $filter('date')(myDate, 'yyyy-MM-dd'); Is it possible to use pipes in services/compon..

SQL Server copy all rows from one table into another i.e duplicate table

I want to keep a table as history and replace it with an empty one. How can I do this through Management Studio?..

Numpy AttributeError: 'float' object has no attribute 'exp'

Here is my code: def sigmoid(X, T): return (1.0 / (1.0 + np.exp(-1.0*np.dot(X, T)))) And this line gives me error "AttributeError: 'float' object has no attribute 'exp'". X, t are Num..

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

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

Best method for reading newline delimited files and discarding the newlines?

I am trying to determine the best way to handle getting rid of newlines when reading in newline delimited files in Python. What I've come up with is the following code, include throwaway code to test..

How can I redirect a php page to another php page?

Possible Duplicate: How to redirect users to another page? I'm a beginner in the programming field....I want to redirect a php page to another one..How is it possible in the most easiest way? My co..

http://localhost:50070 does not work HADOOP

I already installed Hadoop on my machine "Ubuntu 13.05" and now I have an error when browsing localhost:50070 the browser says that the page does not exist...

The developers of this app have not set up this app properly for Facebook Login?

I'm trying to make login with Facebook available in my script. I've done everything, but when I attempt to login with a Facebook account I get this error from Facebook: Error App Not Setup: T..

Spring Boot - inject map from application.yml

I have a Spring Boot application with the following application.yml - taken basically from here: info: build: artifact: ${project.artifactId} name: ${project.name} description: $..

Uncaught SyntaxError: Unexpected token < On Chrome

I know this question has been asked many times but I can't find similarity with my issue. I'm getting this error only in Chrome, in every other browser everything is ok. I return data with JSON in sev..

Remove empty elements from an array in Javascript

How do I remove empty elements from an array in JavaScript? Is there a straightforward way, or do I need to loop through it and remove them manually?..

Trying to get the average of a count resultset

I have the following SQL:(bitemp) SELECT COUNT (*) AS Count FROM Table T WHERE (T.Update_time = (SELECT MAX (B.Update_time ) FROM Table B WHERE (B.Id = T.Id))..

Get current folder path

I want to create a program that converts files. I would like the user to be able to place the executable file in any directory, and when executing that program (double-clicking on the .exe) I want the..

How to show SVG file on React Native?

I want to show svg files (I have bunch of svg images) but the thing I couldn't find the way to show. I tried to use Image and Use components of react-native-svg but they don't work with that. And I tr..

Retrofit and GET using parameters

I am trying to send a request to the Google GeoCode API using Retrofit. The service interface looks like this: public interface FooService { @GET("/maps/api/geocode/json?address={zipcode}&am..

Block Comments in a Shell Script

Is there a simple way to comment out a block of code in a shell script?..

How to resolve 'unrecognized selector sent to instance'?

In the AppDelegate, I'm alloc'ing an instance defined in a static library. This instance has an NSString property set a "copy". When I access the string property on this instance, the app crashes wi..

replace anchor text with jquery

i want to replace the text of a html anchor: <a href="index.html" id="link1">Click to go home</a> now i want to replace the text 'click to go home' i've tried this: alert($("link1").c..

Chrome Uncaught Syntax Error: Unexpected Token ILLEGAL

Receiving the subject error when Chrome tries to load the script file on the page. It says it's at the last line of the javascript file. I can't seem to find anything wrong with it. No errors in firef..

Center align with table-cell

I'm trying to use the table-cell way to center a div vertically and horizontally. It works when I use the following code: div { display: table; } .logo { display: table-cell; position: ..

Concatenating Matrices in R

How can I concatenate matrices of same columns but different number of rows? For example, I want to concatenate a ( dim(a) = 15 7000 ) and b (dim(b) = 16 7000) and I want the result to be a matrix of ..

How do I convert date/time from 24-hour format to 12-hour AM/PM?

From a data feed I'm getting date and time in this format: 19:24:15 06/13/2013 I need to have it converted to be in 12-hour AM/PM without the seconds. So the above time would be 7:24 PM. The date s..

Redirecting to a relative URL in JavaScript

I have a problem: I want to redirect via JavaScript to a directory above. My code: location.href = (location.href).substr(0, (location.href).lastIndexOf('folder')); The URL looks like this: exa..

Java current machine name and logged in user?

Is it possible to get the name of the currently logged in user (Windows/Unix) and the hostname of the machine? I assume it's just a property of some static environment class. I've found this for the..

Guzzle 6: no more json() method for responses

Previously in Guzzle 5.3: $response = $client->get('http://httpbin.org/get'); $array = $response->json(); // Yoohoo var_dump($array[0]['origin']); I could easily get a PHP array from a JSON r..

TypeError: ufunc 'add' did not contain a loop with signature matching types

I am creating bag of words representation of the sentence. Then taking the words that exist in the sentence to compare to the file "vectors.txt", in order to get their embedding vectors. After getting..

error: resource android:attr/fontVariationSettings not found

Warning:The android.dexOptions.incremental property is deprecated and it has no effect on the build process. /home/midhilaj/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/be3106e..

Convert UTC Epoch to local date

I have been fighting with this for a bit now. I’m trying to convert epoch to a date object. The epoch is sent to me in UTC. Whenever you pass new Date() an epoch, it assumes it’s local epoch. I tr..

React eslint error missing in props validation

I have the next code, eslint throw: react/prop-types onClickOut; is missing in props validation react/prop-types children; is missing in props validation propTypes was defined but eslint does not re..

How do I implement JQuery.noConflict() ?

I am using both javascript and jquery code on the same html page. For some reason, the jQuery library is stopping my native javascript code from working properly. I found this page: jQuery No Conflic..

Error: EACCES: permission denied

I run npm install lodash but it throws Error: EACCES: permission denied error. I know it is permission issue but as far as I know, sudo permission is not required for installing node module locally. I..

Multipart File upload Spring Boot

Im using Spring Boot and want to use a Controller to receive a multipart file upload. When sending the file I keep getting the error 415 unsupported content type response and the controller is never r..

Are there any worse sorting algorithms than Bogosort (a.k.a Monkey Sort)?

My co-workers took me back in time to my University days with a discussion of sorting algorithms this morning. We reminisced about our favorites like StupidSort, and one of us was sure we had seen a ..

Can I use multiple versions of jQuery on the same page?

A project I'm working on requires the use of jQuery on customers' Web pages. Customers will insert a chunk of code that we'll supply which includes a few <script> elements that build a widget in..

Linux command for extracting war file?

How can I extract a .war file with Linux command prompt?..

INSERT SELECT statement in Oracle 11G

I'm trying to run a very simple sql statement in Oracle 11g. insert into table1 (col1, col2) values (select t1.col1, t2.col2 from oldtable1 t1, oldtable2 t2); Very simple query. Cartesian join old..

No mapping found for HTTP request with URI Spring MVC

Here's my Web.xml <servlet> <servlet-name>dispatcherServlet</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-c..

session handling in jquery

I am using following code to store value in session object in jQuery but i get error $.session function is not a function. I also add plugin "jquery.session.js" from githhub site but it is not work. ..

How to solve "java.io.IOException: error=12, Cannot allocate memory" calling Runtime#exec()?

On my system I can't run a simple Java application that start a process. I don't know how to solve. Could you give me some hints how to solve? The program is: [root@newton sisma-acquirer]# cat pro..

How to center align the ActionBar title in Android?

I am trying to use the following code to center the text in the ActionBar, but it aligns itself to the left. How do you make it appear in the center? ActionBar actionBar = getActionBar(); actionBar..

How do I make a C++ macro behave like a function?

Let's say that for some reason you need to write a macro: MACRO(X,Y). (Let's assume there's a good reason you can't use an inline function.) You want this macro to emulate a call to a function with ..

Get current value when change select option - Angular2

I'm writing an angular2 component and am facing this problem. Description: I want to push an option value in select selector to its handler when the (change) event is triggered. Such as the below temp..

How to navigate to a directory in C:\ with Cygwin?

I'm trying to install PyQt4 so I can mess around with it. The installation guide said I had to install Sip. The last step to installing Sip is to use the make install command. Windows doesn't have tha..

typedef struct vs struct definitions

I'm a beginner in C programming, but I was wondering what's the difference between using typedef when defining a structure versus not using typedef. It seems to me like there's really no difference, t..

Java SSL: how to disable hostname verification

Is there a way for the standard java SSL sockets to disable hostname verfication for ssl connections with a property? The only way I found until now, is to write a hostname verifier which returns true..

Window.Open with PDF stream instead of PDF location

Based on the question Open PDF in new browser full window, it looks like I can use JavaScript to open a new window with a PDF file with the following code: window.open('MyPDF.pdf', '_blank'); I'd l..

MVC ajax json post to controller action method

I am trying to achieve a JQuery AJAX call to a controller action method that contains a complex object as a parameter. I have read plenty blogs and tried several techniques learned from these. The key..

UML diagram shapes missing on Visio 2013

I have installed Visio 2013 Standard and I'm trying to create an UML diagram. I choose the "UML class" template but when it opens, the Shapes panel is empty. As recomended, I go to "More Shapes" menu..

Warning: mysqli_query() expects parameter 1 to be mysqli, null given in

I am trying to build a simple custom CMS, but I'm getting an error: Warning: mysqli_query() expects parameter 1 to be MySQLi, null given in Why am I getting this error? All my code is already My..

.NET End vs Form.Close() vs Application.Exit Cleaner way to close one's app

sometimes, when I use Form.close() when debugging my program, although the form is closed, the application is still running. I noticed this behaviour when using the msgbox function. I have no thread ..

How to set the JDK Netbeans runs on?

I have older NB6.7, NB6.9, NB7.0, which used to run on jdk1.6.0_21 and jdk1.6.0_25. Now I've removed those JDKs and only have jdk1.6.0_26 and jdk1.7.0 left, but I still want to keep the older NBs, but..

No generated R.java file in my project

I am doing the Notepad tutorial, exercise 2. I started by creating a new Android project and chose Create from source to import the downloaded source files for the excercise. But now I get many error..

list all files in the folder and also sub folders

Possible Duplicate: List all files from a directory recursively with Java How can i return a file array that include all files on the folder and also sub folders my method just work for fol..

PHP if not statements

This may be the way my server is set up, but I'm banging my head against the wall. I'm trying to say that if $action has no value or has a value that is not "add" or "delete" then have an error, else ..

Selecting all text in HTML text input when clicked

I have the following code to display a textbox in a HTML webpage. <input type="text" id="userid" name="userid" value="Please enter the user ID" /> When the page displays, the text contains th..

What is the meaning of 'No bundle URL present' in react-native?

When I run a react-native project, I get a error no bundle URL present , but I don't know what mistakes I do, I was very confused. ..

Request header field Access-Control-Allow-Headers is not allowed by Access-Control-Allow-Headers

I'm trying to send files to my server with a post request, but when it sends it causes the error: Request header field Content-Type is not allowed by Access-Control-Allow-Headers. So I googled t..

Accessing JPEG EXIF rotation data in JavaScript on the client side

I'd like to rotate photos based on their original rotation, as set by the camera in JPEG EXIF image data. The trick is that all this should happen in the browser, using JavaScript and <canvas>. ..

Javascript replace all "%20" with a space

Is there a way to replace every "%20" with a space using JavaScript. I know how to replace a single "%20" with a space but how do I replace all of them? var str = "Passwords%20do%20not%20match"; v..

Codeigniter: does $this->db->last_query(); execute a query?

Does query execution happen at the get_where() clause of the following codeigniter active record statement? $this->db->select('*'); $q = $this->db->get_where('Contacts', array('id' =&..

Run bash script from Windows PowerShell

In cygwin, I could just do ./script.sh args, but this opens the script file in notepad in PowerShell. What do I need to do have it execute?..

Correct MySQL configuration for Ruby on Rails Database.yml file

I have this configuration: development: adapter: mysql2 encoding: utf8 database: my_db_name username: root password: my_password host: mysql://127.0.0.1:3306 And I am getting this error..

How can I disable mod_security in .htaccess file?

How can we disable mod_security by using .htaccess file on Apache server? I am using WordPress on my personal domain and posting a post which content has some code block and as per my hosting provide..

How can I get table names from an MS Access Database?

Microsoft SQL Server and MySQL have an INFORMATION_SCHEMA table that I can query. However it does not exist in an MS Access database. Is there an equivalent I can use?..

Can I pass an array as arguments to a method with variable arguments in Java?

I'd like to be able to create a function like: class A { private String extraVar; public String myFormat(String format, Object ... args){ return String.format(format, extraVar, args); } } ..

Find text in string with C#

How can I find given text within a string? After that, I'd like to create a new string between that and something else. For instance, if the string was: This is an example string and my data is here ..

Difference between @click and v-on:click Vuejs

the questions should be enough clear :). But I can see that someone use: <button @click="function()">press</button> Someone use: <button v-on:click="function()">press</button&..

CSS3 background image transition

I'm trying to make a "fade-in fade-out" effect using the CSS transition. But I can't get this to work with the background image... The CSS: .title a { display: block; width: 340px; heigh..

PDF to image using Java

I to want convert PDF pages into an image (PNG,JPEG/JPG or GIF). I want them in full-page sizes. How can this be done using Java? What libraries are available for achieving this? ..

How can I make a TextBox be a "password box" and display stars when using MVVM?

How can I do this in XAML: PSEUDO-CODE: <TextBox Text="{Binding Password}" Type="Password"/> so that the user sees stars or dots when he is typing in the password. I've tried various exampl..

Eclipse error "Could not find or load main class"

I know there are many duplicates of this question, but I have looked at them all, and none of them have solved the issue. I am trying to run a class that has a main function. I have cleaned the proje..

Retrieve specific commit from a remote Git repository

Is there any way to retrieve only one specific commit from a remote Git repo without cloning it on my PC? The structure of remote repo is absolutely same as that of mine and hence there won't be any c..

Insert picture into Excel cell

I'm tying to generate a report with pictures, but I cannot get the pictures into a single cell. I can get the pictures to "float" around my worksheet, but I need to put them into a cell. How can I do ..

Spring MVC Missing URI template variable

I have a Controller class with a function that saves a record to the Database. I am passing several parameters to the Controller function however i think i may be writing the @RequestMapping incorrect..

Resource from src/main/resources not found after building with maven

Hello I'm using a configuration file from src/main/resources in my java application. I'm reading it in my Class like this : new BufferedReader(new FileReader(new File("src/main/resources/config.txt")..

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

Removing whitespace between HTML elements when using line breaks

I have a page with a row of about 10 imgs. For readability of the HTML, I want to put a linebreak in between each img tag, but doing so renders whitespace between the images, which I do not want. Is t..

How do I return the response from an asynchronous call?

I have a function foo which makes an asynchronous request. How can I return the response/result from foo? I tried returning the value from the callback, as well as assigning the result to a local vari..

Android - SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

I have the following layout (virtually empty): <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/set_layout..

How to stop and restart memcached server?

How to stop and restart memcached server 1.4.5 in linux OS from command line?..

What is "entropy and information gain"?

I am reading this book (NLTK) and it is confusing. Entropy is defined as: Entropy is the sum of the probability of each label times the log probability of that same label How can I apply entr..

How do I do a HTTP GET in Java?

How do I do a HTTP GET in Java?..

Left Join without duplicate rows from left table

Please look at the following query: tbl_Contents Content_Id Content_Title Content_Text 10002 New case Study New case Study 10003 New case Study New case Study 10004 New case Study Ne..

MySQL high CPU usage

Recently my server CPU has been going very high. CPU load averages 13.91 (1 min) 11.72 (5 mins) 8.01 (15 mins) and my site has only had a slight increase in traffic. After running a top command, I s..

Initialize a vector array of strings

Would it be possible to initialize a vector array of strings. for example: static std::vector<std::string> v; //declared as a class member I used static just to initialize and fill it with st..

android fragment- How to save states of views in a fragment when another fragment is pushed on top of it

In android, a fragment (say FragA) gets added to the backstack and another fragment (say FragB) comes to the top. Now on hitting back FragA comes to the top and the onCreateView() is called. Now I had..

string in namespace std does not name a type

This may just be a simple mistake that I'm not seeing, but I think I'm simply doing something wrong. Don't worry I'm not using namespace std in my header functions or anything which seemed to be thi..

How to serialize an object to XML without getting xmlns="..."?

Is there a way for me to serialize an object in .NET without the XML Namespaces automatically serializing also? It seems that by default .NET believes the XSI and XSD namespaces should be included, b..

html "data-" attribute as javascript parameter

Lets say I have this: <div data-uid="aaa" data-name="bbb", data-value="ccc" onclick="fun(this.data.uid, this.data-name, this.data-value)"> And this: function fun(one, two, three) { //som..

How to get URL parameters with Javascript?

Possible Duplicate: How to get “GET” request parameters in JavaScript? jQuery querystring How can I get query string values in JavaScript? Javascript does not provide a core m..

How to find row number of a value in R code

In the following set of values how can I find the row number of a particular value in column 4 ?? For example how can I find the row number of the value "1578" that's in column number 4 using the R c..

Laravel 5 How to switch from Production mode

When I run $ php artisan env I get; Current application environment: production How can I change this to development or something similar? So I can see errors.. I have read a lot of the documentati..

selecting unique values from a column

I have a MySQL table which contains the following type of information: Date product 2011-12-12 azd 2011-12-12 yxm 2011-12-10 sdx 2011-12-10 ssd..

Way to create multiline comments in Bash?

I have recently started studying shell script and I'd like to be able to comment out a set of lines in a shell script. I mean like it is in case of C/Java : /* comment1 comment2 comment3 */` ..

"Debug certificate expired" error in Eclipse Android plugins

I am using Eclipse Android plugins to build a project, but I am getting this error in the console window: [2010-02-03 10:31:14 - androidVNC]Error generating final archive: Debug certificate expired o..

Convert string to float?

Just as title says. I don't believe it is possible to do this but if it is let me know. This is needed for a bukkit (minecraft server) plugin I'm writing. I want to take a command: tnt [power]. Wher..

Calculate distance in meters when you know longitude and latitude in java

Possible Duplicate: Working with latitude/longitude values in Java Duplicate: Working with latitude/longitude values in Java How do I calculate distance between two latitude longitude points? I n..

Passing by reference in C

If C does not support passing a variable by reference, why does this work? #include <stdio.h> void f(int *j) { (*j)++; } int main() { int i = 20; int *p = &i; f(p); printf("i = ..

Setting a max character length in CSS

I am making responsive website for school and my question is: How do I set a max character length of the sentences (with CSS) on my website (like 75 characters) that when I have a very large screen, ..

Generate random number between two numbers in JavaScript

Is there a way to generate a random number in a specified range (e.g. from 1 to 6: 1, 2, 3, 4, 5, or 6) in JavaScript?..

How to retrieve SQL result column value using column name in Python?

Is there a way to retrieve SQL result column value using column name instead of column index in Python? I'm using Python 3 with mySQL. The syntax I'm looking for is pretty much like the Java construct..

Adding integers to an int array

I am trying to add integers into an int array, but Eclipse says: cannot invoke add(int) on the array type int[] Which is completely illogical to me. I also tried addElement() and addInt(), howe..

Difference between logger.info and logger.debug

What is the difference between logger.debug and logger.info ? When will logger.debug be printed?..

Why is my variable unaltered after I modify it inside of a function? - Asynchronous code reference

Given the following examples, why is outerScopeVar undefined in all cases? var outerScopeVar; var img = document.createElement('img'); img.onload = function() { outerScopeVar = this.width; }; im..

Why is there no multiple inheritance in Java, but implementing multiple interfaces is allowed?

Java doesn't allow multiple inheritance, but it allows implementing multiple interfaces. Why?..

What is the difference between JOIN and UNION?

What is the difference between JOIN and UNION? Can I have an example?..

Loading state button in Bootstrap 3

I'm new to Bootstrap 3. Can't figure out how to activate the loading state button function. My code below is from the documents on getboostrap.com. <button type="button" data-loading-text="Loading..

How to do associative array/hashing in JavaScript

I need to store some statistics using JavaScript in a way like I'd do it in C#: Dictionary<string, int> statistics; statistics["Foo"] = 10; statistics["Goo"] = statistics["Goo"] + 1; statist..

Multiple arguments to function called by pthread_create()?

I need to pass multiple arguments to a function that I would like to call on a separate thread. I've read that the typical way to do this is to define a struct, pass the function a pointer to that, an..

.htaccess redirect all pages to new domain

Which redirect rule would I use to redirect all pages under olddomain.example to be redirected to newdomain.example? The site has a totally different structure, so I want every page under the old dom..

Breaking a list into multiple columns in Latex

Hopefully this is simple: I have a relatively long list where each list item contains very little text. For example: * a * b * c * d * e * f I wish to format it like so: * a * d * b * e ..

Suppress output of a function

I'm looking to suppress the output of one command (in this case, the apply function). Is it possible to do this without using sink()? I've found the described solution below, but would like to do th..

Clicking at coordinates without identifying element

As part of my Selenium test for a login function, I would like to click a button by identifying its coordinates and instructing Selenium to click at those coordinates. This would be done without ident..

Hide Spinner in Input Number - Firefox 29

On Firefox 28, I'm using <input type="number"> works great because it brings up the numerical keyboard on input fields which should only contain numbers. In Firefox 29, using number inputs disp..

How to access shared folder without giving username and password

I have shared one folder to "Everyone" on a machine 1 and trying to access the folder from another machine 2. It is asking for username and password of the machine 1. I am accessing the share folder f..

How do I create a MongoDB dump of my database?

What command do I use and run?..

Difference between an API and SDK

I am trying to explain to a non-developer the difference between an API an SDK. I need to explain why a commercial fingerprint software vendor will likely not provide an SDK, although they may certain..

ffmpeg - Converting MOV files to MP4

I have just installed ffmpeg and I am trying to encode all my uploaded videos to .mp4 file. Most of the users currently upload .mov and I want to convert every video to .mp4. I am running the command..

Node.js: what is ENOSPC error and how to solve?

I have a problem with Node.js and uploading files to server. For uploading files to server I use this plugin. When starting file upload to the server, Node.js process crashed and show error: Error..

How to run Selenium WebDriver test cases in Chrome

I tried this WebDriver driver = new ChromeDriver(); But I'm getting the error as Failed tests: setUp(com.TEST): The path to the driver executable must be set by the webdriver.chrome.driver system ..

Xampp Access Forbidden php

I'm a windows user. I've been using xampp for quite a while but suddenly none of my .php files are working now! I get this error message: Access forbidden! You don't have permission to access the ..

How to alias a table in Laravel Eloquent queries (or using Query Builder)?

Lets say we are using Laravel's query builder: $users = DB::table('really_long_table_name') ->select('really_long_table_name.id') ->get(); I'm looking for an equivalent ..

How do I create a Bash alias?

I'm on OSX and I need to put something like this, alias blah="/usr/bin/blah" in a config file but I don't know where the config file is. ..

Compare two dates with JavaScript

Can someone suggest a way to compare the values of two dates greater than, less than, and not in the past using JavaScript? The values will be coming from text boxes...

How do I check whether a checkbox is checked in jQuery?

I need to check the checked property of a checkbox and perform an action based on the checked property using jQuery. For example, if the age checkbox is checked, then I need to show a textbox to enter..

What methods of ‘clearfix’ can I use?

I have the age-old problem of a div wrapping a two-column layout. My sidebar is floated, so my container div fails to wrap the content and sidebar. <div id="container"> <div id="content"&g..

Get CPU Usage from Windows Command Prompt

How would I get total CPU Usage from Windows Command Prompt?: Expected Output: 27% ..

In Python try until no error

I have a piece of code in Python that seems to cause an error probabilistically because it is accessing a server and sometimes that server has a 500 internal server error. I want to keep trying until ..

How to rename uploaded file before saving it into a directory?

Below is the code I used in order to upload files into a directory. It works fine. My main question is: move_uploaded_file() is the one that saves the uploaded file into the directory, and it is also..

In Bash, how do I add a string after each line in a file?

How do I add a string after each line in a file using bash? Can it be done using the sed command, if so how?..

Can you detect "dragging" in jQuery?

I have a throbber that is to appear when a user clicks a link. The problem is is that that same link can be clicked and dragged to be rearranged. In this case, I wouldn't need the throbber to appear...

Does C have a "foreach" loop construct?

Almost all languages have a foreach loop or something similar. Does C have one? Can you post some example code?..

How to run a hello.js file in Node.js on windows?

I am trying to run a hello world program written in javascript in a separate file named hello.js Currently running windows version of node.js. The code runs perfectly in console window but how do I ..

How to extend / inherit components?

I would like to create extensions for some components already deployed in Angular 2, without having to rewrite them almost completely, as the base component could undergo changes and wish these change..

Forking vs. Branching in GitHub

I'd like to know more about the advantages and disadvantages of forking a github project vs. creating a branch of a github project. Forking makes my version of the project more isolated from the orig..

Windows Bat file optional argument parsing

I need my bat file to accept multiple optional named arguments. mycmd.bat man1 man2 -username alice -otheroption For example my command has 2 mandatory parameters, and two optional parameters (-use..

Detect page change on DataTable

With DataTable I can order, list, do pagination but I want to detect when the pagination changes, I've seen the API but the only one I can do is change the page but no detect this change...

What are carriage return, linefeed, and form feed?

What is the meaning of the following control characters: Carriage return Line feed Form feed ..