Questions Tagged with #Mib

A MIB is an acronym for Management Information Base in use with the SNMP Protocol.

How to assign more memory to docker container

As the title reads, I'm trying to assign more memory to my container. I'm using an image from docker hub called "aallam/tomcat-mysql" in case that's relevant. When I start it normally without any spe..

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver

I'm running an AWS EC2 g2.2xlarge instance with Ubuntu 14.04 LTS. I'd like to observe the GPU utilization while training my TensorFlow models. I get an error trying to run 'nvidia-smi'. ubuntu@ip-10-..

How to define and use function inside Jenkins Pipeline config?

I'm trying to create a task with a function inside: def doCopyMibArtefactsHere(projectName) { step ([ $class: 'CopyArtifact', projectName: $projectName, filter: '**/**.mib..

How to add fonts to create-react-app based projects?

I'm using create-react-app and prefer not to eject. It's not clear where fonts imported via @font-face and loaded locally should go. Namely, I'm loading @font-face { font-family: 'Myriad Pro Reg..

Docker: unable to prepare context: unable to evaluate symlinks in Dockerfile path: GetFileAttributesEx

I just downloaded Docker Toolbox for Windows 10 64bit today. I'm going through the tutorial. I'm receving the following error when trying to build an image using a Dockerfile. Steps: Launched Doc..

ffprobe or avprobe not found. Please install one

i want to add tags to mp3 converted by youtube-dl & ffmpeg : youtube-dl -o '/Output/qpgTC9MDx1o.mp3' qpgTC9MDx1o -f bestaudio --extract-audio --metadata-from-title "%(artist)s - %(title)s"..

resize2fs: Bad magic number in super-block while trying to open

I am trying to resize a logical volume on CentOS7 but am running into the following error: resize2fs 1.42.9 (28-Dec-2013) resize2fs: Bad magic number in super-block while trying to open /dev/mapper/c..

Saving binary data as file using JavaScript from a browser

I am working on a business application using angularJS. One of my service method returning me a byte[] (inclding PDF file content) now i need to download this file as PDF to client machine using JavaS..

Linux bash script to extract IP address

I want to make big script on my Debian 7.3 ( something like translated and much more new user friendly enviroment ). I have a problem. I want to use only some of the informations that commands give me..

fatal: early EOF fatal: index-pack failed

I have googled and found many solutions but none work for me. I am trying to clone from one machine by connecting to the remote server which is in the LAN network. Running this command from another m..

New xampp security concept: Access Forbidden Error 403 - Windows 7 - phpMyAdmin

I have downloaded and installed XAMPP 1.8.1 for Windows on Windows 7 Ultimate. I have set up XAMPP to run together with IIS as per these instructions All good so far, my PHP sites run locally and eve..

Create a remote branch on GitHub

In SVN I have at least two ways to create a branch: svn cp /home/me/localcheckout/trunk /home/me/localcheckout/branches/newbranch svn cp http://server/trunk http://server/branches/newbranch The fir..

Programmatically Creating UILabel

I know this should be very simple, but I've been really struggling with creating a UILabel programmatically and getting it to behave the way I would like. All I want is to be able to create a label, ..

Why emulator is very slow in Android Studio?

I just setup Android Studio on my PC, which is new launch to develop Android application. My problem is that, when I try to run my small app in emulator, it take to much time to launch and after then..

jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

I am running a Maven project which is also a dynamic web project. I have used all Spring libraries in Maven. I created web.xml, but when I start my Tomcat 7 server I am getting the following message: ..

Git, fatal: The remote end hung up unexpectedly

When I tried to run git push origin master --force I just got Counting objects: 2649, done. Delta compression using up to 2 threads. Compressing objects: 100% (1280/1280), done. error: RPC failed;..

failed to push some refs to [email protected]

I am getting this error when I am trying push my files into heroku rep. Ive set autocrlf = false already in gitconfig but this problem is still there. i have also tried this solution here but no gain..

remote rejected master -> master (pre-receive hook declined)

I'm working in rails 3.2 and I receive an error when I try to push to heroku: git push heroku master Counting objects: 496, done. Delta compression using up to 8 threads. Compressing objects: 100% (..

fatal: does not appear to be a git repository

Why am I getting this error when my git repository url is correct? jitendra@JITENDRA-PC /c/mySite (master) $ git push beanstalk master fatal: '[email protected]/gittest.git' does not appear ..

TypeError: 'module' object is not callable

File "C:\Users\Administrator\Documents\Mibot\oops\blinkserv.py", line 82, in __init__ self.serv = socket(AF_INET,SOCK_STREAM) TypeError: 'module' object is not callable Why am I getting this err..

Git fails when pushing commit to github

I cloned a git repo that I have hosted on github to my laptop. I was able to successfully push a couple of commits to github without problem. However, now I get the following error: Compressing ob..

Convert pem key to ssh-rsa format

I have a certificate in der format, from it with this command I generate a public key: openssl x509 -inform der -in ejbcacert.cer -noout -pubkey > pub1key.pub Which results in this: -----BEGIN ..

How do I find which process is leaking memory?

I have a system (Ubuntu) with many processes and one (or more) have a memory leak. Is there a good way to find the process that has the leak? Some of the process are JVMs, some are not. Some are home ..

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

Why Response.Redirect causes System.Threading.ThreadAbortException?

When I use Response.Redirect(...) to redirect my form to a new page I get the error: A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll An exce..

Using JsonConvert.DeserializeObject to deserialize Json to a C# POCO class

Here is my simple User POCO class: /// <summary> /// The User class represents a Coderwall User. /// </summary> public class User { /// <summary> /// A User's username. eg: ..

How can I get the average (mean) of selected columns

I would like to get the average for certain columns for each row. I have this data: w=c(5,6,7,8) x=c(1,2,3,4) y=c(1,2,3) length(y)=4 z=data.frame(w,x,y) Which returns: w x y 1 5 1 1 2 6 2 2 ..

How to trap on UIViewAlertForUnsatisfiableConstraints?

I'm seeing an error appear in my debugger log: Will attempt to recover by breaking constraint <NSLayoutConstraint:0x191f0920 H:[MPKnockoutButton:0x17a876b0]-(34)-[MPDetailSlider:0x17a8bc50](LTR)&..

Python: Differentiating between row and column vectors

Is there a good way of differentiating between row and column vectors in python? So far I'm using numpy and scipy and what I see so far is that If I was to give one a vector, say from numpy import * ..

How to achieve function overloading in C?

Is there any way to achieve function overloading in C? I am looking at simple functions to be overloaded like foo (int a) foo (char b) foo (float c , int d) I think there is no straight forwa..

Pair/tuple data type in Go

While doing the final exercise of the Tour of Go, I decided I needed a queue of (string, int) pairs. That's easy enough: type job struct { url string depth int } queue := make(chan job) queu..

Need to ZIP an entire directory using Node.js

I need to zip an entire directory using Node.js. I'm currently using node-zip and each time the process runs it generates an invalid ZIP file (as you can see from this Github issue). Is there another..

Typescript export vs. default export

What is the difference in Typescript between export and default export. In all the tutorials I see people exporting their classes and I cannot compile my code if I don't add the default keyword before..

How to make a gap between two DIV within the same column

I have two paragraphs. The two paragraphs are located in the same column. Now my question is I need to make the two paragraphs in two separate boxes, down each other. In other words, gap between two b..

What is JavaScript garbage collection?

What is JavaScript garbage collection? What's important for a web programmer to understand about JavaScript garbage collection, in order to write better code?..

Variable interpolation in the shell

I have a variable called filepath=/tmp/name. To access the variable, I know that I can do this: $filepath In my shell script I attempted to do something like this (the backticks are intended) `tail..

Force IE9 to emulate IE8. Possible?

Is this possible at all? I tried adding this to the page but it didn't change a thing. <meta http-equiv="X-UA-Compatible" content="IE=8"> UPDATE- I'm trying to do this because our site has so..

'Access-Control-Allow-Origin' issue when API call made from React (Isomorphic app)

I'm running into an issue with my isomorphic JavaScript app using React and Express. I am trying to make an HTTP request with axios.get when my component mounts componentDidMount() { const url =..

Cannot add a project to a Tomcat server in Eclipse

I cannot add my project to a server in Eclipse - why is that? I installed all necessary tools (Web Dev, Java EE, Server Adapters, and Tomcat itself, everything) I configured the runtime environments, ..

How to drop a PostgreSQL database if there are active connections to it?

I need to write a script that will drop a PostgreSQL database. There may be a lot of connections to it, but the script should ignore that. The standard DROP DATABASE db_name query doesn't work when t..

What is the purpose of a question mark after a type (for example: int? myVariable)?

Typically the main use of the question mark is for the conditional, x ? "yes" : "no". But I have seen another use for it but can't find an explanation of this use of the ? operator, for example. pub..

How to change the text of a label?

I have a radiobutton list and on click on the radio button item I have to change the text of its label. But for some reason it's not working. Code is below: <asp:Label ID="lblVessel" Text="Vessel:..

What is unit testing and how do you do it?

Exact duplicate of many posts: What is unit testing? What Makes a Good Unit Test? New to Unit Testing Unit Testing - definitions Learning Unit Testing How to properly mock and unit test Unit Te..

Remove empty lines in a text file via grep

FILE: hello world foo bar How can I remove all the empty new lines in this FILE? Output of command: FILE: hello world foo bar ..

How do I ALTER a PostgreSQL table and make a column unique?

I have a table in PostgreSQL where the schema looks like this: CREATE TABLE "foo_table" ( "id" serial NOT NULL PRIMARY KEY, "permalink" varchar(200) NOT NULL, "text" varchar(512) NOT NULL..

How can I get the active screen dimensions?

What I am looking for is the equivalent of System.Windows.SystemParameters.WorkArea for the monitor that the window is currently on. Clarification: The window in question is WPF, not WinForm...

Insert images to XML file

I would like to insert an images within an element the XML file, what is the best way to do this? Would you please suggest some good way to include an images to xml file?..

CSS disable text selection

Currently, I have put this in the body tag to disable text selections: body { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } However, my inpu..

Floating divs in Bootstrap layout

I need to do something like this using Boostrap. "Fluid" content on the page with two widgets inside it - first at top-right and second at left-bottom. Widget1 is easy - I just needed class="pull-..

JavaScript to get rows count of a HTML table

How to get with JavaScript the rows count of a HTML table having id and name?..

How do I format a number with commas in T-SQL?

I'm running some administrative queries and compiling results from sp_spaceused in SQL Server 2008 to look at data/index space ratios of some tables in my database. Of course I am getting all sorts o..

How can I disable the Maven Javadoc plugin from the command line?

In pom.xml I have declaration like this <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> &l..

How do I execute a stored procedure once for each row returned by query?

I have a stored procedure that alters user data in a certain way. I pass it user_id and it does it's thing. I want to run a query on a table and then for each user_id I find run the stored procedure o..

"Adaptive Server is unavailable or does not exist" error connecting to SQL Server from PHP

I'm attempting to connect to a SQL Server 2005 DB from my Mac using unixODBC and FreeTDS as I have outlined here. However, when I try to connect in to a different DB using the same setup, I get: Conn..

Changing button color programmatically

Is there a way to change the color of a button, or at least the color of the button label programmatically? I can change the label itself with document.getElementById("button").object.textElement.in..

Tomcat 7.0.43 "INFO: Error parsing HTTP request header"

I use Tomcat 7.0.43 with a websocket application. My app works fine in Tomcat 7.0.42 but with 43 I get the following output when I try to access my server on websockets: Sep 16, 2013 3:08:34 AM org.a..

Extending from two classes

How can I do this: public class Main extends ListActivity , ControlMenu Also, I would like to know that is this approach is okay that I have made the menus in class which is ControlMenu and I am e..

Convert string to datetime in vb.net

I have a datetime that looks like this: 201210120956 ccyyMMDDhhmm When I try this: Dim convertedDate As Date = Date.Parse(DateString) Return convertedDate I get back this: #10/12/2012# I'm lo..

Expanding tuples into arguments

Is there a way to expand a Python tuple into a function - as actual parameters? For example, here expand() does the magic: some_tuple = (1, "foo", "bar") def myfun(number, str1, str2): return (..

Replace new lines with a comma delimiter with Notepad++?

I have a Notepad++ question. How can I take the below words in Notepad++ (which is on different lines) Apples Apricots Pear Avocados Bananas And turn them into a paragraph with a comma at the end ..

Returning unique_ptr from functions

unique_ptr<T> does not allow copy construction, instead it supports move semantics. Yet, I can return a unique_ptr<T> from a function and assign the returned value to a variable. #include..

List of Java processes

How can I list all Java processes in bash? I need an command line. I know there is command ps but I don't know what parameters I need to use...

Preferred way of loading resources in Java

I would like to know the best way of loading a resource in Java: this.getClass().getResource() (or getResourceAsStream()), Thread.currentThread().getContextClassLoader().getResource(name), System.cl..

How can I use pointers in Java?

I know Java doesn't have pointers, but I heard that Java programs can be created with pointers and that this can be done by the few who are experts in java. Is it true?..

Simple Java Client/Server Program

I'm writing my first java client/server program which just establishes a connection with the server sends it a sentence and the server sends the sentence back all capitalized. This is actually an exam..

cannot connect to pc-name\SQLEXPRESS

While trying to connect to SQL Server 2005 Standard Edition through SQL Server Management Studio 2005 I get the following error: I put all my effort to solve this problem but there is no solution. On..

YAML: Do I need quotes for strings in YAML?

I am trying to write a YAML dictionary for internationalisation of a Rails project. I am a little confused though, as in some files I see strings in double-quotes and in some without. A few points to ..

Job for mysqld.service failed See "systemctl status mysqld.service"

Console says [root@ip-172-31-18-2 mysql]# service mysqld start Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See "systemctl statu..

Add Facebook Share button to static HTML page

Is there any way to add a Facebook Share Button to a static HTML page? I've implemented a simple web site with no server side, just a bunch of html pages and I was abble to add a Like button because i..

Removing border from table cells

I know this is a dumb question but I seem to have totally forgotten how to do it. I have a HTML table and I want to remove all borders around all the cells so that there is only one border around th..

Where do I find the line number in the Xcode editor?

In Xcode 3, the line number of the current cursor location was displayed. I don't see this in Xcode 4. Is there a setting that will turn it on? Or a keypress that will give it to me?..

How do I analyze a program's core dump file with GDB when it has command-line parameters?

My program operates like this: exe -p param1 -i param2 -o param3 It crashed and generated a core dump file, core.pid. I want to analyze the core dump file by gdb ./exe -p param1 -i param2 -o para..

How to insert a picture into Excel at a specified cell position with VBA

I'm adding ".jpg" files to my Excel sheet with the code below : 'Add picture to excel xlApp.Cells(i, 20).Select xlApp.ActiveSheet.Pictures.Insert(picPath).Select 'Calgulate new picture size With xlAp..

Spring Boot Java Config Set Session Timeout

How can I configure my (embedded) Tomcat Session Timeout in a Spring Boot Application? public class SessionListener implements HttpSessionListener{ @Override public void sessionCreated(HttpSessionEv..

How to delete a cookie using jQuery?

I want to use jQuery to delete cookies; I have tried this: $.cookie('name', '', { expires: -1 }); But when I refresh the page, the cookie is still there: alert('name:' +$.cookie('name')); Why?..

What do the icons in Eclipse mean?

What do the icons in the Eclipse debugger mean? What do the icon decorators in Eclipse mean? What do the icons in Eclipse's Package Explorer mean? What do the little letters on top of Eclipse icons m..

What is the runtime performance cost of a Docker container?

I'd like to comprehensively understand the run-time performance cost of a Docker container. I've found references to networking anecdotally being ~100┬Ás slower. I've also found references to the run..

Copy from one workbook and paste into another

I have written the following code and continually see pastespecial method of class has failed. I have tried to overcome this issue, but nothing seems to work. I am trying to copy an entire sheet from ..

Click events on Pie Charts in Chart.js

I've got a question regard Chart.js. I've drawn multiple piecharts using the documentation provided. I was wondering if on click of a certain slice of one of the charts, I can make an ajax call depe..

MySQL: Enable LOAD DATA LOCAL INFILE

I'm running Mysql 5.5 on Ubuntu 12 LTS. How should I enable LOAD DATA LOCAL INFILE in my.cnf? I've tried adding local-infile in my config at various places but I'm still getting the "The used comma..

How to kill an application with all its activities?

Possible Duplicate: Quitting an application - is that frowned upon? I want to offer the user an option to exit the application as I need to delete some sensitive data, which is stored in th..

javascript setTimeout() not working

Hi I'm trying to use the function setTimeout() in javascript except it's not working. Thanks in advance to anyone who can help. <!DOCTPYE html> <html> <head> <script> ..

Equivalent of .bat in mac os

I currently use a .bat file that is utilized to invoke a java file. If I wanted to utilize the same functionality on Mac OS what format changes would I make? (unless the .bat equivalent on Mac OS is t..

How to do multiple line editing?

I want to edit multiple lines in eclipse, but I can't find any short cut or Plugin. In Geany I just press ctrl+alt+up/down I can add / edit multiple lines. Maybe this example can explain what I mean:..

Inserting values into a SQL Server database using ado.net via C#

I have created a simple program to insert values into the table [regist], but I keep getting the error Incorrect syntax near ')' on cmd.ExecuteNonQuery();: private void button1_Click(object s..

How to pass a Javascript Array via JQuery Post so that all its contents are accessible via the PHP $_POST array?

How can I pass a Javascript Array via JQuery Post so that all its contents are accessible via the PHP $_POST array? Please show an example of code that would do the trick. Thanks!..

How can I insert vertical blank space into an html document?

I am writing a quiz in html and I would like to insert a consistent blank vertical space between questions (like one would use vspace{3 cm} in LaTeX). For example: <html> <body> ..

How to catch an Exception from a thread

I have Java main class, in the class, I start a new thread, in the main, it waits until the thread dies. At some moment, I throw a runtime exception from the thread, but I can't catch the exception th..

SyntaxError: Unexpected token function - Async Await Nodejs

I was experimenting on using Node version 6.2.1 with some of my code. Had plans to migrate most of the hyper-callback oriented codes to something that looks cleaner and maybe performs better. I have ..

How can I insert data into Database Laravel?

I'm new to programming. I have created a basic form inside views/register.blade.php like this @section('content') <h1>Registration Form</h1><hr> <h3>Ple..

How to convert JSON object to JavaScript array?

I need to convert JSON object string to a JavaScript array. This my JSON object: {"2013-01-21":1,"2013-01-22":7} And I want to have: var data = new google.visualization.DataTable(); data.addColum..

How to get second-highest salary employees in a table

It's a question I got this afternoon: There a table contains ID, Name, and Salary of Employees, get names of the second-highest salary employees, in SQL Server Here's my answer, I just wrote it in p..

Passing a string with spaces as a function argument in bash

I'm writing a bash script where I need to pass a string containing spaces to a function in my bash script. For example: #!/bin/bash myFunction { echo $1 echo $2 echo $3 } myFunction "f..

How to load npm modules in AWS Lambda?

I've created several Lambda functions using the web based editor. So far so good. I'd now like to start extending those with modules (such as Q for promises). I can't figure out how to get the modules..

Uncaught TypeError: .indexOf is not a function

I am new to JavaScript and I'm getting an error as below. Uncaught TypeError: time.indexOf is not a function Gee, I really thought indexOf() really was a function. Here is a snippet of my code:..

How to align 3 divs (left/center/right) inside another div?

I want to have 3 divs aligned inside a container div, something like this: [[LEFT] [CENTER] [RIGHT]] Container div is 100% wide (no set width), and center div should remain in center a..

Set database timeout in Entity Framework

My command keeps timing out, so I need to change the default command timeout value. I've found myDb.Database.Connection.ConnectionTimeout, but it's readonly. How can I set the command timeout in Ent..

PHP: How to handle <![CDATA[ with SimpleXMLElement?

I noticed that when using SimpleXMLElement on a document that contains those CDATA tags, the content is always NULL. How do I fix this? Also, sorry for spamming about XML here. I have been trying to ..

Styling the arrow on bootstrap tooltips

I'm trying to style tootltips using .tooltip-inner{} But i'm having troubles cause i can't find how to style tooltip small arrow. As shown on screenshot the arrow of the tooltip is black i want to..

GetType used in PowerShell, difference between variables

What is the difference between variables $a and $b? $a = (Get-Date).DayOfWeek $b = Get-Date | Select-Object DayOfWeek I tried to check $a.GetType $b.GetType MemberType : Method OverloadD..

Adding days to a date in Python

I have a date "10/10/11(m-d-y)" and I want to add 5 days to it using a Python script. Please consider a general solution that works on the month ends also. I am using following code: import re from ..

Splitting a C++ std::string using tokens, e.g. ";"

Possible Duplicate: How to split a string in C++? Best way to split a string in C++? The string can be assumed to be composed of words separated by ; From our guide lines point of view C s..

What Vim command(s) can be used to quote/unquote words?

How can I quickly quote/unquote words and change quoting (e.g. from ' to ") in Vim? I know about the surround.vim plugin, but I would like to use just Vim. ..

Global Angular CLI version greater than local version

When running ng serve I get this warning about my global CLI version being greater than my local version. I don't notice any issues from this warning, but I was wondering if the two versions should be..

Missing `server' JVM (Java\jre7\bin\server\jvm.dll.)

Getting JVM error that it is missing some dll...

How can I parse a local JSON file from assets folder into a ListView?

I'm currently developing a physics app that is supposed to show a list of formulas and even solve some of them (the only problem is the ListView) This is my main layout <LinearLayout xmlns:an..

Function passed as template argument

I'm looking for the rules involving passing C++ templates functions as arguments. This is supported by C++ as shown by an example here: #include <iostream> void add1(int &v) { v+=1; } ..

Reset all the items in a form

I was wondering, is there a way I can reset all the checkboxes, textboxes, numerics and other controls back to the default values without writing code for every control individually? This is the code ..

Change private static final field using Java reflection

I have a class with a private static final field that, unfortunately, I need to change it at run-time. Using reflection I get this error: java.lang.IllegalAccessException: Can not set static final bo..

Load JSON text into class object in c#

How can I convert the following Json Response to a C# object? { "err_code": "0", "org": "CGK", "des": "SIN", "flight_date": "20120719", "schedule": [ ["W2-888","20120719","20120719","1200","1600"..

Is it possible to have a multi-line comments in R?

I found this old thread (from over a year ago), which explains how come R doesn't support a multi-line comments (like /* comment */ of PHP, for example). I am wondering if this has been resolved in ..

