Questions Tagged with #Dynamic rdlc generation

Use this tag for questions about the dynamic generation of the Client Report Definition Language file

AttributeError: 'tuple' object has no attribute

I'm a beginner in python. I'm not able to understand what the problem is? def list_benefits(): s1 = "More organized code" s2 = "More readable code" s3 = "Easier code reuse" ..

Count number of objects in list

R function that will return the number of items in a list?..

Creating a 3D sphere in Opengl using Visual C++

I am not able to create a simple 3D sphere using the OpenGL library function glutSolidSphere() in C++. Here's what I tried: #include<GL/glu.h> void display() { glClear(GL_COLOR_BUFFER_B..

Android Studio - mergeDebugResources exception

I recently updated the Android Studio to it's latest version, and now I am experiencing a headache with an exception in Gradle build. Every time I run the project, two or three times before it succee..

setHintTextColor() in EditText

I have View in which there are two text boxes, and the user can select text color from another view on the same screen (through dialog box). So when the user changes color via dialog box, I am changi..

Arguments to main in C

I don't know what to do! I have a great understanding of C basics. Structures, file IO, strings, etc. Everything but CLA. For some reason I cant grasp the concept. Any suggestions, help, or advice. PS..

Python read-only property

I don't know when attribute should be private and if I should use property. I read recently that setters and getters are not pythonic and I should use property decorator. It's ok. But what if I hav..

Excel Date to String conversion

In a cell in Excel sheet I have a Date value like: 01/01/2010 14:30:00 I want to convert that Date to Text and also want the Text to look exactly like Date. So a Date value of 01/01/2010 14:30:00 s..

Disable all table constraints in Oracle

How can I disable all table constrains in Oracle with a single command? This can be either for a single table, a list of tables, or for all tables...

How do you compare structs for equality in C?

How do you compare two instances of structs for equality in standard C?..

Regex - how to match everything except a particular pattern

How do I write a regex to match any string that doesn't meet a particular pattern? I'm faced with a situation where I have to match an (A and ~B) pattern...

CORS header 'Access-Control-Allow-Origin' missing

I'm calling this function from my asp.net form and getting following error on firebug console while calling ajax. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote ..

Change bullets color of an HTML list without using span

I was wondering if there is a way to change the color on the bullets in a list. I have a list like this: <ul> <li>House</li> <li>Car</li> <li>Garden<..

Jquery Validate custom error message location

This looks very simply, but I can't figure it out. I'm using the jquery validate plugin. I'm trying to validate <input name=first> and <input name=second> to output the error messages into..

How can I specify the schema to run an sql file against in the Postgresql command line

I run scripts against my database like this... psql -d myDataBase -a -f myInsertFile.sql The only problem is I want to be able to specify in this command what schema to run the script against. I c..

Can you run GUI applications in a Docker container?

How can you run GUI applications in a Docker container? Are there any images that set up vncserver or something so that you can - for example - add an extra speedbump sandbox around say Firefox?..

How to enable mbstring from php.ini?

I have real difficulties with enabling mbstring extension on my localhost. I'm using XAMPP 1.7.4, for Windows, which has PHP 5.3.5, and tried to edit my php.ini file according to the documentation a..

Find the last element of an array while using a foreach loop in PHP

I am writing a SQL query creator using some parameters. In Java, it's very easy to detect the last element of an array from inside the for loop by just checking the current array position with the arr..

"installation of package 'FILE_PATH' had non-zero exit status" in R

By installing the package in R using the following command: install.packages('FILE_PATH', repos=NULL, type = "source") I got the following error: Installing package into ‘/home/p/R/x86_64-pc-..

Retrieve the maximum length of a VARCHAR column in SQL Server

I want to find the longest VARCHAR in a specific column of a SQL Server table. Here's an example: ID = INT IDENTITY DESC = VARCHAR(5000) ID | Desc ---|----- 1 | a 2 | aaa 3 | aa What's the SQL..

Failed to resolve: com.android.support:appcompat-v7:27.+ (Dependency Error)

I am having this issue in Android studio. Error:Failed to resolve: com.android.support:appcompat-v7:27.+ <a href="install.m2.repo">Install Repository and sync project</a><br><a h..

How to quickly and conveniently disable all console.log statements in my code?

Is there any way to turn off all console.log statements in my JavaScript code, for testing purposes?..

