Questions Tagged with #Unbuffered output

CSS3 animate border color

I want to animate borders of an element using CSS3, whether it's in hover state or normal state. Can someone provide me a code snippet for this or can guide? I can do this using jQuery but looking fo..

How can I close a window with Javascript on Mozilla Firefox 3?

I need to close the tab which displays my webpage, by the click of a button. But firefox does not allow to close the window by javascript as long as it is not opened by javascript. If I set the value ..

Android on-screen keyboard auto popping up

One of my apps has an "opening screen" (basically a menu) that has an EditText followed by several Buttons. The problem is that several of my users are reporting that when they open the app it's autom..

jQuery: Check if div with certain class name exists

Using jQuery I'm programmatically generating a bunch of div's like this: <div class="mydivclass" id="myid1">Some Text1</div> <div class="mydivclass" id="myid2">Some Text2</div>..

Uploading multiple files using formData()

var fd = new FormData(); fd.append("fileToUpload", document.getElementById('fileToUpload').files[0]); var xhr = new XMLHttpRequest(); xhr.open("POST", "uph.php"); xhr.send(fd); uph.php: var_dump($_..

Secure FTP using Windows batch script

I currently have batch scripts on different servers that transfer a csv file to an FTP server at a different location. My script looks similar to this: echo user ftp_user> ftpcmd.dat echo password..

How to get multiple selected values from select box in JSP?

I have a html form which have a select list box from which you can select multiple values because its multiple property is set to multiple. Consider form method is get method. The html code for form i..

Possible to change where Android Virtual Devices are saved?

I've set up the Android SDK and Eclipse on my machine running Windows XP and AVDs (Android Virtual Devices) are saved to "Documents and Settings\user\.android" by default. Is there any way to change ..

Modal width (increase)

I want a modal to be 80% or so of a screen width. modal-lg isn't large enough. This: .modal .modal-dialog { width: 80%; } Doesn't work with Bootstrap 4...

g++ undefined reference to typeinfo

I just ran across the following error (and found the solution online, but it's not present in Stack Overflow): (.gnu.linkonce.[stuff]): undefined reference to [method] [object file]:(.gnu.link..

Run PHP function on html button click

I need to run some PHP function when a button is clicked. I know this is not supposed to be php's use, rather js should do it, but what my functions are doing in gathering data from a server when the ..

How to access the services from RESTful API in my angularjs page?

I am very new to angularJS. I am searching for accessing services from RESTful API, but I didn't get any idea. How can I do that?..

Generate class from database table

How can I generate a class from a SQL Server table object? I'm not talking about using some ORM. I just need to create the entities (simple class). Something like: public class Person { ..

What is the purpose and use of **kwargs?

What are the uses for **kwargs in Python? I know you can do an objects.filter on a table and pass in a **kwargs argument.   Can I also do this for specifying time deltas i.e. timedelta(hours = ..

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin ('null')

I have a game in heroku, now I'm trying to make it work in Facebook canvas, but, while it works in Firefox, in Chrome and IE doesn't. IE shows a warning with a button, when clicking the button, it sh..

What does the "map" method do in Ruby?

I'm new to programming. Can someone explain what .map would do in: params = (0...param_count).map ..

Automatic exit from Bash shell script on error

I've been writing some shell script and I would find it useful if there was the ability to halt the execution of said shell script if any of the commands failed. See below for an example: #!/bin/bash ..

What's the difference between equal?, eql?, ===, and ==?

I am trying to understand the difference between these four methods. I know by default that == calls the method equal? which returns true when both operands refer to exactly the same object. === by d..

Example for boost shared_mutex (multiple reads/one write)?

I have a multithreaded app that has to read some data often, and occasionally that data is updated. Right now a mutex keeps access to that data safe, but it's expensive because I would like multiple t..

"Least Astonishment" and the Mutable Default Argument

Anyone tinkering with Python long enough has been bitten (or torn to pieces) by the following issue: def foo(a=[]): a.append(5) return a Python novices would expect this function to always ..

Method to get all files within folder and subfolders that will return a list

I have a method that will iterate through a folder and all of its subfolders and get a list of the file paths. However, I could only figure out how to create it and add the files to a public List, but..

Android - styling seek bar

I wanted to style a seek bar which looks like the one in the image below. By using default seekbar I will get something like this: So what I need is to only change the color. I need no extra sty..

Open a workbook using FileDialog and manipulate it in Excel VBA

I am learning how to use Excel macros and I found this code: Dim fd As Office.FileDialog Set fd = Application.FileDialog(msoFileDialogFilePicker) With fd .AllowMultiSelect = False .Title =..

What is thread Safe in java?

Possible Duplicate: What does threadsafe mean? I am very confused that any class is Thread safe. I am understanding that, if any class is thread safe then it has some specific on its method..

SQL Inner-join with 3 tables?

I'm trying to join 3 tables in a view; here is the situation: I have a table that contains information of students who are applying to live on this College Campus. I have another table that lists the..

Google Maps API v3: Can I setZoom after fitBounds?

I have a set of points I want to plot on an embedded Google Map (API v3). I'd like the bounds to accommodate all points unless the zoom level is too low (i.e., zoomed out too much). My approach has ..

"ImportError: No module named" when trying to run Python script

I'm trying to run a script that launches, amongst other things, a python script. I get a ImportError: No module named ..., however, if I launch ipython and import the same module in the same way thro..

bash string equality

In bash, what's the difference, if any, between the equal and double equal test operators? [[ "a" = "a" ]] && echo equal || echo not-equal [[ "a" == "a" ]] && echo equal || echo not-e..

How to update values in a specific row in a Python Pandas DataFrame?

With the nice indexing methods in Pandas I have no problems extracting data in various ways. On the other hand I am still confused about how to change data in an existing DataFrame. In the following..

Converting a value to 2 decimal places within jQuery

Possible Duplicate: JavaScript: formatting number with exactly two decimals Now that I have got a bit of script to add values in to a div with a total in it, I then try to divide the values..

Is there a WebSocket client implemented for Python?

I found this project: http://code.google.com/p/standalonewebsocketserver/ for a WebSocket server, but I need to implement a WebSocket client in python, more exactly I need to receive some commands fro..

ASP.net using a form to insert data into an sql server table

Hi in php i would do a form with an action to lets say a process.php page and in that page i would take the post values and using a mysql_query would do an insertion. now i am lost ,i am trying to cre..

Measure string size in Bytes in php

I am doing a real estate feed for a portal and it is telling me the max length of a string should be 20,000 bytes (20kb), but I have never run across this before. How can I measure byte size of a var..

How to use struct timeval to get the execution time?

After reading this article about elapsed time, I wrote a simple code to calculate the execution time of a loop: #include <stdio.h> #include <sys/time.h> int main (int argc, char** argv) ..

Validate Dynamically Added Input fields

I have used this jquery validation plugin for the following form. <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript" src="http://jzaefferer...

How do you write a migration to rename an ActiveRecord model and its table in Rails?

I'm terrible at naming and realize that there are a better set of names for my models in my Rails app. Is there any way to use a migration to rename a model and its corresponding table?..

Toggle Class in React

I'm using react for a project where I have a menu button. <a ref="btn" href="#" className="btn-menu show-on-small"><i></i></a> And a Sidenav component like: <Sidenav ref..

Is key-value pair available in Typescript?

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

ReferenceError: describe is not defined NodeJs

I am trying to define some endpoints and do a test using nodejs. In server.js I have: var express = require('express'); var func1 = require('./func1.js'); var port = 8080; var server = express(); se..

How to make a phone call using intent in Android?

I'm using the following code to make a call in Android but it is giving me security exception please help. posted_by = "111-333-222-4"; String uri = "tel:" + posted_by.trim() ; Intent intent = ne..

Error handling in C code

What do you consider "best practice" when it comes to error handling errors in a consistent way in a C library. There are two ways I've been thinking of: Always return error code. A typical function..

Loop in react-native

I want to make a list of fields depending on the number of the player that user has selected. I wanted to make something like this: generatePaymentField() { var noGuest = this.state.guest; va..

Android: Pass data(extras) to a fragment

I'm new to Android programming and I'm having problems while passing an ArrayList of a Parcelable to a fragment. This is the Activity that is launched(working well!) where feedlist is an ArrayList of ..

Looping over a list in Python

I have a list with sublists in it. I want to print all the sublists with length equal to 3. I am doing the following in python: for x in values[:]: if len(x) == 3: print(x) values is t..

How to get the primary IP address of the local machine on Linux and OS X?

I am looking for a command line solution that would return me the primary (first) IP address of the localhost, other than 127.0.0.1 The solution should work at least for Linux (Debian and RedHat) and..

Adding quotes to a string in VBScript

I have this code: a = "xyz" g = "abcd " & a After running it, the value of g is abcd xyz. However, I want quotes around the value of a in g. After running the code, g should be abcd "xyz" ..

“Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G

First of all, I have a box with 8gb of ram, so I doubt total memory is the issue. This application is running fine on machines with 6gb or less. I am trying to reserve 3GB of space using -Xmx3G under..

How to get an object's properties in JavaScript / jQuery?

In JavaScript / jQuery, if I alert some object, I get either [object] or [object Object] Is there any way to know: what is the difference between these two objects what type of Object is this what..

Fatal error: Call to undefined function curl_init()

<?php $filename = "xx.gif"; $handle = fopen($filename, "r"); $data = fread($handle, filesize($filename)); // $data is file data $pvars = array('image' => base64_encode($data), 'key' => IMG..

Non-conformable arrays error in code

I'm stuck at the following code: y = c(2.5, 6.0, 6.0, 7.5, 8.0, 8.0, 16.0, 6.0, 5.0, 6.0, 28.0, 5.0, 9.5, 6.0, 4.5, 10.0, 14.0, 3.0, 4.5, 5.5, 3.0, 3.5, 6.0, 2.0, 3.0, 4.0, 6.0, 5.0, 6..

How to use Tomcat 8 in Eclipse?

EDIT 2014-02-07: Eclipse Luna is here, and support for Tomcat 8 is included in the bundled WTP : ) Happy days! Tomcat 8 is still in development, but you can get it here. Now there is a RC version on ..

Spring: Returning empty HTTP Responses with ResponseEntity<Void> doesn't work

We are implementing a REST API with Spring (4.1.1.). For certain HTTP requests, we would like to return a head with no body as a response. However, using ResponseEntity<Void> doesn't seem to wor..

How change List<T> data to IQueryable<T> data

Possible Duplicate: IList<T> to IQueryable<T> I have a List data, but I want a IQueryable data , is it possible from List data to IQueryable data? Show me code..

How to use support FileProvider for sharing content to other apps?

I'm looking for a way to correctly share (not OPEN) an internal file with external application using Android Support library's FileProvider. Following the example on the docs, <provider andr..

How to get a user's time zone?

Does anyone know of a way to get a users time zone in Swift? I'm getting a specific time something is on t.v. out of a database and then need to subtract/add from where they are located to show them..

How to solve '...is a 'type', which is not valid in the given context'? (C#)

The following code produces the error: Error : 'CERas.CERAS' is a 'type', which is not valid in the given context Why does this error occur? using System.Drawing; using System.Linq; using Sys..

Python - Get Yesterday's date as a string in YYYY-MM-DD format

As an input to an API request I need to get yesterday's date as a string in the format YYYY-MM-DD. I have a working version which is: yesterday = datetime.date.fromordinal(datetime.date.today().toord..

Using a bitmask in C#

Let's say I have the following int susan = 2; //0010 int bob = 4; //0100 int karen = 8; //1000 and I pass 10 (8 + 2) as a parameter to a method and I want to decode this to mean susan and karen I ..

jQuery multiple events to trigger the same function

Is there a way to have keyup, keypress, blur, and change events call the same function in one line or do I have to do them separately? The problem I have is that I need to validate some data with a d..

How to exit from the application and show the home screen?

I have an application where on the home page I have buttons for navigation through the application. On that page I have a button "EXIT" which when clicked should take the user to the home screen on t..

What is the difference between synchronous and asynchronous programming (in node.js)

I've been reading nodebeginner And I came across the following two pieces of code. The first one: var result = database.query("SELECT * FROM hugetable"); console.log("Hello World"); The se..

How to use Oracle ORDER BY and ROWNUM correctly?

I am having a hard time converting stored procedures from SQL Server to Oracle to have our product compatible with it. I have queries which returns the most recent record of some tables, based on a t..

Putty: Getting Server refused our key Error

I created key pair using puttygen.exe (client is windows 8). On server (Ubuntu 12.04.3 LTS), I have put my public key in ~/.ssh/authorized_keys. The public key is this: ssh-rsa AAAAB3NzaC1yc2EAAAABJQ..

Redirecting unauthorized controller in ASP.NET MVC

I have a controller in ASP.NET MVC that I've restricted to the admin role: [Authorize(Roles = "Admin")] public class TestController : Controller { ... If a user who is not in the Admin role navi..

Python JSON encoding

I'm trying to encode data to JSON in Python and I been having a quite a bit of trouble. I believe the problem is simply a misunderstanding. I'm relatively new to Python and never really got familiar..

Calling one method from another within same class in Python

I am very new to python. I was trying to pass value from one method to another within the class. I searched about the issue but i could not get proper solution. Because in my code, "if" is calling cla..

How do you use colspan and rowspan in HTML tables?

I don't know how to merge rows and columns inside HTML tables. Can you please help me with making such a table in HTML?..

kubectl apply vs kubectl create?

What I understood by the documentation is that: kubectl create = Creates a new k8s resource in the cluster kubectl replace = Updates a resource in the live cluster kubectl apply = If I want to do cr..

What's wrong with overridable method calls in constructors?

I have a Wicket page class that sets the page title depending on the result of an abstract method. public abstract class BasicPage extends WebPage { public BasicPage() { add(new Label("t..

Can I rollback a transaction I've already committed? (data loss)

I committed an incorrect UPDATE statement and have lost some data. Is it possible to rollback now, after I've already committed? Any help? ROLLBACK says NOTICE: there is no transaction in progre..

Why GDB jumps unpredictably between lines and prints variables as "<value optimized out>"?

Can anyone explain this behavior of gdb? 900 memset(&new_ckpt_info,'\0',sizeof(CKPT_INFO)); (gdb) **903 prev_offset = cp_node->offset;** (gdb) **905 m_CPND_CKPTINFO_R..

How to clone object in C++ ? Or Is there another solution?

I wrote a Stack and Queue implementation (Linked List based). There is one stack (bigStack). For example, I separate bigStack (example: stackA and stackB). I pop() a node from bigStack, I push() in st..

React Native: Possible unhandled promise rejection

I'm getting the following error: Possible unhandled promise rejection (id:0: Network request failed Here's the promise code, I don't see what's wrong here, any ideas? return fetch(url) .the..

Is there something like Codecademy for Java

Does anyone know of a site like Codecademy that focuses on teaching programming with Java? (Codeacademy.com uses guided lessons in JavaScript, HTML and CSS, and Python)..

Is it possible to have empty RequestParam values use the defaultValue?

if I have a a request mapping similar to the following: @RequestMapping(value = "/test", method = RequestMethod.POST) @ResponseBody public void test(@RequestParam(value = "i", defaultValue = "10") in..

Convert DOS line endings to Linux line endings in Vim

If I open files I created in Windows, the lines all end with ^M. How do I delete these characters all at once?..

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

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

C - reading command line parameters

I have made little program for computing pi (p) as an integral. Now I am facing a question how to extend it to compute an integral, which will be given as an extra parameter when starting an applicati..

How to make script execution wait until jquery is loaded

I am having a problem where the page is loading so fast, that jquery hasn't finished loading before it is being called by a subsequent script. Is there a way to check for the existence of jquery and ..

Compare cell contents against string in Excel

Consider the following: A B 1 ENG 1 2 ENG 1 3 FRA 0 4 FOO 0 I need a formula to populate the B column with 1 if the A column contains the string ENG, or 0 otherwise. I've tried (in c..

How to clear all inputs, selects and also hidden fields in a form using jQuery?

I would like to clear all inputs, selects and also all hidden fields in a form. Using jQuery is an option if best suited. What is the easiest way to do this... I mean easy to understand and maintain...

How to animate a View with Translate Animation in Android

I have one ImageView in my application which can be situated anywhere on screen On touch I want to move this view at the center of the Screen. I tried this functionality with Translate Animation and ..

MySQL stored procedure vs function, which would I use when?

I'm looking at MySQL stored procedures and function. What is the real difference? They seem to be similar, but a function has more limitations. I'm likely wrong, but it seems a stored procedure can..

Visual Studio 2017 error: Unable to start program, An operation is not legal in the current state

After fresh installation of Visual Studio 2017 I tried to run .NET Core Web project and when trying to run it on Chrome I am getting this error: Unable to start program, An operation is not legal ..

How do I parse command line arguments in Bash?

Say, I have a script that gets called with this line: ./myscript -vfd ./foo/bar/someFile -o /fizz/someOtherFile or this one: ./myscript -v -f -d -o /fizz/someOtherFile ./foo/bar/someFile What's the..

Measuring elapsed time with the Time module

With the Time module in python is it possible to measure elapsed time? If so, how do I do that? I need to do this so that if the cursor has been in a widget for a certain duration an event happens. ..

Excel function to make SQL-like queries on worksheet data?

I have a largish table in an Excel worksheet: Column_1 | Column_2 | Column_3 ValueA ValueB ValueC .... What I need is a function that will take as input the range and an SQL-like query S..

Can a local variable's memory be accessed outside its scope?

I have the following code. #include <iostream> int * foo() { int a = 5; return &a; } int main() { int* p = foo(); std::cout << *p; *p = 8; std::cout <<..

Android Studio - local path doesn't exist

After updating Android Studio to 0.2.4 I can't get my project to deploy. There is a complete mismatch of the apk filename. Waiting for device. Target device: 0146B0020E010020 Uploading file local..

multi line comment vb.net in Visual studio 2010

Possible Duplicate: commenting VB code Lack of block comments in VB .NET? How to? Is there a way to comment out more than one line of code in vb.net using VS 2010?..

Authentication failed for https://xxx.visualstudio.com/DefaultCollection/_git/project

I am trying to use git to push my repository to a visual studio team services project, but I get the error: fatal: Authentication failed for (url of team project) I am using the commands: git remote ..

Removing Duplicate Values from ArrayList

I have one Arraylist of String and I have added Some Duplicate Value in that. and i just wanna remove that Duplicate value So how to remove it. Here Example I got one Idea. List<String> list ..

navbar color in Twitter Bootstrap

How can I change the background color of the navbar of the Twitter Bootstrap 2.0.2? How can I change color of all the elements of the navbar to reflect the background color?..

How to force div to appear below not next to another?

I would like to place my div below the list, but actually it is placed next to the list.The list is generated dynamically, so it doesn't have a fixed hight. I would like to have the map div on the rig..

How can I display the users profile pic using the facebook graph api?

I would like to display the users profile picture inside of my applications canvas page, is there a way to do that using the graph api? I know I can do it using FBML but I would also like to pass the..

Display curl output in readable JSON format in Unix shell script

In my Unix shell script, when I execute a curl command, the result will be displayed as below which I am redirecting to file: {"type":"Show","id":"123","title":"name","description":"Funny","channelTi..

http://localhost:8080/ Access Error: 404 -- Not Found Cannot locate document: /

I'm really very new to this Tomcat stuff. I downloaded Tomcat 7.0 windows installer and installed it using the default configuration. After installing, I typed localhost:8080 in my browser to see if T..

Why did I get the compile error "Use of unassigned local variable"?

My code is the following int tmpCnt; if (name == "Dude") tmpCnt++; Why is there an error "Use of unassigned local variable tmpCnt"? I know I didn't explicitly initialize ..

A cycle was detected in the build path of project xxx - Build Path Problem

I'm in the process of converting my projects to OSGI bundles using maven and eclipse. Maven builds the stuff just fine, only I get the above error now within Eclipse. How can I find out which project ..

Why should we include ttf, eot, woff, svg,... in a font-face

In CSS3 font-face, there are multiple font types included like ttf, eot, woff, svg and cff. Why should we use all of these types? If they are special to different browsers, why is the number of them..

Find closing HTML tag in Sublime Text

I have a very long and very nested HTML document, where I need to quickly find the closing tag. How can I do this?..

How to pass multiple checkboxes using jQuery ajax post

How to pass multiple checkboxes using jQuery ajax post this is the ajax function function submit_form(){ $.post("ajax.php", { selectedcheckboxes:user_ids, confirm:"true" }, function(data){ $..

C++, What does the colon after a constructor mean?

Possible Duplicates: Variables After the Colon in a Constructor C++ constructor syntax question (noob) I have some C++ code here: class demo { private: unsigned char len, *dat; pub..

How to choose an AWS profile when using boto3 to connect to CloudFront

I am using the Boto 3 python library, and want to connect to AWS CloudFront. I need to specify the correct AWS Profile (AWS Credentials), but looking at the official documentation, I see no way to spe..

Should you commit .gitignore into the Git repos?

Do you think it is a good practice to commit .gitignore into a Git repo? Some people don't like it, but I think it is good as you can track the file's history. Isn't it?..

How to set a default entity property value with Hibernate

How do I set a default value in Hibernate field?..

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

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

Setting the focus to a text field

I have an application developed in netbeans and I want to set the focus to a certain jTextField when a panel is displayed. I have read a number of post and have tried various methods but non have work..

Code snippet or shortcut to create a constructor in Visual Studio

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

Check if PHP session has already started

I have a PHP file that is sometimes called from a page that has started a session and sometimes from a page that doesn't have session started. Therefore when I have session_start() on this script I so..

how to convert .java file to a .class file

Can anyone tell me how I can convert a .java file into .class file with an executable bytecode?..

Markdown open a new window link

I'm trying to edit a website which uses a modx cms, and it's using Markdown. Now I would like to open a new link into another window. Is it possible? The Link [Registration](http://www.registration...

How to split data into training/testing sets using sample function

I've just started using R and I'm not sure how to incorporate my dataset with the following sample code: sample(x, size, replace = FALSE, prob = NULL) I have a dataset that I need to put into a tr..

Check if a value is within a range of numbers

I want to check if a value is in an accepted range. If yes, to do something; otherwise, something else. The range is 0.001-0.009. I know how to use multiple if to check this, but I want to know if th..

Comparing strings in Java

Im trying to compare the values of two edittext boxes. What i would like is to just compare passw1 = passw2. As my code is now comparing two strings i have entered as i could not get to compare them. ..

ImproperlyConfigured: You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings

I was trying to configure my django project to deploy to heroku. I am getting the following error and I don't really know how to fix it. Here is the full traceback and error: 22:46:15 web.1 | Trac..

Hide/Show Column in an HTML Table

I have an HTML table with several columns and I need to implement a column chooser using jquery. When a user clicks on a checkbox I want to hide/show the corresponding column in the table. I would l..

Execute a shell script in current shell with sudo permission

For executing a shell script in current shell, we need to use a period . or a source command. But why does it not work with a sudo permission? I have a script with execute permission called setup.sh...

HTTP response code for POST when resource already exists

I'm building a server that allows clients to store objects. Those objects are fully constructed at client side, complete with object IDs that are permanent for the whole lifetime of the object. I ha..

How to edit default dark theme for Visual Studio Code?

I'm using Windows 7 64-bit. Is there a way to edit default dark theme in the Visual Studio Code? In %USERPROFILE%\.vscode folder there are only themes from the extensions, while in installation path ..

How to calculate time difference in java?

I want to subtract two timeperiods say 16:00:00 from 19:00:00. Is there any java function for this? The results can be in milliseconds, seconds, or minutes...

How to load a xib file in a UIView

I have been searching everywhere and nothing so far has worked for me. Basically I want to have a .xib file called rootView.xib and inside it I want to have a UIView (lets call it containerView) tha..

Mailto: Body formatting

Possible Duplicate: mailto link multiple body lines Just a quick question. I am creating a website for a charity and they have a section on the site where people can give some suggestions f..

how to query LIST using linq

Suppose if I add person class instance to list and then I need to query the list using linq. List lst=new List(); lst.add(new person{ID=1,Name="jhon",salary=2500}); lst.add(new person{ID=2,Name="Sena..

LISTAGG in Oracle to return distinct values

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

How can I make Bootstrap columns all the same height?

I'm using Bootstrap. How can I make three columns all the same height? Here is a screenshot of the problem. I would like the blue and red columns to be the same height as the yellow column. Here ..

Class Diagrams in VS 2017

I have been using VS 2015 and like the Class Diagram item. I recently upgraded to 2017 and can't seem to find the Class Diagram item. Anyone know how I get to it?..

findViewById in Fragment

I am trying to create an ImageView in a Fragment which will refer to the ImageView element which I have created in the XML for the Fragment. However, the findViewById method only works if I extend an ..

Error: More than one module matches. Use skip-import option to skip importing the component into the closest module

When I try to create a component in the angular cli, it's showing me this error. How do I get rid of it ? Error: More than one module matches. Use skip-import option to skip importing the componen..

How can I delay a :hover effect in CSS?

Is there a way to delay the :Hover event without using JavaScript? I know there is a way to delay animations, but I haven't seen anything on delaying the :hover event. I'm building a son-of-suckerfis..

Get a list of all the files in a directory (recursive)

I'm trying to get (not print, that's easy) the list of files in a directory and its sub directories. I've tried: def folder = "C:\\DevEnv\\Projects\\Generic"; def baseDir = new File(folder); files =..

Parse json string to find and element (key / value)

I have following json in a file timezones.json: { "Atlantic/Canary": "GMT Standard Time", "Europe/Lisbon": "GMT Standard Time", "Antarctica/Mawson": "West Asia Standard Time", "Etc/GMT+3": "SA Eas..

Resolving a Git conflict with binary files

I've been using Git on Windows (msysgit) to track changes for some design work I've been doing. Today I've been working on a different PC (with remote repo brian) and I'm now trying to merge the edit..

Remove excess whitespace from within a string

I receive a string from a database query, then I remove all HTML tags, carriage returns and newlines before I put it in a CSV file. Only thing is, I can't find a way to remove the excess white space f..

Sort arrays of primitive types in descending order

I've got a large array of primitive types (double). How do I sort the elements in descending order? Unfortunately the Java API doesn't support sorting of primitive types with a Comparator. The first..

How to multiply all integers inside list

Hello so I want to multiply the integers inside a list. For example; l = [1, 2, 3] l = [1*2, 2*2, 3*2] output: l = [2, 4, 6] So I was searching online and most of the answers were regarding mul..

Bootstrap 4 align navbar items to the right

How do I align a navbar item to right? I want to have the login and register to the right. But everything I try does not seem to work. This is what I have tried so far: <div> around the &..

ng-repeat: access key and value for each object in array of objects

I have an array of objects and I am using an ng-repeat to iterate over them, which is easy. The array looks something like this: $scope.steps = [ {companyName: true}, {businessType: true}, ..

Browser/HTML Force download of image from src="data:image/jpeg;base64..."

I am generating a image on client side and I display it with HTML like this: <img src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgM...."/> I want to offer the possibilit..

static linking only some libraries

How can I statically link only a some specific libraries to my binary when linking with GCC? gcc ... -static ... tries to statically link all the linked libraries, but I haven't got the static versio..

How do you create a toggle button?

I want to create a toggle button in html using css. I want it so that when you click on it , it stays pushed in and than when you click it on it again it pops out. If theres no way of doing it just..

What's the most elegant way to cap a number to a segment?

Let's say x, a and b are numbers. I need to limit x to the bounds of the segment [a, b]. In other words, I need a clamp function: clamp(x) = max( a, min(x, b) ) Can anybody come up with a more readab..

Set Date in a single line

According to the Java API, the constructor Date(year, month, day) is deprecated. I know that I can replace it with the following code: Calendar myCal = Calendar.getInstance(); myCal.set(Calendar.YEAR..

how to change onclick event with jquery?

I have create a js file in which i am creating the dynamic table and dynamically changing the click event for the calendar but onclicking the calender image for dynamic generated table, calendar popup..

Ansible Ignore errors in tasks and fail at end of the playbook if any tasks had errors

I am learning Ansible. I have a playbook to clean up resources, and I want the playbook to ignore every error and keep going on till the end , and then fail at the end if there were errors. I can ign..

Sort table rows In Bootstrap

Can someone please show me an example of code that I would have to use to sort a column of a table in Bootstrap? For example, if I want to sort by price, or by name...

How to generate gcc debug symbol outside the build target?

I know I can generate debug symbol using -g option. However the symbol is embeded in the target file. Could gcc generate debug symbol outside the result executable/library? Like .pdb file of windows V..

Javascript : array.length returns undefined

I have a set of data that is being passed on by the PHP's json_encode function. I'm using the jQuery getJSON function to decode it: $.getJSON("url", function (data) { console.log(data); }); Th..

JSR 303 Validation, If one field equals "something", then these other fields should not be null

I'm looking to do a little custom validation with JSR-303 javax.validation. I have a field. And If a certain value is entered into this field I want to require that a few other fields are not null. ..

Merge data frames based on rownames in R

How can I merge the columns of two data frames, containing a distinct set of columns but some rows with the same names? The fields for rows that don't occur in both data frames should be filled with z..

undefined reference to 'std::cout'

Shall this be the example: #include <iostream> using namespace std; int main() { cout << "Hola, moondo.\n"; } It throws the error: gcc -c main.cpp gcc -o edit main.o main.o: In fu..

How to pass a value from one Activity to another in Android?

I have created an Activity with a AutuCompleteTextView[ACTV] and button. I enter some text in the ACTV then press the button. After I press the button I want the Activity to go to another Activity. In..

Split string in C every white space

I want to write a program in C that displays each word of a whole sentence (taken as input) at a seperate line. This is what i have done so far: void manipulate(char *buffer); int get_words(char *b..

Use ffmpeg to add text subtitles

I am trying to add text subtitles to an .mp4 container using ffmpeg: ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mp4 When I am trying to run this line, it gives me an error :..

Reverse a string in Python

There is no built in reverse function for Python's str object. What is the best way of implementing this method? If supplying a very concise answer, please elaborate on its efficiency. For example, w..

Do you get charged for a 'stopped' instance on EC2?

Bit confused here, I have an on-demand instance but do I get charged even when I stop the instance?..

Why can't I change my input value in React even with the onChange listener

I am quite new to React and after going through some tutorials, I was trying the below code of mine. I made one component, passed props to it from a store, on componentWillMount I make a new state for..

What HTTP traffic monitor would you recommend for Windows?

I need the sniffer to test network traffic of applications developed by me for Windows and Facebook. Basic requirements: display request and response display HTTP headers display the time it took t..

How to use PHP with Visual Studio

First let me say I've never used PHP but I'm looking to learn it, so my question is this how do you use PHP within Visual Studio Ultimate? is it similar to how you declare JQuery i.e $(document).re..

How to use glyphicons in bootstrap 3.0

I have already used glyphicons in bootstrap 2.3 but now I have upgraded to bootstrap 3.0. Now, I am unable to use the icon property. In bootstrap 2.3, below tag is working <i class="icon-search"&..

Javascript: Call a function after specific time period

In JavaScript, How can I call a function after a specific time interval? Here is my function I want to run: function FetchData() { } ..

Delete a single record from Entity Framework?

I have a SQL Server table in Entity Framework named employ with a single key column named ID. How do I delete a single record from the table using Entity Framework?..

Finding the last index of an array

How do you retrieve the last element of an array in C#?..

jQuery append() vs appendChild()

Here's some sample code: function addTextNode(){ var newtext = document.createTextNode(" Some text added dynamically. "); var para = document.getElementById("p1"); para.appendChild(newtex..

How to move text up using CSS when nothing is working

I want to move the text displayed at the bottom of the page slightly upwards and have tried almost everything i know and google but can't shift the text upwards to display the remaining clipped text. ..

What is w3wp.exe?

I have a WCF service running under a service user on my local system. Every time I try to debug it is giving me a message Attach Security warning. In Visual Studio, by default (even without attaching..

.NET HashTable Vs Dictionary - Can the Dictionary be as fast?

I am trying to figure out when and why to use a Dictionary or a HashTable. I have done a bit of a search on here and have found people talking about the generic advantages of the Dictionary which I t..

How to show uncommitted changes in Git and some Git diffs in detail

How do I show uncommitted changes in Git? I STFW'ed, and these commands are not working: teyan@TEYAN-THINK MINGW64 /d/nano/repos/PSTools/psservice (teyan/psservice) $ git status On branch teyan/psse..

add item in array list of android

I want to add value getting from text view of android to an existing array list.e.g. my current array list contain values Cricket,Football and by text view I want to add hockey in array list at last ..

HTML Input Type Date, Open Calendar by default

I have a task which is to show the calendar by default to select date in the input field of html. For suppose this is the code: input type="date" name="bday" Ok, now when I click on the input box,..

Best HTML5 markup for sidebar

I'm setting up my WordPress sidebars for an HTML5 theme and really wanting to use before_widget and after_widget right. So my question is this: which of the two markup patterns is more appropriate? T..

Swift days between two NSDates

I'm wondering if there is some new and awesome possibility to get the amount of days between two NSDates in Swift / the "new" Cocoa? E.g. like in Ruby I would do: (end_date - start_date).to_i ..

How to write UTF-8 in a CSV file

I am trying to create a text file in csv format out of a PyQt4 QTableWidget. I want to write the text with a UTF-8 encoding because it contains special characters. I use following code: import codecs..

Convert Existing Eclipse Project to Maven Project

For a project at work, we're considering using the Maven plugin for Eclipse to automate our builds. Right now the procedure is far more complicated than it ought to be, and we're hoping that Maven wil..

Using success/error/finally/catch with Promises in AngularJS

I'm using $http in AngularJs, and I'm not sure on how to use the returned promise and to handle errors. I have this code: $http .get(url) .success(function(data) { // Handle data ..

Bootstrap Dropdown with Hover

OK, so what I need is fairly straightforward. I have set up a navbar with some dropdown menus in it (using class="dropdown-toggle" data-toggle="dropdown"), and it works fine. The thing is it works "..

Navigation bar show/hide

I have an app with a navigation bar consisting of 2 bar buttons. I would like to hide and show this navigation bar when a user double taps the screen. Initially, the navigation bar should be hidden. ..

Sql Server 'Saving changes is not permitted' error ? Prevent saving changes that require table re-creation

When I create a table in SQL Server and save it, if I try to edit the table design, like change a column type from int to real, I get this error: Saving changes is not permitted. The change you ha..

Get encoding of a file in Windows

This isn't really a programming question, is there a command line or Windows tool (Windows 7) to get the current encoding of a text file? Sure I can write a little C# app but I wanted to know if there..

How to establish ssh key pair when "Host key verification failed"

I have set up ssh key pairs between my desktop and two servers, and from the servers to my desktop, but after reinstalling the OS on my desktop, I can't re-establish the key-pair going into my desktop..

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

PHP Function with Optional Parameters

I've written a PHP function that can accepts 10 parameters, but only 2 are required. Sometimes, I want to define the eighth parameter, but I don't want to type in empty strings for each of the paramet..

How to use ESLint with Jest

I'm attempting to use the ESLint linter with the Jest testing framework. Jest tests run with some globals like jest, which I'll need to tell the linter about; but the tricky thing is the directory ..

How to convert PDF files to images

I need to convert PDF files to images. If the PDF file is multi-page,I just need one image that contains all of the PDF pages. Is there an open source solution which is not charged like the Acrobat p..

server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

I can push by clone project using ssh, but it doesn't work when I clone project with https. The error message that shows me is: server certificate verification failed. CAfile: /etc/ssl/certs/cacerti..

Xcode 10: A valid provisioning profile for this executable was not found

Since yesterday I've been getting the following error when trying run an app on my device: A valid provisioning profile for this executable was not found." This is after updating to Xcode 10. B..

How to completely hide the navigation bar in iPhone / HTML5

I'm really new to HTML5 for mobile. I use jQuery Mobile for my current app and I have some problems hiding the navigation bar. I found this site: http://m.somethingborrowedmovie.warnerbros.com/. (I d..

How can I display a list view in an Android Alert Dialog?

In an Android application, I want to display a custom list view in an AlertDialog. How can I do this?..

changing iframe source with jquery

I've been trying this for a bit now and have looked at other answers to similar questions on SO, but when I am trying to change the src attribute of an iframe, it updates it for the whole window. Here..

Footnotes for tables in LaTeX

When I do \footnote{} for a value in a table, the footnote doesn't show up. How do I get it to show up? Also, is it possible to get it to show up at the bottom of the table rather than the bottom of t..

CSS '>' selector; what is it?

I've seen the "greater than" (>) used in CSS code a few times, but I can't work out what it does. What does it do?..

Difference between web reference and service reference?

What is the difference between web reference and service reference in WCF? Which is preferable in WCF?..

Excel Formula to SUMIF date falls in particular month

I have excel data in following format. Date Amount 03-Jan-13 430.00 25-Jan-13 96.00 10-Jan-13 440.00 28-Feb-13 72.10 28-Feb-13 72.30 I need to sum the amount field only if the..

Insert a new row into DataTable

I have a datatable filled with staff data like.. Staff 1 - Day 1 - Total Staff 1 - Day 2 - Total Staff 1 - Day 3 - Total Staff 2 - Day 1 - Total Staff 2 - Day 2 - Total Staff 2 - Day 3 - Total Staff ..

iPhone SDK:How do you play video inside a view? Rather than fullscreen

I am trying to play video inside a UIView, so my first step was to add a class for that view and start playing a movie in it using this code: - (IBAction)movie:(id)sender{ NSBundle *bundle = [NS..

How to list the certificates stored in a PKCS12 keystore with keytool?

I wanted to list the certificates stored in a PKCS12 keystore. The keystore has the extension .pfx..

Sending POST data without form

Can i send for example a string or another piece of information to another .php file without it being exposed [thus not by GET but by POST conform to what i know] without using a form?..

How do I read an image file using Python?

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

How can I generate a 6 digit unique number?

How can I generate a 6 digit unique number? I have verification mechanisms in place to check for duplicate entries...

How to redirect stderr to null in cmd.exe

I have an application that logs a lot of noise to stderr and REALLY slows down the execution of the application. I would like to redirect that output to null. Is this possible with cmd.exe?..