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.
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..
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..
how can I make a column take up 100% height of the browser w bootstrap 4?
See the following: https://codepen.io/johnpickly/pen/dRqxjV
Note the yellow div, I need this div/column to take up a height ..
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..
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..
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..
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..
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...
..
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 ..
I found this code to print in Javascript.
function printData()
{
var divToPrint=document.getElementById("printTable");
newWin= window.open("");
newWin.document.write(divToPrint.outerHTML);
..
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..
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 ..
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..
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..
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..
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 ..
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..
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..
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..
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..
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..
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..
<script type="application/javascript">
function getip(json){
alert(json.ip); // alerts the ip address
}
</script>
<script type="application/javascript" src="http://jsonip..
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..
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...
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..
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..
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
..
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..
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..
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? 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..
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..
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..
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..
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..
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..
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..
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?
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..
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 ..
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..
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..
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..
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..
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..
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..
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..
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..
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...
#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 ..
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 ..
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..
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..
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..
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..
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..
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 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..
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..
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..
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..
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..
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. ..
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..
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..
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..
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?..
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 ..
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..
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
}
..
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)..
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..
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..
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..
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 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..
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..
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..
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+..
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..
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 ..
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">
&..
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..
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 ..
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..
I have a column containing urls (id, url):
http://www.example.com/articles/updates/43
http://www.example.com/articles/updates/866
http://www.example.com/articles/updates/323
http://www.example.com/ar..
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..
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..
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..
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..
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 ..
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..
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 ..
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..
I have the default Route in Global.asax:
RouteTable.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = System.Web.Http.R..
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 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..
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()
..
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('..
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..
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..
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..
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..
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..
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..
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] ..
<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 a safe "get" method like dictionary?
>>> d = {'a':'b'}
>>> d['a']
'b'
>>> d['c']
KeyError: 'c'
>>> d.get('c', 'fail')
'fail'
>>> l ..
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..
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..
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..
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..
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..
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..
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:..
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..
I want to use mstsc /admin to login to a server silently. My batch file reads the code as
mstsc /v:xxx.xxx.xxx.xxx /admin
But it ask me to enter password. Can anyone help me to skip this step?
I w..
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](https://stackoverflow.com/question..
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). ..
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) {
$.browser.chrome = /chrom(e|ium)/.test(navigator.userAgen..
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..
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 ..
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..
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:
<..
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..
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..
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..
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..
How do I install Soap?
I got this error:
Fatal error: Class 'SoapClient' not found in /home/user/mysite.com/path/to/file.php on line 16
I am hosting my site in DreamHost and they don't support..
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..
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<>..
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 ..
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..
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 ..
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..
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?
..
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..
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..
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: ..
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..
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..
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..
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() <..
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...
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..
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..
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..
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 ..
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 ..
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..
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..
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..
I'm using openssl to create self-signed certs. I'm getting this error with the certs I generated:
javax.net.ssl.SSLHandshakeException:
java.security.cert.CertificateException: No subject alterna..
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..
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..
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 ..
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..
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..
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...
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..
I want to put all my config files in a /config subfolder of my application directory. Log4j is expecting the log4j.properties file in the root folder of my application. Is there a way to tell log4j wh..
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 ..
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..
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..
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..
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..
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..
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..
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
..
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 ..
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 ..
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..
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..
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..
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..
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=..
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..