Questions Tagged with #Paypal subscriptions

Refers to PayPal Subscriptions and Recurring Payments. Supports automatically recurring subscriptions from websites, or other links.

How to insert a file in MySQL database?

I want to insert a file in MYSQL database residing on a remote webserver using a webservice. My question is: What type of table column (e.g. varchar, etc.) will store a file? And will the insert stat..

Google Maps API - Get Coordinates of address

I would like to convert addresses into long/lat. Is there any way to do this without using JavaScript? Because in my case there is no need to display anything since the conversion is in the backgroun..

File uploading with Express 4.0: req.files undefined

I'm attempting to get a simple file upload mechanism working with Express 4.0 but I keep getting undefined for req.files in the app.post body. Here is the relevant code: var bodyParser = require('bo..

Why is Dictionary preferred over Hashtable in C#?

In most programming languages, dictionaries are preferred over hashtables. What are the reasons behind that?..

Can't find/install libXtst.so.6?

I'm running Ubuntu 12.10 and I'm trying to install Netbeans 7.1(or later) I have the .sh file, but it won't install, the error appears here: [2013-06-27 19:11:28.918]: at org.netbeans.installer...

Parameter binding on left joins with array in Laravel Query Builder

I trying to do a left join with where IN clause search. But I couldn't able to bind the array to the query. $query = DB::table('offers'); $query->select('id', 'business_id', 'address_id',..

how to re-format datetime string in php?

I receive a datetime from a plugin. I put it into a variable: $datetime = "20130409163705"; That actually translates to yyyymmddHHmmss. I would need to display this to the user as a transaction t..

1067 error on attempt to start MySQL

I've installed MySQL on Windows 7. When I'm trying to start MySQL service I'm getting error 1067: The process terminated unexpectedly. Log message: 101111 22:27:11 [Note] Plugin 'FEDERATED' is disabl..

How to break a while loop from an if condition inside the while loop?

I want to break a while loop of the format below which has an if statement. If that if statement is true, the while loop also must break. Any help would be appreciated. while(something.hasnext()) { ..

Check if a Python list item contains a string inside another string

I have a list: my_list = ['abc-123', 'def-456', 'ghi-789', 'abc-456'] and want to search for items that contain the string 'abc'. How can I do that? if 'abc' in my_list: would check if 'abc' exi..

Convert PDF to PNG using ImageMagick

using ImageMagick, what command should i use to convert a PDF to PNG? I need highest quality, smallest file size. this is what I have so far (very slow by the way): convert -density 300 -depth 8 -qua..

How to make html <select> element look like "disabled", but pass values?

When I'm disabling a <select name="sel" disabled> <option>123</option> </select> element, it doesnt pass its variable. What to do to look it like disabled, but be in "..

Regex any ASCII character

What is the regex to match xxx[any ASCII character here, spaces included]+xxx? I am trying xxx[(\w)(\W)(\s)]+xxx, but it doesn't seem to work...

How to set image button backgroundimage for different state?

I want imagebutton with two states i) normal ii) touch(or click). I have set normal image in the imagebutton background and I am trying to change image(pressed) from onclick method, but it doesn't ch..

What is sharding and why is it important?

I think I understand sharding to be putting back your sliced up data (the shards) into an easy to deal with aggregate that makes sense in the context. Is this correct? Update: I guess I am struggli..

How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?

I am trying to use ELMAH to log errors in my ASP.NET MVC application, however when I use the [HandleError] attribute on my controllers ELMAH doesn't log any errors when they occur. As I am guessing i..

compression and decompression of string data in java

I am using the following code to compress and decompress string data, but the problem which I am facing is, it is easily getting compressed without error, but decompress method throws following error...

Convert Base64 string to an image file?

I am trying to convert my base64 image string to an image file. This is my Base64 string: http://pastebin.com/ENkTrGNG Using following code to convert it into an image file: function base64_to_jpeg..

Export and import table dump (.sql) using pgAdmin

I have pgAdmin version 1.16.1 So, for exporting table dumm I do: Right click on table, then in menu click on backup, then in Format choice Plain and save file as some_name.sql Then I remove table..

static constructors in C++? I need to initialize private static objects

I want to have a class with a private static data member (a vector that contains all the characters a-z). In java or C#, I can just make a "static constructor" that will run before I make any instance..

Javascript event handler with parameters

I want to make an eventHandler that passes the event and some parameters. The problem is that the function doesn't get the element. Here is an example: doClick = function(func){ var elem = .. // ..

how to install apk application from my pc to my mobile android

I have 2 questions: First, I need to to install apk application from my pc to my mobile android? Second, how I run my code in the mobile directly? I install usb driver but my pc can't detect the us..

Two Divs on the same row and center align both of them

I have two divs like this <div style="border:1px solid #000; float:left">Div 1</div> <div style="border:1px solid red; float:left">Div 2</div> I want them to display on the ..

Python: SyntaxError: non-keyword after keyword arg