How do I deal with special characters like \^$.?*|+()[{ in my regex?

I want to match a regular expression special character, \^$.?*|+()[{. I tried: x <- "a[b" grepl("[", x) ## Error: invalid regular expression '[', reason 'Missing ']'' (Equivalently stringr::str..

Jenkins - passing variables between jobs?

I have two jobs in jenkins, both of which need the same parameter. How can I run the first job with a parameter so that when it triggers the second job, the same parameter is used?..

How to put the legend out of the plot

I have a series of 20 plots (not subplots) to be made in a single figure. I want the legend to be outside of the box. At the same time, I do not want to change the axes, as the size of the figure ge..

How to check if array is not empty?

How to check if the array is not empty? I did this: if not self.table[5] is None: Is this the right way?..

Is there a way to make AngularJS load partials in the beginning and not at when needed?

I have a route setup like this: var myApp = angular.module('myApp', []). config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/landing', { templateU..

How do I calculate the MD5 checksum of a file in Python?

I have written some code in Python that checks for an MD5 hash in a file and makes sure the hash matches that of the original. Here is what I have developed: # Defines filename filename = "file.e..

Range with step of type float

The documentation basically says that range must behave exactly as this implementation (for positive step): def range(start, stop, step): x = start while True: if x >= stop: return yie..

How to Get Element By Class in JavaScript?

I want to replace the contents within a html element so I'm using the following function for that: function ReplaceContentInContainer(id,content) { var container = document.getElementById(id); ..

Does java.util.List.isEmpty() check if the list itself is null?

Does java.util.List.isEmpty() check if the list itself is null, or do I have to do this check myself? For example: List<String> test = null; if (!test.isEmpty()) { for (String o : test) {..

Best way to iterate through a Perl array

Which is the best implementation(in terms of speed and memory usage) for iterating through a Perl array? Is there any better way? (@Array need not be retained). Implementation 1 foreach (@Array) { ..

Splitting a string into separate variables

I have a string, which I have split using the code $CreateDT.Split(" "). I now want to manipulate two separate strings in different ways. How can I separate these into two variables?..

How to change navbar collapse threshold using Twitter bootstrap-responsive?

I'm using Twitter Bootstrap 2.0.1 in a Rails 3.1.2 project, implemented with bootstrap-sass. I'm loading both the bootstrap.css and the bootstrap-responsive.css files, as well as the bootstrap-collaps..

String strip() for JavaScript?

What's a clean and efficient JavaScript implementation to strip leading and trailing spaces from a string? For example: " dog" "dog " " dog " " dog " all get turned into "dog"..

Set value of hidden input with jquery

I'm trying to set the value of the hidden field below using jQuery. <input type="hidden" value="" name="testing" /> I'm using this code: var test = $("input[name=testing]:hidden"); test.valu..

What does "int 0x80" mean in assembly code?

Can someone explain what the following assembly code does? int 0x80 ..

How to write a switch statement in Ruby

How do I write a switch statement in Ruby?..

AJAX cross domain call

I know about AJAX cross-domain policy. So I can't just call "http://www.google.com" over a ajax HTTP request and display the results somewhere on my site. I tried it with dataType "jsonp", that actua..

What is SYSNAME data type in SQL Server?

What is the SQL Server SYSNAME data type for? BOL says: The sysname data type is used for table columns, variables, and stored procedure parameters that store object names. but I don't rea..

Mock functions in Go

I'm puzzled with dependencies. I want to be able to replace some function calls with mock ones. Here's a snippet of my code: func get_page(url string) string { get_dl_slot(url) defer free_dl_s..

Setting up PostgreSQL ODBC on Windows

I have the latest 64 bit version of PostgreSQL. I am running Win 7 64 bit. I had installed the ODBC driver (via the initial installer) when I installed PG, and upgraded it to the latest version from h..

How to get source code of a Windows executable?

I've got some old Windows executable files. How can I edit them with Visual Studio 2010? What are the ways to see an exe's source code?..

Where are shared preferences stored?

Where in an Eclipse project might one encounter a shared preferences file?..

How do I clear this setInterval inside a function?

Normally, I’d set the interval to a variable and then clear it like var the_int = setInterval(); clearInterval(the_int); but for my code to work I put it in an anonymous function: function interval..

Escaping ampersand in URL

I am trying to send a GET message that contains strings with ampersands and can't figure how to escape the ampersand in the URL. Example: http://www.example.com?candy_name=M&M result => candy..

How to perform a mysqldump without a password prompt?

I would like to know the command to perform a mysqldump of a database without the prompt for the password. REASON: I would like to run a cron job, which takes a mysqldump of the database once everyda..

Why is it string.join(list) instead of list.join(string)?

This has always confused me. It seems like this would be nicer: my_list = ["Hello", "world"] print(my_list.join("-")) # Produce: "Hello-world" Than this: my_list = ["Hello", "world"] print("-".joi..

Cookies vs. sessions

I started using PHP a couple of months ago. For the sake of creating a login system for my website, I read about cookies and sessions and their differences (cookies are stored in the user's browser an..

SQL Server : GROUP BY clause to get comma-separated values

Possible Duplicate: SQL group_concat function in SQL Server I am looking to create a query but somehow I am unable to do so. Can anyone please help me out here? The original data ID Re..

extract part of a string using bash/cut/split

I have a string like this: /var/cpanel/users/joebloggs:DNS9=domain.com I need to extract the username (joebloggs) from this string and store it in a variable. The format of the string will always..

Differences between key, superkey, minimal superkey, candidate key and primary key

I'm new to MySQL, and I'm really confused about the different terms that I've encountered. I tried googling the answer but the results are really confusing and when I try and understand it just seems ..

How to get the previous url using PHP

Suppose my site's url is given as hyperlink on some page on the internet; that page could be anything on internet - blog, orkut, yahoo, even stackoverflow etc, and someone clicks on it,and visited my ..

What is The difference between ListBox and ListView

What is the difference between WPF's ListBox and ListView? I can not find any significant difference in their properties. Is there different typical use?..

Open web in new tab Selenium + Python

So I am trying to open websites on new tabs inside my WebDriver. I want to do this, because opening a new WebDriver for each website takes about 3.5secs using PhantomJS, I want more speed... I'm usin..

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 run Pip commands from CMD

As I understand, Python 2.7.9 comes with Pip installed, however when I try to execute a Pip command from CMD (Windows) I get the following error: 'pip' is not recognized as an internal or external c..

C# 4.0: Convert pdf to byte[] and vice versa

How do I convert a pdf file to a byte[] and vice versa? ..

How to auto resize and adjust Form controls with change in resolution

I have noticed that some applications change their controls position to adjust them as much as possible in the resolution as possible, If window is maximized they set themselves in such a way that ove..

Python 3.6 install win32api?

Is there a way to install the win32api module for python 3.6 or do I have to change my version of python? Everytime I try to install it using pip I get the following error: Could not find a version ..

IIS error, Unable to start debugging on the webserver

I want to run my application from IIS on my local machine. I created the virtual directory and added the application to it and in the properties folder of the application I checked the radio button 'U..

Create mysql table directly from CSV file using the CSV Storage engine?

I just learned that MySQL has a native CSV storage engine which stores data in a Comma-Separated-Value file per table. Is it possible to create a table directly from a uploaded CSV file, something li..

How to write html code inside <?php ?>, I want write html code within the PHP script so that it can be echoed from Backend

I want to create table inside php script .. Is there any way that i could create table inside php script.? <?php html code to create table ?> ..

Android, canvas: How do I clear (delete contents of) a canvas (= bitmaps), living in a surfaceView?

In order to make a simple game, I used a template that draws a canvas with bitmaps like this: private void doDraw(Canvas canvas) { for (int i=0;i<8;i++) for (int j=0;j<9;j++) ..

HTML - Display image after selecting filename

I have a form that allows me with <input type="file" name="filename" accept="image/gif, image/jpeg, image/png"> to browse and select a file. What I want to do is display that image immediat..

How can I change NULL to 0 when getting a single value from a SQL function?

I have a query that counts the price of all items between two dates. Here is the select statement: SELECT SUM(Price) AS TotalPrice FROM Inventory WHERE (DateAdded BETWEEN @StartDate AND @EndDate) ..

Visual Studio SignTool.exe Not Found

I have completed an application I have made in Visual Studio 14.0, but when I tried to publish the program, I get an error as Visual Studio cannot find 'SignTool.exe'. I have searched my Hard drive a..

How to track untracked content?

See below the solid line for my original question. I have a folder in my local directory that is untracked. When I run git status, I get: Changed but not updated: modified: vendor/plugins/open_fla..

How to remove specific elements in a numpy array

How can I remove some specific elements from a numpy array? Say I have import numpy as np a = np.array([1,2,3,4,5,6,7,8,9]) I then want to remove 3,4,7 from a. All I know is the index of the value..

Is this the proper way to do boolean test in SQL?

Assume active is a "boolean field" (tiny int, with 0 or 1) # Find all active users select * from users where active # Find all inactive users select * from users where NOT active In words, can t..

Importing Excel files into R, xlsx or xls

Please can someone help me on the best way to import an excel 2007 (.xlsx) file into R. I have tried several methods and none seems to work. I have upgraded to 2.13.1, windows XP, xlsx 0.3.0, I don't ..

Get value from hashmap based on key to JSTL

I want to get the value of HashMap based on key. HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>(); ArrayList<String> arrayList = ne..

Change values of select box of "show 10 entries" of jquery datatable

By default, jquery datatable shows 10 by default and has options : 10,25,50,100 How can I change these options?..

Should I use 'has_key()' or 'in' on Python dicts?

I wonder what is better to do: d = {'a': 1, 'b': 2} 'a' in d True or: d = {'a': 1, 'b': 2} d.has_key('a') True ..

What do *args and **kwargs mean?

What exactly do *args and **kwargs mean? According to the Python documentation, from what it seems, it passes in a tuple of arguments. def foo(hello, *args): print hello for each in args: ..

How to pipe list of files returned by find command to cat to view all the files

I am doing a find and then getting a list of files. How do I pipe it to another utility like cat (so that cat displays the contents of all those files) and basically need to grep something from these ..

How can I determine whether a specific file is open in Windows?

One of my favourite tools for linux is lsof - a real swiss army knife! Today I found myself wondering which programs on a WinXP system had a specific file open. Is there any equivalent utility to lso..

Jersey client: How to add a list as query parameter

I'm creating a Jersey client for a GET service that has a List as query parameter. According to the documentation, it's possible to have a List as a query parameter (this information is also at @Query..

How to get all options in a drop-down list by Selenium WebDriver using C#?

I'm new to both C# and Selenium WebDriver. I know how to select/click on an option in a drop-down list, but I've a problem before that. Since the drop-down list is dynamically generated, I have to g..

null vs empty string in Oracle

Possible Duplicate: Why does Oracle 9i treat an empty string as NULL? I have a table in Oracle 10g named TEMP_TABLE with only two columns - id and description just for the sake of demonstra..

What is the convention in JSON for empty vs. null?

I know that in most programming scenarios, the preference is for empty collections to null collections when there are 0 elements. However, most languages that consume JSON (like JavaScript) will trea..

How to print out all the elements of a List in Java?

I am trying to print out all the elements of a List, however it is printing the pointer of the Object rather than the value. This is my printing code... for(int i=0;i<list.size();i++){ System..

SQL Server: how to create a stored procedure

I'm learning sql from a book and I'm trying to write a stored procedure but I don't believe that I'm doing it correctly. Is the following way not valid in Microsoft SQL? If not, when is it valid, if e..

How to set portrait and landscape media queries in css?

Here is my media query: @media screen and (min-device-width: 768px) and (max-device-width: 1824px) and (orientation : portrait){ .hidden-desktop { display: inherit !important; } .visible-de..

JWT (JSON Web Token) library for Java

I am working on a web application developed using Java and AngularJS and chose to implement token authentication and authorization. For the exercise purpose, I've come to the point where I send the cr..

Check if year is leap year in javascript

function leapYear(year){ var result; year = parseInt(document.getElementById("isYear").value); if (years/400){ result = true } else if(years/100){ result = false ..

Prevent body scrolling but allow overlay scrolling

I've been searching for a "lightbox" type solution that allows this but haven't found one yet (please, suggest if you know of any). The behavior I'm trying to recreate is just like what you'd see at ..

c++ array - expression must have a constant value

I get an error when I try to create an array from the variables I declared. int row = 8; int col= 8; int [row][col]; Why do I get this error: expression must have a constant value. ..

how to show confirmation alert with three buttons 'Yes' 'No' and 'Cancel' as it shows in MS Word

I'm showing a confirmation alert box through JavaScript: function checked() { if (hdnval.toLowerCase() != textbox1.toLowerCase()) { var save = window.confirm('valid') if (save == true) { ..

Windows 7 - Add Path

I need to add a new path (sumatraPDF) on my PATH variable. I don't know why it does not work... I think everything is right but when I try to execute sumatrapdf.exe from CMD it cannot find the program..

Download a file with Android, and showing the progress in a ProgressDialog

I am trying to write a simple application that gets updated. For this I need a simple function that can download a file and show the current progress in a ProgressDialog. I know how to do the Progress..

How to use ArrayList's get() method

I'm new to java (& to OOP too) and I'm trying to understand about the class ArrayList but I don't understand how to use the get(). I tried searching in net, but couldn't find anything helpful...

Wordpress keeps redirecting to install-php after migration

Here's my situation. I have followed the exact instructions on wordpress codex page about moving a site to another server. Here are the step's i have taken. Export a copy of my database Make a new d..

Eclipse Intellisense?

How do I tell Eclipse to automatically make suggestions as I type? I'm looking for a Visual Studio Intellisense-like feature with Resharper. Currently I have to press CTRL+Space each time...

How to check if a socket is connected/disconnected in C#?

How can you check if a network socket (System.Net.Sockets.Socket) is still connected if the other host doesn't send you a packet when it disconnects (e.g. because it disconnected ungracefully)?..

Reading serial data in realtime in Python

I am using a script in Python to collect data from a PIC microcontroller via serial port at 2Mbps. The PIC works with perfect timing at 2Mbps, also the FTDI usb-serial port works great at 2Mbps (both..

Connect Java to a MySQL database

How do you connect to a MySQL database in Java? When I try, I get java.sql.SQLException: No suitable driver found for jdbc:mysql://database/table at java.sql.DriverManager.getConnection(DriverM..

Jquery $(this) Child Selector

I'm using this: jQuery('.class1 a').click( function() { if ($(".class2").is(":hidden")) { $(".class2").slideDown("slow"); } else { $(".class2").slideUp(); } }); On page structure: &l..

Incrementing in C++ - When to use x++ or ++x?

I'm currently learning C++ and I've learned about the incrementation a while ago. I know that you can use "++x" to make the incrementation before and "x++" to do it after. Still, I really don't know ..

Rails 3 execute custom sql query without a model

I need to write a standalone ruby script that is supposed to deal with database. I used code given below in rails 3 @connection = ActiveRecord::Base.establish_connection( :adapter => "mysql2", :ho..

Removing the fragment identifier from AngularJS urls (# symbol)

Is it possible to remove the # symbol from angular.js URLs? I still want to be able to use the browser's back button, etc, when I change the view and will update the URL with params, but I don't want..

The import org.junit cannot be resolved

I need to solve a java problem for an interview, and they have sent me the test class. It starts with import org.junit.Before; and also has the following syntax at places: @RunWith(JUnit4.class) ..

Is there an advantage to use a Synchronized Method instead of a Synchronized Block?

Can any one tell me the advantage of synchronized method over synchronized block with an example?..

How to show code but hide output in RMarkdown?

I want my html file to show the code, but not the output of this chunk: ```{r echo=True, include=FALSE} fun <- function(b) { for(a in b) {print(a) return(a * a)} } y &l..

Connecting client to server using Socket.io

I'm relatively new to node.js and it's addons, so this is probably a beginnersquestion. I'm trying to get a simple HTML page on a webserver connect to a different server running node.js with websocke..

Best way to write to the console in PowerShell

I am having a little confusion about the various ways to print (echo) to the console. I have seen that there are multiple ways to write output to the console, such as: Write-Host "Hello world1" "Hell..

Correct MySQL configuration for Ruby on Rails Database.yml file

I have this configuration: development: adapter: mysql2 encoding: utf8 database: my_db_name username: root password: my_password host: mysql://127.0.0.1:3306 And I am getting this error..

VBoxManage: error: Failed to create the host-only adapter

I am running vagrant 1.4 and virtual box 4.3 on fedora 17 machine. When I do "vagrant up", I get this error: Bringing machine 'default' up with 'virtualbox' provider... ..

How to completely hide the navigation bar in iPhone / HTML5

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

Can't clone a github repo on Linux via HTTPS

I'm trying to do a simple git clone https://github.com/org/project.git on a CentOS box but get: error: The requested URL returned error: 401 while accessing https://github.com/org/project.git/in..

Connecting to Oracle Database through C#?

I need to connect to a Oracle DB (external) through Visual Studio 2010. But I dont want to install Oracle on my machine. In my project I referenced: System.Data.OracleClient. But its not fulfilling t..

Java "user.dir" property - what exactly does it mean?

I want to use user.dir dir as a base dir for my unit tests (that creates a lot of files). Is it correct that this property points to the current working directory (e.g. set by the 'cd' command)?..

Error in file(file, "rt") : cannot open the connection

I'm new to R, and after researching this error extensively, I'm still not able to find a solution for it. Here's the code. I've checked my working directory, and made sure the files are in the right ..

Replace specific text with a redacted version using Python

I am looking to do the opposite of what has been done here: import re text = '1234-5678-9101-1213 1415-1617-1819-hello' re.sub(r"(\d{4}-){3}(?=\d{4})", "XXXX-XXXX-XXXX-", text) output = 'XXXX-XXXX..

How to convert Double to int directly?

May be this is silly question. I want to get rid of the fractional part of the Double number. But I cant do that. It shows the error that incompatible types. What to do? Double to int conversion in o..

Calling Javascript from a html form

I am basing my question and example on Jason's answer in this question I am trying to avoid using an eventListener, and just to call handleClick onsubmit, when the submit button is clicked. Absolute..

When to use the !important property in CSS

Consider: #div p { color: red !important; } ... #div p { color: blue; } I understand how !important works. In this case the div will render red because now it has priority (!important). But..

Why am I getting 'Assembly '*.dll' must be strong signed in order to be marked as a prerequisite.'?

I'm trying to compile my excel addin using C# 4.0, and started to get this problem when building my project in Visual Studio. It's important to tell you that I haven't had this problem before. What co..

How to do a https request with bad certificate?

Say I want to get https://golang.org programatically. Currently golang.org (ssl) has a bad certificate which is issued to *.appspot.com So when I run this: package main import ( "log" "net/h..

What's the difference between "2*2" and "2**2" in Python?

What is the difference between the following codes? code1: var=2**2*3 code2: var2=2*2*3 I see no difference. This raises the following question. Why is the code1 used if we can use code2?..

Laravel Eloquent LEFT JOIN WHERE NULL

I'm trying to use Eloquent to perform the following query during a database seed: SELECT * FROM customers LEFT JOIN orders ON customers.id = orders.customer_id WHERE orders.custom..

Error Code: 1062. Duplicate entry '1' for key 'PRIMARY'

I have a problem on this error message, when i try this: INSERT INTO `PROGETTO`.`UFFICIO-INFORMAZIONI` (`ID`, `viale`, `num_civico`, `data_apertura`, `data_chiusura`, `orario_apertura`, `orario_chi..

Checking if a variable is an integer

Does Rails 3 or Ruby have a built-in way to check if a variable is an integer? For example, 1.is_an_int #=> true "[email protected]".is_an_int #=> false? ..

Window vs Page vs UserControl for WPF navigation?

I am currently writing a desktop application, but I cannot seem to get my head around what to use when redirecting someone to a new section of the application. My options appear to be Window Page U..

How to use multiple LEFT JOINs in SQL?

Is it possible to use multiple left joins in sql query? LEFT JOIN ab ON ab.sht = cd.sht i want to add to attach one more query like this to it? will it work? LEFT JOIN..

How to query for Xml values and attributes from table in SQL Server?

I have a table that contains a Xml column: SELECT * FROM Sqm A sample of the xml data of a row would be: <Sqm version="1.2"> <Metrics> <Metric id="TransactionCleanupThread...

Generate a range of dates using SQL

I have a SQL query that takes a date parameter (if I were to throw it into a function) and I need to run it on every day of the last year. How to generate a list of the last 365 days, so I can use st..

Valid to use <a> (anchor tag) without href attribute?

I've been using Twitter Bootstrap to build a site, and a lot of its functionality depends on wrapping things in <a>, even if they're just going to execute Javascript. I've had problems with the ..

add controls vertically instead of horizontally using flow layout

I am adding checkboxes on JPanel in FlowLayout the checkboxes are being added horizontally. I want to add checkboxes vertically on the Panel. What is the possible solution?..

How to generate Javadoc from command line

Can anybody show me how to generate Javadoc from command line? My project contains the package com.test and I want to put the generated documentation in files located in a specific folder like this: ..

ServletContext.getRequestDispatcher() vs ServletRequest.getRequestDispatcher()

why getRequestDispatcher(String path) of the ServletRequest interface cannot extend outside the current servlet context where as getRequestDispatcher(String path) of the ServletCon..

What does <T> (angle brackets) mean in Java?

I am currently studying Java and have recently been stumped by angle brackets(<>). What exactly do they mean? public class Pool<T>{ public interface PoolFactory<T>{ public ..

LaTeX: remove blank page after a \part or \chapter

How to remove a blank page that gets added automatically after \part{} or \chapter{} in a book document class? I need to add some short text describing the \part. Adding some text after the part comm..

MySQL dump by query

Is it possible to do mysqldump by single SQL query? I mean to dump the whole database, like phpmyadmin does when you do export to SQL..

Disable automatic sorting on the first column when using jQuery DataTables

I'm using jQuery DataTables and I would like to know if there's possible to disable automatic sorting on the first column of the table? My code looks like this: /* Default class modification..

Save multiple sheets to .pdf

I have a reporting spreadsheet that grabs some data from a database and forms three sheets of summary report information. I want to run the spreadsheet automatically from the command line, and have it..

Iterate through <select> options

I have a <select> element in HTML. This element represents a drop down list. I'm trying to understand how to iterate through the options in the <select> element via JQuery. How do I use J..

Changes in import statement python3

I don't understand the following from pep-0404 In Python 3, implicit relative imports within packages are no longer available - only absolute imports and explicit relative imports are supporte..

C++ sorting and keeping track of indexes

Using C++, and hopefully the standard library, I want to sort a sequence of samples in ascending order, but I also want to remember the original indexes of the new samples. For example, I have a set, ..

How to programmatically modify WCF app.config endpoint address setting?

I'd like to programmatically modify my app.config file to set which service file endpoint should be used. What is the best way to do this at runtime? For reference: <endpoint address="http://myd..

How to get current route in Symfony 2?

How do I get the current route in Symfony 2? For example, routing.yml: somePage: pattern: /page/ defaults: { _controller: "AcmeBundle:Test:index" } How can I get this somePage value?..

Automatically capture output of last command into a variable using Bash?

I'd like to be able to use the result of the last executed command in a subsequent command. For example, $ find . -name foo.txt ./home/user/some/directory/foo.txt Now let's say I want to be able to..

Proxy with urllib2

I open urls with: site = urllib2.urlopen('http://google.com') And what I want to do is connect the same way with a proxy I got somewhere telling me: site = urllib2.urlopen('http://google.com', prox..

Remove git mapping in Visual Studio 2015

This question has nothing to do with git itself; rather, it has to do with removing a binding/mapping to a git repository that Visual Studio 2015 (VS2015) has previously seen. Here's a screen shot of..

Android Emulator sdcard push error: Read-only file system

I am developing under Android 1.6 (Android SDK 2.1). I create a avd by using avd manager in Eclipse. When I launch this avd, I found that the /sdcard directory's permisson is "d---------". So I can't ..

Java 8 Stream and operation on arrays

I have just discovered the new Java 8 stream capabilities. Coming from Python, I was wondering if there was now a neat way to do operations on arrays like summing, multiplying two arrays in a "one lin..

Java NIO: What does IOException: Broken pipe mean?

For some of my Java NIO connections, when I have a SocketChannel.write(ByteBuffer) call, it throws an IOException: "Broken pipe". What causes a "broken pipe", and, more importantly, is it possible to..

Avoid trailing zeroes in printf()

I keep stumbling on the format specifiers for the printf() family of functions. What I want is to be able to print a double (or float) with a maximum given number of digits after the decimal point. ..

How to list branches that contain a given commit?

How can I query git to find out which branches contain a given commit? gitk will usually list the branches, unless there are too many, in which case it just says "many (38)" or something like that. I ..

Getting the difference between two repositories

How can we get the difference between two git repositories? The scenario: We have a repo_a and repo_b. The latter was created as a copy of repo_a. There have been parallel development in both the rep..

Updating .class file in jar

I want to update a .class file in a jar with a new one. What is the easiest way to do it, especially in the Eclipse IDE?..

How do I create a new line in Javascript?

var i; for(i=10; i>=0; i= i-1){ var s; for(s=0; s<i; s = s+1){ document.write("*"); } //i want this to print a new line /document.write(?); } I am printing a pyramid of sta..

Python conditional assignment operator

Does a Python equivalent to the Ruby ||= operator ("set the variable if the variable is not set") exist? Example in Ruby : variable_not_set ||= 'bla bla' variable_not_set == 'bla bla' variable_s..

ORA-12528: TNS Listener: all appropriate instances are blocking new connections. Instance "CLRExtProc", status UNKNOWN

I'm getting this error if i try to login as db user. If lsnrctl status is run i get the below error. DB was working fine all these years and stopped working suddenly. Connecting to (DESCRIPTION=(ADDR..

How to read an http input stream

The code pasted below was taken from java docs on HttpURLConnection. I get the following error: readStream(in) as there is no such method. I see this same thing in the Class Overview for URLC..

Adding hours to JavaScript Date object?

It amazes me that JavaScript's Date object does not implement an add function of any kind. I simply want a function that can do this: var now = Date.now(); var fourHoursLater = now.addHours(4); fun..

How can I see what I am about to push with git?

Is there a way to see what would be pushed if I did a git push command? What I'm picturing is something like the "Files Changed" tab of Github's "pull request" feature. When I issue a pull request, I..

There was no endpoint listening at (url) that could accept the message

I'm building an ASP.NET website - it's a solution with a few projects, a data base and a web service. Everything worked fine, but last time I tried to run the project, I got the following error: Ther..

How to declare or mark a Java method as deprecated?

I would like to make one of my methods "deprecated" = not used anymore. But still I would like to have it in my API. I just want to show "warning" to anyone using that method. How can I achieve that..

export html table to csv

I am trying to add a feature of csv download option in my website. It should convert the html table present in the website in to csv content and make it downloadable. Ive been searching through intern..

How to POST raw whole JSON in the body of a Retrofit request?

This question may have been asked before but no it was not definitively answered. How exactly does one post raw whole JSON inside the body of a Retrofit request? See similar question here. Or is this..

Excel how to find values in 1 column exist in the range of values in another

I have two columns- column A which extends upto 11027(values) and column I which extends to 42000(values).Both the columns contains some code details. Something like this A B q123 ..

Should a function have only one return statement?

Are there good reasons why it's a better practice to have only one return statement in a function? Or is it okay to return from a function as soon as it is logically correct to do so, meaning there ..

Javamail Could not convert socket to TLS GMail

I am trying to send an email using JavaMail through gmails SMTP Server. however this code. final String username = "[email protected]"; final String password = "mygmailpassword"; Properties ..

Gradle: How to Display Test Results in the Console in Real Time?

I would like to see test results ( system.out/err, log messages from components being tested ) as they run in the same console I run: gradle test And not wait until tests are done to look at the te..

Creating a .dll file in C#.Net

I had created a project which is C# console application project for which I need to call this project dll in another windows application project. I had built the project in visual studio 2010 and chec..

Running Java Program from Command Line Linux

I am not very experience with java and this is driving me crazy. I wrote a java program FileManagement and I need to run it from the command line. I can compile it from the command line with javac Fi..

Find and replace string values in list

I got this list: words = ['how', 'much', 'is[br]', 'the', 'fish[br]', 'no', 'really'] What I would like is to replace [br] with some fantastic value similar to &lt;br /&gt; and thus getting..

Could not load file or assembly 'System.Web.Http 4.0.0 after update from 2012 to 2013

I did the upgrade according to. http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2 I get the error. Does any one else got this er..

Set a cookie to HttpOnly via Javascript

I have a cookie that is NOT HttpOnly Can I set this cookie to HttpOnly via JavaScript?..

Round up value to nearest whole number in SQL UPDATE

I'm running SQL that needs rounding up the value to the nearest whole number. What I need is 45.01 rounds up to 46. Also 45.49 rounds to 46. And 45.99 rounds up to 46, too. I want everything up one w..

How to convert DateTime to a number with a precision greater than days in T-SQL?

Both queries below translates to the same number SELECT CONVERT(bigint,CONVERT(datetime,'2009-06-15 15:00:00')) SELECT CAST(CONVERT(datetime,'2009-06-15 23:01:00') as bigint) Result 39978 39978 ..

Detect if value is number in MySQL

Is there a way to detect if a value is a number in a MySQL query? Such as SELECT * FROM myTable WHERE isANumber(col1) = true ..

The server response was: 5.7.0 Must issue a STARTTLS command first. i16sm1806350pag.18 - gsmtp

I am trying to send mail using gmail, and I am getting an exception that is The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue ..

SSIS Excel Connection Manager failed to Connect to the Source

I have a server that is capable of creating and running an Excel Import task using the Import Wizard. I am trying to automate that process by using a visual Studio 2010 Integration Services package, t..

What causes the error "_pickle.UnpicklingError: invalid load key, ' '."?

I'm trying to storage 5000 data elements on an array. This 5000 elements are storage on an existent file (therefore it's not empty). But I'm getting an error and I don't know what is causing it. I..

Best way to get user GPS location in background in Android

In my android app i want to get user current location every few minute interval and update in to my center server using web service. Currently i am using Fused Location Provide for get user current lo..

How to show all privileges from a user in oracle?

Can someone please tell me how to show all privileges/rules from a specific user in the sql-console?..

Application_Start not firing?

I have an ASP.NET MVC (beta) application that I'm working on, and am having trouble figuring out if I'm doing something wrong, or if my Application_Start method in Global.asax.cs is in fact not firing..

Hidden Features of Xcode

With a huge influx of newbies to Xcode, I'm sure there are lots of Xcode tips and tricks to be shared. What are yours? ..

How to write a JSON file in C#?

I need to write the following data into a text file using JSON format in C#. The brackets are important for it to be valid JSON format. [ { "Id": 1, "SSN": 123, "Message": "whatever" ..

How can I set the initial value of Select2 when using AJAX?

I have a select2 v4.0.0 being populated from an Ajax array. If I set the val of the select2 I can see via javascript debugging that it has selected the correct item (#3 in my case), however this is no..

How do synchronized static methods work in Java and can I use it for loading Hibernate entities?

If I have a util class with static methods that will call Hibernate functions to accomplish basic data access. I am wondering if making the method synchronized is the right approach to ensure thread-s..

Playing HTML5 video on fullscreen in android webview

Well, I've been searching few days already, how to display HTML5 video in full-screen mode on android WebView. I managed to play HTML5 videos on my webview. Problems are arising when displaying video..

Error : getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443

I am working on a corporate network. Trying to install npm. But I'm getting this error again and again. $ npm install npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe..

show dbs gives "Not Authorized to execute command" error

I've spent some time trying to figure out what is wrong but as I could not find out, I decided to ask here. I am running MongoDB(Windows 64-bit 2008 R2+) version 3.2.3 on Windows 8, the paths are : ..

How do I access Configuration in any class in ASP.NET Core?

I have gone through configuration documentation on ASP.NET core. Documentation says you can access configuration from anywhere in the application. Below is Startup.cs created by template public clas..

What do two question marks together mean in C#?

Ran across this line of code: FormsAuth = formsAuth ?? new FormsAuthenticationWrapper(); What do the two question marks mean, is it some kind of ternary operator? It's hard to look up in Google...

How to add/update child entities when updating a parent entity in EF

The two entities are one-to-many relationship (built by code first fluent api). public class Parent { public Parent() { this.Children = new List<Child>(); } public int ..

Prevent any form of page refresh using jQuery/Javascript

Once the user is on my page, I do not want him to refresh the page. Anytime, the user hits F5 or refresh button on top. He should get an alert saying You cannot refresh the page. Also if the user ..

Primefaces valueChangeListener or <p:ajax listener not firing for p:selectOneMenu

I am using Primefaces 3.4.2. I have the following in my JSF page <p:selectOneMenu id="emp" value="#{mymb.emp.employeeName}" valueChangeListener="#{mymb.handleChange}" required="..

Removing html5 required attribute with jQuery

Hi I would like to remove the 'required=""' attribute with jquery. <input type="text" id="edit-submitted-first-name" name="submitted[first_name]" value="" size="30" maxleng..

How to click an element in Selenium WebDriver using JavaScript

I have the following HTML: <button name="btnG" class="gbqfb" aria-label="Google Search" id="gbqfb"><span class="gbqfi"></span></button> My following code for clicking "Googl..

Postgres: SQL to list table foreign keys

Is there a way using SQL to list all foreign keys for a given table? I know the table name / schema and I can plug that in...

Creating a script for a Telnet session?

Does anyone know of an easy way to create a script that can connect to a telnet server, do some usual telnet stuff, and then log off? I am dealing with users who are not familiar with telnet and the ..

How to avoid precompiled headers

I am trying to compile a simple VS program in C++ as an assignment for class. We only ever include <iostream> and I keep getting this error: 1>Assignment.cpp(15): fatal error C1010: unexpect..

How to use if statements in underscore.js templates?

I'm using the underscore.js templating function and have done a template like this: <script type="text/template" id="gridItem"> <div class="griditem <%= gridType %> <%= gridSiz..

How can I see CakePHP's SQL dump in the controller?

Is there a way that one can cause CakePHP to dump its SQL log on demand? I'd like to execute code up until a point in my controller and see what SQL has been run...

Given URL is not allowed by the Application configuration

I am trying to create facebook sign-in page according to this tutorial. I only changed the two lines appId : '370675846382420', // App ID channelUrl : '//http://bp.php5.cz/channel.html', // Cha..

How do I get the path of the current executed file in Python?

This may seem like a newbie question, but it is not. Some common approaches don't work in all cases: sys.argv[0] This means using path = os.path.abspath(os.path.dirname(sys.argv[0])), but this does ..