Differences between utf8 and latin1

what is the difference between utf8 and latin1?..

Python Iterate Dictionary by Index

I want to iterate through a dictionary in python by index number. Example : dict = {'apple':'red','mango':'green','orange':'orange'} I want to iterate through the dictionary from first to last, s..

Detect whether Office is 32bit or 64bit via the registry

Now that Office also comes in a 64bit install, where in the registry do you find out if the version of Office installed is 32bit or 64bit?..

Find duplicate values in R

I have a table with 21638 unique* rows: vocabulary <- read.table("http://socserv.socsci.mcmaster.ca/jfox/Books/Applied-Regression-2E/datasets/Vocabulary.txt", header=T) This table has five colum..

How to change the text of a button in jQuery?

How do you change the text value of a button in jQuery? Currently, my button has 'Add' as its text value, and upon being clicked I want it to change to 'Save'. I have tried this method below, but so f..

Is calling destructor manually always a sign of bad design?

I was thinking: they say if you're calling destructor manually - you're doing something wrong. But is it always the case? Are there any counter-examples? Situations where it is neccessary to call it m..

Eventviewer eventid for lock and unlock

What is the event id in Event Viewer for lock, unlock for a computer in Windows XP, Windows 7, Windows Vista and Windows Server 2008?..

Vertically and horizontally centering text in circle in CSS (like iphone notification badge)

