Questions Tagged with #Grid layout

Grid layout is used to align content into columns and fields. Unlike table layouts, grids are composed of guide lines so that elements positioned relative to the grid can have drag and drop behavior.

Load arrayList data into JTable

I'm trying to set items from a method called FootballClub and so far it's fine. but then I created an arrayList from it and I somehow can't find a way to store this information into a JTable. The prob..

How do I specify row heights in CSS Grid layout?

I have a CSS Grid Layout in which I want to make some (middle 3) rows stretch to their maximum size. I'm probably looking for a property similar to what flex-grow: 1 does with Flexbox but I can't seem..

Bootstrap 4, how to make a col have a height of 100%?

how can I make a column take up 100% height of the browser w bootstrap 4? See the following: Note the yellow div, I need this div/column to take up a height ..

Equal height rows in CSS Grid Layout

I gather that this is impossible to achieve using Flexbox, as each row can only be the minimal height required to fit its elements, but can this be achieved using the newer CSS Grid? To be clear, I w..

GridView VS GridLayout in Android Apps

I have to use a Grid to implement Photo Browser in Android. So, I would like to know the difference between GridView and GridLayout. So that I shall choose the right one. Currently I'm using GridVi..

Flex-box: Align last row to grid

I have a simple flex-box layout with a container like: .grid { display: flex; flex-flow: row wrap; justify-content: space-between; } Now I want the items in the last row to be aligned with th..

Prevent content from expanding grid items

TL;DR: Is there anything like table-layout: fixed for CSS grids? I tried to create a year-view calendar with a big 4x3 grid for the months and therein nested 7x6 grids for the days. The calendar s..

Grid of responsive squares

I'm wondering how I would go about creating a layout with responsive squares. Each square would have vertically and horizontally aligned content. The specific example is displayed below... ..

Getting the index of the returned max or min item using max()/min() on a list

