Questions Tagged with #Collaborative

How do I list all tables in all databases in SQL Server in a single result set?

I am looking for T-SQL code to list all tables in all databases in SQL Server (at least in SS2005 and SS2008; would be nice to also apply to SS2000). The catch, however, is that I would like a single ..

Spring-Boot: How do I set JDBC pool properties like maximum number of connections?

Spring-Boot is a pretty awesome tool, but the documentation is a bit sparse when it comes to more advanced configuration. How can I set properties like the maximum size for my database connection pool..

Should I call Close() or Dispose() for stream objects?

Classes such as Stream, StreamReader, StreamWriter etc implements IDisposable interface. That means, we can call Dispose() method on objects of these classes. They've also defined a public method call..

sed one-liner to convert all uppercase to lowercase?

I have a textfile in which some words are printed in ALL CAPS. I want to be able to just convert everything in the textfile to lowercase, using sed. That means that the first sentence would then read,..

How do you format an unsigned long long int using printf?

#include <stdio.h> int main() { unsigned long long int num = 285212672; //FYI: fits in 29 bits int normalInt = 5; printf("My number is %d bytes wide and its value is %ul. A normal nu..

Is there a free GUI management tool for Oracle Database Express?

Like Microsoft SQL Server Management Studio for MSSQL?..

C++ multiline string literal

Is there any way to have multi-line plain-text, constant literals in C++, à la Perl? Maybe some parsing trick with #includeing a file? I can't think of one, but boy, that would be nice. I know it'll ..

Setting paper size in FPDF

i want to seting paper size in fpdf to a half of letter size, it's approximately 8.5x5.5 inc. How can i do that? My fpdf function in php language is $pdf = new FPDF('P','mm','?????'); is..

phpmyadmin logs out after 1440 secs

In my local development Ubuntu box I use MySQL and phpmyadmin to work with the database. Whenever phpmyadmin is idle for 1440 secs (24min) the session expires. I lose my place and have to login and ..

R Not in subset

Possible Duplicate: Standard way to remove multiple elements from a dataframe I know in R that if you are searching for a subset of another group or matching based on id you'd use something..

How do I add FTP support to Eclipse?

I'm using Eclipse PHP Development Tools. What would be the easiest way to access a file or maybe create a remote project trough FTP and maybe SSH and SFTP?...

How to decrypt hash stored by bcrypt

I have this script that encrypts a password but I don't know how to reverse it and decrypt it. This may be a very simple answer but I don't understand how to do it. #!/usr/bin/perl use Crypt::Eksblow..

'module' object is not callable - calling method in another file

I have a fair background in java, trying to learn python. I'm running into a problem understanding how to access methods from other classes when they're in different files. I keep getting module obj..

Simulate user input in bash script

I am creating my own bash script, but I am stuck at the moment. Basically, the script would be used to automate server setup in CentOS. Some software normally asks the user to type a password. I want ..

how to fix groovy.lang.MissingMethodException: No signature of method:

I am trying to use this method without a closure def copyAndReplaceText(source, dest, targetText, replaceText){ dest.write(source.text.replaceAll(targetText, replaceText)) } def source = new Fi..

org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/CollegeWebsite]]

org.apache.catalina.core.ContainerBase addChildInternal SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost..

Any way to limit border length?

Is there any way to limit the length of a border. I have a <div> that has a bottom border, but I want to add a border on the left of the <div> that only stretches half of the way up. Is ..

How to convert List to Json in Java