I'm looking for a way of to do a cross-browser iphone-like badge in CSS3. I'd obviously like to use one div for this, but alternative solutions would be fine. The important factor is that it needs to ..

How to click or tap on a TextView text

I know this is so easy (doh...) but I am looking for a way to run a method on tapping or clicking a TextView line of text in an Android App. I keep thinking about button listeners and anonymous metho..

Pass by pointer & Pass by reference

Possible Duplicate: What are the differences between pointer variable and reference variable in C++? Are there benefits of passing by pointer over passing by reference in C++? In both cas..

How to set Status Bar Style in Swift 3

I'm using Xcode 8.0 beta 4. In previous version, UIViewController have method to set the status bar style public func preferredStatusBarStyle() -> UIStatusBarStyle However, I found it changed t..

Read file data without saving it in Flask

I am writing my first flask application. I am dealing with file uploads, and basically what I want is to read the data/content of the uploaded file without saving it and then print it on the resulting..

Using .htaccess to make all .html pages to run as .php files?

I need to run all of my .html files as .php files and I don't have time to change all of the links before our presentation tomorrow. Is there any way to "hack" this with my Apache server?..

Changing the resolution of a VNC session in linux

I use VNC to connect to a Linux workstation at work. At work I have a 20" monitor that runs at 1600x1200, while at home I use my laptop with its resolution of 1440x900. If I set the vncserver to run ..