I'm using Python's max and min functions on lists for a minimax algorithm, and I need the index of the value returned by max() or min(). In other words, I need to know which move produced the max (at ..

How to print table using Javascript?

I found this code to print in Javascript. function printData() { var divToPrint=document.getElementById("printTable"); newWin=""); newWin.document.write(divToPrint.outerHTML); ..

How to prevent null values inside a Map and null fields inside a bean from getting serialized through Jackson

I have a a Map<String,Foo> foosMap that I want to serialize through Jackson . Now I want following two settings on the serialization process: The Map can have have plenty of null values and n..

Import a custom class in Java

How do I import a class I wrote in a different file? All my classes are under the same package...

Is there a simple way that I can sort characters in a string in alphabetical order

I have strings like this: var a = "ABCFE"; Is there a simple way that I can sort this string into: ABCEF Thanks..

Mercurial: how to amend the last commit?

I'm looking for a counter-part of git commit --amend in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier ..

Turn off display errors using file "php.ini"

I am trying to turn off all errors on my website. I have followed different tutorials on how to do this, but I keep getting read and open error messages. Is there something I am missing? I have tried..

How to list installed packages from a given repo using yum

I want to list all packages I have installed on a system from a given repo using yum. Usually to do this I use yum list installed | grep "something". But now I am faced with a problem. The repo I am i..

Base64 decode snippet in C++

Is there a freely available Base64 decoding code snippet in C++?..

Check if a Postgres JSON array contains a string

I have a table to store information about my rabbits. It looks like this: create table rabbits (rabbit_id bigserial primary key, info json not null); insert into rabbits (info) values ('{"name":"He..

Create, read, and erase cookies with jQuery

Somebody help me. How to create, read and erase some cookies with jQuery ? ..

Format SQL in SQL Server Management Studio

In Visual Studio & other IDEs, you can easily auto format your code with a keyboard shortcut, through the menu, or automatically as you type. I was wondering if there is yet a way to enable this ..

How to create a folder with name as current date in batch (.bat) files

I don't know much about windows .bat file syntax. My simple requirement is to create a folder at a specific location with name as current date. I tried searching this on google but didn't get any good..

How to turn off caching on Firefox?

During development I have to "clear cache" in Firefox all the time in order to make it use the latest version of JavaScript files. Is there some kind of setting (about:config) to turn off caching com..

Check if a string contains a number

Most of the questions I've found are biased on the fact they're looking for letters in their numbers, whereas I'm looking for numbers in what I'd like to be a numberless string. I need to enter a stri..

Print a list of all installed node.js modules

In a node.js script that I'm working on, I want to print all node.js modules (installed using npm) to the command line. How can I do this? console.log(__filename); //now I want to print all installe..

Run a single migration file

Is there an easy way to run a single migration? I don't want to migrate to a certain version I just want to run a specific one...

How to get the position of a character in Python?

How can I get the position of a character inside a string in python?..

Using Helvetica Neue in a Website

Normally, I use "Helvetica Neue" for the fonts in some websites although looking at other sites, I've seen some with "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue". Is there any reas..

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

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

IP to Location using Javascript

<script type="application/javascript"> function getip(json){ alert(json.ip); // alerts the ip address } </script> <script type="application/javascript" src="http://jsonip..

Apply global variable to Vuejs

I have a javascript variable which I want to pass globally to Vue components upon instantiation thus either each registered component has it as a property or it can be accessed globally. Note:: I nee..

How to disable the back button in the browser using JavaScript

I want to disable the back button for a website. Whenever the person clicks on the browser back button it should not be able to go on the page the user visited before...

How to open Visual Studio Code from the command line on OSX?

The docs mention an executable called code, but I'm not sure where I can find that so I can put it on my path. The zip I downloaded from the VSCode site did not include any such executable. (I am able..

openssl s_client -cert: Proving a client certificate was sent to the server

Background I am stuck in a finger-pointing match with a service provider with an API protected by SSL server and client certificates. I have generated a CSR, obtained a certificate from a public C..

How do I get the domain originating the request in express.js?

I'm using express.js and i need to know the domain which is originating the call. This is the simple code app.get( '/verify_license_key.json', function( req, res ) { // do something ..

Insert HTML from CSS

Is there any way to insert an HTML element, dom or code from CSS(3)?..

Mixing C# & VB In The Same Project

Can you mix vb and c# files in the same project for a class library? Is there some setting that makes it possible? I tried and none of the intellisense works quite right, although the background comp..

Determine Whether Integer Is Between Two Other Integers?

How do I determine whether a given integer is between two other integers (e.g. greater than/equal to 10000 and less than/equal to 30000)? I'm using 2.3 IDLE and what I've attempted so far is not worki..

Match everything except for specified strings

I know that the following regex will match "red", "green", or "blue". red|green|blue Is there a straightforward way of making it match everything except several specified strings?..

Where is the visual studio HTML Designer?

Where is the Visual Studio HTML Designer? I see that there are options for the HTML Designer but I can't open it. So I just want to ask why I can't find the designer and how do I open it. When I cre..

Vertical align text in block element

I know vertical alignment is always asked about, but I don't seem to be able to find a solution for this particular example. I'd like the text centered within the element, not the element centered its..

Error type 3 Error: Activity class {} does not exist

I have an IntelliJ Android project, that I successfully imported to Android Studio 0.4.0. It works perfectly if I don't change anything in manifest. However, when I want to change the launcher activit..

Get Windows version in a batch file

I need to get the OS version with a batch file. I 've seen a lot of examples online, many uses something like this code: @echo off ver | find "XP" > nul if %ERRORLEVEL% == 0 goto ver_xp if not e..

android.content.Context.getPackageName()' on a null object reference

I am working with Fragments which implements an interface. public class SigninFragment extends Fragment implements SigninInterface The interface's method implementation in the fragment class is as f..

Calculating a 2D Vector's Cross Product

From wikipedia: the cross product is a binary operation on two vectors in a three-dimensional Euclidean space that results in another vector which is perpendicular to the plane containing the two..

How to send a POST request using volley with string body?

I'm developing an Android app that communicate with a RESTful web service I wrote. Using Volley for GET methods is awesome and easy, but I can't put my finger on the POST methods. I want to send a PO..

Python: SyntaxError: keyword can't be an expression

In a Python script I call a function from rpy2, but I get this error: #using an R module res = DirichletReg.ddirichlet(np.asarray(my_values),alphas, log=False, sum.up=F..

How can I convert a cv::Mat to a gray scale in OpenCv?

How can I convert a cv::Mat to a gray scale? I am trying to run drawKeyPoints func from opencv, however I have been getting an Assertion Filed error. My guess is that it needs to receive a gray scale..

Trust Store vs Key Store - creating with keytool

I understand that the keystore would usually hold private/public keys and the trust store only public keys (and represents the list of trusted parties you intend to communicate with). Well, that's my ..

How to remove \n from a list element?

I'm trying to get Python to a read line from a .txt file and write the elements of the first line into a list. The elements in the file were tab- separated so I used split("\t") to separate the elemen..

Laravel - check if Ajax request

I have been trying to find a way to determine ajax call in Laravel but i don't find any document regarding it. I have a index() function which i want to handle situation differently based on the natu..

Where/how can I download (and install) the Microsoft.Jet.OLEDB.4.0 for Windows 8, 64 bit?

I've got a 32 bit .net 2.0 app that uses the Jet OLEDB 4.0. It runs fin on Windows 8 32 bit, but not on the 64 bit. on 64 bit I'm getting an error: 'Microsoft.Jet.OLEDB.4.0' provider is not regis..

How to validate GUID is a GUID

How to determine if a string contains a GUID vs just a string of numbers. will a GUID always contain at least 1 alpha character?..

Measuring the distance between two coordinates in PHP

Hi I have the need to calculate the distance between two points having the lat and long. I would like to avoid any call to external API. I tried to implement the Haversine Formula in PHP: Here is t..

What does -1 mean in numpy reshape?

A numpy matrix can be reshaped into a vector using reshape function with parameter -1. But I don't know what -1 means here. For example: a = numpy.matrix([[1, 2, 3, 4], [5, 6, 7, 8]]) b = numpy.res..

Output data from all columns in a dataframe in pandas

I have a csv file with the name params.csv. I opened up ipython qtconsole and created a pandas dataframe using: import pandas paramdata = pandas.read_csv('params.csv', names=paramnames) where, para..

Why does checking a variable against multiple values with `OR` only check the first value?

I want to check if a variable has one of multiple values. I'm confused about why or doesn't work in this situation. I was following a tutorial that gave the example if (a or b):, but when I try to d..

CSS Transition doesn't work with top, bottom, left, right

I have an element with style position: relative; transition: all 2s ease 0s; Then I want to change its position smoothly after clicking on it, but when I add the style change the transition doesn't t..

Run automatically program on startup under linux ubuntu

I'd need a program to be run every time I startup my ubuntu linux. So I'd need to add it to my startup programs list. Just one problem: I'd need to do it via terminal...

std::cin input with spaces?

#include <string> std::string input; std::cin >> input; The user wants to enter "Hello World". But cin fails at the space between the two words. How can I make cin take in the whole of ..

UIScrollView scroll to bottom programmatically

How can I make a UIScrollView scroll to the bottom within my code? Or in a more generic way, to any point of a subview?..

Java Swing - how to show a panel on top of another panel?

I wish to have an internal (non window) dialog to ask for member input. I would like the dialog to be placed centrally on an existing JPanel. I have looked at layeredpanes and these seem unusable due ..

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

How to process each output line in a loop?

I have a number of lines retrieved from a file after running the grep command as follows: var=`grep xyz abc.txt` Let’s say I got 10 lines which consists of xyz as a result. Now I need to process..

How to return first 5 objects of Array in Swift?

In Swift, is there a clever way of using the higher order methods on Array to return the 5 first objects? The obj-c way of doing it was saving an index, and for-loop through the array incrementing in..

Detach (move) subdirectory into separate Git repository

I have a Git repository which contains a number of subdirectories. Now I have found that one of the subdirectories is unrelated to the other and should be detached to a separate repository. How can I..

How to use a PHP class from another file?

Let's say I've got two files class.php and page.php class.php <?php class IUarts { function __construct() { $this->data = get_data('mydata'); } } ?> That..

Java8: sum values from specific field of the objects in a list

Suppose to have a class Obj class Obj{ int field; } and that you have a list of Obj instances, i.e. List<Obj> lst. Now, how can I find in Java8 with streams the sum of the values of the i..

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

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

relative path to CSS file

I have a css folder at the root of my Java Web Application. My import statement looks like this: <link rel="stylesheet" type="text/css" href="/css/styles.css"/> The style is not being applied..

Adding value labels on a matplotlib bar chart

I got stuck on something that feels like should be relatively easy. The code I bring below is a sample based on a larger project I'm working on. I saw no reason to post all the details, so please acce..

Using :focus to style outer div?

When I begin writing text in the textarea, I want the outer div, with a class box, to have it's border turned solid instead of dashed, but somehow the :focus doesn't apply in this case. If it works wi..

MySQL: Curdate() vs Now()

What is difference between MySQL Curdate() and Now()?..

How to I say Is Not Null in VBA

Hi I have the following expression. I'm trying to say "if the second field Is Not Null". Can you help. Thanks =Iif((Fields!approved.Value = "N" & Fields!W_O_Count.Value IsNotNull), "Red", "Trans..

Solution for "Fatal error: Maximum function nesting level of '100' reached, aborting!" in PHP

I have made a function that finds all the URLs within an html file and repeats the same process for each html content linked to the discovered URLs. The function is recursive and can go on endlessly. ..

How to change value for innodb_buffer_pool_size in MySQL on Mac OS?

I am trying to increase the size of the innodb_buffer_pool_size in MySQL 5.1 as I keep running into the following error indicating I have run out of space for the table locks. ERROR: The total numbe..

Which is fastest? SELECT SQL_CALC_FOUND_ROWS FROM `table`, or SELECT COUNT(*)

When you limit the number of rows to be returned by a SQL query, usually used in paging, there are two methods to determine the total number of records: Method 1 Include the SQL_CALC_FOUND_ROWS opti..

File path issues in R using Windows ("Hex digits in character string" error)

I run R on Windows, and have a csv file on the Desktop. I load it as follows, x<-read.csv("C:\Users\surfcat\Desktop\2006_dissimilarity.csv",header=TRUE) but the R gives the following error messa..

Add days Oracle SQL

SELECT ORDER_NUM, CUSTOMER_NUM, CUSTOMER_NAME, ADD_DAYS (ORDER_DATE, 20) FROM CUSTOMER, ORDERS; Oracle Express says ADD_DAYS invalid? Any ideas what Am I doing wrong?..

How to map and remove nil values in Ruby

I have a map which either changes a value or sets it to nil. I then want to remove the nil entries from the list. The list doesn't need to be kept. This is what I currently have: # A simple example ..

Raw SQL Query without DbSet - Entity Framework Core

With Entity Framework Core removing dbData.Database.SqlQuery<SomeModel> I can't find a solution to build a raw SQL Query for my full-text search query that will return the tables data and also t..

Can a for loop increment/decrement by more than one?

Are there other ways to increment a for loop in Javascript besides i++ and ++i? For example, I want to increment by 3 instead of one. for (var i = 0; i < myVar.length; i+3) { //every three } ..

php stdClass to array

I have a problem to convert an object stdClass to array. I have tried in this way: return (array) $booking; or return (array) json_decode($booking,true); or return (array) json_decode($booking)..

'import' and 'export' may only appear at the top level

I'm using webpack with vuejs. Webpack does its thing, but when I look at the outputted app.js file, it gives me this error. 'import' and 'export' may only appear at the top level I'm assuming i..

Best way to format multiple 'or' conditions in an if statement (Java)

A simple question but Google hasn't been helping much. I have an if statement with many conditions (have to check for 10 or 15 constants to see if any of them are present.) Instead of writing someth..

How to draw a dotted line with css?

How can I draw a dotted line with CSS?..

Find and Replace Inside a Text File from a Bash Command

What's the simplest way to do a find and replace for a given input string, say abc, and replace with another string, say XYZ in file /tmp/file.txt? I am writting an app and using IronPython to execut..

jQuery Date Picker - disable past dates

I am trying to have a date Range select using the UI date picker. in the from/to field people should not be able to view or select dates previous to the present day. This is my code: $(function() {..

How to access parameters in a Parameterized Build?

How do you access parameters set in the "This build is parameterized" section of a "Workflow" Jenkins job? TEST CASE Create a WORKFLOW job. Enable "This build is parameterized". Add a STRING PARAM..

How do I create a comma delimited string from an ArrayList?

I'm storing an ArrayList of Ids in a processing script that I want to spit out as a comma delimited list for output to the debug log. Is there a way I can get this easily without looping through thing..

Center Contents of Bootstrap row container

I have the code below and I'd like to center the "well" elements of the outer "row" div. I've tried various approaches such as text-align: center (which just centers the text and not the inner DIV el..

cannot open shared object file: No such file or directory

I met the share library not found on the head node of a cluster with torch. I have built the library as well as specify the correct path of the library while compiling my own program "absurdity" by g+..

Two way sync with rsync

I have a folder a/ and a remote folder A/. I now run something like this on a Makefile: get-music: rsync -avzru server:/media/10001/music/ /media/Incoming/music/ put-music: rsync -avzru /media/Inc..

Decoding and verifying JWT token using System.IdentityModel.Tokens.Jwt

I've been using the JWT library to decode a Json Web Token, and would like to switch to Microsoft's official JWT implementation, System.IdentityModel.Tokens.Jwt. The documentation is very sparse, so ..

Can VS Code run on Android?

Does anybody know about plans of MS to support running VS Code so it can run on Android OS?..

How to make bootstrap column height to 100% row height?

I haven't found a suitable solution to this and it seems so trivial. I have two columns inside a row: <div class="row"> <div class="col-xs-9"> <div class="left-side"> &..

The POM for project is missing, no dependency information available

Background Trying to add a Java library to the local Maven repository using a clean install of Apache Maven 3.1.0, with Java 1.7. Here is how the Java archive file was added: mvn install:install-fil..

How to export all collections in MongoDB?

I want to export all collections in MongoDB by the command: mongoexport -d dbname -o Mongo.json The result is: No collection specified! The manual says, if you don't specify a collection, all ..

Which HTTP methods match up to which CRUD methods?

In RESTful style programming, we should use HTTP methods as our building blocks. I'm a little confused though which methods match up to the classic CRUD methods. GET/Read and DELETE/Delete are obvious..

MySQL string replace

I have a column containing urls (id, url):

Is there an easy way to add a border to the top and bottom of an Android View?

I have a TextView and I'd like to add a black border along its top and bottom borders. I tried adding android:drawableTop and android:drawableBottom to the TextView, but that only caused the entire v..

How can one tell the version of React running at runtime in the browser?

Is there a way to know the runtime version of React in the browser?..

How can I extract a predetermined range of lines from a text file on Unix?

I have a ~23000 line SQL dump containing several databases worth of data. I need to extract a certain section of this file (i.e. the data for a single database) and place it in a new file. I know both..

ClassNotFoundException com.mysql.jdbc.Driver

This question might have asked here number of times . After doing some google search for the above error and doing some update, I can't understand why I'm still getting that error. I've already put my..

How to get the number of characters in a std::string?

How should I get the number of characters in a string in C++?..

How to replace innerHTML of a div using jQuery?

How could I achieve the following: document.all.regTitle.innerHTML = 'Hello World'; Using jQuery where regTitle is my div id?..

Calling Member Functions within Main C++

#include <iostream> using namespace std; class MyClass { public: void printInformation(); }; void MyClass::printInformation() { return; } int main() { MyClass::printInformat..

How to send email by using javascript or jquery

I developed a web-form for a blog, and I need to send its values to an email. How can I send an email by using jQuery or JavaScript alone?..

Xcode iOS 8 Keyboard types not supported

I have a UITextField Ctrl-dragged as an @Outlet in my .swift class. Now in viewDidLoad i'm using this code self.myTextField.keyboardType = UIKeyboardType.DecimalPad When i launch my app on simulato..

How to redirect 'print' output to a file using python?

I want to redirect the print to a .txt file using python. I have a 'for' loop, which will 'print' the output for each of my .bam file while I want to redirect ALL these output to one file. So I tried ..

How to remove commits from a pull request

I did a pull request but after that I made some commits to the project locally which ended polluting my pull request, I tried to remove it but without any luck. I found some similar questions on Stac..

Pass array to where in Codeigniter Active Record

I have a table in my database with adminId and clientId There might be 20 records with the adminId of the logged in user and I'm trying to pull a list of clients. I am wondering if there is a way i ..

R: Plotting a 3D surface from x, y, z

imagine I have a 3 columns matrix x, y, z where z is a function of x and y. I know how to plot a "scatter plot" of these points with plot3d(x,y,z) But if I want a surface instead I must use other co..

How can I remove a button or make it invisible in Android?

How can I remove a button in Android, or make it invisible?..

Web API Routing - api/{controller}/{action}/{id} "dysfunctions" api/{controller}/{id}

I have the default Route in Global.asax: RouteTable.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = System.Web.Http.R..

Why are elementwise additions much faster in separate loops than in a combined loop?

Suppose a1, b1, c1, and d1 point to heap memory, and my numerical code has the following core loop. const int n = 100000; for (int j = 0; j < n; j++) { a1[j] += b1[j]; c1[j] += d1[j]; } T..

How do I convert a String to an int in Java?

How can I convert a String to an int in Java? My String contains only numbers, and I want to return the number it represents. For example, given the string "1234" the result should be the number 123..

Get File Path (ends with folder)

I know how to let the user click on a button to navigate to a specific file to open. Code: Private Sub CommandButton2_Click() Dim vaFiles As Variant vaFiles = Application.GetOpenFilename() ..

How do I copy directories recursively with gulp?

I am trying to stage a project from a working directory to a server (same machine). Using the following code: gulp.src([ 'index.php', 'css/**', 'js/**', 'src/**', ]) .pipe(gulp.dest('..

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

Keyword not supported: "data source" initializing Entity Framework Context

I'm initializing Entity Framework Object context, and this gives me the keyword not supported error: metadata=res://*/MainDB.csdl|res://*/MainDB.ssdl|res://*/MainDB.msl;provider=System.Data.SqlClient..

How to determine total number of open/active connections in ms sql server 2005

My PHP/MS Sql Server 2005/win 2003 Application occasionally becomes very unresponsive, the memory/cpu usage does not spike. If i try to open any new connection from sql management studio, then the it..

ASP.NET MVC Global Variables

How do you declare global variables in ASP.NET MVC?..

Java. Implicit super constructor Employee() is undefined. Must explicitly invoke another constructor

Hello I'm new to Java, I'm getting this error in my production worker class. My Production worker constructor says explicitly invoke another constructor. I don't know what to do?. import java.util.Da..

How to get config parameters in Symfony2 Twig Templates

I have a Symfony2 Twig template. I want to output the value of a config parameter in this twig template (a version number). Therefore I defined the config parameter like this: parameters: app.ver..

Android : Fill Spinner From Java Code Programmatically

How do you fill a spinner from java code programmatically? I have a spinner in the layout like this: <Spinner android:id="@+id/consultation_deseases" android:layout_width="@dimen/bigSp..

Python: slicing a multi-dimensional array

I'm new to Python and numpy. I've figured out how to slice 1 dimensional sequence: arr[start:end], and access an element in the array: el = arr[row][col]. Trying something like slice = arr[0:2][0:2] ..

How to get label of select option with jQuery?

<select> <option value="test">label </option> </select> The value can be retrieved by $select.val(). What about the label? Is there a solution that will work in IE6?..

Why doesn't list have safe "get" method like dictionary?

Why doesn't list have a safe "get" method like dictionary? >>> d = {'a':'b'} >>> d['a'] 'b' >>> d['c'] KeyError: 'c' >>> d.get('c', 'fail') 'fail' >>> l ..

I have 2 dates in PHP, how can I run a foreach loop to go through all of those days?

I'm starting with a date 2010-05-01 and ending with 2010-05-10. How can I iterate through all of those dates in PHP?..

How to remove CocoaPods from a project?

What's the right way of removing CocoaPods from a project? I want to remove the whole CocoaPod. Due to some limitations imposed by my client I can't use it. I need to have just one xcodeproj instead o..

Please add a @Pipe/@Directive/@Component annotation. Error

I am stuck in a situation here. I am getting an error like this. compiler.es5.js:1694 Uncaught Error: Unexpected value 'LoginComponent' declared by the module 'AppModule'. Please add a @Pipe/@Direc..

Sort a list of Class Instances Python

I have a list of class instances - x = [<iteminstance1>,...] among other attributes the class has score attribute. How can I sort the items in ascending order based on this parameter? EDIT..

How to find out what character key is pressed?

I would like to find out what character key is pressed in a cross-browser compatible way in pure Javascript...

Reading tab-delimited file with Pandas - works on Windows, but not on Mac

I've been reading a tab-delimited data file in Windows with Pandas/Python without any problems. The data file contains notes in first three lines and then follows with a header. df = pd.read_csv(myf..

Is there a way to split a widescreen monitor in to two or more virtual monitors?

Like most developers I have grown to love dual monitors. I won't go into all the reasons for their goodness; just take it as a given. However, they are not perfect. You can never seem to line them up..

When should you use constexpr capability in C++11?

It seems to me that having a "function that always returns 5" is breaking or diluting the meaning of "calling a function". There must be a reason, or a need for this capability or it wouldn't be in C..

Checking length of dictionary object

I'm trying to check the length here. Tried count. Is there something I'm missing? var dNames = {}; dNames = GetAllNames(); for (var i = 0, l = dName.length; i < l; i++) { alert("Name:..

How to manually update datatables table with new JSON data

I am using plugin jQuery datatables and load my data which I have loaded in DOM at the bottom of page and initiates plugin in this way: var myData = [ { "id": 1, "first_name": "Jo..

login to remote using "mstsc /admin" with password

I want to use mstsc /admin to login to a server silently. My batch file reads the code as mstsc / /admin But it ask me to enter password. Can anyone help me to skip this step? I w..

Iterator invalidation rules

What are the iterator invalidation rules for C++ containers? Preferably in a summary list format. _(Note: This is meant to be an entry to [Stack Overflow's C++ FAQ](

MongoDB - admin user not authorized

I am trying to add authorization to my MongoDB. I am doing all this on Linux with MongoDB 2.6.1. My mongod.conf file is in the old compatibility format (this is how it came with the installation). ..

How can I detect browser type using jQuery?

I want to detect if the user is using IE and Firefox but I cannot find the script. I have code as below: $(document).ready(function(e) { $ = /chrom(e|ium)/.test(navigator.userAgen..

indexOf and lastIndexOf in PHP?

In Java, we can use indexOf and lastIndexOf. Since those functions don't exist in PHP, what would be the PHP equivalent of this Java code? if(req_type.equals("RMT")) pt_password = message.substri..

How to check for valid email address?

Is there a good way to check a form input using regex to make sure it is a proper style email address? Been searching since last night and everybody that has answered peoples questions regarding this ..

How can I get the Google cache age of any URL or web page?

In my project I need the Google cache age to be added as important information. I tried to search sources for the Google cache age, that is, the number of days since Google last re-indexed the page li..

OnClick vs OnClientClick for an asp:CheckBox?

Does anyone know why a client-side javascript handler for asp:CheckBox needs to be an OnClick="" attribute rather than an OnClientClick="" attribute, as for asp:Button? For example, this works: <..

class method generates "TypeError: ... got multiple values for keyword argument ..."

If I define a class method with a keyword argument thus: class foo(object): def foodo(thing=None, thong='not underwear'): print thing if thing else "nothing" print 'a thong is',thong cal..

In SQL Server, how to create while loop in select

data will be like this: id | data ----|--------- 1 | AABBCC 2 | FFDD 3 | TTHHJJKKLL what the result I want is id | data ----|--------- 1 | AA 1 ..

How can I find out if an .EXE has Command-Line Options?

Suppose you have an .EXE and you want to check if it has Command-Line Options. How can one know if the .EXE has this ability. In my case I know that Nir Sofers WebBrowserPassView.exe has the ability t..

Show SOME invisible/whitespace characters in Eclipse

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

Alternative to deprecated getCellType

I'm reading an excel-file (file extension xlsx) using org.apache.poi 3.15. This is my code: try (FileInputStream fileInputStream = new FileInputStream(file); XSSFWorkbook workbook = new XSSFWorkboo..

RequestDispatcher.forward() vs HttpServletResponse.sendRedirect()

What is the conceptual difference between forward() and sendRedirect()?..

How do I install soap extension?

How do I install Soap? I got this error: Fatal error: Class 'SoapClient' not found in /home/user/ on line 16 I am hosting my site in DreamHost and they don't support..

jQuery $.ajax(), pass success data into separate function

I am using the jQuery $.ajax() function. I have put this into a parent function, which passes some values into the ajax function. What I would like to do, is have a user defined callback function, w..

Is there a typescript List<> and/or Map<> class/library?

Did they add a runtime List<> and/or Map<> type class to typepad 1.0? And if not, is there a solid library out there someone wrote that provides this functionality? And in the case of List<>..

Android: combining text & image on a Button or ImageButton

I'm trying to have an image (as the background) on a button and add dynamically, depending on what's happening during run-time, some text above/over the image. If I use ImageButton I don't even have ..

Java 32-bit vs 64-bit compatibility

Will Java code built and compiled against a 32-bit JDK into 32-bit byte code work in a 64-bit JVM? Or does a 64-bit JVM require 64-bit byte code? To give a little more detail, I have code that was w..

How to serve .html files with Spring

I am developing a website with Spring, and am trying to serve resources that are not .jsp files (.html for example) right now i have commented out this part of my servlet configuration <bean ..

How to list the properties of a JavaScript object?

Say I create an object thus: var myObject = {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"}; What is the best way to retrieve a list of the property names? i.e. I would l..

Bootstrap: adding gaps between divs

If my page uses the Bootstrap class row, col-md-x and such to arrange the content, what would be the proper way to create a distance between each div containing a whole element semantically speaking? ..

Execution failed app:processDebugResources Android Studio

I'm using bitbucket so I can work with other developer but it seems that we can't get it to work flawlessly. I got this error after pulling the changes from him: Execution failed for task ':app:proce..

How to connect PHP with Microsoft Access database

I am currently faced with a new challenge to develop a site using Microsoft Access as the primary database instead of mysql. I have not used MS Access before and I would like guidiance on how to go ab..

CSS scale height to match width - possibly with a formfactor

I have implemented a GoogleMapsV3 map in a twitterBootstrap basic responsive design site. But my question is quite simple: i have: <div id="map"></map> and #map{ width: 100%; height: ..

Checking if an Android application is running in the background

By background, I mean none of the application's activities are currently visible to the user?..

How to obtain the last index of a list?

Suppose I've the following list: list1 = [1, 2, 33, 51] ^ | indices 0 1 2 3 How do I obtain the last index, which in this case would be 3, of that list..

Javascript onHover event

Is there a canonical way to set up a JS onHover event with the existing onmouseover, onmouseout and some kind of timers? Or just any method to fire an arbitrary function if and only if user has hover..

Use of Java's Collections.singletonList()?

What is the use of Collections.singletonList() in Java? I understand that it returns a list with one element. Why would I want to have a separate method to do that? How does immutability play a role h..

Reversing a String with Recursion in Java

Here is some Java code to reverse a string recursively. Could someone provide an explanation of how it works? public static String reverse(String str) { if ((null == str) || (str.length() <..

What is Bit Masking?

I am fairly new to C programming, and I encountered bit masking. Can someone explain to me the general concept and function of bit masking? Examples are much appreciated...

Can you style html form buttons with css?

I don't like the default button style. It's really boring. I am using <input type="submit"> type buttons. Can I style these somehow in css? If not, the other way of doing it i guess would be..

Getting all request parameters in Symfony 2

In symfony 2 controllers, every time I want to get a value from post I need to run: $this->getRequest()->get('value1'); $this->getRequest()->get('value2'); Is there any way to consolida..

How to read and write excel file

I want to read and write an Excel file from Java with 3 columns and N rows, printing one string in each cell. Can anyone give me simple code snippet for this? Do I need to use any external lib or doe..

Postgres could not connect to server

After I did brew update and brew upgrade, my postgres got some problem. I tried to uninstall postgres and install again, but it didn't work as well. This is the error message.(I also got this error ..

Python: Finding differences between elements of a list

Given a list of numbers, how does one find differences between every (i)-th elements and its (i+1)-th? Is it better to use a lambda expression or maybe a list comprehension? For example: Given a ..

gitx How do I get my 'Detached HEAD' commits back into master

Using Git X and must have fumbled royally on something. Looks like a few days ago I created a branch called detached HEAD and have been committing to it. My normal process is to commit to master and..

If statement with String comparison fails

I really don't know why the if statement below is not executing: if (s == "/quit") { System.out.println("quitted"); } Below is the whole class. It is probably a really stupid logic problem but..

Config Error: This configuration section cannot be used at this path

I've encountered an error deploying a site to a server. When trying to load the home page, or access authentication on the new site in IIS, I get the error: Config Error: This configuration secti..

How to add subject alernative name to ssl certs?

I'm using openssl to create self-signed certs. I'm getting this error with the certs I generated: No subject alterna..

How to get CRON to call in the correct PATHs

I'm trying to get cron to call in the correct PATHs. When I run a Python script from shell the script runs fine as it uses the PATHs set in bashrc but when I use cron all the PATHs are not used from b..

Collections.emptyList() vs. new instance

In practice, is it better to return an empty list like this: return Collections.emptyList(); Or like this: return new ArrayList<Foo>(); Or is this completely dependent upon what you're goi..

Recursively find files with a specific extension

I'm trying to find files with specific extensions. For example, I want to find all .pdf and .jpg files that's named Robert I know I can do this command $ find . -name '*.h' -o -name '*.cpp' but ..

Open text file and program shortcut in a Windows batch file

I have two files in the same folder that I'd like to run. One is a .txt file, and the other is the program shortcut to an .exe. I'd like to make a batch file in the same location to open the text file..

How to add an extra row to a pandas dataframe

If I have an empty dataframe as such: columns = ['Date', 'Name', 'Action','ID'] df = pd.DataFrame(columns=columns) is there a way to append a new row to this newly created dataframe? Currently I h..

Resize to fit image in div, and center horizontally and vertically

I have an image in a div. I would like the image to resize to fit the div, and be horizontally and vertically centered. I would like a solution that works in ie >= 8...

What is a View in Oracle?

What is a view in Oracle?..

How to launch jQuery Fancybox on page load?

I would like to launch a Fancybox (e.g. Fancybox's version of a modal or light box) on page load. I could bind it to a hidden anchor tag and fire the click event of that anchor tag via JavaScript, but..

Change location of

I want to put all my config files in a /config subfolder of my application directory. Log4j is expecting the file in the root folder of my application. Is there a way to tell log4j wh..

How do I get the file extension of a file in Java?

Just to be clear, I'm not looking for the MIME type. Let's say I have the following input: /path/to/file/foo.txt I'd like a way to break this input up, specifically into .txt for the extension. Is ..

How to remove error about glyphicons-halflings-regular.woff2 not found

ASP.NET MVC4 Bootstrap 3 application is running from Microsoft Visual Studio Express 2013 for Web IDE. Chrome console shows always error http://localhost:52216/admin/fonts/glyphicons-halflings-regul..

Installing cmake with home-brew

I'm new to programming. Can you please help me install cmake? I typed brew install cmake. What should I do next? ..

MySQL date format DD/MM/YYYY select query?

I'm a bit confused on how to order by date formats. For the format YYYY-MM-DD you would do this: ...ORDER BY date DESC... How would you order by DD/MM/YYYY? This isn't working: SELECT * FROM $tab..

Syntax error on print with Python 3

Why do I receive a syntax error when printing a string in Python 3? >>> print "hello World" File "<stdin>", line 1 print "hello World" ^ SyntaxError: invali..

Is it possible to simulate key press events programmatically?

Is it possible to simulate key press events programmatically in JavaScript?..

Could pandas use column as index?

I have a spreadsheet like this: Locality 2005 2006 2007 2008 2009 ABBOTSFORD 427000 448000 602500 600000 638500 ABERFELDIE 534000 600000 735000 710000 775000 AIREYS INLET459..

How to delete zero components in a vector in Matlab?

I have a vector for example a = [0 1 0 3] I want to turn a into b which equals b = [1 3]. How do I perform this in general? So I have a vector with some zero components and I want to remove the ze..

How to compile or convert sass / scss to css with node-sass (no Ruby)?

I was struggling with setting up libsass as it wasn't as straight-forward as the Ruby based transpiler. Could someone explain how to: install libsass? use it from command line? use it with task runn..

In MVC, how do I return a string result?

In my AJAX call, I want to return a string value back to the calling page. Should I use ActionResult or just return a string? ..

What causes "Unable to access jarfile" error?

I want to execute my program without using an IDE. I've created a jar file and an exectuable jar file. When I double click the exe jar file, nothing happens, and when I try to use the command in cmd..

How to resolve a Java Rounding Double issue

Seems like the subtraction is triggering some kind of issue and the resulting value is wrong. double tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d; 78.75 = 787.5 * 10.0/100d ..

Understanding lambda in python and using it to pass multiple arguments

After reading everything I can find on lambda, I still don't understand how to make it do what I want. Everyone uses the example: lambda x, y : x + y Why do you need to state both x and y before ..

Disabling Chrome cache for website development

I am modifying a site's appearance (CSS modifications) but can't see the result on Chrome because of annoying persistent cache. I tried Shift+refresh but it doesn't work. How can I disable the cache ..

How to validate domain name in PHP?

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

WPF button click in C# code

I have an array of button which is dynamically generated at run time. I have the function for button click in my code, but I can't find a way to set the button's click name in code. So, what is the..

C - casting int to char and append char to char

I am making my first parallel application, but I am stuck with basics of C. I need to know, how to cast int to char and then how to append one char to another. It you could help me please, i would b..

What is the difference between fastcgi and fpm?

I am trying to install php with fpm on macports. I read somewhere that fpm means FastCGI process manager. Does that mean fastcgi and fpm are same? If they are same, then why do we have two different m..

Create a root password for PHPMyAdmin

PHPMyAdmin is giving me a message saying that the user (root) does not have a password. So, how can I create one?..

Set Radiobuttonlist Selected from Codebehind

Hey I have a radiobuttonlist and trying to set one of the radiobuttons to selected based on a session variable but proving impossible. <asp:radiobuttonlist id="radio1" runat="server" AutoPostBack=..

Python recursive folder read

I have a C++/Obj-C background and I am just discovering Python (been writing it for about an hour). I am writing a script to recursively read the contents of text files in a folder structure. The pro..