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..
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..
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..
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..
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..
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..
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..
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..
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 ..
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..
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;
..
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..
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..
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..
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..
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..
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..
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..
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..
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 ..
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..
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..
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...
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..
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..
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..
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..
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 ..
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..
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 ..
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..
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..
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..
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..
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..
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..
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..
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..
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 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 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..
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 ..
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..
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
#
#..
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..
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..
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..
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..
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..
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..
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
..
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..
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..
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..
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..
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? ..
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..
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
..
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..
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 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.
..
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..
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..
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..
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..
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..
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..
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
..
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..
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 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..
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..
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?
Aren't they the same thing, or at least written in the same thing (ie. Oracle RDBMS)?..
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;
..
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..
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
..
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..
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..
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..
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..
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..
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..
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. 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 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 ..
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..
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..
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..
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..
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 ..
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..
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..
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_..
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..
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..
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 ( ..
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..
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..
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..
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..
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 ..
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 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 ..
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..
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..
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..
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..
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..
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..
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..
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 ..
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;..
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..
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..
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..
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..
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?
I am preparing test scripts using Selenium and Robot framework...
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..
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:
..
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..
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..
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..
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..
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 ..
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 ..
I'm trying to create a randomized string in PHP, and I get absolutely no output with this:
<?php
function RandomString()
{
$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEF..
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 ..
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 ..
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..
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..
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)"}..
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..
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..
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..
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: {..
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..
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..
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 ..
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..
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 ..
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?
For example in the following program class Animal contains only one method but Dog class contai..
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..
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..
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 ..
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..
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 ..
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..
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..
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..
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..
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. ..
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..
<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..
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..
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..
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 ..
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..
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...
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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...
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..
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 ..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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?..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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"..
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..
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..
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...
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..
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..
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..
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..
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?..
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..
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..
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?..
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()..
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..
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..
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..
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..
None of the following code works :
p:before { content: " "; }
p:before { content: " "; }
How do I add white space before element's content ?
Note: I need to color the border-left and the..
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) ..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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? 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..
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..
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' =..
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..
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..
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 ..
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..
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..
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..
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..
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..
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..
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..
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..
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 ..
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..
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. ..
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..
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 ..
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..
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 ..
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,..
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>
{
..
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..
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?
..
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..
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 <br /> and thus getting..
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,..
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..
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..
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..
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, ..
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? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style mapViewSt..
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..
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..
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..
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,..
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..
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: ..
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 ..
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..
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...
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..
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..