What's the best way to identify hidden characters in the result of a query in SQL Server (Query Analyzer)?

When trying to identify erroneous data (often needing manual review and removal), I'd like an easy way of seeing hidden characters, such as TAB, Space, Carriage return and Line feed. Is there a built-..

How to clear cache of Eclipse Indigo

I would like to know what is the standard way to clear the cache of Eclipse Indigo?..

Select All Rows Using Entity Framework

I'm trying to select all the rows out of a database using entity framework for manipulation before they're sent to the form var ptx = [modelname].[tablename](); ptx.[tablename].Select(????) what go..

Print directly from browser without print popup window

As it said in the subject I've to create a feature for a web-based application that will allow users to send print directly without prompting any dialog boxe just make the print i.e click and print, s..

Android, landscape only orientation?

How can I make it so the screen orientation is always landscape? Do I need to add something to the manifest.xml?..

javascript: calculate x% of a number

I am wondering how in javascript if i was given a number (say 10000) and then was given a percentage (say 35.8%) how would I work out how much that is (eg 3580)..

How do I set up curl to permanently use a proxy?

How can I set up "curl" to permanently use a proxy server in the terminal?..

What is a tracking branch?

Can someone explain a "tracking branch" as it applies to git? Here's the definition from git-scm.com: A 'tracking branch' in Git is a local branch that is connected to a remote branch. When y..