When I run the following code def regEx1(): os.chdir("C:/Users/Luke/Desktop/myFiles") files = os.listdir(".") os.mkdir("C:/Users/Luke/Desktop/FilesWithRegEx") regex_txt = input("Please enter..

Best Practices for Custom Helpers in Laravel 5

I would like to create helper functions to avoid repeating code between views in Laravel 5: view.blade.php <p>Foo Formated text: {{ fooFormatText($text) }}</p> They're basically text f..

MySQL does not start when upgrading OSX to Yosemite or El Capitan

I know similar questions exist, such as MySQL with MAMP does not work with OSX Yosemite 10.10. However, I do have MAMP, nor XAMPP installed on my computer. When I try to start mySQL from the PrefPane..

Windows equivalent of linux cksum command

I am looking for a way to compute crc checksum cross platform. cksum works on Linux, AIX, HP-UX Itanium, Solaris, is there a equivalent command of linux cksum in windows too? %cksum run.sh 14913019..

Access Control Request Headers, is added to header in AJAX request with jQuery

I would like to add a custom header to an AJAX POST request from jQuery. I have tried this: $.ajax({ type: 'POST', url: url, headers: { "My-First-Header":"first value", ..

Running JAR file on Windows 10

I have made a Jar file, but I cant make it to run by double clicking. It works fine using java -jar name.jar or by making a batch file. I have already reinstalled jdk1.8.0_102, set the JAVA_HOME varia..

Creating JSON on the fly with JObject

For some of my unit tests I want the ability to build up particular JSON values (record albums in this case) that can be used as input for the system under test. I have the following code: var jsonO..

How to require a controller in an angularjs directive

Can anyone tell me how to include a controller from one directive in another angularJS directive. for example I have the following code var app = angular.module('shop', []). config(['$routeProvider',..

What's the difference between isset() and array_key_exists()?

How do the following two function calls compare: isset($a['key']) array_key_exists('key', $a) ..

The first day of the current month in php using date_modify as DateTime object

I can get the Monday of this week with: $monday = date_create()->modify('this Monday'); I would like to get with the same ease the 1st of this month. How can I achieve that?..

python inserting variable string as file name

I'm trying to create a file file a unique file name, every time my script is ran, it's only intended to be weekly or monthly. so I chose to use the date for the file name. f = open('%s.csv', 'wb') %..

'module' has no attribute 'urlencode'

When I try to follow the Python Wiki's example related to URL encoding: >>> import urllib >>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) >>> f = urllib.u..

Why is 1/1/1970 the "epoch time"?

Why is 1 January 1970 00:00:00 considered the epoch time?..

Test if something is not undefined in JavaScript

I'm checking if(response[0].title !== undefined), but I get the error: Uncaught TypeError: Cannot read property 'title' of undefined. ..

Android: Tabs at the BOTTOM

I've seen some chatter about this, but nothing definite. Is there a way to put the tabs in a TabWidget to the bottom of the screen? If so, how? I've tried the following, but didn't work: a) sett..

How to do a logical OR operation for integer comparison in shell scripting?

I am trying to do a simple condition check, but it doesn't seem to work. If $# is equal to 0 or is greater than 1 then say hello. I have tried the following syntax with no success: if [ "$#" == 0 -..

How to find tag with particular text with Beautiful Soup?

I have the following html (line breaks marked with \n): ... <tr> <td class="pos">\n "Some text:"\n <br>\n <strong>some value</strong>\n </td>..

How to select a radio button by default?

I have some radio buttons and I want one of them to be set as selected by default when the page is loaded. How can I do that? <input type="radio" name="imgsel" value="" /> ..

Undefined index error PHP

I'm new in PHP and I'm getting this error: Notice: Undefined index: productid in /var/www/test/modifyform.php on line 32 Notice: Undefined index: name in /var/www/test/modifyform.php on lin..

Why is PHP session_destroy() not working?

I tried to destroy all session variable by using the session_destroy() method, but after using this method, the values are not destroyed. Why is session_destroy() not working? Is there any other way..

Call an angular function inside html

I was seeing if there is a way to call a function I designed inside the scope. <ul class="ui-listview ui-radiobutton" ng-repeat="meter in meters"> <li class = "ui-divider"> ..

Combine Regexp?

After collecting user input for various conditions like Starts with : /(^@)/ Ends with : /(@$)/ Contains : /@/ Doesn't contains To make single regex if user enter multiple conditions, I combine th..

Is it possible to make input fields read-only through CSS?

I know that input elements are made read-only by applying the readonly boolean attribute, and being an attribute it is not affected by CSS. On the other hand, my scenario seems to be a very good fit ..

How to print formatted BigDecimal values?

I have a BigDecimal field amount which represents money, and I need to print its value in the browser in a format like $123.00, $15.50, $0.33. How can I do that? (The only simple solution which I se..

Update Rows in SSIS OLEDB Destination

I have a data flow process where I have an OLEDB Source and an OLEDB Destination like below: Source merges data from two staging tables and returns a result set (say, 50K rows). These 50K rows are ..

What's a simple way to get a text input popup dialog box on an iPhone

I want to get the user name. A simple text input dialog box. Any simple way to do this?..

Split array into chunks

Let's say that I have an Javascript array looking as following: ["Element 1","Element 2","Element 3",...]; // with close to a hundred elements. What approach would be appropriate to chunk (split)..

Combining a class selector and an attribute selector with jQuery

Is it possible to combine both a class selector and an attribute selector with jQuery? For example, given the following HTML: <TABLE> <TR class="myclass" reference="12345"><TD>Ro..

C#: calling a button event handler method without actually clicking the button

I have a button in my aspx file called btnTest. The .cs file has a function which is called when the button is clicked. btnTest_Click(object sender, EventArgs e) How can I call this function from w..

Batch file script to zip files

i have a folder structure in this pattern. I've just shown two sub directories and 2 files in each but generally I have n number of subdirectories at a single level and single level of files (but can ..

Git merge master into feature branch

Let’s say we have the following situation in Git: A created repository: mkdir GitTest2 cd GitTest2 git init Some modifications in the master take place and get committed: echo "On Master" > ..

Java 8 lambdas, Function.identity() or t->t

I have a question regarding the usage of the Function.identity() method. Imagine the following code: Arrays.asList("a", "b", "c") .stream() .map(Function.identity()) // <- Thi..

Android and Facebook share intent

I'm developing an Android app and am interested to know how you can update the app user's status from within the app using Android's share intents. Having looked through Facebook's SDK it appears tha..

Regular Expression to find a string included between two characters while EXCLUDING the delimiters

I need to extract from a string a set of characters which are included between two delimiters, without returning the delimiters themselves. A simple example should be helpful: Target: extract the su..

MySQL - ERROR 1045 - Access denied

In some way I have managed to get this error when I try to access into MySQL via the command line: [root@localhost ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'roo..

Simple bubble sort c#

int[] arr = {800,11,50,771,649,770,240, 9}; int temp = 0; for (int write = 0; write < arr.Length; write++) { for (int sort = 0; sort < arr.Length - 1; sort++) { if (arr[sort] &..

str_replace with array

I'm having some troubles with the PHP function str_replace when using arrays. I have this message: $message = strtolower("L rzzo rwldd ty esp mtdsza'd szdepw ty esp opgtw'd dple"); And I am trying..

Add User to Role ASP.NET Identity

I know the new Membership includes a "Simple Role Provider." I can't find any help related to creating a user and assigning a role when the user is created. I've added a user which created the table..

Mongodb: failed to connect to server on first connect

I get the following error: Warning { MongoError: failed to connect to server [mongodb:27017] on first connect at Pool.<anonymous> (/Users/michaelks/Desktop/users/node_modules/mongodb-core/l..

What is the difference between rb and r+b modes in file objects

I am using pickle module in Python and trying different file IO modes: # works on windows.. "rb" with open(pickle_f, 'rb') as fhand: obj = pickle.load(fhand) # works on linux.. "r" with open..

Lightweight Javascript DB for use in Node.js

Anybody know of a lightweight yet durable database, written in Javascript, that can be used with Node.js. I don't want the 'weight' of (great) solutions like Mongo or Couch. A simple, in memory JS d..

How to trigger ngClick programmatically

I want to trigger ng-click of an element at runtime like: _ele.click(); OR _ele.trigger('click', function()); How can this be done?..

Change the Arrow buttons in Slick slider

I want to change the arrows in my slick slider but it does not change. I want the next and previous button as an image. I have tried putting it in a <style> but it still not working. Where can I..

Running CMake on Windows

I am currently trying to get CMake to run on my Windows 7 (64-bit) system. I want to compile TagLib for later use with a Qt application I am working on. I would like to compile it with MinGW (not Visu..

Min/Max-value validators in asp.net mvc

Validation using attributes in asp.net mvc is really nice. I have been using the [Range(min, max)] validator this far for checking values, like e.g.: [Range(1, 10)] public int SomeNumber { get; set;..

React proptype array with shape

Is there a built-in way to use proptypes to ensure that an array of objects being passed to a component is actually an array of objects of a specific shape? Maybe something like this? annotationRang..

how to get the host url using javascript from the current page

Given that I'm on the following page: http://www.webmail.com/pages/home.aspx How can I retrieve the host name ("http://www.webmail.com") with JavaScript?..

how to view the contents of a .pem certificate

I am using Java keytool. I have exported a self-signed .pem certificate from my keystore. Is there a command to view the certificate details directly from the .pem file (not of the certificate in the ..

How can I order a List<string>?

I have this List<string>: IList<string> ListaServizi = new List<string>(); How can I order it alphabetically and ascending?..

MySQL select with CONCAT condition

I'm trying to compile this in my mind.. i have a table with firstname and lastname fields and i have a string like "Bob Jones" or "Bob Michael Jones" and several others. the thing is, i have for exam..

How I can filter a Datatable?

I use a DataTable with Information about Users and I want search a user or a list of users in this DataTable. I try it butit don't work :( Here is my c# code: public DataTable GetEntriesBySearch(s..

Easy login script without database

How do I create an easy login script that does not require a database. I would like it to be safe. Alright, what about this script, i just made it by my knowledge in php. <?php // Start session ..

Change onClick attribute with javascript

This is my function and it should change the onClick attribute of the HTML input, but if I use document.getElementById('buttonLED'+id).onclick = "writeLED(1,1)"; it does not work at all, but if I u..

Java String new line

I have string like "I am a boy". I want to print like this way "I am a boy". Can anybody help me?..

What's the canonical way to check for type in Python?

What is the best way to check whether a given object is of a given type? How about checking whether the object inherits from a given type? Let's say I have an object o. How do I check whether it's a ..

Multidimensional arrays in Swift

Edit: As Adam Washington points out, as from Beta 6, this code works as is, so the question is no longer relevant. I am trying to create and iterate through a two dimensional array: var array = Arr..

How to parse JSON without JSON.NET library?

I'm trying to build a Metro application for Windows 8 on Visual Studio 2011. and while I'm trying to do that, I'm having some issues on how to parse JSON without JSON.NET library (It doesn't support t..

How to uninstall with msiexec using product id guid without .msi file present

I'm trying to automate the uninstallation of packages created using WiX for the purposes of changing the installed software stack & configuration without reprovisioning a whole OS. Eventually I'll..

ASP.NET Core Identity - get current user

To get the currently logged in user in MVC5, all we had to do was: using Microsoft.AspNet.Identity; [Authorize] public IHttpActionResult DoSomething() { string currentUserId = User.Identity.GetUs..

jQuery function to get all unique elements from an array?

jQuery.unique lets you get unique elements of an array, but the docs say the function is mostly for internal use and only operates on DOM elements. Another SO response said the unique() function worke..

Concatenating string and integer in python

In python say you have s = "string" i = 0 print s+i will give you error so you write print s+str(i) to not get error. I think this is quite a clumsy way to handle int and string concatenation...

Way to read first few lines for pandas dataframe

Is there a built-in way to use read_csv to read only the first n lines of a file without knowing the length of the lines ahead of time? I have a large file that takes a long time to read, and occasion..

How to get C# Enum description from value?

I have an enum with Description attributes like this: public enum MyEnum { Name1 = 1, [Description("Here is another")] HereIsAnother = 2, [Description("Last one")] LastOne = 3 } ..

Resolve conflicts using remote changes when pulling from Git remote

I'm trying to pull code from my GitHub repo onto my server, but the pull keeps failing because of merge conflicts. I don't want to keep any of the changes that may have occurred on my local server sin..

Content Security Policy: The page's settings blocked the loading of a resource

I am using CAPTCHA on page load, but it is blocking because of some security reason. I am facing this problem: Content Security Policy: The page's settings blocked the loading of a resource a..

Any way to make a WPF textblock selectable?

How to allow TextBlock's text to be selectable? I tried to get it to work by displaying the text using a read-only TextBox styled to look like a textblock but this will not work in my case because a T..

Compare dates with javascript

I have two dates in javascript: var first = '2012-11-21'; var second = '2012-11-03'; i would like make: if(first > second){ //... } how is the best way for this, without external library..

How do I add Git version control (Bitbucket) to an existing source code folder?

How can I add the contents of an existing folder to Git version control? The tutorial here covers the case of making a directory and then adding source contents to it. I have some source code in a fo..

How do I use Bash on Windows from the Visual Studio Code integrated terminal?

Visual Studio Code on Windows uses PowerShell by default as the integrated terminal. If you want to use Bash from Visual Studio Code, what steps should be followed?..

jQuery checkbox check/uncheck

What would be a proper way to check/uncheck checkbox that's placed inside the element that triggers my function? Here's my code: <table id="news_list"> <tr> <td><input type=..

How to use the CSV MIME-type?

In a web application I am working on, the user can click on a link to a CSV file. There is no header set for the mime-type, so the browser just renders it as text. I would like for this file to be s..

How do I add an image to a JButton

I am trying to add an image to a JButton and I'm not sure what I'm missing. When I run the following code the button looks exactly the same as if I had created it without any image attribute. Water.bm..

How to change theme for AlertDialog

I was wondering if someone could help me out. I am trying to create a custom AlertDialog. In order to do this, I added the following line of code in styles.xml <resources> <style name="Cust..

How to get file_get_contents() to work with HTTPS?

I'm working on setting up credit card processing and needed to use a workaround for CURL. The following code worked fine when I was using the test server (which wasn't calling an SSL URL), but now whe..

How to check if a specified key exists in a given S3 bucket using Java

I would like to check if a key exists in a given bucket using Java. I looked at the API but there aren't any methods that are useful. I tried to use getObject but it threw an exception...

Formatting ISODate from Mongodb

In Mongodb I am storing date and time in ISODate format. Which looks like this ISODate("2012-07-14T01:00:00+01:00") Using nodejs/javascript, how can I display the time component so I would get so..

Ajax success function

I am using an Ajax post to submit form data to the server, be validated and then return a message based on whether or not the data was valid and could be stored. My success function in my ajax post do..

Sending and Parsing JSON Objects in Android

I would like to send messages in the form of JSON objects to a server and parse the JSON response from the server. Example of JSON object { "post": { "username": "John Doe", "message": "te..

jQuery how to find an element based on a data-attribute value?

I've got the following scenario: var el = 'li'; and there are 5 <li>'s on the page each with a data-slide=number attribute (number being 1,2,3,4,5 respectively). I now need to find the curre..

Replace an element into a specific position of a vector

I want to replace an element into a specific position of a vector, can I just use an assignment: // vec1 and 2 have the same length & filled in somehow vec1; vec2; vec1[i] = vec2[i] // insert ve..

No appenders could be found for logger(log4j)?

I have put log4j to my buildpath, but I get the following message when I run my application: log4j:WARN No appenders could be found for logger (dao.hsqlmanager). log4j:WARN Please initialize the log4..

Difference between opening a file in binary vs text

I've done some stuff like: FILE* a = fopen("a.txt", "w"); const char* data = "abc123"; fwrite(data, 6, 1, a); fclose(a); and then in the generated text file, it says "abc123" just like expected. Bu..

Center the nav in Twitter Bootstrap

I want to be able to center the nav dead middle of a page and have it stayed centered in different resolutions. I don't want to use offsets to push it over or margin-left as this would just screw it u..

403 Access Denied on Tomcat 8 Manager App without prompting for user/password

I have set up tomcat 8 according to this, and I have the following tomcat-users.xml file: <?xml version="1.0" encoding="UTF-8"?> <tomcat-users xmlns="http://tomcat.apache.org/xml" ..

@angular/material/index.d.ts' is not a module

With Angular 8, While building the app, we encounter the following error: app/modules/admin-module/pages/editor/editor.component.ts:6:27 - error TS2306: File ...node_modules/@angular/material/index...

what is the difference between json and xml

What is the difference between JSON and XML?..

Best way to compare dates in Android

I am trying to compare a date in a String format to the current date. This is how I did it (haven't tested, but should work), but am using deprecated methods. Any good suggestion for an alternative? T..

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

How to multi-line "Replace in files..." in Notepad++

If the free source code editor Notepad++ has the feature "Find in files...", that is without the files being opened in the editor, does it also have the feature "Replace in files..."? Notepad++ is ba..

pop/remove items out of a python tuple

I am not sure if I can make myself clear but will try. I have a tuple in python which I go through as follows (see code below). While going through it, I maintain a counter (let's call it 'n') and 'p..

Convert Float to Int in Swift

I want to convert a Float to an Int in Swift. Basic casting like this does not work because these types are not primitives, unlike floats and ints in Objective-C var float: Float = 2.2 var integer: I..

Remove secure warnings (_CRT_SECURE_NO_WARNINGS) from projects by default in Visual Studio

Is there a way to set by default for all projects removing the precompiler secure warnings that come up when using functions like scanf(). I found that you can do it by adding a line in the project op..

hasOwnProperty in JavaScript

Consider: function Shape() { this.name = "Generic"; this.draw = function() { return "Drawing " + this.name + " Shape"; }; } function welcomeMessage()..

What does the ^ (XOR) operator do?

What mathematical operation does XOR perform?..

XML Schema minOccurs / maxOccurs default values

I'm wondering how the XML Schema specification handles these cases: <xsd:element minOccurs="1" name="asdf"/> No maxOccurs given -> Is this the cardinality [1..1]? <xsd:element minOccurs="..

Counter exit code 139 when running, but gdb make it through

My question sounds specific, but I doubt it still can be of a C++ debug issue. I am using omnet++ which is to simulate wireless network. omnet++ itself is a c++ program. I encountered a queer phenom..

Rails find_or_create_by more than one attribute?

There is a handy dynamic attribute in active-record called find_or_create_by: Model.find_or_create_by_<attribute>(:<attribute> => "") But what if I need to find_or_create by more than..

How to check the version before installing a package using apt-get?

I'm thinking to install hylafax+ version 5.5.4 which was release last month on my Debian PC. I checked dpkg -l | grep "hylafax" and found out that the current version is 5.5.3. Then I checke..

When tracing out variables in the console, How to create a new line?

So I'm trying to do something simple, I want to break up my traces in the console into several lines, using 1 console.log statement: console.log('roleName = '+roleName+' role_ID = '+role_ID+' modal_I..

How to convert Java String to JSON Object

This question has been asked earlier, but I am unable to figure out the error in my code from the responses to those questions. I am trying to convert a java string into json object. Here is the co..

How can I make all images of different height and width the same via CSS?

I am trying to create an image wall consisting of product photos. Unfortunately, all of them are of different height and width. How can I use css to make all images look the same size? preferably 10..

How to connect access database in c#

I have access database file with 7 tables in it but I don't know how to connect and show all tables, If some one can help me? this is my code but it doesn't show anything private void button1_Click..

Can't push to remote branch, cannot be resolved to branch

I migrated my repos from Bitbucket or Github. I don't think this matters but it's the only thing different... For a little while I had two remotes set up: origin: bitbucket github: github Then I r..

Detect changed input text box

I've looked at numerous other questions and found very simple answers, including the code below. I simply want to detect when someone changes the content of a text box but for some reason it's not wo..

How do I run Google Chrome as root?

I have installed Google Chrome in Ubuntu 10.10. When I try to use in normal user, it is working fine. Now if I want to use as a root it gives the following error: Google Chrome does not run as ro..

Broadcast receiver for checking internet connection in android app

I am developing an android broadcast receiver for checking internet connection. The problem is that my broadcast receiver is being called two times. I want it to get called only when the network is a..

The cause of "bad magic number" error when loading a workspace and how to avoid it?

I tried to load my R workspace and received this error: Error: bad restore file magic number (file may be corrupted) -- no data loaded In addition: Warning message: file ‘WORKSPACE_Wedding_Weekend_..

check if a std::vector contains a certain object?

Is there something in <algorithm> which allows you to check if a std:: container contains something? Or, a way to make one, for example: if(a.x == b.x && a.y == b.y) return true; retu..

Making a drop down list using swift?

What is the library to make drop down menu in swift? I am new to Xcode and the Swift language, so can anyone please direct me on how to implement the drop down list in swift?..

Uninstall Eclipse under OSX?

I'm running Eclipse SDK 3.4.0 on Mac OS X 10.5.6. Every time I try to install something new through "software updates", the message "The software items you selected may not be valid with your current..

How to get current memory usage in android?

I have used /proc/meminfo and parsed command response.however it result shows that : MemTotal: 94348 kB MemFree: 5784 kB means. it shows there is only 5MB free memory. Is it possibl..

How to get Domain name from URL using jquery..?

I have domain name for eq. 1) http://www.abc.com/search 2) http://go.abc.com/work I get only domain name from the above URL Output like 1) http://www.abc.com/ 2) http://go.abc.com/ how can I ..

ssh: Could not resolve hostname github.com: Name or service not known; fatal: The remote end hung up unexpectedly

The process of setting up a GitHub account works just fine but it doesn't work when I try pushing my repository to GitHub. The error message it shows is as follows: ssh: Could not resolve hostname gi..

package javax.servlet.http does not exist

I have the jre7 and jdk1.7.0 installed along with the Tomcat 7.0 but it shows this error. servlet.http is not the only one that "does not exist", there are also other (servlet.) components. Can anybo..

How to find the index of an element in an array in Java?

I am looking to find the index of a given element, knowing its contents, in Java. I tried the following example, which does not work: class masi { public static void main( String[] args ) { ..

How to get the excel file name / path in VBA

Say, I'm writing a VBA inside my excel file sample.xls. Now I want to get the full path of sample.xls in my VBA. How do I do it?..

How to check if an array element exists?

Example: I'm checking for the existence of an array element like this: if (!self::$instances[$instanceKey]) { $instances[$instanceKey] = $theInstance; } However, I keep getting this error: Not..

Javascript sleep/delay/wait function

Sorry if this question has already been asked here before, I could not find a suitable answer. I am wanting to create a JavaScript sleep/delay/wait function that I can call anywhere in the script, li..

500 internal server error, how to debug

I have internal server errors on my POST requests. How can I debug them ? Is it something to set up in php.ini ? THe file is really big and the word 'error' is met there many-many times...

How do I use a custom Serializer with Jackson?

I have two Java classes that I want to serialize to JSON using Jackson: public class User { public final int id; public final String name; public User(int id, String name) { this..

Background Image for Select (dropdown) does not work in Chrome

I want to use an image for the background of a select/dropdown. The following CSS works fine in Firefox and IE, but does not in Chrome: #main .drop-down-loc { width:506px; height: 30px; border: none;..

Select values of checkbox group with jQuery

I'm using Zend_Form to output a set group of checkboxes: <label style="white-space: nowrap;"><input type="checkbox" name="user_group[]" id="user_group-20" value="20">This Group</label&..

Test for multiple cases in a switch, like an OR (||)

How would you use a switch case when you need to test for a or b in the same case? switch (pageid) { case "listing-page" || "home-page": alert("hello"); break; case "details-page": al..

Postgresql : Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections

I am trying to connect postgresql but I am getting this error. org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting..

Changing website favicon dynamically

I have a web application that's branded according to the user that's currently logged in. I'd like to change the favicon of the page to be the logo of the private label, but I'm unable to find any cod..

How to paginate with Mongoose in Node.js?

I am writing a webapp with Node.js and mongoose. How can I paginate the results I get from a .find() call? I would like a functionality comparable to "LIMIT 50,100" in SQL...

WSDL/SOAP Test With soapui

I have tested my web services (wsdl/soap) with soapui. and i have the errors : http/log : error 400 BAD REQUEST. What can be the error please with my wsdl ? error/log : un Jun 05 14:10:37 CEST 2011..

Override console.log(); for production

I'm fairly new to Javascript development so this might be a real newbie question. I've got a sencha-touch application riddled with console.log(); for debugging purposes. I've got chirpy doing all of..

Selecting multiple columns/fields in MySQL subquery

Basically, there is an attribute table and translation table - many translations for one attribute. I need to select id and value from translation for each attribute in a specified language, even if t..

Angular: conditional class with *ngClass

What is wrong with my Angular code? I am getting: Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass ... <ol class="breadcrumb"> <li *ngClass="{act..

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required?

I want to send an email from my application and i have written following code for sending mail MailMessage msg = new MailMessage(); msg.From = new MailAddress("mymailid"); msg.To.Add("re..

Can I have H2 autocreate a schema in an in-memory database?

(I've already seen the H2 database In memory - Init schema via Spring/Hibernate question; it is not applicable here.) I'd like to know if there's a setting in H2 that will allow me to auto-create a s..

How to use componentWillMount() in React Hooks?

In the official docs of React it mentions - If you’re familiar with React class lifecycle methods, you can think of useEffect Hook as componentDidMount, componentDidUpdate, and componentWi..

Virtual Memory Usage from Java under Linux, too much memory used

I have a problem with a Java application running under Linux. When I launch the application, using the default maximum heap size (64 MB), I see using the tops application that 240 MB of virtual Memor..

How do I make a new line in swift

Is there a way to have a way to make a new line in swift like "\n" for java? var example: String = "Hello World \n This is a new line" ..

What is the best way to remove accents (normalize) in a Python unicode string?

I have a Unicode string in Python, and I would like to remove all the accents (diacritics). I found on the web an elegant way to do this (in Java): convert the Unicode string to its long normalized f..

How do I measure execution time of a command on the Windows command line?

Is there a built-in way to measure execution time of a command on the Windows command line?..

Difference between two lists

I Have two generic list filled with CustomsObjects. I need to retrieve the difference between those two lists(Items who are in the first without the items in the second one) in a third one. I was t..

How to get value in the session in jQuery

I'm a beginner in jQuery. I want to set the values in an HTML page and I have to get them in another HTML page. Here is the piece of code I am trying now: To set the value in session: $.session.s..

How can I parse a local JSON file from assets folder into a ListView?

I'm currently developing a physics app that is supposed to show a list of formulas and even solve some of them (the only problem is the ListView) This is my main layout <LinearLayout xmlns:an..

Python equivalent of D3.js

Can anyone recommend a Python library that can do interactive graph visualization? I specifically want something like d3.js but for python and ideally it would be 3D as well. I have looked at: Ne..

Using regular expressions to do mass replace in Notepad++ and Vim

So I've got a big text file which looks like the following: <option value value='1' >A <option value value='2' >B <option value value='3' >C <option value value='4' >D It's ..

Using async/await for multiple tasks

I'm using an API client that is completely asynchrounous, that is, each operation either returns Task or Task<T>, e.g: static async Task DoSomething(int siteId, int postId, IBlogClient client) ..

How can I find the current OS in Python?

Possible Duplicate: Python: What OS am I running on? As the title says, how can I find the current operating system in python?..

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

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

How can I get the class name from a C++ object?

Is it possible to get the object name too? #include<cstdio> class one { public: int no_of_students; one() { no_of_students = 0; } void new_admission() { no_of_students++; } }; int..

How to create a project from existing source in Eclipse and then find it?

I have created several .java files. All of them are located in one directory. I used a text editor to write these files. Now I want to switch to Eclipse. How can I do it? I have tried many ways. None ..

Using reflection in Java to create a new instance with the reference variable type set to the new instance class name?

All the examples I look at for reflection show creating a new instance of an unknown implementation, and casting that implementation to it's interface. The issue with this is that now you can't call a..

PostgreSQL database default location on Linux

What is the default directory where PostgreSQL will keep all databases on Linux?..

How to get the innerHTML of selectable jquery element?

I have a php generated list whose list items are selectable using jquery selectable widget. The list for all intents and purposes is: <ul id="#select-image"> <li class="ui-widget-content..

How do I use two submit buttons, and differentiate between which one was used to submit the form?

Currently, I have an HTML form where the user will enter a title and text for an article. When it is time to submit, they are presented with two buttons. One is to 'save' their article without publish..

How do I base64 encode a string efficiently using Excel VBA?

I need to encode a 100KB+ string as base64 in VBA. Are there any built-in functions or COM objects available which will do this as a pure VBA approach is either complex or doesn't scale well at these ..

C# - How to get Program Files (x86) on Windows 64 bit

I'm using: FileInfo( System.Environment.GetFolderPath( System.Environment.SpecialFolder.ProgramFiles) + @"\MyInstalledApp" In order to determine if a program is detected on a users..

Display an image into windows forms

I wanted to display an image to the windows forms, but i already did this and the image did not come out. Where did I go wrong? Here is the code: private void Images(object sender, EventArgs e) { ..

Enable/Disable a dropdownbox in jquery

I am new to jQuery and I want to enable and disable a dropdown list using a checkbox. This is my html: <select id="dropdown" style="width:200px"> <option value="feedback" name="aft_qst"..

How to install all required PHP extensions for Laravel?

I need to make my Ubuntu 16.04. Is there a way using the GUI or is the simplest way to do this by using terminal? I have already installed PHP 7.1, MariaDB. I need to enable: OpenSSL PHP Extension..

How do you load custom UITableViewCells from Xib files?

The question is simple: How do you load custom UITableViewCell from Xib files? Doing so allows you to use Interface Builder to design your cells. The answer apparently is not simple due to memory mana..

Remove .php extension with .htaccess

Yes, I've read the Apache manual and searched here. For some reason I simply cannot get this to work. The closest I've come is having it remove the extension, but it points back to the root directory...

Python ImportError: No module named wx

Im sorry to ask this question again. I have searched and found endles repeats of it both on stackoverflow and also on general google search. Unfortunatly I just cant get my system sorted. I have the ..

Excel date to Unix timestamp

Does anyone know how to convert an Excel date to a correct Unix timestamp?..

What does "export" do in shell programming?

As far as I can tell, variable assignment is the same whether it is or is not preceded by "export". What's it for?..

If using maven, usually you put log4j.properties under java or resources?

Where should I put the log4j.properties file when using the conventional Maven directories? ..

PHP remove commas from numeric strings

In PHP, I have an array of variables that are ALL strings. Some of the values stored are numeric strings with commas. What I need: A way to trim the commas from strings, and ONLY do this for nume..

How to delete and recreate from scratch an existing EF Code First database

I am using EF Code First with EF 5 in VS 2012. I use PM update-database command and I have a simple seed method to fill some tables with sample data. I would like to delete and recreate my x.mdb. The..

Stop embedded youtube iframe?

I'm using YouTube iframe to embed videos on my site. <iframe width="100%" height="443" class="yvideo" id="p1QgNF6J1h0" src="http://www.youtube.com/embed/p1QgNF6J1h0?rel=0&control..

Why is it not advisable to have the database and web server on the same machine?

Listening to Scott Hanselman's interview with the Stack Overflow team (part 1 and 2), he was adamant that the SQL server and application server should be on separate machines. Is this just to make su..

Install Application programmatically on Android

I'm interested in knowing if it is possible to programmatically install a dynamically downloaded apk from a custom Android application...

How can I create an MSI setup?

I've created setups for all my Delphi tools with Inno Setup for years. Now some users rather want an MSI installation package, so they can deploy the setups from a central server to all workstations. ..

How to pass a value from one jsp to another jsp page?

I have two jsp pages: search.jsp and update.jsp. When I run search.jsp then one value fetches from database and I store that value in a variable called scard. Now, what I want is to use that variab..

Adding CSRFToken to Ajax request

I need to pass CSRFToken with Ajax based post request but not sure how this can done in a best way. Using a platform which internally checking CSRFToken in request (POST request only) initially I was..

How to get a float result by dividing two integer values using T-SQL?

Using T-SQL and Microsoft SQL Server I would like to specify the number of decimal digits when I do a division between 2 integer numbers like: select 1/3 That currently returns 0. I would like it t..

How to get bean using application context in spring boot

I am developing a SpringBoot project and I want to get the bean by its name using applicationContext. I have tried many solution from web but could not succeed. My Requirement is that I have a control..

Getting Excel to refresh data on sheet from within VBA

How do you get spreadsheet data in Excel to recalculate itself from within VBA, without the kluge of just changing a cell value?..

How to import and export components using React + ES6 + webpack?

I'm playing around with React and ES6 using babel and webpack. I want to build several components in different files, import in a single file and bundle them up with webpack Let's say I have a few co..

Checking for duplicate strings in JavaScript array

I have JS array with strings, for example: var strArray = [ "q", "w", "w", "e", "i", "u", "r"]; I need to compare for duplicate strings inside array, and if duplicate string exists, there should be ..

Setting initial values on load with Select2 with Ajax

I have select2 controls set up with Ajax (have both single and multiple). I'm trying to have some values on page load but I'm not able to get this to work however. My code for select2 is given below..

Batch command date and time in file name

I am compressing files using WinZip on the command line. Since we archive on a daily basis, I am trying to add date and time to these files so that a new one is auto generated every time. I use the f..