Questions Tagged with #Dbm

DBM is a simple UNIX database format. It uses a key-value storage and hashing for fast retrieval of the data by key.

Why does C++ code for testing the Collatz conjecture run faster than hand-written assembly?

I wrote these two solutions for Project Euler Q14, in assembly and in C++. They implement identical brute force approach for testing the Collatz conjecture. The assembly solution was assembled with: n..

java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

I have Hadoop 2.7.1 and apache-hive-1.2.1 versions installed on ubuntu 14.0. Why this error is occurring ? Is any metastore installation required? When we typing hive command on terminal how the xm..

How to view the roles and permissions granted to any database user in Azure SQL server instance?

Could you guide me on how to view the current roles/permissions granted to any database user in Azure SQL Database or in general for a MSSQL Server instance? I have this below query: SELECT r.name..

EntityType 'IdentityUserLogin' has no key defined. Define the key for this EntityType

I am working with Entity Framework Code First and MVC 5. When I created my application with Individual User Accounts Authentication I was given an Account controller and along with it all the required..

Spring Boot Multiple Datasource

I'm quite new to spring boot and I'd like to create a multiple datasource for my project. Here is my current case. I have two packages for entity for multiple database. Let's say com.test.entity.db.m..

There is already an object named in the database

Update-Database failed from Package Manager Console. I've used Entity Framework 6.x and code-first approach. Error is "There is already an object named 'AboutUs' in the database." How can I solve th..

How to turn off INFO logging in Spark?

I installed Spark using the AWS EC2 guide and I can launch the program fine using the bin/pyspark script to get to the spark prompt and can also do the Quick Start quide successfully. However, I cann..

PLS-00201 - identifier must be declared

I executed a PL/SQL script that created the following table TABLE_NAME VARCHAR2(30) := 'B2BOWNER.SSC_Page_Map'; I made an insert function for this table using arguments CREATE OR REPLACE FUNCTION..

Entity Framework 6 GUID as primary key: Cannot insert the value NULL into column 'Id', table 'FileStore'; column does not allow nulls

I have an entity with primary key "Id" which is Guid: public class FileStore { public Guid Id { get; set; } public string Name { get; set; } public string Path { get; set; } } And some ..

web-api POST body object always null

I'm still learning web API, so pardon me if my question sounds stupid. I have this in my StudentController: public HttpResponseMessage PostStudent([FromBody]Models.Student student) { if (DBManag..

Default Values to Stored Procedure in Oracle

I have a stored procedure as follows. CREATE OR REPLACE PROCEDURE TEST( X IN VARCHAR2 DEFAULT 'P', Y IN NUMBER DEFAULT 1) AS BEGIN DBMS_OUTPUT.PUT_LINE('X'|| X||'--'||'Y'||Y); END; ..

How to call Oracle MD5 hash function?

I have below code. I am using Oracle 11g. SELECT DBMS_OBFUSCATION_TOOLKIT.md5 (input => UTL_RAW.cast_to_raw( FIRST_NAME ||LAST_NAME )) md5_key , FIRST_NAME , LAST_NAME FROM C_NAME_TAB WH..

The model backing the 'ApplicationDbContext' context has changed since the database was created

First of all, I have not seen this error anywhere else and I guess it's not a replicate so please read the whole situation first. Everything was working just fine then I tried to update one of my mod..

Entity Framework code-first: migration fails with update-database, forces unneccessary(?) add-migration

