Questions Tagged with #Opacity

Opacity is the degree to which a graphical object obscures objects which are rendered behind it.

How to change the opacity (alpha, transparency) of an element in a canvas element after it has been drawn?

Using the HTML5 <canvas> element, I would like to load an image file (PNG, JPEG, etc.), draw it to the canvas completely transparently, and then fade it in. I have figured out how to load the im..

Transparent CSS background color

I want to make the list menu's background disappear by using opacity, without affecting the font. Is it possible with CSS3?..

CSS opacity only to background color, not the text on it?

Can I assign the opacity property to the background property of a div only and not to the text on it? I've tried: background: #CCC; opacity: 0.6; but this doesn't change the opacity...

css transition opacity fade background

I am doing a transition where it fades into transparent white, when a user is hovering an image. My problem is that I need to change the color, that it fades to, to black. I have tried just simply a..

How to change text transparency in HTML/CSS?

I'm very new to HTML/CSS and I'm trying to display some text as like 50% transparent. So far I have the HTML to display the text with full opacity <html><font color=\"black\" face=\"arial\"..

How to make blinking/flashing text with CSS 3

Currently, I have this code: @-webkit-keyframes blinker { from { opacity: 1.0; } to { opacity: 0.0; } } .waitingForConnection { -webkit-animation-name: blinker; -webkit-animation-iteration-c..

Opacity CSS not working in IE8

I'm using CSS to indicate the trigger text for a jQuery slide-down section: i.e. when you hover over the trigger text the cursor changes to a pointer and the opacity of the trigger text is reduced to ..

How do I give text or an image a transparent background using CSS?

Is it possible, using CSS only, to make the background of an element semi-transparent but have the content (text & images) of the element opaque? I'd like to accomplish this without having the te..

How can I make my website's background transparent without making the content (images & text) transparent too?

I'm doing a website for a school project, and I'm currently having a small problem... I can't make the body's background transparent without it also affecting the content in it. Here's my HTML code: ..

How to darken a background using CSS?

I have an element with text in it. Whenever I decrease the opacity, then I decrease the opacity of the WHOLE body. Is there any way I can just make the background-image darker, and not everything else..

How to set the opacity/alpha of a UIImage?

I know you can do this with a UIImageView, but can it be done to a UIImage? I want to have the animation images array property of a UIImageView to be an array of the same image but with different opa..

Change background image opacity

I have a div element with text blocks and a parent div in which I have set a background image. Now I want to reduce the opacity of the background image. Please suggest how I can do that. Thanks in ad..

Background images: how to fill whole div if image is small and vice versa

I have three problems: When I tried to use a background image in a smaller size div, the div shows only part of image. How can I show the full or a specific part of image? I have a smaller image and..

Achieving white opacity effect in html/css

is there a way to achieve this effect in a cross-browser compatible way without having to prepare separated images? Basically the frame on which text lays has a white overlay of 50% opacity.. I would..

How to set opacity in parent div and not affect in child div?

Hey i am searching in google but i can't fine any perfect answer I want to Opacity in parent DIV but not Child DIV Example HTML <div class="parent"> <div class="child"> Hello I am ch..

Set opacity of background image without affecting child elements

Is it possible to set the opacity of a background image without affecting the opacity of child elements? Example All links in the footer need a custom bullet (background image) and the opacity of th..

Can you set a border opacity in CSS?

Is there a straight forward CSS way to make the border of an element semi-transparent with something like this? border-opacity: 0.7; If not, does anyone have an idea how I could do so without using..

CSS Background Opacity

I am using something similar to the following code: <div style="opacity:0.4; background-image:url(...);"> <div style="opacity:1.0;"> Text </div> </div> I ex..

Using CSS for a fade-in effect on page load

Can CSS transitions be used to allow a text paragraph to fade-in on page load? I really like how it looked on http://dotmailapp.com/ and would love to use a similar effect using CSS. The domain has s..

Opacity of background-color, but not the text

How do I make the cross-browser (including Internet Explorer 6) transparency for the background of a div while the text remains opaque? I need to do it without using any library such as jQuery, etc. ..

How to Set Opacity (Alpha) for View in Android

I have a button as in the following: <Button android:text="Submit" android:id="@+id/Button01" android:layout_width="fill_parent" android:layout_height="wrap_content"> &l..

jQuery CSS Opacity

What's wrong? I want to change the opacity if #nav .drop is display:block; jQuery(document).ready(function(){ if (jQuery('#nav .drop').css('display') === 'block') { jQuery('#main').css('o..

How can I set the opacity or transparency of a Panel in WinForms?

I was wondering how to change or modify the transparency of a Panel in C#, not the whole form, but the panel only.. I've seen many C# tutorials on Opacity, but its for the Form. im looking for how it ..

Opacity of div's background without affecting contained element in IE 8?

I want to set Opacity of div's background without affecting contained element in IE 8. have a any solution and don't answer to set 1 X 1 .png image and set opacity of that image because I am using dyn..

Making text background transparent but not text itself

So I am having a problem. I have looked around and looked around but no luck. I would like to make the background of my body transparent but leave the text non transparent. As it is right now I keep m..

How to change the background colour's opacity in CSS

I have a PNG file which I give a background colour to its transparent areas, but I would like to make the background colour a bit transparent, like opacity. Here is my code so far: social img{ op..

How to make in CSS an overlay over an image?

I am trying to achieve something like this: When I hover over an image, I would like to put on that image this dark color with some text and the icon. I am stuck here. I found some tutorials but t..

How to set opacity to the background color of a div?

I have this class .box { background-color:#fff; border:3px solid #eee; } My question is how can I set an opacity to the white background only so that it will kinda mix with my background? Thank yo..

HTML embed autoplay="false", but still plays automatically

On the front page of this website, there is a sticky post titled "National Radio Advertising Campaign ForACURE" which contains the following HTML: <embed type="audio/x-wav" src="http://www.foracur..

jQuery: Check if special characters exists in string

I know this question is asked more often here on Stack, but I can't seem to get a straight answer out of the questions already posted. I need to check if all special characters (except -) are in a st..

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

Set style for TextView programmatically

I'm trying to use the TextView constructor with style like this: TextView myText = new TextView(MyActivity.this, null, R.style.my_style); However, when I do this, the text view does not appear to t..

How Do I Convert an Integer to a String in Excel VBA?

How do I convert the integer value "45" into the string value "45" in Excel VBA?..

How do I decode a string with escaped unicode?

I'm not sure what this is called so I'm having trouble searching for it. How can I decode a string with unicode from http\u00253A\u00252F\u00252Fexample.com to http://example.com with JavaScript? I tr..

Spring Boot - How to get the running port

I have a spring boot application (using embedded tomcat 7), and I've set server.port = 0 in my application.properties so I can have a random port. After the server is booted up and running on a port,..

How do I copy a hash in Ruby?

I'll admit that I'm a bit of a ruby newbie (writing rake scripts, now). In most languages, copy constructors are easy to find. Half an hour of searching didn't find it in ruby. I want to create a copy..

Make a number a percentage

What's the best way to strip the "0."XXX% off a number and make it a percentage? What happens if the number happens to be an int? var number1 = 4.954848; var number2 = 5.9797; $(document).ready(fun..

How can I label points in this scatterplot?

Can you help me on putting labels on the following graph? The code i use is: valbanks<-scan("banks.txt", what=list(0,0,""), sep="", skip=1, comment.char="#") valbanks valj2007<-valbanks[[..

Is there a difference between "==" and "is"?

My Google-fu has failed me. In Python, are the following two tests for equality equivalent? n = 5 # Test one. if n == 5: print 'Yay!' # Test two. if n is 5: print 'Yay!' Does this hold tr..

Mongoose: CastError: Cast to ObjectId failed for value "[object Object]" at path "_id"

I am new to node.js, so I have a feeling that this will be something silly that I have overlooked, but I haven't been able to find an answer that fixes my problem. What I'm trying to do is create a pa..

Refused to display 'url' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'

<script async="" defer="" src="//survey.g.doubleclick.net/async_survey?site=vj2nngtlb7sbtnveaepk5so4ke"></script> Screenshot of the error: and I'm getting Refused to display 'https:/..

How to replace four spaces with a tab in Sublime Text 2?

I want to replace all the "four spaces" that is written by another text editor with tabs. How can I do it?..

Split a string by a delimiter in python

How to split this string where __ is the delimiter MATCHES__STRING To get an output of ['MATCHES', 'STRING']?..

"ArrayAdapter requires the resource ID to be a TextView" xml problems

I am getting an error when trying to set my view to display the ListView for the file I want to display(text file). I am pretty sure it has something to do with the xml. I just want to display the inf..

How to convert datetime to integer in python

how can i convert YYYY-MM-DD hh:mm:ss format to integer in python? for example 2014-02-12 20:51:14 -> to integer. i know how to convert only hh:mm:ss but not yyyy-mm-dd hh:mm:ss def time_to_num(time..

Centering a Twitter Bootstrap button

I'm making a form with Twitter Bootstrap, and am having a really difficult time centering the button. It's contained inside a div with a span of 7. Below is the HTML, and the button is at the very bot..

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable

I recently tried to import sample Android games I downloaded from Google's developer website. After importing them into Android Studio, I'm getting the following error: Error: SDK location not fou..

Apply style to cells of first row

It should be very simple but I can't figure it out. I have a table like this : <table class="category_table"> <tr><td> blabla 1</td><td> blabla 2 </td></tr>..

Python Key Error=0 - Can't find Dict error in code

basically I have been racking my brains for a good while now as to why my code is not working, I have tested parts separately and have look throughout the web to see if it can help, to no avail. I am ..

T-SQL: Selecting rows to delete via joins

Scenario: Let's say I have two tables, TableA and TableB. TableB's primary key is a single column (BId), and is a foreign key column in TableA. In my situation, I want to remove all rows in TableA ..

How to get active user's UserDetails

In my controllers, when I need the active (logged in) user, I am doing the following to get my UserDetails implementation: User activeUser = (User)SecurityContextHolder.getContext().getAuthentication..

Multiple bluetooth connection

I want to connect 3 devices via bluetooth (My Droid must connect to 2 bluetooth devices). I 've connected my Droid to 1 device using Bluetooth chat How should I modify it for multiple bluetooth device..

What represents a double in sql server?

I have a couple of properties in C# which are double and I want to store these in a table in SQL Server, but noticed there is no double type, so what is best to use, decimal or float? This will store..

How can I capitalize the first letter of each word in a string using JavaScript?

I'm trying to write a function that capitalizes the first letter of every word in a string (converting the string to title case). For instance, when the input is "I'm a little tea pot", I ex..

docker mounting volumes on host

I have successfully been able to share folders between a docker container with volumes using docker run -v /host/path:/container/path ... But my question is what the difference between this and usi..

python numpy machine epsilon

I am trying to understand what is machine epsilon. According to the Wikipedia, it can be calculated as follows: def machineEpsilon(func=float): machine_epsilon = func(1) while func(1)+func(ma..

Comparing strings by their alphabetical order

String s1 = "Project"; String s2 = "Sunject"; I want to compare the two above string by their alphabetic order (which in this case "Project" then "Sunject" as "P" comes before "S"). Does anyone know..

Change windows hostname from command line

Is it possible to change the hostname in Windows 2003 from the command line with out-of-the-box tools?..

Java equivalent to JavaScript's encodeURIComponent that produces identical output?

I've been experimenting with various bits of Java code trying to come up with something that will encode a string containing quotes, spaces and "exotic" Unicode characters and produce output that's id..

Excel: the Incredible Shrinking and Expanding Controls

Occasionally, I'll happen across a spreadsheet which suffers from magic buttons or listboxes which get bigger or smaller over time. Nothing in the code is instructing this. Has anybody else experien..

Auto line-wrapping in SVG text

I would like to display a <text> in SVG what would auto-line-wrap to the container <rect> the same way as HTML text fills <div> elements. Is there a way to do it? I don't want to pos..

wget can't download - 404 error

I tried to download an image using wget but got an error like the following. --2011-10-01 16:45:42-- http://www.icerts.com/images/logo.jpg Resolving www.icerts.com... 97.74.86.3 Connecting to www.ic..

Java - Check Not Null/Empty else assign default value

I am trying to simplify the following code. The basic steps that the code should carry out are as follows: Assign String a default value Run a method If the method returns a null/empty string lea..

How can I fix the form size in a C# Windows Forms application and not to let user change its size?

How can I fix the form size in a C# Windows Forms application and not to let user change its size?..

SyntaxError: Unexpected token function - Async Await Nodejs

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

How can I use a custom font in Java?

I wrote a program in Java that uses a special font that by default doesn't exist on any operating system. Is it possible in Java to add this special font to the operation system? For example, in Wind..

Replace deprecated preg_replace /e with preg_replace_callback

$result = preg_replace( "/\{([<>])([a-zA-Z0-9_]*)(\?{0,1})([a-zA-Z0-9_]*)\}(.*)\{\\1\/\\2\}/iseU", "CallFunction('\\1','\\2','\\3','\\4','\\5')", $result ); The above code gives a..

How to edit hosts file via CMD?

Hello I'd like to block some websites directly from the command prompt. echo like this: 0.0.0.0 websitename.com How can I do this? (OS: Windows 7)..

How to set selected index JComboBox by value

I want to set the selected index in a JComboBox by the value not the index. How to do that? Example public class ComboItem { private String value; private String label; public ComboItem..

Can I make a phone call from HTML on Android?

To make a phone call via HTML on an iPhone I create an <A/> tag with an href formatted as: <a href='tel:123-555-1212'>Dial Me</a>. Is there an equivelant for HTML on Android? CLARI..

Split column at delimiter in data frame

I would like to split one column into two within at data frame based on a delimiter. For example, a|b b|c to become a b b c within a data frame. Thanks!..

How do I simulate a low bandwidth, high latency environment?

I need to simulate a low bandwidth, high latency connection to a server in order to emulate the conditions of a VPN at a remote site. The bandwidth and latency should be tweakable so I can discover th..

Item frequency count in Python

Assume I have a list of words, and I want to find the number of times each word appears in that list. An obvious way to do this is: words = "apple banana apple strawberry banana lemon" uniques = set..

Detecting scroll direction

So I am trying to use the JavaScript on scroll to call a function. But I wanted to know if I could detect the direction of the the scroll without using jQuery. If not then are there any workarounds? ..

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

Why am I getting this database error when I update a table? ERROR at line 1: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired ..

How to drop all user tables?

How can I drop all user tables in oracle? I have problem with constraints. When I disable all it is still no possible...

Difference between git checkout --track origin/branch and git checkout -b branch origin/branch

Does anybody know the difference between these two commands to switch and track a remote branch? git checkout -b branch origin/branch git checkout --track origin/branch I think both keep track of t..

TypeError: Router.use() requires middleware function but got a Object

There have been some middleware changes on the new version of express and I have made some changes in my code around some of the other posts on this issue but I can't get anything to stick. We had it..

How to calculate the SVG Path for an arc (of a circle)

Given a circle centered at (200,200), radius 25, how do I draw an arc from 270 degree to 135 degree and one that goes from 270 to 45 degree? 0 degree means it is right on the x-axis (the right side) ..

MySQL CREATE TABLE IF NOT EXISTS in PHPmyadmin import

I have the following code CREATE TABLE IF NOT EXISTS `abuses` ( `abuse_id` int(11) NOT NULL AUTO_INCREMENT, `user_id` int(11) NOT NULL DEFAULT '0', `abuser_username` varchar(100) NOT NULL DEFAU..

Where is android studio building my .apk file?

I've been rebuilding my project from the ground up, so there's been a lot of problems with it. At the moment, everything's working great, except that when I try to run the app, I get the message 'Loca..

RecyclerView vs. ListView

From android developer (Creating Lists and Cards): The RecyclerView widget is a more advanced and flexible version of ListView. Okay, it sounds cool, but when I saw this example picture, I got..

Git add all subdirectories

I'm having trouble adding a folder and all of it's subdirectories to my git repository. I realized this is a very popular question after doing some googling and I've tried each suggestion with no luck..

Creating a batch file, for simple javac and java command execution

It is a really simple thing but I cannot get my head around it. I have looked at plenty of StackOverFlow post and as well as on internet. My goal is to create a .bat which will open cmd and execute m..

Android: Bitmaps loaded from gallery are rotated in ImageView

When I load an image from the media gallery into a Bitmap, everything is working fine, except that pictures that were shot with the camera while holding the phone vertically, are rotated so that I alw..

Update a local branch with the changes from a tracked remote branch

I have a local branch named 'my_local_branch', which tracks a remote branch origin/my_remote_branch. Now, the remote branch has been updated, and I am on the 'my_local_branch' and want to pull in tho..

"fatal: Not a git repository (or any of the parent directories)" from git status

This command works to get the files and compile them: git clone a-valid-git-url for example: git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts However, git status (or any other gi..

How to assign an action for UIImageView object in Swift

I'm trying to assign an UIImageView to an action when the user taps it. I know how to create an action for a UIButton, but how could I mimic the same behavior of a UIButton, but using a UIImageView?..

Remove an item from array using UnderscoreJS

Say I have this code var arr = [{id:1,name:'a'},{id:2,name:'b'},{id:3,name:'c'}]; and I want to remove the item with id = 3 from the array. Is there a way of doing this without splicing? Maye some..

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

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

How to turn IDENTITY_INSERT on and off using SQL Server 2008?

Why am I getting an error doing an insert when IDENTITY_INSERT is set to OFF? How do I turn it on properly in SQL Server 2008? Is it by using SQL Server Management Studio? I have run this query: ..

div with dynamic min-height based on browser window height

I have three div elements: one as a header, one as a footer, and a center content div. the div in the center needs to expand automatically with content, but I would like a min-height such that the bo..

How to force Laravel Project to use HTTPS for all routes?

I am working on a project that requires a secure connection. I can set the route, uri, asset to use 'https' via: Route::get('order/details/{id}', ['uses' => 'OrderController@details', 'as' => ..

Download a specific tag with Git

I'm trying to figure out how I can download a particular tag of a Git repository - it's one version behind the current version. I saw there was a tag for the previous version on the git web page, wit..

How to create a label inside an <input> element?

I would like to insert a descriptive text inside an input element that disappers when the user click on it. I know it is a very common trick, but I do not know how to do that.. What is the simplest/..

How to iterate over the file in python

I have a text file with some hexadecimal numbers and i am trying to convert it to decimal. I could successfully convert it, but it seems before the loop exist it reads some unwanted character and so i..

POST data to a URL in PHP

How can I send POST data to a URL in PHP (without a form)? I'm going to use it for sending a variable to complete and submit a form...

How to add composite primary key to table

create table d(id numeric(1), code varchar(2)) After I create the above table how can I add a composite primary key on both fields and also a foreign key?..

How do you cast a List of supertypes to a List of subtypes?

For example, lets say you have two classes: public class TestA {} public class TestB extends TestA{} I have a method that returns a List<TestA> and I would like to cast all the objects in tha..

Messagebox with input field

Is it possible to show (pop-up) a message box with an input field in it, possibly a text box? Is somewhere in the language or the framework?..

use a javascript array to fill up a drop down select box

I have a text file which I am reading and storing the data in a javascript array, it's a list of cuisines. I want to use the array to fill up a drop down select box. I know how to hard code in the val..

How do you decompile a swf file

I am the maintainer of a site that has allegedly 'lost' the source code to a flash swf file. How do I decompile this source? Are there any programs online or offline that I could use?..

Android - Activity vs FragmentActivity?

I am new in Android. I want to build an app with tab format. I found many documentation where Activity has been used. Also in many cases have used FragmentActivity. I am not sure which will be better ..

How to run multiple Python versions on Windows

I had two versions of Python installed on my machine (versions 2.6 and 2.5). I want to run 2.6 for one project and 2.5 for another. How can I specify which I want to use? I am working on Windows XP..

How to show data in a table by using psql command line interface?

Is there a way to show all the content inside a table by using psql command line interface? I can use \list to show all the databases, \d to show all the tables, but how can I show all the data in a ..

jQuery .live() vs .on() method for adding a click event after loading dynamic html

I am using jQuery v.1.7.1 where the .live() method is apparently deprecated. The problem I am having is that when dynamically loading html into an element using: $('#parent').load("http://..."); ..

How to remove a key from HashMap while iterating over it?

I am having HashMap called testMap which contains String, String. HashMap<String, String> testMap = new HashMap<String, String>(); When iterating the map, if value is match with specifi..

Determine if string is in list in JavaScript

In SQL we can see if a string is in a list like so: Column IN ('a', 'b', 'c') What's a good way to do this in JavaScript? It's so clunky to do this: if (expression1 || expression2 || str === 'a' |..

Clearing content of text file using php

I have a filelist.txt file and I created a file called clear.php to clear the content of filelist. I put a button in index.html to call clear.php to clear the file. Can anyone help me out regarding ..

Java: How to insert CLOB into oracle database

I need to write an XML file content into oracle database where the column is of CLOB datatype. How will I do that?..

What is the use of "using namespace std"?

What is the use of using namespace std? I'd like to see explanation in Layman terms...

How to upload a project to Github

After checking Upload my project to github I still have no idea how to get a project uploaded to my Git Hub repository. I'm new to GitHub and I have no idea what to do. I created a repository but i wa..

SET NAMES utf8 in MySQL?

I often see something similar to this below in PHP scripts using MySQL query("SET NAMES utf8"); I have never had to do this for any project yet so I have a couple basic questions about it. I..

Windows batch files: .bat vs .cmd?

As I understand it, .bat is the old 16-bit naming convention, and .cmd is for 32-bit Windows, i.e., starting with NT. But I continue to see .bat files everywhere, and they seem to work exactly the sam..

How Can I Remove “public/index.php” in the URL Generated Laravel?

I need to remove index.php or public/index.php from the generated URL in Laravel; commonly path is localhost/public/index.php/someWordForRoute, It should be something like localhost/someWordForRoute...

HTML5 Video tag not working in Safari , iPhone and iPad

I am trying to create an html5 web page in which there is a small video like 13s , I converted the flash version of this video into 3 format : .ogv using fireFogg , .webm using firefogg also and .mp4 ..

How to use/install gcc on Mac OS X 10.8 / Xcode 4.4

I have install Mountain Lion (Mac OS X 10.8) and now gcc doesn't seem to be available anymore. I've also installed Xcode 4.4 so there is no more /Developer directory. I need gcc both for mac ports a..

How to round up with excel VBA round()?

I have the following data: cell(1,1) = 2878.75 cell(1,2) = $31.10 cell(2,1) = $89,529.13 However, when I tried to use round(cells(1,1).value*cells(1,2).value),2), the result does not match cell(2,1..

How to replace specific values in a oracle database column?

I am looking to replace values in a particular column. For example the following column values column name ---------- Test1 Test2 Test3 Test12 should be (replacing est1 with rest1) column name ---..

How can I check if a checkbox is checked?

I am building a mobile web app with jQuery Mobile and I want to check if a checkbox is checked. Here is my code. <script type=text/javascript> function validate(){ if (remember.checked ==..

How to convert an Array to a Set in Java

I would like to convert an array to a Set in Java. There are some obvious ways of doing this (i.e. with a loop) but I would like something a bit neater, something like: java.util.Arrays.asList(Object..

Format number as percent in MS SQL Server

I am trying to simply format a number as a percent with two decimal places. If it is 37 divided by 38 (aka .973684210526315789), I would like it to show 97.36 % in the SQL output. I know it is recomme..

How to determine day of week by passing specific date?

For Example I have the date: "23/2/2010" (23th Feb 2010). I want to pass it to a function which would return the day of week. How can I do this? In this example, the function should return String "Tu..

Refused to load the font 'data:font/woff.....'it violates the following Content Security Policy directive: "default-src 'self'". Note that 'font-src'

My react webApp give this Error in Browser Console Refused to load the font 'data:font/woff;base64,d09........' because it` `violates the following Content Security Policy directive: "default-src` `..

php codeigniter count rows

I am new in codeigniter, I want to count all rows from database table but the query dose not retrieve the exact total of rows. Here is Model public function countRow(){ $query = $this->db->quer..

How to generate sample XML documents from their DTD or XSD?

We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data..

How do I get data from a table?

How do I pull data (string) from a column called "Limit" in a table ("displayTable") in Javascript? var table = document.getElementById('displayTable'); var rowCount = table.ro..

Adding an image to a PDF using iTextSharp and scale it properly

here's my code. It correctly adds the pictures I want and everything works except that the images are using their native resolution, so if the image is big it's being cropped to fit the page. Is ther..

Postgresql: password authentication failed for user "postgres"

I have installed PostgreSQL 8.4, Postgres client and Pgadmin 3. Authentication failed for user "postgres" for both console client and Pgadmin. I have typed user as "postgres" and password "postgres", ..

Are the PUT, DELETE, HEAD, etc methods available in most web browsers?

I've seen a couple questions around here like How to debug RESTful services, which mentions: Unfortunately that same browser won't allow me to test HTTP PUT, DELETE, and to a certain degree even H..

List<T> OrderBy Alphabetical Order

I'm using C# on Framework 3.5. I'm looking to quickly sort a Generic List<T>. For the sake of this example, let's say I have a List of a Person type with a property of lastname. How would I s..

IndexError: tuple index out of range ----- Python

Please Help me. I'm running a simple python program that will display the data from mySQL database in a tkinter form... from Tkinter import * import MySQLdb def button_click(): root.destroy() r..

jQuery check if attr = value

I seem to be having trouble with my code. I need to say: if ( $('html').attr('lang').val() == 'fr-FR' ) { // do this } else { // do that } When I check the console, I just get an error tell..

Reversing a String with Recursion in Java

Here is some Java code to reverse a string recursively. Could someone provide an explanation of how it works? public static String reverse(String str) { if ((null == str) || (str.length() <..

Stop an input field in a form from being submitted

I'm writing some javascript (a greasemonkey/userscript) that will insert some input fields into a form on a website. The thing is, I don't want those input fields to affect the form in any way, I don..

C# difference between == and Equals()

I have a condition in a silverlight application that compares 2 strings, for some reason when I use == it returns false while .Equals() returns true. Here is the code: if (((ListBoxItem)lstBaseMenu...

How do I get today's date in C# in mm/dd/yyyy format?

How do I get today's date in C# in mm/dd/yyyy format? I need to set a string variable to today's date (preferably without the year), but there's got to be a better way than building it month-/-day on..

Best way to encode text data for XML in Java?

Very similar to this question, except for Java. What is the recommended way of encoding strings for an XML output in Java. The strings might contain characters like "&", "<", etc...

SQL Server - calculate elapsed time between two datetime stamps in HH:MM:SS format

I have a SQL Server table that has a "Time" column. The table is a log table the houses status messages and timestamps for each message. The log table is inserted into via a batch file. There is an ..

How to suppress Update Links warning?

I'm trying to write a script that opens many Excel files. I keep getting the prompt: This workbook contains links to other data sources. I want to keep this message from appearing, so that my scri..

replace String with another in java

What function can replace a string with another string? Example #1: What will replace "HelloBrother" with "Brother"? Example #2: What will replace "JAVAISBEST" with "BEST"?..

How to use numpy.genfromtxt when first column is string and the remaining columns are numbers?

Basically, I have a bunch of data where the first column is a string (label) and the remaining columns are numeric values. I run the following: data = numpy.genfromtxt('data.txt', delimiter = ',') ..

Add custom header in HttpWebRequest

I need to add some custom headers to the HttpWebRequest object. How can I add Custom Header to HttpWebRequest object in Windows Phone 7...

Not equal string

I'm trying to set a condition like this if (myString=!"-1") { //Do things } But it fails. I've tried if(myString.Distinct("-1")) { //Do things } but it doesn't work either. ..

What is the difference between `sorted(list)` vs `list.sort()`?

list.sort() sorts the list and replaces the original list, whereas sorted(list) returns a sorted copy of the list, without changing the original list. When is one preferred over the other? Which is ..

How to prevent sticky hover effects for buttons on touch devices

I have created a carousel with a previous and a next button that are always visible. These buttons have a hover state, they turn blue. On touch devices, like iPad, the hover state is sticky, so the bu..

Stopping an Android app from console

Is it possible to stop an Android app from the console? Something like: adb stop com.my.app.package It would speed up our testing process so much. Right now we uninstall/install the app each time t..

Best Practice to Use HttpClient in Multithreaded Environment

For a while, I have been using HttpClient in a multithreaded environment. For every thread, when it initiates a connection, it will create a completely new HttpClient instance. Recently, I have disco..

How to display request headers with command line curl

Command line curl can display response header by using -D option, but I want to see what request header it is sending. How can I do that?..

How to download an entire directory and subdirectories using wget?

I am trying to download the files for a project using wget, as the SVN server for that project isn't running anymore and I am only able to access the files through a browser. The base URLs for all the..

How do you change the formatting options in Visual Studio Code?

I know you can Format Code using Ctrl+F / Cmd+F in Visual Studio Code but how do you change the formatting options for each language? For example, in Visual Studio 2013 I can choose compact mode for C..

SFTP Libraries for .NET

Can anyone recommend a good SFTP library to use? Right now I'm looking at products such as SecureBlackbox, IPWorks SSH, WodSFTP, and Rebex SFTP. However, I have never used any SFTP library before so..

How to print a float with 2 decimal places in Java?

Can I do it with System.out.print?..

How to add shortcut keys for java code in eclipse

Say I type "sout", the intellisense should expand it to "System.out.println()". Is there a way to adding such templates?..

Using GitLab token to clone without authentication

I want to clone GitLab repository without prompt for my automation script, by using my private token from my GitLab account. Can someone provide me a sample? I know I can do so with user and password:..

Base64 PNG data to HTML5 canvas

I want to load a PNG image encoded in Base64 to canvas element. I have this code: <html> <head> </head> <body> <canvas id="c"></canvas> <script type="text/javas..

Can you delete data from influxdb?

How do you delete data from influxdb? The documentation shows it should be as simple as: delete from foo where time < now() -1h For some reason, influxdb rejects my delete statements saying "D..

Get file path of image on Android

I have an app that can make pictures and upload them. The upload requires the file path of the photo but I can't get it. This is my code: public void maakfoto (View v) { Intent cameraIntent..

How to swap String characters in Java?

How can I swap two characters in a String? For example, "abcde" will become "bacde"...

HttpClient - A task was cancelled?

It works fine when have one or two tasks however throws an error "A task was cancelled" when we have more than one task listed. List<Task> allTasks = new List<Task>(); allTasks.Add(......

Clicking HTML 5 Video element to play, pause video, breaks play button

I'm trying to get the video to be able to play and pause like it does YouTube (Using both the play and pause button, and clicking the video itself.) <video width="600" height="409" id="videoPlayer..

How do I fetch multiple columns for use in a cursor loop?

When I try to run the following SQL snippet inside a cursor loop, set @cmd = N'exec sp_rename ' + @test + N',' + RIGHT(@test,LEN(@test)-3) + '_Pct' + N',''COLUMN''' I get the following ..

How to edit an Android app?

I need to edit an Android app just to change some text that was written incorrectly. I have the .apk files, so how would I modify them?..

Deep copy, shallow copy, clone

I need clarification on the differences between deep copy, shallow copy, and clone in Java..

React hooks useState Array

I tried looking for resetting useState array values in here but could not find any references to array values. Trying to change the drop down value from initial state to allowedState values. I am usi..

Convert an NSURL to an NSString

I have an app where the user can choose an image either from the built-in app images or from the iphone photo library. I use an object Occasion that has an NSString property to save the imagePath. N..

How to loop through a JSON object with typescript (Angular2)

I am new to Angular2 and I am trying to loop through a JSON object that I am getting back from a GET request but can't work it out. My JSON object: { Results: [{ Time: "2017-02-11T08:15..

How to check if BigDecimal variable == 0 in java?

I have the following code in Java; BigDecimal price; // assigned elsewhere if (price.compareTo(new BigDecimal("0.00")) == 0) { return true; } What is the best way to write the if condition?..

mongodb how to get max value from collections

I have a mongodb collection like: db.kids.find() //results [ {name:'tom', age:10}, {name:'alice', age:12}, .... ] I need a query to get MAX 'age' from this collection like in SQL: SELEC..

Not an enclosing class error Android Studio

I am new in android development and do not have an in depth knowledge of Java. I am stuck on a problem for a long time. I am trying to open a new activity on button click. But I am getting an error th..

How can I resolve the error "The security token included in the request is invalid" when running aws iam upload-server-certificate?

I cd into the directory where all the pem/key files are and run the following: aws iam upload-server-certificate --server-certificate-name certificate_name --certificate-body file://webserv..

jQuery click / toggle between two functions

I am looking for a way to have two separate operations / functions / "blocks of code" run when something is clicked and then a totally different block when the same thing is clicked again. I put this ..

Xcode Error: "The app ID cannot be registered to your development team."

We are porting an Android app to iOS for a client. They have added our account to their iTunes Connect account and created an app entry. We developed the app using the bundle ID they specified. But n..

Git - Pushing code to two remotes

I have two remote git repositories. origin and github I push my branch devel to both repositories. git push -u origin devel git push -u github devel But then, when I do. git push It would only get..

Attach (open) mdf file database with SQL Server Management Studio

Can you help me how can I open *.MDF file of database created with VisualStudio 2010, into SQL Server Management Studio? Tried to attach by myself, but I cannot navigate to that file for (I guess) so..

Why does CSS not support negative padding?

I have seen this many a times that the prospect of a negative padding might help the development of CSS of certain page elements become better and easier. Yet, there is no provision for a negative pad..

How to give the background-image path in CSS?

My CSS file is in : Project/Web/Support/Styles/file.css My image is in : Project/Web/images/image.png I want this image in my CSS file. I have tried : 1) background-image: url(/images/image.png)..

Getting session value in javascript

I am using an external javascript file for my asp.net project. Now i want to get the session value in that javascript. How can i get the session value in that javascript file? Thanks in advance....

How can I hide or encrypt JavaScript code?

Is there any way to hide or encrypt JavaScript code to prevent people from viewing, copying, and/or modifying proprietary programs?..

JUnit Testing Exceptions

I'm really new to java. I'm running some JUnit tests on a constructor. The constructor is such that if it is given a null or an empty string for one of its parameters, it's supposed to throw an exce..

How to set a hidden value in Razor

I know that what I'm trying to do is bad idea, but I have specific constrains for now. I have multiple sites, using one and the same MVC3 code base. For one of them the requirement is to hide some re..

How to select a dropdown value in Selenium WebDriver using Java

I am new to selenium , currently am working on selenium webdriver i want to select a value from the drop down. The id=periodId and the option is many in that am trying to select Last 52 weeks. Here i..

NameError: name 'datetime' is not defined

I'm teaching myself Python and was just "exploring". Google says that datetime is a global variable but when I try to find todays date in the terminal I receive the NameError in the question title? m..

How to initialize a List<T> to a given size (as opposed to capacity)?

.NET offers a generic list container whose performance is almost identical (see Performance of Arrays vs. Lists question). However they are quite different in initialization. Arrays are very easy to..

jQuery has deprecated synchronous XMLHTTPRequest

Like many others, my website is using jQuery. When I open the developer tools, I see a warning that says that XMLHTTPRequest is deprecated because of its detrimental effects to the end user's exp..

How to restart counting from 1 after erasing table in MS Access?

I have table in MS Access that has an AutoNumber type in field ID After inserting some rows, the ID has become 200 Then, I have deleted the records in the table. However, when I tried to insert a ne..

Understanding [TCP ACKed unseen segment] [TCP Previous segment not captured]

We are doing some load testing on our servers and I'm using tshark to capture some data to a pcap file then using the wireshark GUI to see what errors or warnings are showing up by going to Analyze ->..

How to read until EOF from cin in C++

I am coding a program that reads data directly from user input and was wondering how could I (without loops) read all data until EOF from standard input. I was considering using cin.get( input, '\0' )..

Visual Studio Expand/Collapse keyboard shortcuts

In Visual Studio, if I have a code file open, I can press CTRL + M or CTRL + M + O to collapse all code blocks, regions, namespaces, etc. How to I do the opposite and expand everything? I have Googl..

Find nearest value in numpy array

Is there a numpy-thonic way, e.g. function, to find the nearest value in an array? Example: np.find_nearest( array, value ) ..

Validate that text field is numeric usiung jQuery

I have a simple issue -- I would like to check a field to see if it's an integer if it is not blank. I'm not using any additional plugins, just jQuery. My code is as follows: if($('#Field').val() != ..

JFrame.dispose() vs System.exit()

What is the difference between these two methods - System.exit() and JFrame.dispose()? If we want to close a Java Swing application when a button is clicked, which method should I use?..

<script> tag vs <script type = 'text/javascript'> tag

I was just wondering, what is the difference between <script> and <script type = 'text/javascript'> Is it different for different webservers? For example,(I know it's incorrect to..

How do I enable/disable log levels in Android?

I am having lots of logging statements to debug for example. Log.v(TAG, "Message here"); Log.w(TAG, " WARNING HERE"); while deploying this application on device phone i want to turn off the verbose..

Serialize an object to string

I have the following method to save an Object to a file: // Save an object out to the disk public static void SerializeObject<T>(this T toSerialize, String filename) { XmlSerializer xmlSeri..

Better way to find last used row

I am trying to find the last row the same way I found the last column: Sheets("Sheet2").Cells(1,Sheets("Sheet2").Columns.Count).End(xlToLeft).Column I know this way but it is not ..

What's the best way to share data between activities?

I have one activity which is the main activity used throughout the app and it has a number of variables. I have two other activities which I would like to be able to use the data from the first activi..

event Action<> vs event EventHandler<>

Is there any different between declaring event Action<> and event EventHandler<>. Assuming it doesn't matter what object actually raised an event. for example: public event Action<bo..

How can I display just a portion of an image in HTML/CSS?

Let's say I want a way to display just the the center 50x50px of an image that's 250x250px in HTML. How can I do that. Also, is there a way to do this for css:url() references? I'm aware of clip in C..

Difference between using Throwable and Exception in a try catch

Sometimes, I see try { } catch(Throwable e) { } And sometimes try { } catch(Exception e) { } What is the difference?..

What's the fastest algorithm for sorting a linked list?

I'm curious if O(n log n) is the best a linked list can do...

d3.select("#element") not working when code above the html element

This works: <div id="chart"></div> <script>var svg = d3.select("#chart").append("svg:svg");</script> This doesn't: <script>var svg = d3.select("#chart").append("svg:s..

Insert multiple rows into single column

I'm new to SQL, (using SQL 2008 R2) and I am having trouble inserting multiple rows into a single column. I have a table named Data and this is what I am trying INSERT INTO Data ( Col1 ) VALUES ('He..

Why is $$ returning the same id as the parent process?

I have problem with Bash, and I don't know why. Under shell, I enter: echo $$ ## print 2433 (echo $$) ## also print 2433 (./getpid) ## print 2602 "getpid" is a C program to get current pid, lik..

Android: How to bind spinner to custom object list?

In the user interface there has to be a spinner which contains some names (the names are visible) and each name has its own ID (the IDs are not equal to display sequence). When the user selects the na..

Find a row in dataGridView based on column and value

I have a dataGridView that has 3 columns: SystemId, FirstName, LastName that is bound using database information. I would like to highlight a certain row, which I would do using: dataGridView1.Rows[..

How to set maximum fullscreen in vmware?

I'm using VMware workstation 8 on windows 7 and having some Linux hosts such as Centos, Backtrack and ... on it. The problem is the screen of the virtual machines is not fixed with my screen. here is ..

Best approach to converting Boolean object to string in java

I am trying to convert boolean to string type... Boolean b = true; String str = String.valueOf(b); or Boolean b = true; String str = Boolean.toString(b); which one of above would be more efficie..

Force drop mysql bypassing foreign key constraint

I'm trying to delete all tables from a database except one, and I end up having the following error: Cannot delete or update a parent row: a foreign key constraint fails Of course I could trial..

java.lang.OutOfMemoryError: Java heap space in Maven

When I run maven test, java.lang.OutOfMemoryError happens. I googled it for solutions and have tried to export MAVEN_OPTS=-Xmx1024m, but it did not work. Anyone know other solutions for this problem? ..

iOS / Android cross platform development

I've been playing around with developing Android apps in Java for a while and am starting to get a handle on it. However if I want to on start on an iOS version I need to code everything from scratch..

Populate dropdown select with array using jQuery

I am trying to populate a dropdown select with an array using jQuery. Here is my code: // Add the list of numbers to the drop down here var numbers[] = { 1, 2, 3, 4, 5}; $.ea..

Shell script not running, command not found

I am very, very new to UNIX programming (running on MacOSX Mountain Lion via Terminal). I've been learning the basics from a bioinformatics and molecular methods course (we've had two classes) where w..

Error after upgrading pip: cannot import name 'main'

Whenever I am trying to install any package using pip, I am getting this import error: guru@guru-notebook:~$ pip3 install numpy Traceback (most recent call last): File "/usr/bin/pip3", line 9, in &..

Cast Int to enum in Java

What is the correct way to cast an Int to an enum in Java given the following enum? public enum MyEnum { EnumValue1, EnumValue2 } MyEnum enumValue = (MyEnum) x; //Doesn't work??? ..

How to clear all input fields in bootstrap modal when clicking data-dismiss button?

How to clear all input fields in a Bootstrap V3 modal when clicking the data-dismiss button?..

How to git ignore subfolders / subdirectories?

I have a lot of projects in my .Net solution. I would like to exclude all "bin/Debug" and "bin/Release" folders (and their contents), but still include the "bin" folder i..

MongoDB inserts float when trying to insert integer

> db.data.update({'name': 'zero'}, {'$set': {'value': 0}}) > db.data.findOne({'name': 'zero}) {'name': 'zero', 'value': 0.0} How do I get Mongo to insert an integer? Thank you..

MSVCP120d.dll missing

Every time I want to compile my Visual Studio project I get the message that MSVCP120d.dll is missing. Google can't help me. I already installed some redistributables but they didn't help. I also foun..

SCP Permission denied (publickey). on EC2 only when using -r flag on directories

scp -r /Applications/XAMPP/htdocs/keypairfile.pem uploads ec2-user@publicdns:/var/www/html where uploads is a directory returns Permission denied (publickey). However scp -i /Applications/XAMPP/h..

Try-Catch-End Try in VBScript doesn't seem to work

I'm trying the following code: Try ' DOESN'T WORK Throw 2 ' How do I throw an exception? Catch ex 'What do I do here? End Try but I'm getting the error Statement expected in the catch claus..

How can I connect to MySQL in Python 3 on Windows?

I am using ActiveState Python 3 on Windows and wanted to connect to my MySQL database. I heard that mysqldb was the module to use. I can't find mysqldb for Python 3. Is there a repository available w..

Generate Controller and Model

I am newbie with Laravel and I played around laravel 4(Beta version). I want to know how to generate Controller and Model by command line use php artisan. But I don't know how to do them...

c# regex matches example

I am trying to get values from the following text. How can this be done with Regex? Input Lorem ipsum dolor sit %download%#456 amet, consectetur adipiscing %download%#3434 elit. Duis non nunc nec..

How to URL encode a string in Ruby

How do I URI::encode a string like: \x12\x34\x56\x78\x9a\xbc\xde\xf1\x23\x45\x67\x89\xab\xcd\xef\x12\x34\x56\x78\x9a to get it in a format like: %124Vx%9A%BC%DE%F1%23Eg%89%AB%CD%EF%124Vx%9A as p..

Bootstrap change div order with pull-right, pull-left on 3 columns

I’ve been working on this the whole day but don’t come up with a solution. I have 3 columns in one row in a container. 1: right content – pull-right 2: navigation – pull-left 3: main conten..

How is a CSS "display: table-column" supposed to work?

Given the following HTML and CSS, I see absolutely nothing in my browser (Chrome and IE latest at time of writing). Everything collapses down to 0x0 px. Why? <!DOCTYPE html> <html> <he..

Excel 2013 VBA Clear All Filters macro

It seems older macros are not working. I have proper securtiy set to run VBA macros but when I have tried a few methods for clearing ALL filters on a worksheet, I get a compile error. Here is what I ..