Questions Tagged with #Right to left

Right to Left (RTL) refers to the scripts of natural languages that are written and read from the right to the left instead from the left to the right, such as Hebrew, Arabic and Persian. For problems with interaction of right-to-left and left-to-right text, prefer the "bidi" tag.

How to set Navigation Drawer to be opened from right to left

First of all I know this question appeared here before but after trying a lot I still didn't succeed. I working on the example from Android Developers site. I'm trying to set the menu to be opened f..

slideToggle JQuery right to left

i'm new in JQ i have this script i found on the internet and its do exactly what i need but i want the sliding will be from the right to the left how can i do it? please help this is the code <sc..

How do I check if string contains substring?

I have a shopping cart that displays product options in a dropdown menu and if they select "yes", I want to make some other fields on the page visible. The problem is that the shopping cart also inc..

Copying one structure to another

I know that I can copy the structure member by member, instead of that can I do a memcpy on structures? Is it advisable to do so? In my structure, I have a string also as member which I have to copy..

Equivalent of .bat in mac os

I currently use a .bat file that is utilized to invoke a java file. If I wanted to utilize the same functionality on Mac OS what format changes would I make? (unless the .bat equivalent on Mac OS is t..

Regex pattern inside SQL Replace function?

SELECT REPLACE('<strong>100</strong><b>.00 GB', '%^(^-?\d*\.{0,1}\d+$)%', ''); I want to replace any markup between two parts of the number with above regex, but it does not seem t..

Return values from the row above to the current row

I am trying to do simple thing: I just need to set some cells to values that are on the previous rows. I have tried =A(Row()-1) but it does not work...

Remove a CLASS for all child elements

Given the following HTML: <div id="table-filters"> <ul> <li class="active">blah</li> <li>blah</li> <li>blah</li> &l..

Swift Open Link in Safari

I am currently opening the link in my app in a WebView, but I'm looking for an option to open the link in Safari instead...

Apply jQuery datepicker to multiple instances

I've got a jQuery date picker control that works fine for once instance, but I'm not sure how to get it to work for multiple instances. <script type="text/javascript"> $(function() { ..

Android TextView Justify Text

How do you get the text of a TextView to be Justified (with text flush on the left- and right- hand sides)? I found a possible solution here, but it does not work (even if you change vertical-center..

Calculating frames per second in a game

What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number c..

How can I select rows by range?

Possible Duplicate: Select statement in SQLite recognizing row number For example, SELECT * FROM table WHERE [row] BETWEEN x AND y How can this be done? I've done some reading but haven't ..

IF EXIST C:\directory\ goto a else goto b problems windows XP batch files

whenever i run the code below it occurs to me I have made a mistake using the if exist lines, as no matter whether the directory exists or not, it acts as if the line was never there... either that or..

Is there an easy way to check the .NET Framework version?

The problem is that I need to know if it's version 3.5 SP 1. Environment.Version() only returns 2.0.50727.3053. I found this solution, but I think it will take much more time than it's worth, so I'm ..

jquery 3.0 url.indexOf error

I am getting following error from jQuery once it has been updated to v3.0.0. jquery.js:9612 Uncaught TypeError: url.indexOf is not a function Any Idea why?..

Check if a div does NOT exist with javascript

Checking if a div exists is fairly simple if(document.getif(document.getElementById('if')){ } But how can I check if a div with the given id does not exist?..

SMTPAuthenticationError when sending mail using gmail and python

when i try to send mail using gmail and python error occurred this type of question are already in this site but doesn't help to me gmail_user = "[email protected]" gmail_pwd = "password" TO = 'friend@gm..

What is difference between monolithic and micro kernel?

Could anyone please explain with examples difference between monolithic and micro kernel? Also other classifications of the kernel?..

Textarea that can do syntax highlighting on the fly?

I am storing a number of HTML blocks inside a CMS for reasons of easier maintenance. They are represented by <textarea>s. Does anybody know a JavaScript Widget of some sort that can do syntax h..

How to access a dictionary key value present inside a list?

Suppose I have the following list: list = [{'a': 1, 'b': 2}, {'c': 3, 'd': 4}, {'e': 5, 'f': 6}] How do I access a particular value of key say d?..

Getting value of selected item in list box as string

I am trying to get the value of the selected item in the listbox using the code below, but it is always returning null string. DataSet ds = searchforPrice(Convert.ToString(listBox1.SelectedItem)); ..

Using JQuery to open a popup window and print

A while back I created a lightbox plugin using jQuery that would load a url specified in a link into a lightbox. The code is really simple: $('.readmore').each(function(i){ $(this).popup(); }); ..

Creating a List of Lists in C#

I seem to be having some trouble wrapping my head around the idea of a Generic List of Generic Lists in C#. I think the problem stems form the use of the <T> argument, which I have no prior expe..

Why split the <script> tag when writing it with document.write()?

Why do some sites (or advertisers that give clients javascript code) employ a technique of splitting the <script> and/or </script> tags up within document.write() calls? I noticed that Am..

Reducing MongoDB database file size

I've got a MongoDB database that was once large (>3GB). Since then, documents have been deleted and I was expecting the size of the database files to decrease accordingly. But since MongoDB keeps all..

How to round a numpy array?

I have a numpy array, something like below: data = np.array([ 1.60130719e-01, 9.93827160e-01, 3.63108206e-04]) and I want to round each element to two decimal places. How can I do so? ..

Duplicate / Copy records in the same MySQL table

I have been looking for a while now but I can not find an easy solution for my problem. I would like to duplicate a record in a table, but of course, the unique primary key needs to be updated. I hav..

How can I read command line parameters from an R script?

I've got a R script for which I'd like to be able to supply several command-line parameters (rather than hardcode parameter values in the code itself). The script runs on Windows. I can't find info ..

Python 3 string.join() equivalent?

I've been using string.join() method in python 2 but it seems like it has been removed in python 3. What is the equivalent method in python 3? string.join() method let me combine multiple strings to..

twitter bootstrap typeahead ajax example

I'm trying to find a working example of the twitter bootstrap typeahead element that will make an ajax call to populate it's dropdown. I have an existing working jquery autocomplete example which de..

Bootstrap: Collapse other sections when one is expanded

I am making a Rails app, and am trying to achieve a particular functionality relating to Twitter's Bootstrap collapse. Bear with me as I explain it. I currently have the following view: When each ..

How to downgrade from Internet Explorer 11 to Internet Explorer 10?

As a developer, I found the new Internet Explorer version to be a complete nightmare. I turned the windows feature off, but I wasn't able to install Internet Explorer 10. It says that i..

How to create a signed APK file using Cordova command line interface?

I made a sample application named checkStatus. Now I want to create a signed APK file. So I can install it in different devices for my testing. For this, I Googled and found this documentation. As p..

Calling @Html.Partial to display a partial view belonging to a different controller

I am developing an ASP.NET MVC 3 application, whose content pages have a common pattern of layout elements. However, because the login page does not follow this layout, I cannot place this layout in \..

How to change active class while click to another link in bootstrap use jquery?

I have a html as sidebar, and use Bootstrap. <ul class="nav nav-list"> <li class="active"><a href="/">Link 1</a></li> <li><a href="/link2">Link 2<..

jquery getting post action url

I'm trying to access the post target action in a jquery function. example: <form action="/page/users" id="signup" method="post"> I'd like to access the "action" part - "/page/users" in this ..

Deserialize JSON string to c# object

My Application is in Asp.Net MVC3 coded in C#. This is what my requirement is. I want an object which is in the following format.This object should be achieved when I deserialize the Json string. var..

Open a URL without using a browser from a batch file

I want to open a particular URL without directly opening the browser using only a batch file. I know I can use something like: START www.google.com But I want to open a URL without using a browser...

HTML select form with option to enter custom value

I would like to have an input field that users can enter custom text value or choose from drop down. A regular <select> only offers drop down options. How can I make a <select> accept cus..

GUI Tool for PostgreSQL

I am new to PostgreSQL database and I want to know if there any GUI Tools for PostgreSQL just like SQLYog for MySQL?..

Asking the user for input until they give a valid response

I am writing a program that accepts an input from the user. #note: Python 2.7 users should use `raw_input`, the equivalent of 3.X's `input` age = int(input("Please enter your age: ")) if age >= 18..

How to store an output of shell script to a variable in Unix?

i have a shell script "script.sh" which gives output as "success" or "Failed" when i execute in unix window. Now i want to store the output of script.sh into a unix command variable. say $a = {output ..

ES6 export all values from object

Say I have a module (./my-module.js) that has an object which should be its return value: let values = { a: 1, b: 2, c: 3 } // "export values" results in SyntaxError: Unexpected token So I can imp..

My Routes are Returning a 404, How can I Fix Them?

I've just started learning the Laravel framework and I'm having an issue with routing. The only route that's working is the default home route that's attached to Laravel out of the box. I'm using WA..

Number prime test in JavaScript

I'm trying to complete the Codewars challenge that asks you to check if a number is a prime number. For whatever reason, my solution doesn't seem to work for the square of odd prime numbers (e.g. 9 re..

Split string using a newline delimiter with Python

I need to delimit the string which has new line in it. How would I achieve it? Please refer below code. Input: data = """a,b,c d,e,f g,h,i j,k,l""" Output desired: ['a,b,c', 'd,e,f', 'g,h,i', 'j,..

Find the smallest positive integer that does not occur in a given sequence

I was trying to solve a problem in Codility provided below, Write a function: class Solution { public int solution(int[] A); } that, given an array A of N integers, returns the smallest positive ..

How to SUM parts of a column which have same text value in different column in the same row

I have a column with names and a column with numbers: FirstName Name Number John Smith 17 John Smith 26 Peter Smith 116 Peter Smith 25 Franck ..

Reading DataSet

How do I read data from a DataSet in WPF? I have a train schedule table with just 2 columns and I want to be able to read the departure times and calculate when the next train is leaving. For example,..

How to validate IP address in Python?

What's the best way to validate that an IP entered by the user is valid? It comes in as a string...

Get: TypeError: 'dict_values' object does not support indexing when using python 3.2.3

This is my code: {names[i]:d.values()[i] for i in range(len(names))} This works completely fine when using python 2.7.3; however, when I use python 3.2.3, I get an error stating 'dict_values' objec..

How to get All input of POST in Laravel

I am using Laravel 5 and trying to get all input of POST variable in controller like this- public function add_question() { return Request::all(); } So, I am getting this errors- What I am d..

How do you setLayoutParams() for an ImageView?

I want to set the LayoutParams for an ImageView but cant seem to find out the proper way to do it. I can only find documentation in the API for the various ViewGroups, but not an ImageView. Yet the I..

Copy multiple files from one directory to another from Linux shell

I want to copy several files from one folder to another. How do I do it from the shell command prompt? Consider that folder1 contains ten files (e.g. file1, file2, abc, xyz, etc.). I am currently ..

Calculating how many minutes there are between two times

I have a datagridview in my application which holds start and finish times. I want to calculate the number of minutes between these two times. So far I have got: var varFinish = tsTable.Rows[intCel..

Node.js Best Practice Exception Handling

I just started trying out node.js a few days ago. I've realized that the Node is terminated whenever I have an unhandled exception in my program. This is different than the normal server container tha..

Altering a column: null to not null

I have a table that has several nullable integer columns. This is undesirable for several reasons, so I am looking to update all nulls to 0 and then set these columns to NOT NULL. Aside from changing..

javax.persistence.NoResultException: No entity found for query

Before I posted this question, I already looked this, but I couldn't get what I was looking for. I know that for the query I wrote there may exist only one row or none at all. So, there is not reason..

How to get the list of all printers in computer

I need to get the list of all printers that connect to computer? How I can do it in C#, WinForms?..

Flask Download a File

I'm trying to create a web app with Flask that lets a user upload a file and serve them to another user. Right now, I can upload the file to the upload_folder correctly. But I can't seem to find a way..

Passing the argument to CMAKE via command prompt

I have a makefile for my project and also I am passing some argument and based on that argument i am seting some flag. I am able to do this . but now I want to do the same using cmake. I have created ..

How to install mongoDB on windows?

I am trying to test out mongoDB and see if it is anything for me. I downloaded the 32bit windows version, but have no idea on how to continue from now on. I normally use the WAMP services for develop..

JSTL if tag for equal strings

I've got a variable from an object on my JSP page: <%= ansokanInfo.getPSystem() %> The value of the variable is NAT which is correct and I want to apply certain page elements for this value. H..

Integer to IP Address - C

I'm preparing for a quiz, and I have a strong suspicion I may be tasked with implementing such a function. Basically, given an IP address in network notation, how can we get that from a 32 bit integer..

How do I specify different Layouts in the ASP.NET MVC 3 razor ViewStart file?

I would like to have 2 separate Layouts in my application. Let's say one is for the Public section of the website and the other is for the Member side. For simplicity, let's say all the logic for each..

How to find the socket buffer size of linux

What's the default socket buffer size of linux? Is there any command to see it?..

How to manually set an authenticated user in Spring Security / SpringMVC

After a new user submits a 'New account' form, I want to manually log that user in so they don't have to login on the subsequent page. The normal form login page going through the spring security int..

What is a callback URL in relation to an API?

I've been scouring the net, and can't seem to wrap my head around the idea of a callback URL. In my case I have a few callback URLs that I have to define myself. A popular one is a "default callback U..

Bootstrap 3 collapsed menu doesn't close on click

I have a more or less standard navigation from bootstrap 3 <body data-spy="scroll" data-target=".navbar-collapse"> <!-- ---------- Navigation ---------- --> <div class="navbar ..

Setting a global PowerShell variable from a function where the global variable name is a variable passed to the function

I need to set a global variable from a function and am not quite sure how to do it. # Set variables $global:var1 $global:var2 $global:var3 function foo ($a, $b, $c) { # Add $a and $b and set the..

How can I get the name of an html page in Javascript?

I have an html page and I would like inside the html page to retrieve the name of the html document via Javascript. Is that possible? e.g. name of html document = "indexOLD.html"..

Adding to the classpath on OSX

Can anyone tell me how to add to the classpath on OSX? ..

Skipping Incompatible Libraries at compile

When I try to compile a copy of my project on my local machine, I get an error stating that it 's skipping over incompatible libraries. This isn't the case when I'm messing around with the live versi..

How do you change the text in the Titlebar in Windows Forms?

I am trying to set a condition that would change the writing inside the title bar... But how do I change the title bar text?..

Sum up a column from a specific row down

It seem simple but I cannot find a way to define a range that goes up to the end of the column in an Excel formula. For instance I can use this equation SUM(C:C) to sum all number found on the column..

SQL : BETWEEN vs <= and >=

In SQL Server 2000 and 2005: what is the difference between these two WHERE clauses? which one I should use on which scenarios? Query 1: SELECT EventId, EventName FROM EventMaster WHERE EventDate..

iOS 7 status bar back to iOS 6 default style in iPhone app?

In iOS 7 the UIStatusBar has been designed in a way that it merges with the view like this: (GUI designed by Tina Tavcar) It is cool, but it will somewhat mess up your view when you have something..

When & why to use delegates?

I'm relatively new in C#, & I'm wondering when to use Delegates appropriately. they are widely used in events declaration, but when should I use them in my own code and why are they useful? why no..

Eclipse - Failed to create the java virtual machine

I'm having issue with running my Eclipse with the following config: eclipse.ini -startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launc..

How to remove entry from $PATH on mac

I was trying to install Sencha Touch SDK tools 2.0.0 but could not run it properly. It created an entry in the $PATH variable. Later I deleted the sencha sdk tools folder but didn't realize that the ..

How to generate a Makefile with source in sub-directories using just one makefile

I have source in a bunch of subdirectories like: src/widgets/apple.cpp src/widgets/knob.cpp src/tests/blend.cpp src/ui/flash.cpp In the root of the project I want to generate a single Makefile usin..

Maven Out of Memory Build Failure

As of today, my maven compile fails. [INFO] [ERROR] Unexpected [INFO] java.lang.OutOfMemoryError: Java heap space [INFO] at java.util.Arrays.copyOfRange(Arrays.java:2694) [INFO] at java.lang.String..

Saving a select count(*) value to an integer (SQL Server)

I'm having some trouble with this statement, owing no doubt to my ignorance of what is returned from this select statement: declare @myInt as INT set @myInt = (select COUNT(*) from myTable as count) ..

android: data binding error: cannot find symbol class

I am getting started for using DataBinding feature. I am facing problem with it. Error:(21, 9) error: cannot find symbol class ContactListActivityBinding build.gradle(Module: app) apply plugi..

Is it possible to cast a Stream in Java 8?

Is it possible to cast a stream in Java 8? Say I have a list of objects, I can do something like this to filter out all the additional objects: Stream.of(objects).filter(c -> c instanceof Client) ..

How do I erase an element from std::vector<> by index?

I have a std::vector<int>, and I want to delete the n'th element. How do I do that? std::vector<int> vec; vec.push_back(6); vec.push_back(-17); vec.push_back(12); vec.erase(???); ..

How do you programmatically update query params in react-router?

I can't seem to find how to update query params with react-router without using <Link/>. hashHistory.push(url) doesn't seem to register query params, and it doesn't seem like you can pass a quer..

Find which version of package is installed with pip

Using pip, is it possible to figure out which version of a package is currently installed? I know about pip install XYZ --upgrade but I am wondering if there is anything like pip info XYZ. If not wh..

How to send authorization header with axios

How can I send an authentication header with a token via axios.js? I have tried a few things without success, for example: const header = `Authorization: Bearer ${token}`; return axios.get(URLConsta..

jquery can't get data attribute value

I am trying to set a variable in jQuery. The value is supposed to be set on the click event of the button. The onclick event fires but the x10Device variable remains undefined. I am on jquery 1.7.1..

Importing Pandas gives error AttributeError: module 'pandas' has no attribute 'core' in iPython Notebook

I am running a iPython notebook via the Anaconda Navigator app (version 1.1.0). When I want to import pandas it gives me a strange error. I thought the Anaconda app included the pandas package? -----..

Generate SHA hash in C++ using OpenSSL library

How can I generate SHA1 or SHA2 hashes using the OpenSSL libarary? I searched google and could not find any function or example code...

Code to loop through all records in MS Access

I need a code to loop through all the records in a table so I can extract some data. In addition to this, is it also possible to loop through filtered records and, again, extract data? Thanks!..

To get total number of columns in a table in sql

I need a query in sql to get total columns in a table.Can anybody help?..

jQuery/JavaScript to replace broken images

I have a web page that includes a bunch of images. Sometimes the image isn't available, so a broken image is displayed in the client's browser. How do I use jQuery to get the set of images, filter it..

Removing duplicates in the lists

Pretty much I need to write a program that checks if a list has any duplicates and if it does it removes them and returns a new list with the items that weren't duplicated/removed. This is what I have..

CSS Input with width: 100% goes outside parent's bound

I am trying to make a login form constituted of two input fields with an inset padding, but those two fields always end up exceeding its parent's boundaries; the issue stems from the added inset paddi..

How to calculate combination and permutation in R?

How one can calculate the number of combinations and permutations in R? The Combinations package failed to install on Linux with the following message: > install.packages("Combinations") ..

Android ClassNotFoundException: Didn't find class on path

10-22 15:29:40.897: E/AndroidRuntime(2561): FATAL EXCEPTION: main 10-22 15:29:40.897: E/AndroidRuntime(2561): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.gvg.simid/com..

How to change workspace and build record Root Directory on Jenkins?

I would like Jenkins' data to be written to drive "E:" since this is the large drive on the server. Jenkins itself is installed on "C:". How do I do that? The default configuration that I saw is: ..

Recommended way of making React component/div draggable

I want to make a draggable (that is, repositionable by mouse) React component, which seems to necessarily involve global state and scattered event handlers. I can do it the dirty way, with a global va..

Set CFLAGS and CXXFLAGS options using CMake

I just want to debug some code running on Linux and I need a debug build (-O0 -ggdb). So I added these things to my CMakeLists.txt: set(CMAKE_BUILD_TYPE DEBUG) set(CMAKE_C_FLAGS "-O0 -ggdb") set(CMAK..

How to specify the private SSH-key to use when executing shell command on Git?

A rather unusual situation perhaps, but I want to specify a private SSH-key to use when executing a shell (git) command from the local computer. Basically like this: git clone [email protected]:TheUser/T..

Groovy - Convert object to JSON string

I'm pretty used to Grails converters, where you can convert any object to a JSON representation just like this (http://grails.org/Converters+Reference) return foo as JSON But in plain groovy, I can..

After updating Entity Framework model, Visual Studio does not see changes

If I do any changes to my EF 5.0 model, VS does not seem to see the changes. I have tried adding a new table, which shows up fine in the model, but then if I try to use it somewhere the table does not..

How can I delete all cookies with JavaScript?

I have written code to save cookies in JavaScript. Now I need to clear the cookies irrespective of values that I assigned. Are there any script modules to delete all cookies that were generated by Jav..

Get paragraph text inside an element

I want to have the text value from a <p> inside a <li> element. html: <ul> <li onclick="myfunction()"> <span></span> <p>This Text</p>..

How to serve static files in Flask

So this is embarrassing. I've got an application that I threw together in Flask and for now it is just serving up a single static HTML page with some links to CSS and JS. And I can't find where in the..

Back button and refreshing previous activity

If we have two activities: List of files and last modified time File editing activity A user selects a file from the list and is taken to the file editing activity. When done editing, the user pre..

use std::fill to populate vector with increasing numbers

I would like to fill a vector<int> using std::fill, but instead of one value, the vector should contain numbers in increasing order after. I tried achieving this by iterating the third paramete..

Force DOM redraw/refresh on Chrome/Mac

Every once in a while, Chrome will render perfectly valid HTML/CSS incorrectly or not at all. Digging in through the DOM inspector is often enough to get it to realize the error of its ways and redr..

Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154

I developed a Windows service using C#.NET to generate PDF report. To generate PDF file I am using a third party dll. The application is running in my Windows XP platform. When I deployed the service ..

Clone private git repo with dockerfile

I have copied this code from what seems to be various working dockerfiles around, here is mine: FROM ubuntu MAINTAINER Luke Crooks "[email protected]" # Update aptitude with new repo RUN apt-get upda..

How to install wget in macOS?

I try to install wget in MAC OS 10.11.1 but when I run ./configure --with-ssl=openssl I get this error: configure: error: --with-ssl=openssl was given, but SSL is not available. How to resolve this..

Scroll to bottom of div?

I am creating a chat using Ajax requests and I'm trying to get messages div to scroll to the bottom without much luck. I am wrapping everything in this div: #scroll { height:400px; overflow:sc..

IndexError: index 1 is out of bounds for axis 0 with size 1/ForwardEuler

I am numerically solving for x(t) for a system of first order differential equations. The system is: dy/dt=(C)\*[(-K\*x)+M*A] I have implemented the Forward Euler method to solve this problem as fol..

Adding Apostrophe in every field in particular column for excel

How can you add an apostrophe in every field in an Excel spreadsheet without individually typing it in? I have got like 5k fields ..

Finding CN of users in Active Directory

I'm trying to find the Base DN of the user that can access or controls all the users in Active Directory so I can put it in my LDAP. Usually someone will give me this, and it looks like DC=domain,DC=..

What does iterator->second mean?

In C++, what is the type of a std::map<>::iterator? We know that an object it of type std::map<A,B>::iterator has an overloaded operator -> which returns a std::pair<A,B>*, and t..

How to make HTML code inactive with comments

I have some HTML code on a page that I don't want to erase, but make inactive for the short term. How can I make the browser ignore parts of the page in the same way the // works in some programming l..

Removing a list of characters in string

I want to remove characters in a string in python: string.replace(',', '').replace("!", '').replace(":", '').replace(";", '')... But I have many characters I have to remove. I thought about a list ..

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

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

Why, Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ...?

Why I'm getting this PHP error? Fatal error: Class 'PHPUnit_Framework_TestCase' not found in ... ..

What is "git remote add ..." and "git push origin master"?

Quite often, Git and Rails looks like magic... such as in the first chapter of Rails 3 Tutorial book, it talks about Git: git remote add origin [email protected]:peter/first_app.git git push origin mast..

How to find the Target *.exe file of *.appref-ms

I have to make a Backup of the Program running from the file *.appref-ms When i Opened the File GitHub.appref-ms using text editor i found http://github-windows.s3.amazonaws.com/GitHub.application..

Best way to remove an event handler in jQuery?

I have an input type="image". This acts like the cell notes in Microsoft Excel. If someone enters a number into the text box that this input-image is paired with, I setup an event handler for the inpu..

HTTP GET request in JavaScript?

I need to do an HTTP GET request in JavaScript. What's the best way to do that? I need to do this in a Mac OS X dashcode widget...

Shorten string without cutting words in JavaScript

I'm not very good with string manipulation in JavaScript, and I was wondering how you would go about shortening a string without cutting any word off. I know how to use substring, but not indexOf or a..

How to call a PHP file from HTML or Javascript

I've looked around for a long while now and I can't find anywhere that answers this seemingly basic question. I don't care if the page reloads or displays the results immediately; I just want to have ..

How to: Create trigger for auto update modified date with SQL Server 2008

It would be nice to know how to create a trigger that auto-updates the modifiedDate column in my SQL Server table: Table TimeEntry Id (PK) UserId (FK) Description Time GenDate ModDate Trigger code..

Add a space (" ") after an element using :after

I want to add a blank space after some content, however the content: " "; doesn't seem to work. This is my code: h2:after { content: " "; } ... which doesn't work, however this does: h2:after..

How to replace a string in multiple files in linux command line

I need to replace a string in a lot of files in a folder, with only ssh access to the server. How can I do this?..

Post parameter is always null

Since upgrading to RC for WebAPI I'm having some real odd issue when calling POST on my WebAPI. I've even gone back to the basic version generated on new project. So: public void Post(string value) {..

Random String Generator Returning Same String

I've developed a random string generator but it's not behaving quite as I'm hoping. My goal is to be able to run this twice and generate two distinct four character random strings. However, it just ..

Android studio: emulator is running but not showing up in Run App "choose a running device"

I have launched my emulator via the AVD manager and once it's running I have clicked on run app. I have waited a couple of minutes for my running device to show up in choose a running device but the w..

The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'NTLM'

Few days ago I had quite a headache with authentication problems when using Windows authentication between client and wcf web service. The error I was getting was "The HTTP request is unauthorized wit..

Backbone.js fetch with parameters

Following the documentation, I did: var collection = new Backbone.Collection.extend({ model: ItemModel, url: '/Items' }) collection.fetch({ data: { page: 1} }); the url turned out ..

Can gcc output C code after preprocessing?

I'm using an open source library which seems to have lots of preprocessing directives to support many languages other than C. So that I can study what the library is doing I'd like to see the C code t..

"Parameter not valid" exception loading System.Drawing.Image

Why am I getting the exception "Parameter not valid" in my code: MemoryStream ms = new MemoryStream(byteArrayIn); System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms); The length ..

Laravel PHP Command Not Found

I have installed Laravel using composer without problems, but when I try to execute "laravel" in my terminal I have this typical error: -bash: laravel: command not found If I read the documentat..

How to abort a Task like aborting a Thread (Thread.Abort method)?

We could abort a Thread like this: Thread thread = new Thread(SomeMethod); . . . thread.Abort(); But can I abort a Task (in .Net 4.0) in the same way not by cancellation mechanism. I want to kill t..

How to enable CORS in AngularJs

I have created a demo using JavaScript for Flickr photo search API. Now I am converting it to the AngularJs. I have searched on internet and found below configuration. Configuration: myApp.config(..

Why cannot change checkbox color whatever I do?

I try to style checkbox background color, but it won't change whatever I do. I am using firefox 29 latest. Is there some rule changes in css or may be in the browser? CSS: input[type="checkbox"] { ..

LINUX: Link all files from one to another directory

I want to link ( ln -s ) all files that are in /mnt/usr/lib/ into /usr/lib/ There are lots of files, how can it be done quickly? :)..

Apache error: _default_ virtualhost overlap on port 443

I get this error when trying to start Apache. _default_ virtualhost overlap on port 443 I'm trying to set up SSL. Almost every solution online says add: NameVirtualHost *:443 to the conf file..

How can I implement custom Action Bar with custom buttons in Android?

I want to implement custom ActionBar which must look like this: So questions: How can I implement a button like custom view: just some image? How can I draw a line on the top of the ActionBar? An..

How to create an empty file with Ansible?

What is the easiest way to create an empty file using Ansible? I know I can save an empty file into the files directory and then copy it to the remote host, but I find that somewhat unsatisfactory. A..

What is difference between mutable and immutable String in java

As per my knowledge, a mutable string can be changed, and an immutable string cannot be changed. Here I want to change the value of String like this, String str="Good"; str=str+" Morning"; and ot..

Change font-weight of FontAwesome icons?

I'd like to make one of the FontAwesome icons a bit less heavy - it's much heavier than the font I am using. This how it looks presently: : Ugly, right? So I've tried resetting the font-weight as f..

How do I create a singleton service in Angular 2?

I've read that injecting when bootstrapping should have all children share the same instance, but my main and header components (main app includes header component and router-outlet) are each getting ..

Change span text?

Possible Duplicate: How do I change the text of a span element in javascript Well, I've searched a lot for the answer to this, but still I couldn't find it. What I did find didn't work. Wh..

How do you revert to a specific tag in Git?

I know how to revert to older commits in a Git branch, but how do I revert back to a branch's state dictated by a tag? I envision something like this: git revert -bytag "Version 1.0 Revision 1.5" I..

How to center the text in a JLabel?

despite many tries I can't get the result that I would like to see - text centered within the JLabel and the JLabel somewhat centered in the BorderLayout. I said "somewhat" because there should be als..

Laravel Eloquent - Get one Row

This might be a simple question, but I cannot figure this out. I am trying to get a user by email using: $user = User::whereEmail($email)->get(); But this is returning an array (of dimension 1) ..

Usage of sys.stdout.flush() method

What does sys.stdout.flush() do?..

The 'json' native gem requires installed build tools

I have ruby 1.9.2p180 (2011-02-18) [i386-mingw32] installed on my windows 7 machine. Now I tried to install the JSON gem using the command, "gem install json" and got the following error. ERROR: Err..

In PHP with PDO, how to check the final SQL parametrized query?

In PHP, when accessing MySQL database with PDO with parametrized query, how can you check the final query (after having replaced all tokens)? Is there a way to check what gets really executed by the ..

ERROR:'keytool' is not recognized as an internal or external command, operable program or batch file

When i use the command C:\>keytool -list -alias androiddebugkey -keystore .android\debug.keystore -storepass android -keypass android I get this error: 'keytool' i..

CSS Display an Image Resized and Cropped

I want to show an image from an URL with a certain width and height even if it has a different size ratio. So I want to resize (maintaining the ratio) and then cut the image to the size I want. I ca..

'No database provider has been configured for this DbContext' on SignInManager.PasswordSignInAsync

.Net Core 1.0.0 - SDK Preview 2 (x64) .Net Core 1.0.0 - VS "15" Preview 2 (x64) .Net Core 1.0.0 - Runtime (x64) So, we updated an RC1 app to the latest versions above. After many hours of ..

List<String> to ArrayList<String> conversion issue

I have a following method...which actually takes the list of sentences and splits each sentence into words. Here is it: public List<String> getWords(List<String> strSentences){ allWords =..

How to see PL/SQL Stored Function body in Oracle

I have a stored function in Oracle database pAdCampaign.fGetAlgoGroupKey. How to see the code of this function.?..

creating array without declaring the size - java

i've digging around about the same issue but i couldn't find the same as i had i want to create an array without declaring the size because i don't know how it will be ! to clear the issue i'd like..

Add A Year To Today's Date

I am trying to add a year to todays date. I am working in a system that does not allow you to use standard JavaScript. For instance, to get todays date I have to use: javascript:now(); I have tri..

How do android screen coordinates work?

I am working with Android Animation and I have found the Android coordinate system to be quite confusing so I am here to ask this question about how coordinates work in Android. I am following this im..

How to format a UTC date as a `YYYY-MM-DD hh:mm:ss` string using NodeJS?

Using NodeJS, I want to format a Date into the following string format: var ts_hms = new Date(UTC); ts_hms.format("%Y-%m-%d %H:%M:%S"); How do I do that?..

Maven won't run my Project : Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec

I can't run the Maven Netbeans JavaFX example : Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) onproject mavenproject3: Command execution failed. Process exited ..

Understanding `scale` in R

I'm trying to understand the definition of scale that R provides. I have data (mydata) that I want to make a heat map with, and there is a VERY strong positive skew. I've created a heatmap with a dend..

Flutter: Run method on Widget build complete

I would like to be able to run functions once a Widget has finished building/loading but I am unsure how. My current use case is to check if a user is authenticated and if not, redirect to a login vi..

convert UIImage to NSData

I am using this code in my app which will help me to send a image. However, I have an image view with an image. I have no file in appbundle but have the image in my side. How can I change the below c..


Function in JavaScript that can be called only once

I need to create a function which can be executed only once, in each time after the first it won't be executed. I know from C++ and Java about static variables that can do the work but I would like to..

List View Filter Android

I have created a list view in android and I want to add edit text above the list and when the user enter text the list will be filtered according to user input can anyone tell me please if there is a..

iPhone/iPad browser simulator?

I need to see how my webpages are looking on an iPhone and iPad on my windows desktop. Is this possible? A quick search yielded some iPhone testing sites, which seemed like what I wanted. However, th..

browser.msie error after update to jQuery 1.9.1

I use the following snip of a script: if ($.browser.msie && $.browser.version < 9) { extra = "?" + Math.floor(Math.random() * 3000); } It works fine with jQuery 1.8.3. Now I updated ..

Simultaneously merge multiple data.frames in a list

I have a list of many data.frames that I want to merge. The issue here is that each data.frame differs in terms of the number of rows and columns, but they all share the key variables (which I've call..

What is the default text size on Android?

I have a mixture of Buttons and an own View, where I set my text size using Paint.setTextSize(). I want the text size to look the same like the text on the Button. Now, I can of course set the text si..

Split string in C every white space

I want to write a program in C that displays each word of a whole sentence (taken as input) at a seperate line. This is what i have done so far: void manipulate(char *buffer); int get_words(char *b..

How can I use iptables on centos 7?

I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for httpd service, but something wrong with my iptables service ... what's wrong with it? What am I doing ..

Bash Script : what does #!/bin/bash mean?

In bash script, what does #!/bin/bash at the 1st line mean ? UPDATE: Is there a difference between #!/bin/bash and #!/bin/sh ?..

jQuery get text as number

This code doesn't work: var number = $(this).find('.number').text(); var current = 600; if (current > number){ // do something } HTML: <div class="number">400</div> Seems the..

What is setContentView(R.layout.main)?

I understand that it has to do with the App layout, but when do I have to use it? I tried to look for a link that explained this method, but I couldn't find it. Thank you in advance!..

Recursive mkdir() system call on Unix

After reading the mkdir(2) man page for the Unix system call with that name, it appears that the call doesn't create intermediate directories in a path, only the last directory in the path. Is there a..

How to print Boolean flag in NSLog?

Is there a way to print value of Boolean flag in NSLog?..

How to leave a message for a github.com user

Need help on GitHub usage. I wonder if there is a way to communicate with a github.com user i.e. write the user a message when only username/id is given on their GitHub page? Does GitHub have this soc..

How to open a new window on form submit

I have a submit form and want it to open a new window when users submits the form so i can track it on analytics. Here is the code I'm using: <form action="http://URL at mailchimp subscriber URL...

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

Open Source Javascript PDF viewer

Is there any open source Javascript based PDF Viewer available? Any guide to developing this kind of script that renders PDF docs would be helpful...

Raw_Input() Is Not Defined

I'm a seventh grade programmer so I may be missing a lot of things in this program, but for my coding club my instructor asked us to make a guess the number game. I have very limited knowledge on this..

What is the better API to Reading Excel sheets in java - JXL or Apache POI

Which of the 2 APIs is simpler to read/write/edit excel sheets ? Do these APIs not support CSV extensions ? Using JXL for file.xls and file.xlsx, I get an exception like: jxl.read.biff.BiffExceptio..

C# ASP.NET MVC Return to Previous Page

I have a basic Edit method in my controller that redirects back to a top level listing (“Index”) when the edit succeeds. Standard behavior after MVC scaffolding. I am trying to change this Edit m..

What's a Good Javascript Time Picker?

What's a good time picker for jquery or standalone js? I would like something like google uses in their calendar where it has a drop down of common times in 15min intervals or lets you manually type i..

How can I add new array elements at the beginning of an array in Javascript?

I have a need to add or prepend elements at the beginning of an array. For example, if my array looks like below: [23, 45, 12, 67] And the response from my AJAX call is 34, I want the updated arra..

How do I create JavaScript array (JSON format) dynamically?

I am trying the create the following: var employees = { "accounting": [ // accounting is an array in employees. { "firstName": "John", // First element "lastName": "Doe", "age..

What is console.log?

What is the use of console.log? Please explain how to use it in JavaScript, with a code example...

How to post pictures to instagram using API

I am building a php application which needs to post the user uploaded picture directly to Instagram, but after a quick search i found that there is no such function in the API :( and it feels weird.....

Sorting rows in a data table

We have two columns in a DataTable, like so: COL1 COL2 Abc 5 Def 8 Ghi 3 We're trying to sort this datatable based on COL2 in decreasing order. COL1 COL2 ghi 8 a..

Regex number between 1 and 100

I searched a lot and can't find the solution for this RegExp (I have to say I'm not very experienced in Reg. Expressions). Regex = ^[1-9]?[0-9]{1}$|^100$ I would like to test a number between 1 an..

Match line break with regular expression

<li><a href="#">Animal and Plant Health Inspection Service Permits Provides information on the various permits that the Animal and Plant Health Inspection Service issues as well as onl..

Get the current date in java.sql.Date format

I need to add the current date into a prepared statement of a JDBC call. I need to add the date in a format like yyyy/MM/dd. I've try with DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");..

How can I get the sha1 hash of a string in node.js?

I'm trying to create a websocket server written in node.js To get the server to work I need to get the SHA1 hash of a string. What I have to do is explained in Section 5.2.2 page 35 of the docs. ..