I have a funny effect using migration (EF 5.0) and code-first: I created some models with GUID primary keys. (BTW: It is important for me, that SQL Server uses NEWSEQUENTIALID(), which seems to be th..

PLS-00103: Encountered the symbol when expecting one of the following:

It seems ok but am getting exception please correct me. declare var_number number; begin var_number := 10; if var_number > 100 then dbms_output.put_line(var_number||' is grea..

PLS-00103: Encountered the symbol "CREATE"

What is the problem with this package as it is giving an error? CREATE OR REPLACE PACKAGE PKG_SHOW_CUST_DETAILS AS PROCEDURE SHOW_CUST_DETAILS( myArg VARCHAR2); END PKG_SHOW_CUST_DETAILS; CREAT..

How to run a stored procedure in oracle sql developer?

I'm trying to run this stored procedure DECLARE P_TICKER_SERIAL VARCHAR2(200); P_SECTOR_CODE VARCHAR2(200); P_SOURCE_ID VARCHAR2(200); P_COUNTRY_CODE VARCHAR2(200); P_FILTER_TYPE ..

GROUP BY without aggregate function

I am trying to understand GROUP BY (new to oracle dbms) without aggregate function. How does it operate? Here is what i have tried. EMP table on which i will run my SQL. SELECT ename , sal FROM emp G..

Stored Procedure error ORA-06550

I'm getting compile errors with this code using sqlplus. My errors are: Warning: Procedure created with compilation errors. BEGIN point_triangle; END; Error at line 1: ORA-06550: Line 1..

PL/SQL ORA-01422: exact fetch returns more than requested number of rows

I get keep getting this error I can't figure out what is wrong. DECLARE * ERROR at line 1: ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at line 11 Here is..

ORA-06508: PL/SQL: could not find program unit being called

I am using oracle 10g and toad 11.5. I am trying to call an api from an anonymous block. If I recompile the api after adding dbms_output.put_line and then try to execute the anonymous block, it shows ..

How do I configure php to enable pdo and include mysqli on CentOS?

PHP Version 5.3.3 on CentOS (x86_64, RHEL 6) Apparently my PHP installation was configured to exclude Mysqli and disable PDO for some reason. Therefore, I believe this is what's causing them to not w..

ORA-06502: PL/SQL: numeric or value error: character string buffer too small

I tried the following code different ways, like by taking out the while or the if, but when I put both together (if and while), I always get the error at the end... undefine numero set serveroutput o..

What is the difference between DBMS and RDBMS?

After reading some answers on different websites I am confused now. So, it would be helpful to mention the key difference between DBMS and RDBMS and any relation between them...

The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32'

I am building My first MVC application, I have a table in database containing 3 columns: Id ? primary key Username password When I am clicking on edit link edit a record, its throwing following ex..

What is meaning of negative dbm in signal strength?

When we try to get nearby cells and their LAC, MNC, signal (and while using other android apps) we are getting signal as negative value (like -85dbm). How should I take this? Should I ignore -ve sign..

Search for a particular string in Oracle clob column

How to get a particular string from a clob column? I have data as below which is stored in clob column called product_details CALCULATION=[N]NEW.PRODUCT_NO=[T9856] OLD.PRODUCT_NO=[T9852].... -- wit..

List all liquibase sql types

I try to find documentation on the supported types that can be used in change log files. But cannot find it. Is there any document, site or something similar where I can find all types-specific issues..

How to increase dbms_output buffer?

I tried to debug my dynamic query via dbms_output but seems like the query string is too long for dbms_output buffer. I got : ORA-06502: PL/SQL: numeric or value error: character string buffer too ..

Foreach in a Foreach in MVC View

BIG EDIT : I have edited my full post with the answer that I came up with the help of Von V and Johannes, A BIG THANK YOU GUYS !!!! I've been trying to do a foreach loop inside a foreach loop in my i..

postgresql port confusion 5433 or 5432?

I have installed postgresql on OSX. When I run psql, I get $ psql psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix ..

Entity Framework Provider type could not be loaded?

I am trying to run my tests on TeamCity which is currently installed on my machine. System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlPr..

ORACLE: Updating multiple columns at once

I am trying to update two columns using the same update statement can it be done? IF V_COUNT = 9 THEN UPDATE INVOICE SET INV_DISCOUNT = DISC3 * INV_SUBTOTAL , INV_TOTA..

IF EXISTS condition not working with PLSQL

I am trying to print the TEXT when condition is TRUE. The select code is perfectly working fine. It's showing 403 value when i only run select code. But I have to print some text when condition exists..

set serveroutput on in oracle procedure

I've created a simple procedure. In this procedure i want to output some data. However where ever i put set serveroutput on it says Error(26,5): PLS-00103: Encountered the symbol "SERVEROUTPUT..

Oracle: Call stored procedure inside the package

I'm not much in Oracle. I use PL/SQL Developer. I have the following package: create or replace package PKG1 as procedure INIT ( nRN in number, nREC_TYPE in..

How to convert CLOB to VARCHAR2 inside oracle pl/sql

I have a clob variable, need to assign it to varchar2 variable. The data inside clob var is less than 4000 (i..e varchar2's maxsize) oracle10+ I tried report_len := length(report_clob); report..

How to SELECT in Oracle using a DBLINK located in a different schema?

We have an Oracle DBMS (11g) and the following configuration: A DB user "MYUSER" Two schemas "MYUSER" and "SCHEMA_B" User "MYUSER" can access "SCHEMA_B" and has READ permissions on its tables A publ..

INSERT and UPDATE a record using cursors in oracle

I have 2 tables- student and studLoad both having 2 fields studID and studName. I want to load data from student table into stuLoad table. If the data already exists in the studLoad table, then it sho..

How to refresh materialized view in oracle

Iam trying to refresh the materialized view by using: DBMS_MVIEW.REFRESH('v_materialized_foo_tbl') But it's throwing invalid sql statement. Then I have created a stored procedure like this: CREA..

Can we use join for two different database tables?

Can we use the join operation for two tables from different databases? If yes, how do I do it? Both databases are on the same server and DBMS is the same...

How do I print output in new line in PL/SQL?

How do I print a new line in PL/SQL? I'm after something similar to '\n' in the C language. Example: begin dbms_output.put_line('Hi, good morning friends'); end; I need the output is like th..

PL/SQL, how to escape single quote in a string?

In the Oracle PL/SQL, how to escape single quote in a string ? I tried this way, it doesn't work. declare stmt varchar2(2000); begin for i in 1021 .. 6020 loop stmt := 'insert into MY_TBL ..

How to calculate distance from Wifi router using Signal Strength?

I would like to calculate the exact location of a mobile device inside a building ( so no GPS access) I want to do this using the signal strength(in dBm) of at least 3 fixed wifi signals(3 fixed rout..

Error message "Forbidden You don't have permission to access / on this server"

I have configured my Apache by myself and have tried to load phpMyAdmin on a virtual host, but I received: 403 Forbidden You don't have permission to access / on this server My httpd.conf # #..

DBMS_OUTPUT.PUT_LINE not printing

When executing the following code, it just says the procedure is completed and doesn't print the infomation i want it to (firstName, lastName) and then the other values from the select query in a tabl..

Java - Convert image to Base64

I'm having a problem while converting a gif image to a base 64 string. When I converts it, the code adds me like 100,000 AAAAAA whereas the image is really small! Here is my code: import java.io.Bu..

Calling a stored procedure in Oracle with IN and OUT parameters

I have this procedure: CREATE OR REPLACE PROCEDURE PROC1(invoicenr IN NUMBER, amnt OUT NUMBER) AS BEGIN SELECT AMOUNT INTO amnt FROM INVOICE WHERE INVOICE_NR = invoicenr; END; So when I run it like..

ORA-01747: invalid user.table.column, table.column, or column specification

Get the above error when the execute immediate is called in a loop Update CustomersPriceGroups set 1AO00=:disc Where cuno=:cuno Parameters: disc=66 cuno=000974 Update CustomersPriceGroups set..

auto increment ID in H2 database

Is there a way to have an auto_incrementing BIGINT ID for a table. It can be defined like so id bigint auto_increment but that has no effect (it does not increment automatically). I would like to i..

How to retrieve the current version of a MySQL database management system (DBMS)?

What command returns the current version of a MySQL database?..

Computed / calculated / virtual / derived columns in PostgreSQL

Does PostgreSQL support computed / calculated columns, like MS SQL Server? I can't find anything in the docs, but as this feature is included in many other DBMSs I thought I might be missing somethin..

dropping a global temporary table

2 Separate questions. I am using this script to drop a table [SOLVED] BEGIN EXECUTE IMMEDIATE 'DROP TABLE_NAME'; DBMS_OUTPUT.PUT_LINE ('Global table TABLE_NAME Dropped'); EXCEPTION ..

Printing the value of a variable in SQL Developer

I wanted to print the value of a particular variable which is inside an anonymous block. I am using Oracle SQL Developer. I tried using dbms_output.put_line. But it is not working. The code which I am..

No more data to read from socket error

We are using Oracle as the database for our Web application. The application runs well most of the time, but we get this "No more data to read from socket" error. Caused by: java.sql.SQLRecoverableEx..

Oracle PL/SQL string compare issue

I have the following Oracle PL/SQL codes that may be rusty from you guys perspective: DECLARE str1 varchar2(4000); str2 varchar2(4000); BEGIN str1:=''; str2:='sdd'; IF(str1<>str..

SQL: how to select a single id ("row") that meets multiple criteria from a single column

I have a very narrow table: user_id, ancestry. The user_id column is self explanatory. The ancestry column contains the country from where the user's ancestors hail. A user can have multiple rows o..

Convert a SQL query result table to an HTML table for email

I am running a SQL query that returns a table of results. I want to send the table in an email using dbo.sp_send_dbMail. Is there a straightforward way within SQL to turn a table into an HTML table? ..

How to fix the datetime2 out-of-range conversion error using DbContext and SetInitializer?

I'm using the DbContext and Code First APIs introduced with Entity Framework 4.1. The data model uses basic data types such as string and DateTime. The only data annotation I'm using in some cases is..

Oracle PL/SQL - Raise User-Defined Exception With Custom SQLERRM

Is it possible to create user-defined exceptions and be able to change the SQLERRM? For example: DECLARE ex_custom EXCEPTION; BEGIN RAISE ex_custom; EXCEPTION WHEN ex_custom THEN ..

Inserting into Oracle and retrieving the generated sequence ID

I have a handful of raw SQL queries for SQL Server which use SCOPE_IDENTITY to retrieve the generated ID for a specific INSERT immediately after that INSERT occurs all in one execution… INSERT into..

make: *** [ ] Error 1 error

I am trying to compile a Pro*C file on gcc and I am getting this error : make: *** [MedLib_x.o] Error 1 This is the command printed by make: /usr/bin/gcc -g -fPIC -m64 -DSS_64BIT_SERVER -I/hom..

What is it exactly a BLOB in a DBMS context

What is it a BLOB? How can I use it? What are the differences between DBMS's BLOBs. I would like to save data using BLOBs into any DBMS and then read that BLOB with a library. ..

What is the difference between a Relational and Non-Relational Database?

I know that solutions like MySQL, PostgreSQL and MS SQL Server are relational database systems, and NoSQL, MongoDB, etc. are Non-Relational DBMS. However, what are the differences between the two typ..

Arithmetic operation resulted in an overflow. (Adding integers)

I can't understand this error: In this call to method SetVolume, Volume = 2055786000 and size = 93552000. Volume is an Integer property, and size is also Integer, as you can see. The class is a pa..

Set a DateTime database field to "Now"

In VB.net code, I create requests with SQL parameters. It I set a DateTime parameter to the value DateTime.Now, what will my request look like ? UPDATE table SET date = "2010/12/20 10:25:00"; or U..

Android: How to rotate a bitmap on a center point

I've been looking for over a day for a solution to this problem but nothing helps, even the answers here. Documentation doesn't explain anything too. I am simply trying to get a rotation in the direc..

NoSql vs Relational database

Recently NoSQL has gained immense popularity. What are the advantages of NoSQL over traditional RDBMS?..

How to use a variable from a cursor in the select statement of another cursor in pl/sql

I want to run a query, get the results and then iterate through the results of that query with another select statement using the values of the first statement in my 2nd statement (cursor). I have 40..

What are the options for storing hierarchical data in a relational database?

Good Overviews Generally speaking, you're making a decision between fast read times (for example, nested set) or fast write times (adjacency list). Usually, you end up with a combination of the optio..

Oracle "(+)" Operator

I am checking some old SQL Statements for the purpose of documenting them and probably enhancing them. The DBMS is Oracle I did not understand a statement which read like this: select ... from a,b ..

How to Store Historical Data

Some co-workers and I got into a debate on the best way to store historical data. Currently, for some systems, I use a separate table to store historical data, and I keep an original table for the cu..

How to query a CLOB column in Oracle

I'm trying to run a query that has a few columns that are a CLOB datatype. If i run the query like normal, all of those fields just have (CLOB) as the value. I tried using DBMS_LOB.substr(column) and..

The model backing the <Database> context has changed since the database was created

The error message : "The model backing the 'AddressBook' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an ID..

'profile name is not valid' error when executing the sp_send_dbmail command

I have a windows account with users group and trying to exec sp_send_dbmail but getting an error: profile name is not valid. However, when I logged in as administrator and execute the sp_send_dbmail..

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

What is the difference between a database and a data warehouse?

What is the difference between a database and a data warehouse? Aren't they the same thing, or at least written in the same thing (ie. Oracle RDBMS)?..

Call a stored procedure with another in Oracle

Does anyone know of a way, or even if its possible, to call a stored procedure from within another? If so, how would you do it? Here is my test code: SET SERVEROUTPUT ON; DROP PROCEDURE test_sp_1; ..

Infinite Recursion with Jackson JSON and Hibernate JPA issue

When trying to convert a JPA object that has a bi-directional association into JSON, I keep getting org.codehaus.jackson.map.JsonMappingException: Infinite recursion (StackOverflowError) All I fou..

Print debugging info from stored procedure in MySQL

Is there a way in MySQL to print debugging messages to stdout, temptable or logfile? Something like: print in SQLServer DBMS_OUTPUT.PUT_LINE in Oracle ..

Is there a combination of "LIKE" and "IN" in SQL?

In SQL I (sadly) often have to use "LIKE" conditions due to databases that violate nearly every rule of normalization. I can't change that right now. But that's irrelevant to the question. Further, I..

Login failed for user 'DOMAIN\MACHINENAME$'

I know this is almost a duplicate of : The error "Login failed for user 'NT AUTHORITY\IUSR'" in ASP.NET and SQL Server 2008 and Login failed for user 'username' - System.Data..

Sleep function in ORACLE

I need execute an SQL query in ORACLE it takes a certain amount of time. So I wrote this function: CREATE OR REPLACE FUNCTION MYSCHEMA.TEST_SLEEP ( TIME_ IN NUMBER ) RETURN INTEGER IS BEGIN DB..

dbms_lob.getlength() vs. length() to find blob size in oracle

I'm getting the same results from select length(column_name) from table as select dbms_lob.getlength(column_name) from table However, the answers to this question seem to favor using dbms_lob.g..

How do I get column datatype in Oracle with PL-SQL with low privileges?

I have "read only" access to a few tables in an Oracle database. I need to get schema information on some of the columns. I'd like to use something analogous to MS SQL's sp_help. I see the table I'm..

Why is a "GRANT USAGE" created the first time I grant a user privileges?

I'm new to the admin side of DBMS and was setting up a new database tonight (using MySQL) when I noticed this. After granting a user a privilege for the first time, another grant is created that looks..

How to execute an oracle stored procedure?

I am using oracle 10g express edition. It has a nice ui for db developers. But i am facing some problems executing stored procedures. Procedure: create or replace procedure temp_proc is begin DBM..

Oracle's default date format is YYYY-MM-DD, WHY?

Oracle's default date format is YYYY-MM-DD. Which means if I do: select some_date from some_table ...I lose the time portion of my date. Yes, I know you can "fix" this with: alter session set ..

How to get size in bytes of a CLOB column in Oracle?

How do I get the size in bytes of a CLOB column in Oracle? LENGTH() and DBMS_LOB.getLength() both return number of characters used in the CLOB but I need to know how many bytes are used (I'm dealing ..

What are the different types of keys in RDBMS?

What are the different types of keys in RDBMS? Please include examples with your answer...

Selecting Values from Oracle Table Variable / Array?

Following on from my last question (Table Variables in Oracle PL/SQL?)... Once you have values in an array/table, how do you get them back out again? Preferably using a select statement or something..

Generating Random Number In Each Row In Oracle Query

I want to select all rows of a table followed by a random number between 1 to 9: select t.*, (select dbms_random.value(1,9) num from dual) as RandomNumber from myTable t But the random number is th..

When to use MongoDB or other document oriented database systems?

We offer a platform for video- and audio-clips, photos and vector-grafics. We started with MySQL as the database backend and recently included MongoDB for storing all meta-information of the files, be..

How to redirect the output of DBMS_OUTPUT.PUT_LINE to a file?

I need to debug in pl/sql to figure times of procedures, I want to use: SELECT systimestamp FROM dual INTO time_db; DBMS_OUTPUT.PUT_LINE('time before procedure ' || time_db); but I don't understand..

Password Protect a SQLite DB. Is it possible?

I have to face a new little project. It will have about 7 or 9 tables, the biggest of them will grow by a max rate of 1000 rows a month. I thought about SQLite as my db... But i will need to protect ..

How can I check if a View exists in a Database?

I have some SQL code that needs to be executed if a certain View exists in a database. How would I go about checking if the View exists? EDIT: The DBMS being used is Microsoft SQL Server..

what is the difference between GROUP BY and ORDER BY in sql

When do you use which in general? Examples are highly encouraged! I am referring so MySql, but can't imagine the concept being different on another DBMS..

PL/SQL block problem: No data found error

SET SERVEROUTPUT ON DECLARE v_student_id NUMBER := &sv_student_id; v_section_id NUMBER := 89; v_final_grade NUMBER; v_letter_grade CHAR(1); BEGIN SELECT final_grade INTO v_..

SQL query to get most recent row for each instance of a given key

I'm trying to get the ip, user, and most recent timestamp from a table which may contain both the current ip for a user and one or more prior ips. I'd like one row for each user containing the most re..

What is the difference between a hash join and a merge join (Oracle RDBMS )?

What are the performance gains/losses between hash joins and merge joins, specifically in Oracle RDBMS?..

How do I update a Linq to SQL dbml file?

How do I update a Linq to SQL .dbml file?..

What is the best free SQL GUI for Linux for various DBMS systems

As I make the full switch from Windows to Linux (CentOS 5) I'm in search of the best free GUI SQL Client tool for MSSQL, MySQL, Oracle, etc... any suggestions? I've tried DBVisualizer (The best bet s..

LIMIT 10..20 in SQL Server

I'm trying to do something like : SELECT * FROM table LIMIT 10,20 or SELECT * FROM table LIMIT 10 OFFSET 10 but using SQL Server The only solution I found looks like overkill: SELECT * FROM ( ..

What are the performance characteristics of sqlite with very large database files?

2020 update, about 11 years after the question was posted and later closed, preventing newer answers. Almost everything written here is obsolete. Once upon a time sqlite was limited to the memory capa..

Why can't I shrink a transaction log file, even after backup?

I have a database that has a 28gig transaction log file. Recovery mode is simple. I just took a full backup of the database, and then ran both: backup log dbmcms with truncate_only DBCC SHRINKFIL..

PostgreSQL - fetch the row which has the Max value for a column

I'm dealing with a Postgres table (called "lives") that contains records with columns for time_stamp, usr_id, transaction_id, and lives_remaining. I need a query that will give me the most recent live..

Java Embedded Databases Comparison

I intend to develop a small (Java) application for managing my finances. I believe I need to use an embedded database, but I have no experience regarding this issue. I tried to look at some of the ava..

Print text in Oracle SQL Developer SQL Worksheet window

I am using Oracle SQL (in SQLDeveloper, using the SQL Worksheet). I would like to print a statement before my select, such as PRINT 'Querying Table1'; SELECT * from Table1; What do I use to Print ..

What is the most efficient/elegant way to parse a flat table into a tree?

Assume you have a flat table that stores an ordered tree hierarchy: Id Name ParentId Order 1 'Node 1' 0 10 2 'Node 1.1' 1 10 3 'Node 2' 0..

Skip first couple of lines while reading lines in Python file

I want to skip the first 17 lines while reading a text file. Let's say the file looks like: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 good stuff I just want the good stuff. What I'm doing is a lot more co..

How can I find the number of days between two Date objects in Ruby?

How can I find the number of days between two Date objects?..

How to use group by with union in t-sql

How can I using group by with union in t-sql? I want to group by the first column of a result of union, I wrote the following sql but it doesn't work. I just don't know how to reference the specified ..

Show special characters in Unix while using 'less' Command

I would like to know how to view special characters while using 'less' command. For instance I want to see the non-printable characters with a special notation. For instance in 'vi' editor I use "se..

What is context in _.each(list, iterator, [context])?

I am new to underscore.js. What is the purpose of [context] in _.each()? How should it be used?..

how to implement regions/code collapse in javascript

How can you implement regions a.k.a. code collapse for JavaScript in Visual Studio? If there are hundreds of lines in javascript, it'll be more understandable using code folding with regions as in vb..

How to clear/remove observable bindings in Knockout.js?

I'm building functionality onto a webpage which the user can perform multiple times. Through the user's action, an object/model is created and applied to HTML using ko.applyBindings(). The data-bound..

Embed HTML5 YouTube video without iframe?

Is it possible to embed an html5 version of a youtube video without using an iframe?..

How to access to the parent object in c#

I have a "meter" class. One property of "meter" is another class called "production". I need to access to a property of meter class (power rating) from production class by reference. The powerRating i..

python pandas extract year from datetime: df['year'] = df['date'].year is not working

I import a dataframe via read_csv, but for some reason can't extract the year or month from the series df['date'], trying that gives AttributeError: 'Series' object has no attribute 'year': date Co..

Is there a better way to iterate over two lists, getting one element from each list for each iteration?

I have a list of Latitudes and one of Longitudes and need to iterate over the latitude and longitude pairs. Is it better to: A. Assume that the lists are of equal lengths: for i in range(len(Latit..

Node - how to run app.js?

I am very new to Node.js and I tried to run a project (made by other developer) by having a command in terminal node app.js. But I encountered below error, do you have any idea how to run this project..

Initialize/reset struct to zero/null

struct x { char a[10]; char b[20]; int i; char *c; char *d[10]; }; I am filling this struct and then using the values. On the next iteration, I want to reset all the fields to 0 ..

How to exit in Node.js

What is the command that is used to exit? (i.e terminate the Node.js process)..

Insert image after each list item

What would be the best way to insert a small image after each list element? I tried it with a pseudo class but something is not right... ul li a:after { display: block; width: 3px; height: 5px;..

Definition of int64_t

I am new to C/C++, so I have a couple of questions about a basic type: a) Can you explain to me the difference between int64_t and long (long int)? In my understanding, both are 64 bit integers. Is..

Remove stubborn underline from link

I am attempting to have a link show up in white, without an underline. The text color shows up correctly as white, but the blue underline is stubbornly persisting. I tried text-decoration: none; and t..

How to error handle 1004 Error with WorksheetFunction.VLookup?

I have this code: Dim wsFunc As WorksheetFunction: Set wsFunc = Application.WorksheetFunction Dim ws As Worksheet: Set ws = Sheets("2012") Dim rngLook As Range: Set rngLook = ws.Range("A:M") 'within..

Is there a cross-domain iframe height auto-resizer that works?

I tried a few solutions but wasn't successful. I'm wondering if there is a solution out there preferably with an easy-to-follow tutorial...

How to fix div on scroll

If you scroll down the page in the following URL, the 'share' div will lock onto the browser: http://knowyourmeme.com/memes/pizza-is-a-vegetable I'm assuming they are applying a position: fixed; att..

How to output git log with the first line only?

I am trying to customize the format for git log. I want all commits to be shown in one line. Each line should only show the first line of the commit message. I found out that git log --pretty=short sh..

What is the difference between absolute and relative xpaths? Which is preferred in Selenium automation testing?

What is the difference between absolute and relative xpaths? Which is preferred in Selenium automation testing? I am preparing test scripts using Selenium and Robot framework...

Bootstrap 3: how to make head of dropdown link clickable in navbar

I'm using the default navbar and a couple of the list items are dropdowns. I'm not able to click the link that triggers the dropdown. I know that I could just add a duplicate link into the dropdown bu..

How do I display todays date on SSRS report?

I want to show up Todays date as report generated date on SSRS report. How can i do that ? should I use any variable ? please help me I'm newbie to SSRS. For example refer this image: ..

What is the difference between the float and integer data type when the size is the same?

What the difference between the float and integer data type when size is same?..

Google Maps how to Show city or an Area outline

How to show the places or Area outline just like the below sites does: [I enter an area and it shows the clear border for that area.] Link I have searched for hours in the official maps docs and t..

Hibernate problem - "Use of @OneToMany or @ManyToMany targeting an unmapped class"

I'm finding my feet with Hibernate Annotations and I've hit a problem I hope someone can help with. I have 2 entities, Section and ScopeTopic. The section has a List class member, so a One to Many re..

Where is git.exe located?

I have PyCharm and I am looking around trying to find git.exe to set it up with my repo. What is the PATH to git.exe?..

Writing to output window of Visual Studio

I am trying to write a message to the output window for debugging purposes. I searched for a function like Java's system.out.println(""). I tried Debug.Write, Console.Write, and Trace.Write. It does n..

Android, How to limit width of TextView (and add three dots at the end of text)?

I have a TextView that I want to limit characters of it. Actually, I can do this but the thing that I'm looking for is how to add three dots (...) at the end of string. This one shows the text has con..

How to auto-scroll to end of div when data is added?

I have a table inside of a div with the following style: #data { overflow-x:hidden; overflow-y:visible; height:500px; } This displays a vertical scroll bar once enough data is added to ..

How can I change a file's encoding with vim?

I'm used to using vim to modify a file's line endings: $ file file file: ASCII text, with CRLF line terminators $ vim file :set ff=mac :wq $ file file file: ASCII text, with CR line terminators Is ..

PHP random string generator

I'm trying to create a randomized string in PHP, and I get absolutely no output with this: <?php function RandomString() { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEF..

How to get just the date part of getdate()?

I have a SQL table that has a CreationDate field. I have getdate() in the computed column specification formula. I would like to know how to get just the date portion, that is, '2012-08-24' instead ..

Map to String in Java

When I do System.out.println(map) in Java, I get a nice output in stdout. How can I obtain this same string representation of a Map in a variable without meddling with standard output? Something like ..

Using node.js as a simple web server

I want to run a very simple HTTP server. Every GET request to example.com should get index.html served to it but as a regular HTML page (i.e., same experience as when you read normal web pages). Usin..

@viewChild not working - cannot read property nativeElement of undefined

I'm trying to access a native element in order to focus on it when another element is clicked (much like the html attribute "for" - for cannot be used on elements of this type. However I get the erro..

How to convert a string to JSON object in PHP

I have the following result from an SQL query: {"Coords":[ {"Accuracy":"65","Latitude":"53.277720488429026","Longitude":"-9.012038778269686","Timestamp":"Fri Jul 05 2013 11:59:34 GMT+0100 (IST)"}..

Why does "npm install" rewrite package-lock.json?

I just recently upgraded to npm@5. I now have a package-lock.json file with everything from package.json. I would expect that, when I run npm install that the dependency versions would be pulled fro..

Convert character to Date in R

I am relatively new to R, but this is the first time I have had to deal with date conversions. I read in my data from a CSV (using read.table()), but I shorted the data to highlight my issue. When r..

How to get twitter bootstrap modal to close (after initial launch)

I'm very much a noob, so I think I'm overseeing something (probably obvious) with twitter bootstrap modal. What I am trying to do is get a modal to launch only on mobile. This works fine with adding t..

Display unescaped HTML in Vue.js

How can I manage to get HTML interpreted inside a mustache binding? At the moment the break (<br />) is just displayed/escaped. Small Vue app: var logapp = new Vue({ el: '#logapp', data: {..

How do I copy a range of formula values and paste them to a specific range in another sheet?

I'm trying to get an excel macro to work but I'm having an issue with copying the values from formula-containing cells. So far this is what I have and it works fine with the non-formula cells. Sub G..

Date Format in Swift

How will I convert this datetime from the date? From this: 2016-02-29 12:24:26 to: Feb 29, 2016 So far, this is my code and it returns a nil value: let dateFormatter = NSDateFormatter() date..

How to get streaming url from online streaming radio station

I've been asked to make unofficial online streaming android application for a certain radio station. I've experience with streaming in android for certain mp3 or whatever stream. But I don't know the ..

How to list all the available keyspaces in Cassandra?

I am newbie in Cassandra and trying to implement one toy application using Cassandra. I had created one keyspace and few column families in my Cassandra DB but I forgot the name of my cluster. I am t..

How to wait until an element is present in Selenium?

I'm trying to make Selenium wait for an element that is dynamically added to the DOM after page load. Tried this: fluentWait.until(ExpectedConditions.presenceOfElement(By.id("elementId")); In case ..

How and where are Annotations used in Java?

What are the major areas that we can use Annotations? Is the feature a replacement for XML based configuration?..

How to change Hash values?

I'd like to replace each value in a hash with value.some_method. For example, for given a simple hash: {"a" => "b", "c" => "d"}` every value should be .upcased, so it looks like: {"a" =>..

What is the difference between up-casting and down-casting with respect to class variable

What is the difference between up-casting and down-casting with respect to class variable? For example in the following program class Animal contains only one method but Dog class contai..


How to ignore the certificate check when ssl

I am trying find a way to ignore the certificate check when request a Https resource, so far, I found some helpful article in internet. But I still have some problem. Please review my code. I just d..

Convert List<DerivedClass> to List<BaseClass>

While we can inherit from base class/interface, why can't we declare a List<> using same class/interface? interface A { } class B : A { } class C : B { } class Test { static void Main..

How to debug in Android Studio using adb over WiFi

I'm able to connect to my phone using adb connect, and I can adb shell also. But when I go to Run->Device Chooser, there are no devices there. What should I do to connect my (connected) adb Android ..

What does "Content-type: application/json; charset=utf-8" really mean?

When I make a POST request with a JSON body to my REST service I include Content-type: application/json; charset=utf-8 in the message header. Without this header, I get an error from the service. I ca..

Returning anonymous type in C#

I have a query that returns an anonymous type and the query is in a method. How do you write this: public "TheAnonymousType" TheMethod(SomeParameter) { using (MyDC TheDC = new MyDC()) { var ..

What is difference between png8 and png24

I want to know about uses of png files. There are two formats available for png images; one is png8 and the another one is png24. I would like to know that if I use either type in my html page, will..

How do I change the text size in a label widget, python tkinter

In python 3.4 using Tkinter, how do I change the text size in a label widget? So far I have tried label_one = Label(root, text = 'Hello', size = '50') and label_one.config(fontsize='50') But I..

Assign output of os.system to a variable and prevent it from being displayed on the screen

I want to assign the output of a command I run using os.system to a variable and prevent it from being output to the screen. But, in the below code ,the output is sent to the screen and the value prin..

How to write and read a file with a HashMap?

I have a HashMap with two Strings Map<String, String> ldapContent = new HashMap<String, String>. Now I want to save the Map in an external file to use the Map later without initializing i..

What is the difference between onBlur and onChange attribute in HTML?

When is one called versus the other? Is there a situation were onChange would be called but onBlur would not be called?..

Where does Java's String constant pool live, the heap or the stack?

I know the concept of a constants pool and the String constant pool used by JVMs to handle String literals. But I don't know which type of memory is used by the JVM to store String constant literals. ..

Why does corrcoef return a matrix?

It seems strange to me that np.corrcoef returns a matrix. correlation1 = corrcoef(Strategy1Returns,Strategy2Returns) [[ 1. -0.99598935] [-0.99598935 1. ]] Does anyone know why th..

Descending order by date filter in AngularJs

<div class="recent" ng-repeat="reader in (filteredItems = (book.reader | orderBy: 'created_at' | limitTo: 1))"> </div> So the book comes from rest api and it has many readers attache..

Extracting a parameter from a URL in WordPress

I am trying to pass a parameter to a WordPress site using a URL - for instance: www.fioriapts.com/?ppc=1 will be the URL. I am intending to write a function in the functions.php file but the mecha..

Android device chooser - My device seems offline

I have developed an application and i was planning to deploy it to my HTC Desire. I have installed USB driver. I turned on USB debugging on the phone and choosed charge only when phone plugged-in. Whe..

Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist

I am on a server that has afresh install on RHEL 5. I was able to install Apache and PHP just fine., but I am having serious trouble with my MySQL installation. I tried the following: yum install ..

Gaussian fit for Python

I'm trying to fit a Gaussian for my data (which is already a rough gaussian). I've already taken the advice of those here and tried curve_fit and leastsq but I think that I'm missing something more fu..

Tomcat in Intellij Idea Community Edition

Is it possible to run a web application using Tomcat Server in Intellij Idea Community Edition? I tried to find some information about it but haven't achived any success...

How to append to New Line in Node.js

I'm trying to Append data to a Log file using Node.js and that is working fine but it is not going to the next line. \n doesn't seem to be working in my function below. Any suggestions? function pro..

JS - window.history - Delete a state

Using the html5 window.history API, I can control the navigation pretty well on my web app. The app currently has two states: selectDate(1) and enterDetails(2). When the app loads, I replaceState an..

Pass table as parameter into sql server UDF

I'd like to pass a table as a parameter into a scaler UDF. I'd also prefer to restrict the parameter to tables with only one column. (optional) Is this possible? EDIT I don't want to pass a table..

Cannot read property 'push' of undefined when combining arrays

When pushing an array's contents to another array I get "Uncaught TypeError: Cannot read property 'push' of undefined" error in this snippet. var order = new Object(), stack = []; for(var i=0..

Make a phone call programmatically

How can I make a phone call programmatically on iPhone? I tried the following code but nothing happened: NSString *phoneNumber = mymobileNO.titleLabel.text; [[UIApplication sharedApplication] openURL..

PostgreSQL create table if not exists

In a MySQL script you can write: CREATE TABLE IF NOT EXISTS foo ...; ... other stuff ... and then you can run the script many times without re-creating the table. How do you do this in PostgreSQL..

java.net.MalformedURLException: no protocol

I am getting Java exception like: java.net.MalformedURLException: no protocol My program is trying to parse an XML string by using: Document dom; DocumentBuilderFactory dbf = DocumentBuilderFacto..

Programmatically trigger "select file" dialog box

I have a hidden file input element. Is it possible to trigger its select file dialog box from a button's click event?..

Print the data in ResultSet along with column names

I am retrieving columns names from a SQL database through Java. I know I can retrieve columns names from ResultSet too. So I have this sql query select column_name from information_schema.columns w..

How to find the parent element using javascript

I want to change the background color of the table cell when radio button inside the cell is clicked. <table> <tr> <td align="center"> <input type="radio" value="fo..

Warning: Cannot modify header information - headers already sent by ERROR

I've been struggling with this error for a while now. To start with, I just thought it was white space, but after further research I think it might be a problem similar to this: Look for any stat..

Using an authorization header with Fetch in React Native

I'm trying to use fetch in React Native to grab information from the Product Hunt API. I've obtained the proper Access Token and have saved it to State, but don't seem to be able to pass it along with..

In Python, how do I determine if an object is iterable?

Is there a method like isiterable? The only solution I have found so far is to call hasattr(myObj, '__iter__') But I am not sure how fool-proof this is...

Check time difference in Javascript

How would you check time difference from two text-boxes in Javascript?..

Error: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'

I recently upgraded/updated Entity Framework in an old project from version 4 or 5 to version 6. Now I get this exception: An exception of type 'System.InvalidOperationException' occurred in Ent..

Set variable value to array of strings

I want to set a variable as a string of values. E.g. declare @FirstName char(100) select @FirstName = 'John','Sarah','George' SELECT * FROM Accounts WHERE FirstName in (@FirstName) I'm getting a ..

Return a value from AsyncTask in Android

One simple question: is it possible to return a value in AsyncTask? //AsyncTask is a member class private class MyTask extends AsyncTask<Void, Void, Void>{ protected Void doInBackground(Vo..

iPhone - Grand Central Dispatch main thread

I have been using with success, grand central dispatch in my apps, but I was wondering what is the real advantage of using something like this: dispatch_async(dispatch_get_main_queue(), ^{ ... do stu..

How to get the Android Emulator's IP address?

I want to get the currently running Android Emulator's IP address through code. How can it be achieved?..

Sort objects in ArrayList by date?

Every example I find is about doing this alphabetically, while I need my elements sorted by date. My ArrayList contains objects on which one of the datamembers is a DateTime object. On DateTime I can..

How do you read from stdin?

I'm trying to do some of the code golf challenges, but they all require the input to be taken from stdin. How do I get that in Python?..

Does MS Access support "CASE WHEN" clause if connect with ODBC?

Does ODBC support CASE WHEN clause for MS Access? Is there any other database which does not support the CASE WHEN clause? I tried the following query while connecting to MS Access with ODBC but get a..

Android: Difference between onInterceptTouchEvent and dispatchTouchEvent?

What is the difference between onInterceptTouchEvent and dispatchTouchEvent in Android? According to the android developer guide, both methods can be used to intercept a touch event (MotionEvent), bu..

Meaning of - <?xml version="1.0" encoding="utf-8"?>

I am new to XML and I am trying to understand the basics. I read the line below in "Learning XML", but it is still not clear, for me. Can someone point me to a book or website which explains these ba..

Count work days between two dates

How can I calculate the number of work days between two dates in SQL Server? Monday to Friday and it must be T-SQL...

Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata.`

EDIT: After I modified the web.config and I don't get error that's good.... then I add a new page (html) and write this small code to consume the service like this: $("#btn12").click(function (even..

add elements to object array

This must be really simple but just not getting my syntax right here. let's say we have classes like two below: class Student { Subject[] subjects; } class Subject { string Name; string..

Get list of all input objects using JavaScript, without accessing a form object

I need to get all the input objects and manipulate the onclick param. The following does the job for <a> links. Looking for something like this for input tags. for (var ls = document.links, nu..

How to get value of Radio Buttons?

I have a group box contains radio buttons eg. o Male o Female i want my code to get the selected value of radio button and copy it to string type variable kindly use simple code cause m not very pro..

Using LINQ to remove elements from a List<T>

Say that I have LINQ query such as: var authors = from x in authorsList where x.firstname == "Bob" select x; Given that authorsList is of type List<Author>, how ca..

How to apply CSS to iframe?

I have a simple page that has some iframe sections (to display RSS links). How can I apply the same CSS format from the main page to the page displayed in the iframe?..

When and where to use GetType() or typeof()?

Why this works if (mycontrol.GetType() == typeof(TextBox)) {} and this do not? Type tp = typeof(mycontrol); But this works Type tp = mycontrol.GetType(); I myself use is operator for checkin..

Changing user agent on urllib2.urlopen

How can I download a webpage with a user agent other than the default one on urllib2.urlopen?..

Subprocess changing directory

I want to execute a script inside a subdirectory/superdirectory (I need to be inside this sub/super-directory first). I can't get subprocess to enter my subdirectory: tducin@localhost:~/Projekty/test..

"psql: could not connect to server: Connection refused" Error when connecting to remote database

I am trying to connect to a postgres database installed in a remote server using the following command: psql -h host_ip -U db_username -d db_name This the error that occurs: psql: could not conn..

What do the crossed style properties in Google Chrome devtools mean?

While inspecting an element using Chrome's devtools, in the elements tab, the right-hand side 'Styles' bar shows the corresponding CSS properties. At times, some of these properties are struck-through..

What is the difference between a Shared Project and a Class Library in Visual Studio 2015?

I was looking at the new features for Visual Studio 2015 and Shared Project came up a lot but I don't understand how it is different to using a Class Library or a Portable Class Library. Can anyone ex..

Using strtok with a std::string

I have a string that I would like to tokenize. But the C strtok() function requires my string to be a char*. How can I do this simply? I tried: token = strtok(str.c_str(), " "); which fails becau..

What are the most useful Intellij IDEA keyboard shortcuts?

I did a bit of googling hoping to find a post on IDEA shortcuts similar to Jeff's post on Visual Studio shortcuts (Visual Studio .NET 2003 and 2005 Keyboard Shortcuts), but didn't really spot anything..

How to set selected value on select using selectpicker plugin from bootstrap

I'm using the Bootstrap-Select plugin like this: HTML: <select name="selValue" class="selectpicker"> <option value="1">Val 1</option> <option value="2">Val 2</option..

Check file uploaded is in csv format

I am uploading a file in php and only want to upload it if it's a csv file. I believe my syntax is right for the content type. It always goes to else statement when it's a csv file. What I am doing wr..

Python subprocess/Popen with a modified environment

I believe that running an external command with a slightly modified environment is a very common case. That's how I tend to do it: import subprocess, os my_env = os.environ my_env["PATH"] = "/usr/sbi..

Mysql database sync between two databases

We are running a Java PoS (Point of Sale) application at various shops, with a MySql backend. I want to keep the databases in the shops synchronised with a database on a host server. When some change..

How to return a value from try, catch, and finally?

So when I do a code of blocks inside a try{}, and I try to return a value, it tells me no return values import org.w3c.dom.ranges.RangeException; public class Pg257E5 { public static void ma..

How to list files in a directory in a C program?

I'm trying to write an ftp server on Linux. In this matter how can I list files in the directory on terminal by a C program? Maybe I can use exec function to run find command but I want file name as a..

Java get month string from integer

Is there a better way to compact this method i.e. reduce the cyclomatic complexity by avoid the switch cases? String monthString; switch (month) { case 1: monthString = "January"..

How do I calculate the normal vector of a line segment?

Suppose I have a line segment going from (x1,y1) to (x2,y2). How do I calculate the normal vector perpendicular to the line? I can find lots of stuff about doing this for planes in 3D, but no 2D stuf..

Writing .csv files from C++

I'm trying to output some data to a .csv file and it is outputting it to the file but it isn't separating the data into different columns and seems to be outputting the data incorrectly. ofstrea..

SQL ROWNUM how to return rows between a specific range

How can I return a specific range of ROWNUM values? I'm trying the following: select * from maps006 where rownum >49 and rownum <101 This returns only rows matching the < operator...

passing form data to another HTML page

I have two HTML pages: form.html and display.html. In form.html, there is a form: <form action="display.html"> <input type="text" name="serialNumber" /> <input type="submit" va..

Dividing two integers to produce a float result

Possible Duplicate: Why can't I return a double from two ints being divided My C++ program is truncating the output of my integer devision even when I try and place the output into a fl..

Android: ProgressDialog.show() crashes with getApplicationContext

I can't seem to grasp why this is happening. This code: mProgressDialog = ProgressDialog.show(this, "", getString(R.string.loading), true); works just fine. However, this code: mProgressDialog = P..

How to rearrange Pandas column sequence?

>>> df =DataFrame({'a':[1,2,3,4],'b':[2,4,6,8]}) >>> df['x']=df.a + df.b >>> df['y']=df.a - df.b >>> df a b x y 0 1 2 3 -1 1 2 4 6 -2 2 3 6 9 -3 ..

Mapping US zip code to time zone

When users register with our app, we are able to infer their zip code when we validate them against a national database. What would be the best way to determine a good potential guess of their time z..

How can I list all of the files in a directory with Perl?

Is there a function in Perl that lists all the files and directories in a directory? I remember that Java has the File.list() to do this? Is there a comparable method in Perl?..

Spark specify multiple column conditions for dataframe join

How to give more column conditions when joining two dataframes. For example I want to run the following : val Lead_all = Leads.join(Utm_Master, Leaddetails.columns("LeadSource","Utm_Source","Ut..

Ways to insert javascript into URL?

Duplicate of: What common web exploits should I know about? This is a security question. What should I look for in URL that prevents hacking? Is there a way to execute javascript by passing i..

How to emulate GPS location in the Android Emulator?

I want to get longitude and latitude in Android emulator for testing. Can any one guide me how to achieve this? How do I set the location of the emulator to a test position?..

create a text file using javascript

I am using the following code to create a text file using javascript and it's not working <html> <head> <script language="javascript"> function WriteToFile()..

iptables LOG and DROP in one rule

I am trying to log outgoing connections with iptables. What I want is, drop and accept connection while logging them also. I have found that -j option takes DROP/REJECT/ACCEPT/LOG. But I want to do s..

Pagination response payload from a RESTful API

I want to support pagination in my RESTful API. My API method should return a JSON list of product via /products/index. However, there are potentially thousands of products, and I want to page throug..

How do you Encrypt and Decrypt a PHP String?

What I mean is: Original String + Salt or Key --> Encrypted String Encrypted String + Salt or Key --> Decrypted (Original String) Maybe something like: "hello world!" + "ABCD1234" --> Enc..

How to use graphics.h in codeblocks?

I have recently started learning graphics in C++. I tried #include <graphics.h> in my program in codeblocks but it shows error. Then I downloaded graphics.h header from a site and pasted in the..

CSS: how to add white space before element's content?

None of the following code works : p:before { content: " "; } p:before { content: "&nbsp;"; } How do I add white space before element's content ? Note: I need to color the border-left and the..

Using ng-click vs bind within link function of Angular Directive

In the link function, is there a more "Angular" way to bind a function to a click event? Right now, I'm doing... myApp.directive('clickme', function() { return function(scope, element, attrs) ..

C - error: storage size of ‘a’ isn’t known

This is my C program... #include <stdio.h> struct xyx { int x; int y; char c; char str[20]; int arr[2]; }; int main(void) { struct xyz a; a.x = 100; printf("%d..

How to print third column to last column?

I'm trying to remove the first two columns (of which I'm not interested in) from a DbgView log file. I can't seem to find an example that prints from column 3 onwards until the end of the line. Note t..

Error while waiting for device: Time out after 300seconds waiting for emulator to come online

I have been trying to use android studio 2.0 emulator but I can not run my App on the Emulator. When I Run my App it shows the emulator with following details: Hax is Enabled Hax ram_size 0x800000..

Move existing, uncommitted work to a new branch in Git

I started some work on a new feature and after coding for a bit, I decided this feature should be on its own branch. How do I move the existing uncommitted changes to a new branch and reset my curre..

CakePHP select default value in SELECT input

Using CakePHP: I have a many-to-one relationship, let's pretend it's many Leafs to Trees. Of course, I baked a form to add a Leaf to a Tree, and you can specify which Tree it is with a drop-down box..

need to test if sql query was successful

I have this query and if it returns successful, I want another function to process, if not, do not process that function. Here is the code for running the query global $DB; $DB->query("UPDATE exp..

pip install: Please check the permissions and owner of that directory

While installing pip and python I have ran into a that says: The directory '/Users/Parthenon/Library/Logs/pi' or its parent directory is not owned by the current user and the debug log has been di..

Getting Java version at runtime

I need to work around a Java bug in JDK 1.5 which was fixed in 1.6. I'm using the following condition: if (System.getProperty("java.version").startsWith("1.5.")) { ... } else { ... } Will t..

How do I redirect to another webpage?

How can I redirect the user from one page to another using jQuery or pure JavaScript?..

How to find all links / pages on a website

Is it possible to find all the pages and links on ANY given website? I'd like to enter a URL and produce a directory tree of all links from that site? I've looked at HTTrack but that downloads the wh..

How to use WPF Background Worker

In my application I need to perform a series of initialization steps, these take 7-8 seconds to complete during which my UI becomes unresponsive. To resolve this I perform the initialization in a sepa..

What is the difference between "px", "dip", "dp" and "sp"?

What is the difference between Android units of measure? px dip dp sp ..

Laravel 5.5 ajax call 419 (unknown status)

I do an ajax call but I keep getting this error: 419 (unknown status) No idea what is causing this I saw on other posts it has to do something with csrf token but I have no form so I dont know h..

Is it possible to embed animated GIFs in PDFs?

Is it possible to embed animated GIFs in PDFs? And how might I go about such a thing? are there any dangers I should be aware of? For some more details on why I think it's a good thing and how it help..

ROW_NUMBER() in MySQL

Is there a nice way in MySQL to replicate the SQL Server function ROW_NUMBER()? For example: SELECT col1, col2, ROW_NUMBER() OVER (PARTITION BY col1, col2 ORDER BY col3 DESC) AS intRow FRO..

How to get featured image of a product in woocommerce

Please tell me where I am going wrong . Product featured image is not showing up. $args = array( 'post_type' => 'product', 'posts_per_page' => 80, 'product_cat' => 'profiler', 'orderby' =..

Best way to stress test a website

This may be the wrong question to ask but, what's the best way to replicate a large load on an asp.net web application? Is there an easy way to simulate many requests on particular pages? Or is the be..

Is there any standard for JSON API response format?

Do standards or best practices exist for structuring JSON responses from an API? Obviously, every application's data is different, so that much I'm not concerned with, but rather the "response boiler..

Error "The connection to adb is down, and a severe error has occurred."

I've spent days trying to launch any Android program. Even "Hello World" gives me the same error: "The connection to adb is down, and a severe error has occurred". I'm running Eclipse v3.5 ..

Ant: How to execute a command for each file in directory?

I want to execute a command from an Ant buildfile, for each file in a directory. I am looking for a platform-independent solution. How do I do this? Sure, I could write a script in some scripting la..

How to check db2 version

How to check db2 version on Z/OS using only SQL commands? Thanks, Melita..

Check if a string contains a string in C++

I have a variable of type std::string. I want to check if it contains a certain std::string. How would I do that? Is there a function that returns true if the string is found, and false if it isn't..

Nginx: stat() failed (13: permission denied)

I am using the default config while adding the specific directory with nginx installed on my ubuntu 12.04 machine. server { #listen 80; ## listen for ipv4; this line is default and implied..

PATH issue with pytest 'ImportError: No module named YadaYadaYada'

I used easy_install to install pytest on a mac and started writing tests for a project with a file structure likes so: repo/ repo/app.py repo/settings.py repo/models.py repo/tests/ repo/tests/test_ap..

node.js http 'get' request with query string parameters

I have a Node.js application that is an http client (at the moment). So I'm doing: var query = require('querystring').stringify(propertiesObject); http.get(url + query, function(res) { console.lo..

How to find and replace string?

If s is a std::string, then is there a function like the following? s.replace("text to replace", "new text"); ..

How to push changes to github after jenkins build completes?

I have a jenkins job that clones the repository from github, then runs the powershell script that increments the version number in the file. I'm now trying to publish that update file back to the orig..

How do I create a message box with "Yes", "No" choices and a DialogResult?

I want to make simple Yes/No choiced MessageBox, but I think it is nonsense to design a form for that. I thought I could use MessageBox, add buttons, etc. to accomplish this. It is simple, but since t..

How (and why) to use display: table-cell (CSS)

I have a site with a very active background (I'm talking 6 or so different z-indexes here 2 with animations). I wanted a in the foreground that had content but wanted a "window" through to the backgr..

How to check if input file is empty in jQuery

Brand new to JS. I am trying to check if the file input element is empty when submitting the form with jQuery/JavaScript. I have gone through a bunch of solutions and nothing is working for me. I am ..

How do I create a folder in a GitHub repository?

I want to create a folder in a GitHub repository and want to add files in that folder. How do I achieve this?..

"webxml attribute is required" error in Maven

I am getting the following error: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) I have got web.xml in right place which is pro..

How to access local files of the filesystem in the Android emulator?

I want to know whether there is a method to access local files (say text files, web pages) of the filesystem in Android emulator. I'm using Ubuntu 10.04 for Android development. ..

No Activity found to handle Intent : android.intent.action.VIEW

This is my code to play the recorded audio 3gp file Intent intent = new Intent(android.content.Intent.ACTION_VIEW); Uri data = Uri.parse(path); intent.setDataAndType(data, "audio/mp..

How to convert java.sql.timestamp to LocalDate (java8) java.time?

In Java 8, how can I convert a Timestamp (in java.sql) to a LocalDate (in java.time)?..

How do I create a link using javascript?

I have a string for a title and a string for a link. I'm not sure how to put the two together to create a link on a page using Javascript. Any help is appreciated. EDIT1: Adding more detail to the ..

Reorder bars in geom_bar ggplot2 by value

I am trying to make a bar-plot where the plot is ordered from the miRNA with the highest value to the miRNA with the lowest. Why does my code not work? > head(corr.m) miRNA variab..

SQL query to check if a name begins and ends with a vowel

I want to query the list of CITY names from the table STATION(id, city, longitude, latitude) which have vowels as both their first and last characters. The result cannot contain duplicates. For this ..

what is the size of an enum type data in C++?

This is a C++ interview test question not homework. #include <iostream> using namespace std; enum months_t { january, february, march, april, may, june, july, august, september, october,..

How to create dynamic href in react render function?

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

Visual Studio Code pylint: Unable to import 'protorpc'

I'm using pylint in Visual Studio Code to develop a Google App Engine (GAE) Cloud Endpoint API in Python. I'm unable to resolve a lint error. I don't know what's causing the error, but at a guess, pyl..

intellij incorrectly saying no beans of type found for autowired repository

I have created a simple unit test but IntelliJ is incorrectly highlighting it red. marking it as an error No beans? As you can see below it passes the test? So it must be Autowired? ..

How to wrap text in LaTeX tables?

I am creating a report in LaTeX which involves a few tables. I'm stuck on that as my cell data in the table is exceeding the width of the page. Can I somehow wrap the text so that it falls into the ne..

Difference between webdriver.Dispose(), .Close() and .Quit()

What is the difference between these Webdriver.Close() Webdriver.Quit() Webdriver.Dispose() Which one to be used and when?..

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

How to iterate over a JSONObject?

I use a JSON library called JSONObject (I don't mind switching if I need to). I know how to iterate over JSONArrays, but when I parse JSON data from Facebook I don't get an array, only a JSONObject,..

Adjust UILabel height to text

I have some labels which I want to adjust their height to the text, this is the code I wrote for this now func heightForView(text:String, font:UIFont, width:CGFloat) -> CGFloat{ let label:UILa..

Redirect pages in JSP?

I have to design several pages in jsp. After clicking on the submit button on the first page, the page should be automatically redirected to the second page. Can you help with a quick example or a li..

Fatal error: [] operator not supported for strings

I'm getting information from database, saving it in array and echoing it in a form with loop structure and I'm having problems when I try to save the modified information to database. I'm getting this..

SSIS Text was truncated with status value 4

I am developing a SSIS package, trying to update an existing SQL table from a CSV flat file. All of the columns are successfully updating except for one column. If I ignore this column on truncate, ..

IntelliJ Organize Imports

Does IntelliJ have an Organize Imports feature similar to that in Eclipse? What I have is a Java file with multiple classes missing their imports. Example: package com.test; public class Foo { pu..

Missing styles. Is the correct theme chosen for this layout?

Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style mapViewSt..

Can we pass an array as parameter in any function in PHP?

I have a function to send mail to users and I want to pass one of its parameter as an array of ids. Is this possible to do? If yes, how can it be done? Suppose we have a function as: function sende..

W3WP.EXE using 100% CPU - where to start?

An ASP.NET web app running on IIS6 periodically shoots the CPU up to 100%. It's the W3WP that's responsible for nearly all CPU usage during these episodes. The CPU stays pinned at 100% anywhere from a..

Android soft keyboard covers EditText field

Is there a way to make the screen scroll to allow the text field to be seen?..

One line ftp server in python

Is it possible to have a one line command in python to do a simple ftp server? I'd like to be able to do this as quick and temporary way to transfer files to a linux box without having to install a ft..

HTML5 - mp4 video does not play in IE9

I have an mp4 video that I want to play in IE9 using HTML5 <video> tag. I added the MIME type to IIS 7 so if I browse http://localhost/video.mp4 it plays in both Chrome and IE9 but not in HTML5,..

ExpressJS - throw er Unhandled error event

I created expressjs application using the following commands: express -e folderName npm install ejs --save npm install When I run the application with: node app.js, I have the following errors: ev..

jQuery animated number counter from zero to value

I have created a script to animate a number from zero to it's value. Working jQuery _x000D_ _x000D_ $({ Counter: 0 }).animate({_x000D_ Counter: $('.Single').text()_x000D_ }, {_x000D_ duration: ..

C++ class forward declaration

When I try to compile this code, I get: 52 C:\Dev-Cpp\Projektyyy\strategy\Tiles.h invalid use of undefined type `struct tile_tree_apple' 46 C:\Dev-Cpp\Projektyyy\strategy\Tiles.h forward declaration ..

javascript regex for password containing at least 8 characters, 1 number, 1 upper and 1 lowercase

I am trying to write a regular expression to validate a password which must meet the following criteria: Contain at least 8 characters contain at least 1 number contain at least 1 lowercase charact..

Deleting records before a certain date

How would I go about deleting all records from a MySQL table from before a certain date, where the date column is in DATETIME format? An example datetime is 2011-09-21 08:21:22...

Measuring function execution time in R

Is there a standardized way in R of measuring execution time of function? Obviously I can take system.time before and after execution and then take the difference of those, but I would like to know i..

How to test that no exception is thrown?

I know that one way to do it would be: @Test public void foo() { try { // execute code that you expect not to throw Exceptions. } catch(Exception e) { fail("Should not have thro..

Code snippet or shortcut to create a constructor in Visual Studio

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

How to convert integers to characters in C?

For example, if the integer was 97, the character would be 'a', or 98 to 'b'...