How to convert generic list to json in Java.I have class like this.. public class Output { public int Keyname { get; set; } public Object outputvalue{ get; set; } //outvalue may be even a o..

Append an array to another array in JavaScript

This question is an exact duplicate of: How to append an array to an existing JavaScript Array? How do you append an array to another array in JavaScript? Other ways that a person might word this q..

Is there a splice method for strings?

The Javascript splice only works with arrays. Is there similar method for strings? Or should I create my own custom function? The substr(), and substring() methods will only return the extracted stri..

String concatenation of two pandas columns

I have a following DataFrame: from pandas import * df = DataFrame({'foo':['a','b','c'], 'bar':[1, 2, 3]}) It looks like this: bar foo 0 1 a 1 2 b 2 3 c Now I want to have some..

AngularJS $http, CORS and http authentication

Because using CORS and http authentication with AngularJS can be tricky I edited the question to share one learned lesson. First I want to thank igorzg. His answer helped me a lot. The scenario is the..

Calculate cosine similarity given 2 sentence strings

From Python: tf-idf-cosine: to find document similarity , it is possible to calculate document similarity using tf-idf cosine. Without importing external libraries, are that any ways to calculate cosi..

wkhtmltopdf: cannot connect to X server

I have been using wkthmltopdf to convert html to pdf documents on-the-fly on my linux web server. The program originally needed X11 or similar X server to run correctly, but through many requests by ..

Run Function After Delay

I have the below global jQuery function stored, but on page load, I want to execute it after a 1000 delay. Is there something wrong with my syntax? I know the delay always goes before the function. It..

Conditionally hide CommandField or ButtonField in Gridview

I have a GridView displaying person records. I want to conditionally show a CommandField or ButtonField based on some property of the underlying record. The idea is to only allow a command to be perf..

Default value of 'boolean' and 'Boolean' in Java

What are the default values of boolean (primitive) and Boolean (primitive wrapper) in Java?..

Casting interfaces for deserialization in JSON.NET

I am trying to set up a reader that will take in JSON objects from various websites (think information scraping) and translate them into C# objects. I am currently using JSON.NET for the deserializat..

Execute Python script via crontab

I'm trying to execute a Python script using the Linux crontab. I want to run this script every 10 minutes. I found a lot of solutions and none of them worked. For example: edit the anacron at /etc/cro..

How to properly seed random number generator

I am trying to generate a random string in Go and here is the code I have written so far: package main import ( "bytes" "fmt" "math/rand" "time" ) func main() { fmt.Println(rand..

How to update each dependency in package.json to the latest version?

I copied package.json from another project and now want to bump all of the dependencies to their latest versions since this is a fresh project and I don't mind fixing something if it breaks. What's th..

how to pass parameter from @Url.Action to controller function

I have a function CreatePerson(int id) , I want to pass id from @Url.Action. Below is the reference code: public ActionResult CreatePerson(int id) //controller window.location.href = "@Url.Action(..

Find length (size) of an array in jquery

I think I'm going crazy. I have a simply question that I'm struggling with for some reason. Why does the below return 'undefined'? var testvar={}; testvar[1]=2; testvar[2]=3; alert(testvar.length);..

Why do many examples use `fig, ax = plt.subplots()` in Matplotlib/pyplot/python

I'm learning to use matplotlib by studying examples, and a lot of examples seem to include a line like the following before creating a single plot... fig, ax = plt.subplots() Here are some examples..

Characters allowed in GET parameter

Which characters are allowed in GET parameters without encoding or escaping them? I mean something like this: http://www.example.org/page.php?name=XYZ What can you have there instead of XYZ? I think..

Combine two pandas Data Frames (join on a common column)

I have 2 dataframes: restaurant_ids_dataframe Data columns (total 13 columns): business_id 4503 non-null values categories 4503 non-null values city 4503 non-null values f..

bool to int conversion

How portable is this conversion. Can I be sure that both assertions pass? int x = 4<5; assert(x==1); x = 4>5; assert(x==0); Don't ask why. I know that it is ugly. Thank you...

Difference between dates in JavaScript

How to find the difference between two dates?..

Remove file extension from a file name string

If I have a string saying "abc.txt", is there a quick way to get a substring that is just "abc"? I can't do an fileName.IndexOf('.') because the file name could be "abc.123.txt" or something and I ob..

Lock down Microsoft Excel macro

I've spent some time writing an Excel Macro that is potentially worth money to a lot of companies. How can I lock down the macro to prevent people seeing the source / forwarding to other people? Tha..

How do I set cell value to Date and apply default Excel date format?

I've been using Apache POI for some time to read existing Excel 2003 files programmatically. Now I have a new requirement to create entire .xls files in-memory (still using Apache POI) and then write ..

Facebook database design?

I have always wondered how Facebook designed the friend <-> user relation. I figure the user table is something like this: user_email PK user_id PK password I figure the table with user's data..

Header div stays at top, vertical scrolling div below with scrollbar only attached to that div

I have 2 main divs, the header and a scrolling list contained in a div. I want the header to always remain at the top of the page, and the scrolling list below. The scrollbar should be attached to the..

Array initializing in Scala

I'm new to Scala ,just started learning it today.I would like to know how to initialize an array in Scala. Example Java code String[] arr = { "Hello", "World" }; What is the equivalent of the abov..

How to escape % in String.Format?

I am storing a SQL query in my strings.xml file and I want to use String.Format to build the final string in code. The SELECT statement uses a like, something like this: SELECT Field1, Field2 FROM m..

Bash scripting missing ']'

I am getting an error ./test.sh: line 13: [: missing `]' in the file test.sh I tried using brackets and other options such as -a or by checking the size of the file p1 but the error is always there an..

Adding options to select with javascript

I want this javascript to create options from 12 to 100 in a select with id="mainSelect", because I do not want to create all of the option tags manually. Can you give me some pointers? Thanks functi..

Getting the folder name from a path

string path = "C:/folder1/folder2/file.txt"; What objects or methods could I use that would give me a result of folder2?..

Size of character ('a') in C/C++

What is the size of character in C and C++ ? As far as I know the size of char is 1 byte in both C and C++. In C: #include <stdio.h> int main() { printf("Size of char : %d\n", sizeof(char)..

MySQL - count total number of rows in php

What is the best MySQL command to count the total number of rows in a table without any conditions applied to it? I'm doing this through php, so maybe there is a php function which does this for me? I..

Convert IEnumerable to DataTable

Is there a nice way to convert an IEnumerable to a DataTable? I could use reflection to get the properties and the values, but that seems a bit inefficient, is there something build-in? (I know the ..

Execute Immediate within a stored procedure keeps giving insufficient priviliges error

Here is the definition of the stored procedure: CREATE OR REPLACE PROCEDURE usp_dropTable(schema VARCHAR, tblToDrop VARCHAR) IS BEGIN DECLARE v_cnt NUMBER; BEGIN SELECT COUNT(*) INTO v..

Regex allow digits and a single dot

What would be the regex to allow digits and a dot? Regarding this \D only allows digits, but it doesn't allow a dot, I need it to allow digits and one dot this is refer as a float value I need to be v..

How to open a file for both reading and writing?

Is there a way to open a file for both reading and writing? As a workaround, I open the file for writing, close it, then open it again for reading. But is there a way to open a file for both reading ..

Using Pip to install packages to Anaconda Environment

conda 4.2.13 MacOSX 10.12.1 I am trying to install packages from pip to a fresh environment (virtual) created using anaconda. In the Anaconda docs it says this is perfectly fine. It is done the sam..

Sorting a set of values

I have values like this: set(['0.000000000', '0.009518000', '10.277200999', '0.030810999', '0.018384000', '4.918560000']) set(['4.918859000', '0.060758000', '4.917336999', '0.003949999', '0.013945000..

How can I capture the right-click event in JavaScript?

I want to block the standard context menus, and handle the right-click event manually. How is this done?..

Android: remove notification from notification bar

I have created an application and with an event I manage to add notification in android notification bar. Now I need sample how to remove that notification from notification bar on an event ?? ..

Remove blank values from array using C#

How can I remove blank values from an array? For example: string[] test={"1","","2","","3"}; in this case, is there any method available to remove bl..

How can I plot with 2 different y-axes?

I would like superimpose two scatter plots in R so that each set of points has its own (different) y-axis (i.e., in positions 2 and 4 on the figure) but the points appear superimposed on the same figu..

Remove all files except some from a directory

When using sudo rm -r, how can I delete all files, with the exception of the following: textfile.txt backup.tar.gz script.php database.sql info.txt ..

How to get "GET" request parameters in JavaScript?

How to get "GET" variables from request in JavaScript? Does jQuery or YUI! have this feature built-in?..

How do I get 'date-1' formatted as mm-dd-yyyy using PowerShell?

How does one get date-1 and format it to mm-dd-yyyy in PowerShell? Example: If today is November 1, 2013, and I need 10-31-2013 in my code. I've used AddDays(-1) before, but I can't seem to get it t..

The database cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported

I have created a sample database using SQL Server 2014 Express and added it to my Windows Form solution. When double click on it to open I get this error. The database cannot be opened because it..

how to have two headings on the same line in html

I want to have two headings h2 and h3 on the same horizontal rule one on the left and the other on the right. They have a HR underneath them and I want them to be at the same distance from this HR. ..

Generating a list of pages (not posts) without the index file

I am using Jekyll as a static generator for a website (not a blog), and I want to have an automatically generated list of all pages on my index page. I get that to work with the following code for the..

Get nth character of a string in Swift programming language

How can I get the nth character of a string? I tried bracket([]) accessor with no luck. var string = "Hello, world!" var firstChar = string[0] // Throws error ERROR: 'subscript' is unavailable..

SQL Server Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >=

I run the following query: SELECT orderdetails.sku, orderdetails.mf_item_number, orderdetails.qty, orderdetails.price, supplier.supplierid, supplier.suppliername, supplier.drops..

In Node.js, how do I "include" functions from my other files?

Let's say I have a file called app.js. Pretty simple: var express = require('express'); var app = express.createServer(); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.ge..

React JS Error: is not defined react/jsx-no-undef

I'm developing a map functionality using ReactJS, My app.js file is: import React, { Component } from 'react'; import './Map'; class App extends Component { render() { return ( <d..

Get text from DataGridView selected cells

I have a DataGridView with cells from a database file that contains data. Basically, I want to get the text from the selected cells in the DataGridView and display it in a textbox at the click of the ..

How to check all versions of python installed on osx and centos

I just started setting up a centos server today and noticed that the default version of python on centos is set to 2.6.6. I want to use python 2.7 instead. I googled around and found that 2.6.6 is use..

How do I find the size of a struct?

struct a { char *c; char b; }; What is sizeof(a)? ..

How to use "not" in xpath?

I want to write something of the sort: //a[not contains(@id, 'xx')] (meaning all the links that there 'id' attribute doesn't contain the string 'xx') I can't find the right syntax...

python .replace() regex

I am trying to do a grab everything after the '</html>' tag and delete it, but my code doesn't seem to be doing anything. Does .replace() not support regex? z.write(article.replace('</html>..

How do I find the install time and date of Windows?

This might sound like a little bit of a crazy question, but how can I find out (hopefully via an API/registry key) the install time and date of Windows? The best I can come up with so far is to look ..

php pdo: get the columns name of a table

How can I get all the column names from a table using PDO? id name age 1 Alan 35 2 Alex 52 3 Amy 15 The info that I want to get..

warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777

Every time I run this command rails server: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777 I searched for a solution here and they said to type: chmod go-w /usr/local..

load Js file in HTML

My first PhoneGap application includes 2 HTML files. The first one is named index.html which uses index.js. This file will display a list item. When I click an item in that list, it brings me to det..

YouTube API to fetch all videos on a channel

We need a video list by channel name of YouTube (using the API). We can get a channel list (only channel name) by using the below API: https://gdata.youtube.com/feeds/api/channels?v=2&q=tendulka..

compression and decompression of string data in java

I am using the following code to compress and decompress string data, but the problem which I am facing is, it is easily getting compressed without error, but decompress method throws following error...

Resource leak: 'in' is never closed

Why does Eclipse give me the warming "Resource leak: 'in' is never closed" in the following code? public void readShapeData() { Scanner in = new Scanner(System.in); System.out.println..

jQuery convert line breaks to br (nl2br equivalent)

I'm having jQuery take some textarea content and insert it into an li. I want it to visually retain the line breaks. There must be a really simple way to do this.....

Get month name from Date

How can I generate the name of the month (e.g: Oct/October) from this date object in JavaScript? var objDate = new Date("10/11/2009"); ..

rand() returns the same number each time the program is run

In this rather basic C++ code snippet involving random number generation: include <iostream> using namespace std; int main() { cout << (rand() % 100); return 0; } Why am I alwa..

SSL handshake fails with - a verisign chain certificate - that contains two CA signed certificates and one self-signed certificate

I am stuck with a issue and trying to debug it. We purchased a Verisign certificate. When we use: openssl> s_client -connect myweb.com:443 -showcerts SSL Handshake never completes and at the end..

How do I delete multiple rows in Entity Framework (without foreach)

I'm deleting several items from a table using Entity Framework. There isn't a foreign key / parent object so I can't handle this with OnDeleteCascade. Right now I'm doing this: var widgets = context..

SQL Query - Concatenating Results into One String

I have a sql function that includes this code: DECLARE @CodeNameString varchar(100) SELECT CodeName FROM AccountCodes ORDER BY Sort I need to concatenate all results from the select query into Cod..

Python 3: EOF when reading a line (Sublime Text 2 is angry)

while True: reply = input('Enter text') if reply == 'stop': break print(reply.upper()) The result was: Enter text:Traceback (most recent call last): File "C:\PythonProjects\5.py", li..

How do I vertical center text next to an image in html/css?

What is the best and easiest way to vertically center text that's next to an image in html? Needs to be browser version/type agnostic. A pure html/CSS solution...

Questions every good Database/SQL developer should be able to answer

I was going through Questions every good .Net developer should be able to answer and was highly impressed with the content and approach of this question and so in the same spirit, I am asking this que..

How to Select Min and Max date values in Linq Query

I am moving from SQL to Linq and I need some help. I am testing both Linq-to-SQL and Linq-to-Entities. I want to try both to decide which one suits me best. Your help is appreciated. Thanks What is t..

Change placeholder text

How can I change the placeholder text of an input element? For example I have 3 inputs of type text. <input type="text" name="Email" placeholder="Some Text"> <input type="text" name="First ..

Change type of varchar field to integer: "cannot be cast automatically to type integer"

I have a small table and a certain field contains the type "character varying". I'm trying to change it to "Integer" but it gives an error that casting is not possible. Is there a way around this or ..

How to start Spyder IDE on Windows

I downloaded spyder using the pip install spyder in my windows 10 32-bit operating system, but i dont see any desktop icons or exe files to start running the IDE. I downloaded spyder 3, any my pyth..

How to install Openpyxl with pip

I have windows 10 (64 bit). I want to utilize the Openpyxl package to start learning how to interact with excel and other spreadsheets. I installed Python with "windowsx86-64web-basedinstaller" I ha..

using if else with eval in aspx page

Is there a way to use an else if on the following eval on the aspx page . Currently my div is as follows : <div class="tooltip" style="display: none"> ..

How to get object size in memory?

I need to know how much bytes my object consumes in memory (in C#). for example how much my Hashtable, or SortedList, or List<String>...

Setting Authorization Header of HttpClient

I have an HttpClient that I am using for a REST API. However I am having trouble setting up the Authorization header. I need to set the header to the token I received from doing my OAuth request. I sa..

What does the Visual Studio "Any CPU" target mean?

I have some confusion related to the .NET platform build options in Visual Studio 2008. What is the "Any CPU" compilation target, and what sort of files does it generate? I examined the output execut..

What SOAP client libraries exist for Python, and where is the documentation for them?

I've never used SOAP before and I'm sort of new to Python. I'm doing this to get myself acquainted with both technologies. I've installed SOAPlib and I've tried to read their Client documentation, b..

How to call Stored Procedures with EntityFramework?

I have generated an EF4 Model from a MySQL database and I have included both StoredProcedures and Tables. I know how to make regular instert/update/fetch/delete operations against the EF but I can't ..

iOS 8 removed "minimal-ui" viewport property, are there other "soft fullscreen" solutions?

(This is a multi-part question, I will try my best to summarise the scenario.) We are currently building a responsive web app (news reader) that allow users to swipe between tabbed content, as well a..

Escaping single quote in PHP when inserting into MySQL

I have a perplexing issue that I can't seem to comprehend... I have two SQL statements: The first enters information from a form into the database. The second takes data from the database entered a..

Core dumped, but core file is not in the current directory?

While running a C program, It says "(core dumped)" but I can't see any files under the current path. I have set and verified the ulimit: ulimit -c unlimited ulimit -a I also tried to find a file..

What is the maximum characters for the NVARCHAR(MAX)?

I have declared a column of type NVARCHAR(MAX) in SQL Server 2008, what would be its exact maximum characters having the MAX as the length?..

Allowed memory size of X bytes exhausted

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 13965430 bytes) PHPInfo shows that I have a memory_limit of 128M, so I'm confused as to why the error says I only h..

How to Maximize window in chrome using webDriver (python)

Is there a way to maximize the chrome browser window using python selenium WebDriver? Note: I am using Chrome Driver 23.0 Any solution on this would be greatly appreciated!..

'heroku' does not appear to be a git repository

When I try to push my app to Heroku I get this response: fatal: 'heroku' does not appear to be a git repository fatal: Could not read from remote repository. Please make sure you have the correct ac..

How can I show and hide elements based on selected option with jQuery?

Here is my code. Why it doesn't work? <Script> $('#colorselector').change(function() { $('.colors').hide(); $('#' + $(this).val()).show(); }); </Script> <Select i..

How to place Text and an Image next to each other in HTML?

I want the text and the image to be next to each other but I want the image to be on the far left of the screen and I want the text to be on the far right of the screen. This is what I currently have...

A server is already running. Check …/tmp/pids/server.pid. Exiting - rails

..$ rails s => Booting WEBrick => Rails 4.0.4 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server A se..

How to show alert message in mvc 4 controller?

I tried show a alert box in mvc controller by if-else condition.But alert box does not display.Where is my mistake ? Controller public ActionResult Index() { int userId = Convert.ToInt32(Session..

How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#?

Is there any way to maximize the browser window using WebDriver (Selenium 2) with C#?..

How can I add a help method to a shell script?

How do I check if a -h attribute has been passed into a shell script? I would like to display a help message when a user calls myscript.sh -h...

Pretty-print a Map in Java

I am looking for a nice way to pretty-print a Map. map.toString() gives me: {key1=value1, key2=value2, key3=value3} I want more freedom in my map entry values and am looking for something more like ..

How to get unique values in an array

How can I get a list of unique values in an array? Do I always have to use a second array or is there something similar to java's hashmap in JavaScript? I am going to be using JavaScript and jQuery o..

Clearing state es6 React

I am trying to clear a components state but can't find a reference for the es6 syntax. I was using: this.replaceState(this.getInitialState()); however this does not work with the es6 class synta..

Plotting a list of (x, y) coordinates in python matplotlib

I have a list of pairs (a, b) that I would like to plot with matplotlib in python as actual x-y coordinates. Currently, it is making two plots, where the index of the list gives the x-coordinate, and ..

How to get the day name from a selected date?

I have this : Datetime.Now(); or 23/10/2009 I want this : Friday For local date-time (GMT-5) and using Gregorian calendar...

MySQL: Cloning a MySQL database on the same MySql instance

I would like to write a script which copies my current database sitedb1 to sitedb2 on the same mysql database instance. I know I can dump the sitedb1 to a sql script: mysqldump -u root -p sitedb1 >..

What jar should I include to use javax.persistence package in a hibernate based application?

Is it ok to take it from Glassfish project ( glassfish-persistence-api) or may be there is a Hibernate jar?..

Add ArrayList to another ArrayList in java

I am having the following java code, in which I am trying to copy the ArrayList to another ArrayList. ArrayList<String> nodes = new ArrayList<String>(); ArrayList NodeList=new ArrayLis..

Docker expose all ports or range of ports from 7000 to 8000

Can I specify a port range in a Dockerfile EXPOSE 7000-8000 and when running the container bind all these exposed ports to the same ports on the host machine? docker run -p 7000-8000:7000-8000 ..

Role/Purpose of ContextLoaderListener in Spring?

I am learning Spring Framework which is being used in my project. I found the ContextLoaderListener entry in my web.xml file. But could not figure out how exactly it helps a developer? In the offici..

Some projects cannot be imported because they already exist in the workspace error in Eclipse

I am trying to import a project that me and my co-worker have been working on.. and keep getting this error after I select-- "import" then "import existing project" then click archive file, and then I..

How do I stop a program when an exception is raised in Python?

I need to stop my program when an exception is raised in Python. How do I implement this?..

How to do Select All(*) in linq to sql

How do you select all rows when doing linq to sql? Select * From TableA In both query syntax and method syntax please...

Add a background image to shape in XML Android

How do you add a background image to a shape? The code I tried below but no success: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" ..

Add tooltip to font awesome icon

Has anyone here added tooltips to font-awesome icons? I have the following jsfiddle, but cannot seem to find a guide to add tooltips to the icons. <header> <!-- icons for settings, change..

Launching an application (.EXE) from C#?

How can I launch an application using C#? Requirements: Must work on Windows XP and Windows Vista. I have seen a sample from DinnerNow.net sampler that only works in Windows Vista...

How to create a collapsing tree table in html/css/js?

I have some data to display that is both tabular and hierarchical. I'd like to let the user be able to expand and collapse the nodes. Sort of like this, except functional: http://www.maxdesign.com.a..

pull access denied repository does not exist or may require docker login

I am using Laravel 4.2 with docker. I setup it on local. It worked without any problem but when I am trying to setup online using same procedure then I am getting error pull access denied for <pro..

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

Postgresql - select something where date = "01/01/11"

I have a datetime field in my Postgresql, named "dt". I'd like to do something like SELECT * FROM myTable WHERE extract (date from dt) = '01/01/11' What is the right syntax to do that? Thanks!..

Table Height 100% inside Div element

Hi I want to set table height 100% to its parent div without define height in div. My code is not working. I dont know what I am missing. Fiddle link <div style="overflow:hidden"> <div style..

How to handle floats and decimal separators with html5 input type number

Im building web app which is mainly for mobile browsers. Im using input fields with number type, so (most) mobile browsers invokes only number keyboard for better user experience. This web app is main..

How to synchronize or lock upon variables in Java?

Let me use this small and simple sample: class Sample { private String msg = null; public void newmsg(String x){ msg = x; } public String getmsg(){ String temp = msg..

The type or namespace name 'System' could not be found

I have the following errors (and more) in all my views (*.cshtml) when opening my project in Visual Studio 2015 Professional. Error CS0246 The type or namespace name 'System' could not be found ..

Renaming the current file in Vim

How should I rename my current file in Vim? For example: I am editing person.html_erb_spec.rb I would like it renamed to person.haml_spec.rb I would like to continue editing person.haml_spec.rb H..

Regex Named Groups in Java

It is my understanding that the java.regex package does not have support for named groups (http://www.regular-expressions.info/named.html) so can anyone point me towards a third-party library that doe..

Cannot install node modules that require compilation on Windows 7 x64/VS2012

I cannot install any of the modules that require compilation. All they fail with the following error: MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". ... My environm..

How to set the timezone in Django?

In my django project's settings.py file, I have this line : TIME_ZONE = 'UTC' But I want my app to run in UTC+2 timezone, so I changed it to TIME_ZONE = 'UTC+2' It gives the error ValueError: In..

font-family is inherit. How to find out the font-family in chrome developer pane?

In the Chrome's developer pane, I can see these css settings of an element. As far as I can see, every single font-family value is inherit. How can I find what is the actual value of the font fam..

MySQL update CASE WHEN/THEN/ELSE

I am trying to update a LARGE MyISAM table (25 million records) using a CLI script. The table is not being locked/used by anything else. I figured instead of doing single UPDATE queries for each reco..

Undocumented NSURLErrorDomain error codes (-1001, -1003 and -1004) using StoreKit

I'm writing StoreKit-related code, and I'm getting some rather troubling error codes when I try to add a purchase to the queue. So far, I've experienced error codes -1003 and -1004 and I can't find a..

jQuery Find and List all LI elements within a UL within a specific DIV

I have 3 Columns of ULs each a Dynamic UL container that can have anywhere from 0-9 LI containers (eventually more). All my LI elements have an attribute "rel" which I am trying to ultimately find tha..

How can I represent 'Authorization: Bearer <token>' in a Swagger Spec (swagger.json)

I am trying to convey that the authentication/security scheme requires setting a header as follows: Authorization: Bearer <token> This is what I have based on the swagger documentation: secu..

How to hide element label by element id in CSS?

Let's say I've got this code <table> <tr> <td><input id="foo" type="text"></td> <td><label for="foo">This is foo</label></td>..

eloquent laravel: How to get a row count from a ->get()

I'm having a lot of trouble figuring out how to use this collection to count rows. $wordlist = \DB::table('wordlist')->where('id', '<=', $correctedComparisons) ->get(); I ..

Creating a UIImage from a UIColor to use as a background image for UIButton

I'm creating a colored image like this: CGRect rect = CGRectMake(0, 0, 1, 1); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillColorWithCo..

Python method for reading keypress?

I'm new to Python, and I just made a game and a menu in Python. Question is, that using (raw_)input() requires me to press enter after every keypress, I'd like to make it so that pressing down-arrow w..

Using jquery to delete all elements with a given id

I have a form with several spans with id="myid". I'd like to be able to remove all elements with this id from the DOM, and I think jQuery is the best way to do it. I figured out how to use the $.remov..

javascript code to check special characters

I have JavaScript code to check if special characters are in a string. The code works fine in Firefox, but not in Chrome. In Chrome, even if the string does not contain special characters, it says it ..

Bootstrap 3 - disable navbar collapse

This is my simple navbar: <div class="navbar navbar-fixed-top myfont" role="navigation"> <div class=""> <ul class="nav navbar-nav navbar-left"> <li> ..

How to get images in Bootstrap's card to be the same height/width?

So here is my code, it displays 6 cards, three across and two rows. I would like for the images to all be the same size without having to manually resize the images. The responsiveness does work, I us..

Cannot access wamp server on local network

I want to host a website on my local network. For some reason I can only access wamp in my local computer. I have 2 computers in my network. Both computer A and computer B have wamp server installed..

Converting Python dict to kwargs?

I want to build a query for sunburnt(solr interface) using class inheritance and therefore adding key - value pairs together. The sunburnt interface takes keyword arguments. How can I transform a dict..

TypeError: 'in <string>' requires string as left operand, not int

Why am I getting this error in the very basic Python script? What does the error mean? Error: Traceback (most recent call last): File "cab.py", line 16, in <module> if cab in line: Type..

How do I use typedef and typedef enum in C?

Consider: #define MAXROW 20 #define MAXCOL 60 typedef State Grid[MAXROW+2] [MAXCOL+2] typedef enum state {DEAD,ALIVE} State How do I use typedef and typedef enum in C? What does this part of the co..

android: move a view on touch move (ACTION_MOVE)

I'd like to do a simple control: a container with a view inside. If I touch the container and I move the finger, I want to move the view to follow my finger. What kind of container (layout) should I..

How do I select an element that has a certain class?

My understanding is that using element.class should allow for a specific element assigned to a class to receive different "styling" than the rest of the class. This is not a question about whether thi..

BootStrap : Uncaught TypeError: $(...).datetimepicker is not a function

I have just started off with BootStrap, however stranded with Uncaught TypeError: $(...).datetimepicker is not a function error message. Could someone let me know what went missing with this code? Sin..

Autoreload of modules in IPython

Is there a way to have IPython automatically reload all changed code? Either before each line is executed in the shell or failing that when it is specifically requested to. I'm doing a lot of explorat..

How to get GMT date in yyyy-mm-dd hh:mm:ss in PHP

I want to get the current date in yyyy-mm-dd hh:mm:ss format. I have tried: gmdate('yyyy-mm-dd hh:mm:ss \G\M\T', time()); Its returning a wierd date: 13131313-1111-2323 0707:1111:3131..

Android Writing Logs to text File

I'm Trying to Write Logs to Custom Log.txt File on Android File using this code of Mine but then this method creates file but contains nothing. Basically I want to read previous contents of the file a..

Provide schema while reading csv file as a dataframe

I am trying to read a csv file into a dataframe. I know what the schema of my dataframe should be since I know my csv file. Also I am using spark csv package to read the file. I trying to specify the ..

Python base64 data decode

I have the following piece of base64 encoded data, and I want to use python base64 module to extract information from it. It seems that module does not work. Can anyone tell me how? Q5YACgAAAABDlgA..

Is there an effective tool to convert C# code to Java code?

Is there an effective tool to convert C# code to Java code?..

Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

I am getting this kind of error, how to fix it. Error:Unable to load class 'org.gradle.tooling.internal.protocol.test.InternalTestExecutionConnection'. Possible causes for this unexpected error Gradl..

No module named serial

and I got a question when I run my Python code. I installed Python 2.7 on Windows 7, bit 64. I got an error "No module named serial" when I compiled my code: import serial ser = serial.Serial("COM5..

Automatic vertical scroll bar in WPF TextBlock?

I have a TextBlock in WPF. I write many lines to it, far exceeding its vertical height. I expected a vertical scroll bar to appear automatically when that happens, but it didn't. I tried to look for a..

how to access parent window object using jquery?

How to acess parent window object using jquery? This is my Parent window variable , I want to set its value after closing child window . $('#serverMsg').html('some text here'); ..

No Access-Control-Allow-Origin header is present on the requested resource

I want to access information from same domain but with different port number, To allow this I am adding Access-Control-Allow-Origin with the response header. Servlet Code:(present on www.example.com:..

How to disable HTML links

I have a link button inside a <td> which I have to disable. This works on IE but not working in Firefox and Chrome. Structure is - Link inside a <td>. I cannot add any container in the <..

Print Combining Strings and Numbers

To print strings and numbers in Python, is there any other way than doing something like: first = 10 second = 20 print "First number is %(first)d and second number is %(second)d" % {"first": first, "..

align text center with android

I know it sounds easy. I need to put a text in center, but when the text is too long it needs to go below, but still align in the center of my xml. Here's my code : <LinearLayout android:la..

SQL Error: ORA-00922: missing or invalid option

CREATE TABLE chartered flight(flight_no NUMBER(4) PRIMARY KEY , customer_id NUMBER(6) REFERENCES customer(customer_id) , aircraft_no NUMBER(4) REFERENCES aircraft(aircraft_no) , flight_type VARCHAR2 (..

Get DataKey values in GridView RowCommand

I have a GridView with an associated DataKey, which is the item ID. How do I retrieve that value inside the RowCommand event? This seems to work, but I don't like the cast to LinkButton (what if some..

Replace multiple strings with multiple other strings

I'm trying to replace multiple words in a string with multiple other words. The string is "I have a cat, a dog, and a goat." However, this does not produce "I have a dog, a goat, and a cat", but inst..

Way to insert text having ' (apostrophe) into a SQL table

While I was trying the following SQL command , I got sql error. INSERT INTO exampleTbl VALUES('he doesn't work for me') where doesn't contain the apostrophe. What is the way to insert text having ..

Finding sum of elements in Swift array

What is the easiest (best) way to find the sum of an array of integers in swift? I have an array called multiples and I would like to know the sum of the multiples...

Convert timestamp to readable date/time PHP

I have a timestamp stored in a session (1299446702). How can I convert that to a readable date/time in PHP? I have tried srttotime, etc. to no avail...

Where do I call the BatchNormalization function in Keras?

If I want to use the BatchNormalization function in Keras, then do I need to call it once only at the beginning? I read this documentation for it: http://keras.io/layers/normalization/ I don't see w..

push() a two-dimensional array

I'm trying to push to a two-dimensional array without it messing up, currently My array is: var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] And my code I'm trying is: var r = 3; //start fr..

How to create and use resources in .NET

How do I create a resource that I can reference and use in various parts of my program easily? My specific problem is that I have a NotifyIcon that I want to change the icon of depending on the state..

How do you implement a good profanity filter?

Many of us need to deal with user input, search queries, and situations where the input text can potentially contain profanity or undesirable language. Oftentimes this needs to be filtered out. Where..

Get list from pandas dataframe column or row?

I have a dataframe df imported from an Excel document like this: cluster load_date budget actual fixed_price A 1/1/2014 1000 4000 Y A 2/1/2014 12000 10000 Y A 3/1/2014 360..

"CASE" statement within "WHERE" clause in SQL Server 2008

I am working with a query which contains "CASE" statement within "WHERE" clause. But SQL Server 2008 is giving some errors while executing it. Can anyone please help me with the correct query? Here is..

Not Able To Debug App In Android Studio

I am making an app in Android Studio, now trying to debug it through adb. When I click on the word Android and the logo on the bottom bar, logcat comes up and recognizes my device. Then I see this: ..

How do I disable fail_on_empty_beans in Jackson?

Using jackson 2.1, how do I disable the fail_on_empty beans that the error message seems to want me to disable? I'm assuming this is just the simplest thing in the world, but hell it is late and I h..

Listview Scroll to the end of the list after updating the list

I would like to make sure that the list is scrolled all the way to the bottom, after I have updated the listview by using listAdapter, so that it displays the last element entered in the list. How ca..

java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String() in Java EE application

I am developing a Java EE application in which I need Base64 Encoding/Decoding So I added commons-codec-1.5.jar in WEB-INF/lib folder of my application and used import org.apache.commons.codec.bina..

Cannot execute RUN mkdir in a Dockerfile

This is an error message I get when building a Docker image: Step 18 : RUN mkdir /var/www/app && chown luqo33:www-data /var/www/app ---> Running in 7b5854406120 mkdir: cannot create directo..

Get all variables sent with POST?

I need to insert all variables sent with post, they were checkboxes each representing an user. If I use GET I get something like this: ?19=on&25=on&30=on I need to insert the variables in ..

PHP - Failed to open stream : No such file or directory

In PHP scripts, whether calling include(), require(), fopen(), or their derivatives such as include_once, require_once, or even, move_uploaded_file(), one often runs into an error or warning: Fai..

Insert content into iFrame

I am trying to insert some content into a 'blank' iFrame, however nothing is being inserted. HTML: <iframe id="iframe"></iframe> JS: $("#iframe").ready(function() { var $doc = $("..

Using HTML5/JavaScript to generate and save a file

I've been fiddling with WebGL lately, and have gotten a Collada reader working. Problem is it's pretty slow (Collada is a very verbose format), so I'm going to start converting files to a easier to us..

Copy mysql database from remote server to local computer

I'm under VPN and I don't have SSH access to remote server. I can connect to remote database by console mysql -u username -p -h remote.site.com Now I'm trying to clone the remote database to local..

Change color and appearance of drop down arrow

I want to change the default appearance of the arrow of a dropdown list so that looks the same across browsers. Is there a way to override the default look and feel of the drop down arrow using CSS or..

Are multi-line strings allowed in JSON?

Is it possible to have multi-line strings in JSON? It's mostly for visual comfort so I suppose I can just turn word wrap on in my editor, but I'm just kinda curious. I'm writing some data files in JSO..