CSS get height of screen resolution

I'm having a hard time getting the height of lower screen resolution because my screen resolution is 1920x1080. Does anyone know how to get height and width of the screen resolution? I checked my wo..

How to create dynamic href in react render function?

I am rendering a list of posts. For each post I would like to render an anchor tag with the post id as part of the href string. render: function(){ return ( <ul> { ..

Data was not saved: object references an unsaved transient instance - save the transient instance before flushing

I have a database with two tables User and Country. I want to relationship where many user can belong to one county. I implement this using hibernate using the following model classes: @Entity (name..

What is the best way to initialize a JavaScript Date to midnight?

What is the simplest way to obtain an instance of new Date() but set the time at midnight?..

MySQL SELECT statement for the "length" of the field is greater than 1

I have an LINK field in my table. Some rows have a link, some don't. I'd like to select all rows where LINK is present. (length is greater than X characters). How do I write this?..

When are you supposed to use escape instead of encodeURI / encodeURIComponent?

When encoding a query string to be sent to a web server - when do you use escape() and when do you use encodeURI() or encodeURIComponent(): Use escape: escape("% +&="); OR use encodeURI() / e..

Build the full path filename in Python

I need to pass a file path name to a module. How do I build the file path from a directory name, base filename, and a file format string? The directory may or may not exist at the time of call. For..

Access-control-allow-origin with multiple domains

In my web.config I would like to specify more than one domain for the access-control-allow-origin directive. I don't want to use *. I've tried this syntax: <add name="Access-Control-Allow-Origin..

What's the best way to cancel event propagation between nested ng-click calls?

Here's an example. Let's say I want to have an image overlay like a lot of sites. So when you click a thumbnail, a black overlay appears over your whole window, and a larger version of the image is ..

How to check if an email address exists without sending an email?

I have come across this PHP code to check email address using SMTP without sending an email. Has anyone tried anything similar or does it work for you? Can you tell if an email customer / user enters..

scroll up and down a div on button click using jquery

I am trying to add a feature to scroll up and down a div based on button click. I was able to do the scroll down part easily, but got stuck wit the scroll up part and one more concern was a scenario, ..

How to filter an array of objects based on values in an inner array with jq?

Given this input: [ { "Id": "cb94e7a42732b598ad18a8f27454a886c1aa8bbba6167646d8f064cd86191e2b", "Names": [ "condescending_jones", "loving_hoover" ] }, { "Id": "186db..

Displaying tooltip on mouse hover of a text

I want to display a tooltip when the mouse hovers over a link in my custom rich edit control. Consider the following text: We all sleep at night . In my case the word sleep is a link. When the ..

make: Nothing to be done for `all'

I am going through an eg pgm to create a make file. http://mrbook.org/tutorials/make/ My folder eg_make_creation contains the following files, desktop:~/eg_make_creation$ ls factorial.c functions...

Executing a shell script from a PHP script

I want to execute a Bash script present on the system from a PHP script. I have two scripts present on the system. One of them is a PHP script called client.php present at /var/www/html and the other ..

.war vs .ear file

What is the difference between a .war and .ear file?..

How can I remove or replace SVG content?

I have a piece of JavaScript code which creates (using D3.js) an svg element which contains a chart. I want to update the chart based on new data coming from a web service using AJAX, the problem is t..

Disabled form fields not submitting data

Is there any way (with a attribute flag or something like that) to enable form fields that are disabled to submit data? Or, if that's not possible, is there any way to block fields from editing with ..

How to display Base64 images in HTML?

I'm having trouble displaying a Base64 image inline. Can someone point me in the right direction? <!DOCTYPE html> <html> <head> <title>Display Image</title> <..

VSCode regex find & replace submatch math?

%s@{fileID: \(213[0-9]*\)@\='{fileID: '.(submatch(1)-1900)@ I am using this regex search and replace command in vim to subtract a constant from each matching id. I can do the regex find in VSCode b..

XPath query to get nth instance of an element

There is an HTML file (whose contents I do not control) that has several input elements all with the same fixed id attribute of "search_query". The contents of the file can change, but I know that I a..

Error: "Input is not proper UTF-8, indicate encoding !" using PHP's simplexml_load_string

I'm getting the error: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xED 0x6E 0x2C 0x20 When trying to process an XML response using simplexml_load_string from a 3rd party so..

How to install the Sun Java JDK on Ubuntu 10.10 (Maverick Meerkat)?

I've tried to add the Canonical Partner repository, but I still can't find the sun-java6-jdk package. What is the right way to install the Oracle Sun JDK instead of OpenJDK on Ubuntu 10.10 (Maverick M..

Search of table names

I use the following to search for strings in my stored procedures: use DBname SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%xxx%' Is it easy to amend the above so that i..

Change Date Format(DD/MM/YYYY) in SQL SELECT Statement

The Original SQL Statement is: SELECT SA.[RequestStartDate] as 'Service Start Date', SA.[RequestEndDate] as 'Service End Date', FROM (......)SA WHERE...... The output date format is YYYY/..

PermissionError: [WinError 5] Access is denied python using moviepy to write gif

I'm using windows 8.1 64 bit my code import pdb from moviepy.editor import * clip = VideoFileClip(".\\a.mp4") clip.write_gif('.\\aasda.gif') the exception is at write_gif method Traceback (most ..

how to find my angular version in my project?

I have setup the angular code on my local machine. I need to know the version of the angular that I am using in the project. how can I easily find it in cmd prompt?..

How to get jQuery dropdown value onchange event

I have added two jQuery UI Dropdown Autocomplete script. Now I want get both value onchange of second dropdown and want to store separately in variable. How it is possible? Any ideas or suggestions? ..

How do I list all the files in a directory and subdirectories in reverse chronological order?

I want to do something like ls -t but also have the files in subdirectories included. But the problem is that I don't want the output formated like ls -R does, which is like this: [test]$ ls -Rt b ..

Tomcat: How to find out running tomcat version

I'm trying to get Appfuse + tomcat + jRebel working. Appfuse by default uses Cargo to download tomcat (ver. 7.0.33) and deploy the application to it. I wish to use an already installed tomcat (ver. 7..

What is the apply function in Scala?

I never understood it from the contrived unmarshalling and verbing nouns ( an AddTwo class has an apply that adds two!) examples. I understand that it's syntactic sugar, so (I deduced from context) i..

Vagrant ssh authentication failure

The problem with ssh authentication: ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network..

Failed to add the host to the list of know hosts

Mac OSX Lion 10.7. In an effort to get around weird environment stuff (homebrew wasn't installing wget, and I had all sorts of weird blocks and errors), I uninstalled zschrc and homebrew and a bunch ..

Center Div inside another (100% width) div

Quite a "simple" problem here and not sure why it's being so complicated. Have a 100% (width) sized div. Have another div positioned in the middle of this div (sized 940px width) Any ideas? :) ..

Get error message if ModelState.IsValid fails?

I have this function in my controller. [HttpPost] public ActionResult Edit(EmployeesViewModel viewModel) { Employee employee = GetEmployee(viewModel.EmployeeId); TryUpdateModel(employee); ..

IF EXISTS, THEN SELECT ELSE INSERT AND THEN SELECT

How do you say the following in Microsoft SQL Server 2005: IF EXISTS (SELECT * FROM Table WHERE FieldValue='') THEN SELECT TableID FROM Table WHERE FieldValue='' ELSE INSERT INTO TABLE(FieldVal..

How can I declare dynamic String array in Java

I am using String Array declare as zoom z[]=new String[422];. But this array stores value from 0 to 32, so I got null pointer exception after looping value 32. How to solve this problem in java? Ho..

How to create a custom attribute in C#

I have tried lots of times but still I am not able to understand the usage of custom attributes (I have already gone through lots of links). Can anyone please explain to me a very basic example of a ..

converting Java bitmap to byte array

Bitmap bmp = intent.getExtras().get("data"); int size = bmp.getRowBytes() * bmp.getHeight(); ByteBuffer b = ByteBuffer.allocate(size); bmp.copyPixelsToBuffer(b); byte[] bytes = new b..

Disable future dates in jQuery UI Datepicker

Is it possible to disable future date from today? Let say today is 23/10/2010, so 24/10/2010 onwards are disabled. Sorry I am very new in jQuery and JavaScript...

Limit text length to n lines using CSS

Is it possible to limit a text length to "n" lines using CSS (or cut it when overflows vertically). text-overflow: ellipsis; only works for 1 line text. original text: Ultrices natoque mus mat..

javascript check for not null

Below is a code snippet, where we retrieve a form value. Before further processing check if the value is not null.. var val = document.FileList.hiddenInfo.value; alert("val is " + val); // this prin..

Is there a way to add a gif to a Markdown file?

I want to add this gif to a GitHub flavored markdown file. If it can't be done in GitHub, is it possible to do it in another version of markdown?..

Set UILabel line spacing

How can I modify the gap between lines (line spacing) in a multiline UILabel?..

How do I set the selected item in a drop down box

Is there any way to set the selected item in a drop down box using the following 'type' code? <select selected="<?php print($row[month]); ?>"><option value="Janurary">January</op..

How to send an object from one Android Activity to another using Intents?

How can I pass an object of a custom type from one Activity to another using the putExtra() method of the class Intent? ..

How to source virtualenv activate in a Bash script

How do you create a Bash script to activate a Python virtualenv? I have a directory structure like: .env bin activate ...other virtualenv files... src shell.sh ...my code..

How to split the name string in mysql?

How to split the name string in mysql ? E.g.: name ----- Sachin ramesh tendulkar Rahul dravid Split the name like firstname,middlename,lastname: firstname middlename lastname --------- --..

Run batch file as a Windows service

In order to run one application, a batch file has to be kicked off (which does things like start Jetty, display live logs, etc). The application will work only if this batch file is running. I am henc..

How to delete large data of table in SQL without log?

I have a large data table. There are 10 million records in this table. What is the best way for this query Delete LargeTable where readTime < dateadd(MONTH,-7,GETDATE()) ..

Debugging Spring configuration

I am working on a Java application that uses Spring and Hibernate and runs on a Websphere. I have run into a problem, where I expect Spring to load a Dao into my object, but for some reason that does..

Add a new line to a text file in MS-DOS

I am making a .bat file, and I would like it to write ASCII art into a text file. I was able to find the command to append a new line to the file when echoing text, but when I read that text file, al..

How many threads is too many?

I am writing a server, and I send each action of into a separate thread when the request is received. I do this because almost every request makes a database query. I am using a threadpool library to ..

Javascript Regular Expression Remove Spaces

So i'm writing a tiny little plugin for JQuery to remove spaces from a string. see here (function($) { $.stripSpaces = function(str) { var reg = new RegExp("[ ]+","g"); return str..

How to upgrade OpenSSL in CentOS 6.5 / Linux / Unix from source?

How do I upgrade OpenSSL in CentOS 6.5? I have used these commands, but nothings happens: cd /usr/src wget http://www.openssl.org/source/openssl-1.0.1g.tar.gz tar -zxf openssl-1.0.1g.tar.gz cd o..

Copying and pasting data using VBA code

I have a button on a spreadsheet that, when pressed, should allow the user to open a file, then copy columns A-G of the spreadsheet "Data", then paste the data from those columns on the current sheet...

PHP & localStorage;

I've searched around for use of localStorage in PHP, as I need to get localStorage data as a $var, in PHP and do stuff in PHP with it. Is this possible? P.S. If anybody knows any good HTML5 resources..

How to use wait and notify in Java without IllegalMonitorStateException?

I have 2 matrices and I need to multiply them and then print the results of each cell. As soon as one cell is ready I need to print it, but for example I need to print the [0][0] cell before cell [2][..

Maven compile with multiple src directories

Is there a way to compile multiple java source directories in a single maven project? ..

HTML button opening link in new tab

So this is the simple code for the button to open a certain link <button class="btn btn-success" onclick="location.href='http://google.com';"> Google</button> but it ope..

Link a photo with the cell in excel

Is there anyone who knows how to connect a picture with the cell that it is in at microsoft excel? For example in the first column I put some brands of mobile phones and in the second one some pictur..

How to replace multiple strings in a file using PowerShell

I am writing a script for customising a configuration file. I want to replace multiple instances of strings within this file, and I tried using PowerShell to do the job. It works fine for a single re..

findViewByID returns null

First of all: yes, I read all the other threads on this topic. And not only those from this site... (you see, I'm a little frustrated) Most of them come with the advice to use android:id instead of j..

Why is textarea filled with mysterious white spaces?

I have a simple text area in a form like this: <textarea style="width:350px; height:80px;" cols="42" rows="5" name="sitelink"> <?php if($siteLink_val) echo $siteLink_val; ?> </tex..

Parse string to date with moment.js

I want to parse the following string with moment.js 2014-02-27T10:00:00 and output day month year (14 march 2014) I have been reading the docs but without success http://momentjs.com/docs/#/parsing/no..

break statement in "if else" - java

I keep getting an error, if without else. I tried else if as well for (;;){ System.out.println("---> Your choice: "); choice = input.nextInt(); if (choice==1) ..

What is the standard Python docstring format?

I have seen a few different styles of writing docstrings in Python, is there an official or "agreed-upon" style?..

Apply CSS to jQuery Dialog Buttons

So I currently have a jQuery dialog with two buttons: Save and Close. I create the dialog using the code below: $dialogDiv.dialog({ autoOpen: false, modal: true, width: 600, resizable..

How to stretch a table over multiple pages

I have a Table (multiple rows, multiple columns, see below ) that is longer than one page. How can I tell LaTeX to continue on the next page. Adding a \newpage didn't work Manually 'ending' and 'r..

pandas dataframe create new columns and fill with calculated values from same df

Here is a simplified example of my df: ds = pd.DataFrame(np.abs(randn(3, 4)), index=[1,2,3], columns=['A','B','C','D']) ds A B C D 1 1.099679 0.042043 0.083903 0.410..

Enabling WiFi on Android Emulator

How to enable WiFi on Android emulator? I have tried to find this but everyone is confusing WiFi with 3G...

Why an inline "background-image" style doesn't work in Chrome 10 and Internet Explorer 8?

Why the following example shows the image in Firefox 4, but not in Chrome 10 and Internet Explorer 8? HTML: <div style="background-image: url('http://www.mypicx.com/uploadimg/1312875436_05012011_..

XSL xsl:template match="/"

I am just learning XML and how to use XSL files. In an XSL file I found the following term: xsl:template match="/" What does this stand for? And what could I use instead of the /? Could I write tab..

No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

I'm compiling a project in Eclipse using m2eclipse. I set the JDK path in Eclipse like this: Windows-->preferences-->installed jres--> jdk1.7.xx path But this is showing an error [ERROR]..

Check the current number of connections to MongoDb

What is the command to get the number of clients connected to a particular MongoDB server?..

Maven parent pom vs modules pom

There seem to be several ways to structure parent poms in a multiproject build and I wondering if anyone had any thoughts on what the advantages / drawbacks are in each way. The simplest method of ha..

Linq with group by having count

how do I write this query in linq (vb.net)? select B.Name from Company B group by B.Name having COUNT(1) > 1 ..

linux execute command remotely

how do I execute command/script on a remote linux box? say I want to do service tomcat start on box b from box a...

Add values from two textboxes and display the sum in third textbox

I have tried this code to add from textbox1.text and textbox2.text into textbox3.text private void textBox1_TextChanged(object sender, EventArgs e) { if(!string.IsNullOrEmpty(textBox1.Tex..

Javascript Regex: How to put a variable inside a regular expression?

So for example: function(input){ var testVar = input; string = ... string.replace(/ReGeX + testVar + ReGeX/, "replacement") } But this is of course not working :) Is there any way to do..

Docker: How to delete all local Docker images

I recently started using Docker and never realized that I should use docker-compose down instead of ctrl-c or docker-compose stop to get rid of my experiments. I now have a large number of unneeded do..

What is the difference between `throw new Error` and `throw someObject`?

I want to write a common error handler which will catch custom errors thrown on purpose at any instance of the code. When I did throw new Error('sample') like in the following code try { throw n..

How to clean old dependencies from maven repositories?

I have too many files in .m2 folder where maven stores downloaded dependencies. Is there a way to clean all old dependencies? For example, if there is a dependency with 3 different versions: 1, 2 and ..

Display HTML snippets in HTML

How can I show HTML snippets on a webpage without needing to replace each < with &lt; and > with &gt;? In other words, is there a tag for don't render HTML until you hit the closing tag..

PHP DOMDocument loadHTML not encoding UTF-8 correctly

I'm trying to parse some HTML using DOMDocument, but when I do, I suddenly lose my encoding (at least that is how it appears to me). $profile = "<div><p>various japanese characters</p&..

Error: The type exists in both directories

In a MVC2 project I moved a file from App_code to Content folder and compiled it. Then move it back again to App_Code and then changed its Build Action to "Compile". Now I get this error and I don't k..

How do I specify the exit code of a console application in .NET?

I have a trivial console application in .NET. It's just a test part of a larger application. I'd like to specify the "exit code" of my console application. How do I do this?..

jQuery: set selected value of dropdown list?

What's wrong with this code? jQuery $(document).ready(function() { $("#routetype").val('quietest'); )}; HTML <select id="routetype" name="routetype"> <option value="fastest">F..

What does the line "#!/bin/sh" mean in a UNIX shell script?

I was going through some shell script tutorials and found the following sample program: #!/bin/sh clear echo "HELLO WORLD" Can anyone please tell me what the significance of the comment #!/bin/sh a..