Questions Tagged with #Wingdings

Tick symbol in HTML/XHTML

We need to display a tick symbol (✓ or ✔) within an internal web app and would ideally like to avoid using an image. Has to work starting with IE 6.0.2900 on a XP box, ideally we need i..

After submitting a POST form open a new window showing the result

JavaScript post request like a form submit shows you how to submit a form that you create via POST in JavaScript. Below is my modified code. var form = document.createElement("form"); form.setAttrib..

Changing the action of a form with JavaScript/jQuery

I'm having an issue that is driving me crazy. I'm trying to modify the openid-selector to support facebook. I'm using RPXNow as my provider so it requires the form to be submitted to a different url t..

How do I POST an array of objects with $.ajax (jQuery or Zepto)

I'd like to POST an array of objects with $.ajax in Zepto or Jquery. Both exhibit the same odd error, but I can't find what I'm doing wrong. The data saves to the server when sent using a test client..

Adding elements to object

I need to populate a json file, now I have something like this: {"element":{"id":10,"quantity":1}} And I need to add another "element". My first step is putting that json in a Object type using car..

How to communicate between iframe and the parent site?

The website in the iframe isn't located in the same domain, but both are mine, and I would like to communicate between the iframe and the parent site. Is it possible?..

How to iterate through a table rows and get the cell values using jQuery

I am creating the below table dynamically using jQuery... After executing my code I get the table as below: <table id="TableView" width="800" style="margin-left: 60px"> <tbody> <tr>..

OSX - How to auto Close Terminal window after the "exit" command executed.

When I'm done with Terminal, I want to exit it. Right now, I have three options: killall Terminal. It will end the process, but rather abruptly. I don't think this is the best idea. Call exit. I've ..

Check if event exists on element

Is there a way to check if an event exists in jQuery? I’m working on a plugin that uses custom namespaced events, and would like to be able to check if the event is bound to an element or not...

Is it correct to use DIV inside FORM?

I'm just wondering what are you thinking about DIV-tag inside FORM-tag? I need something like this: <form> <input type="text"/> <div> some </div> <div> another &l..

Is there a timeout for idle PostgreSQL connections?

1 S postgres 5038 876 0 80 0 - 11962 sk_wai 09:57 ? 00:00:00 postgres: postgres my_app ::1(45035) idle 1 ..

What is the point of "Initial Catalog" in a SQL Server connection string?

Every SQL Server connection string I ever see looks something like this: Data Source=MyLocalSqlServerInstance;Initial Catalog=My Nifty Database; Integrated Security=SSPI; Do I need the Initial ..

Vba macro to copy row from table if value in table meets condition

i'm trying to make a macro which: goes through a table looks if value in column B of that table has a certain value if it has, copy that row to a range in an other worksheet The result is similar ..

UIView bottom border?

To a UIScrollView *toScrollView (which is the width of the screen), I want to add a gray bottom border (exactly like that of the to-field of the compose view of the iPhone's native Messages app). To ..

Take the content of a list and append it to another list

I am trying to understand if it makes sense to take the content of a list and append it to another list. I have the first list created through a loop function, that will get specific lines out of a f..

Does overflow:hidden applied to <body> work on iPhone Safari?

Does overflow:hidden applied to <body> work on iPhone Safari? It seems not. I can't create a wrapper on the whole website to achieve that... Do you know the solution? Example: I have a long pa..

How to auto-size an iFrame?

Possible Duplicate: Resizing an iframe based on content I'm loading an iFrame and want the parent to automatically change the height based upon the height of the iFrame's content. To simpl..

Cloning a private Github repo

I have a private repository on Github for a project I'm working on. Until now I had only worked on my home desktop, but I just bought a laptop, and am trying to set it up so that I can work on the pr..

Spring JPA and persistence.xml

I'm trying to set up a Spring JPA Hibernate simple example WAR for deployment to Glassfish. I see some examples use a persistence.xml file, and other examples do not. Some examples use a dataSource, a..

Difference between a virtual function and a pure virtual function

What is the difference between a pure virtual function and a virtual function? I know "Pure Virtual Function is a Virtual function with no body", but what does this mean and what is actually done by..

Best algorithm for detecting cycles in a directed graph

What is the most efficient algorithm for detecting all cycles within a directed graph? I have a directed graph representing a schedule of jobs that need to be executed, a job being a node and a depen..

How to use opencv in using Gradle?

I want to use Android Studio to develop an app using Gradle build tool. I can not insert the OpenCV repo and library on build.gradle. My .gradle file is like below: buildscript { repositories { ..

jQuery dialog popup

I am trying to get this dialog popup form to show up when this link is clicked but it does not work for me. I've been working on this for the past three hours and this is getting too frustrating for m..

Fetching distinct values on a column using Spark DataFrame

Using Spark 1.6.1 version I need to fetch distinct values on a column and then perform some specific transformation on top of it. The column contains more than 50 million records and can grow larger. ..

Rounded Button in Android

I want to create rounded buttons in an Android program. I have looked at How to create EditText with rounded corners? What I want to achieve is: Rounded Edge Buttons Change Button background/appea..

What is bootstrapping?

I keep seeing "bootstrapping" mentioned in discussions of application development. It seems both widespread and important, but I've yet to come across even a poor explanation of what bootstrapping ac..

How to replace multiple patterns at once with sed?

Suppose I have 'abbc' string and I want to replace: ab -> bc bc -> ab If I try two replaces the result is not what I want: echo 'abbc' | sed 's/ab/bc/g;s/bc/ab/g' abab So what sed command can I..

Read a plain text file with php

I have a text file with this information in my server: Data1 Data2 Data3 . . . DataN How do I read all the information from the text file (line by line) using PHP?..

Starting the week on Monday with isoWeekday()

I'm creating a calendar where I print out weeks in a tabular format. One requirement is that I be able to start the weeks either on Monday or Sunday, as per some user option. I'm having a hard time us..

How to replace list item in best way

if (listofelements.Contains(valueFieldValue.ToString())) { listofelements[listofelements.IndexOf(valueFieldValue.ToString())] = value.ToString(); } I have replaced like above. Is there any othe..

Get Row Index on Asp.net Rowcommand event

I have an asp.net GridView: <asp:TemplateField HeaderText="View Faktor" ShowHeader="False" Visible="True"> <ItemTemplate> <asp:ImageButton ID="imgBtn1" CssClass="SelectRow"..

Create instance of generic type whose constructor requires a parameter?

If BaseFruit has a constructor that accepts an int weight, can I instantiate a piece of fruit in a generic method like this? public void AddFruit<T>()where T: BaseFruit{ BaseFruit fruit = n..

using jquery $.ajax to call a PHP function

This may be a simple answer, but I'm using jQuery's $.ajax to call a PHP script. What I want to do is basically put that PHP script inside a function and call the PHP function from javascript. <?..

Find the most frequent number in a NumPy array

Suppose I have the following NumPy array: a = np.array([1,2,3,1,2,1,1,1,3,2,2,1]) How can I find the most frequent number in this array?..

how to get a list of dates between two dates in java

I want a list of dates between start date and end date. The result should be a list of all dates including the start and end date. ..

No newline after div?

Is there a way to not have a newline inserted before a div without using float: left on the previous element? Maybe some tag on the div that will just put it to the right?..

Node.js: get path from the request

I have a service called "localhost:3000/returnStat" that should take a file path as parameter. For example '/BackupFolder/toto/tata/titi/myfile.txt'. How can I test this service on my browser? How ca..

Android: adb: Permission Denied

Whatever I type after adb shell it fails with Permission denied: D:\android-sdk-windows\platform-tools>adb shell find /data -name *.db find: permission denied D:\android-sdk-windows\platform-tools..

How can I get a value from a map?

I have a map named valueMap as follows: typedef std::map<std::string, std::string>MAP; MAP valueMap; ... // Entering data. Then I am passing this map to a function by reference: void functio..

How do I format currencies in a Vue component?

My Vue component is like this : <template> <div> <div class="panel-group"v-for="item in list"> <div class="col-md-8"> <small> ..

How to prevent vim from creating (and leaving) temporary files?

Why does vim create <filename>~ files? Is there a way to disable that? If it's for backup (or something), I use git for that. Also, these .<filename.with.path.hints>.swp files too. How..

Find out time it took for a python script to complete execution

I have the following code in a python script: def fun(): #Code here fun() I want to execute this script and also find out how much time it took to execute in minutes. How do I find out how much..

How to tell Maven to disregard SSL errors (and trusting all certs)?

I frequently need to run "mvn" command : mvn -f pom.xml clean install -Dmaven.test.skip=false --settings /Users/myhome/settings.xml -X -Djavax.net.ssl.trustStore=/Users/myhome/truststore.jks -Djavax...

TypeError: $(...).DataTable is not a function

I am trying to work with jQuery's Datatable JS for my project from this link. I downloaded the complete library from the same source. All the examples given in the package seem to work fine, but when..

how to loop through each row of dataFrame in pyspark

E.g sqlContext = SQLContext(sc) sample=sqlContext.sql("select Name ,age ,city from user") sample.show() The above statement print entire table on terminal but i want to access each row in that tab..

Convert base64 png data to javascript file objects

I have two base64 encoded in PNG, and I need to compare them using Resemble.JS I think that the best way to do it is to convert the PNG's into file objects using fileReader. How can I do it?..

Does MySQL ignore null values on unique constraints?

I have an email column that I want to be unique. But I also want it to accept null values. Can my database have 2 null emails that way?..

What is PECS (Producer Extends Consumer Super)?

I came across PECS (short for Producer extends and Consumer super) while reading up on generics. Can someone explain to me how to use PECS to resolve confusion between extends and super?..

HTML.HiddenFor value set

@Html.HiddenFor(model => model.title, new { id= "natureOfVisitField", @value = '@Model.title'}) it doesen't work! how to set the value?..

Dynamically add child components in React

My goal is to add components dynamically on a page/parent component. I started with some basic example template like this: main.js: var App = require('./App.js'); var SampleComponent = require('./S..

Appending an id to a list if not already present in a string

I am trying to check if id is in a list and append the id only if its not in the list using the below code..however I see that the id is getting appended even though id is already present in the list..

Permission denied (publickey). fatal: The remote end hung up unexpectedly while pushing back to git repository

Possible Duplicate: github: newbie problems -> Permission denied (publickey). fatal: The remote end hung up unexpectedly please see the below command , $ git clone git://github.com/{use..

Rails - How to use a Helper Inside a Controller

While I realize you are supposed to use a helper inside a view, I need a helper in my controller as I'm building a JSON object to return. It goes a little like this: def xxxxx @comments = Array.ne..

Rotate axis text in python matplotlib

I can't figure out how to rotate the text on the X Axis. Its a time stamp, so as the number of samples increase, they get closer and closer until they overlap. I'd like to rotate the text 90 degrees..

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

Google maps Marker Label with multiple characters

I am trying to add a 4 character label (eg 'A123') to a Google Maps marker which has a wide icon defined with a custom path. var marker = new google.maps.Marker({ position: latLon, label: { text:..

Maven build Compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven

I have a maven project forked and cloned from a git repo onto my eclipse. It is build on Java 8. The first thing i do is perform a mvn clean install But I get following failure message: [INFO]..

When is layoutSubviews called?

I have a custom view that's not getting layoutSubview messages during animation. I have a view that fills the screen. It has a custom subview at the bottom of the screen that correctly resizes in Int..

find -mtime files older than 1 hour

I have this command that I run every 24 hours currently. find /var/www/html/audio -daystart -maxdepth 1 -mtime +1 -type f -name "*.mp3" -exec rm -f {} \; I would like to run it every 1 hour and del..

How do I merge a specific commit from one branch into another in Git?

I have BranchA which is 113 commits ahead of BranchB. But I only want the last 10 or so commits from BranchA merged into BranchB. Is there a way to do this?..

What is the best way to search the Long datatype within an Oracle database?

I am working with an Oracle database that stores HTML as a Long datatype. I would like to query the database to search for a specific string within the HTML data stored in the Long. I tried, "sele..

Validating with an XML schema in Python

I have an XML file and an XML schema in another file and I'd like to validate that my XML file adheres to the schema. How do I do this in Python? I'd prefer something using the standard library, but..

How do I write dispatch_after GCD in Swift 3, 4, and 5?

In Swift 2, I was able to use dispatch_after to delay an action using grand central dispatch: var dispatchTime: dispatch_time_t = dispatch_time(DISPATCH_TIME_NOW, Int64(0.1 * Double(NSEC_PER_SEC))) ..

Sql Server string to date conversion

I want to convert a string like this: '10/15/2008 10:06:32 PM' into the equivalent DATETIME value in Sql Server. In Oracle, I would say this: TO_DATE('10/15/2008 10:06:32 PM','MM/DD/YYYY HH:MI:SS..

What is the difference between :focus and :active?

What is the difference between the :focus and :active pseudo-classes?..

Add context path to Spring Boot application

I am trying to set a Spring Boot applications context root programmatically. The reason for the context root is we want the app to be accessed from localhost:port/{app_name} and have all the controlle..

How to add Class in <li> using wp_nav_menu() in Wordpress?

I am using wp_nav_menu($args) and I want to add my_own_class CSS classname to the <li> element for getting the following result: <li class='my_own_class'><a href=''>Link</a> ..

Bulk create model objects in django

I have a lot of objects to save in database, and so I want to create Model instances with that. With django, I can create all the models instances, with MyModel(data), and then I want to save them al..

In Oracle, is it possible to INSERT or UPDATE a record through a view?

In Oracle, is it possible to INSERT or UPDATE a record (a row) through a view?..

Automatically create an Enum based on values in a database lookup table?

How do I automatically create an enum and subsequently use its values in C# based on values in a database lookup table (using enterprise library data layer)? For example, If I add a new lookup value ..

How do I make a semi transparent background?

I need to make a white background 50% transparent without affecting anything else. How do I do it?..

Delete the first three rows of a dataframe in pandas

I need to delete the first three rows of a dataframe in pandas. I know df.ix[:-1] would remove the last row, but I can't figure out how to remove first n rows...

How to adjust text font size to fit textview

Is there any way in android to adjust the textsize in a textview to fit the space it occupies? E.g. I'm using a TableLayout and adding several TextViews to each row. Since I don't want the TextViews ..

Highlight all occurrence of a selected word?

How can I highlight all occurrence of a selected word in GVim, like in Notepad++?..

How do I use Apache tomcat 7 built in Host Manager gui?

Hi I have Apache Tomcat 7.0.5 on my Windows server, and i see that it has a built in Host Manager, but i can't seem to find any useful info on how to use it or set up a virtual Host with that GUI. Th..

DISTINCT for only one column

Let's say I have the following query. SELECT ID, Email, ProductName, ProductModel FROM Products How can I modify it so that it returns no duplicate Emails? In other words, when several rows contai..

How can I generate an MD5 hash?

Is there any method to generate MD5 hash of a string in Java?..

Android ListView not refreshing after notifyDataSetChanged

My ListFragment code public class ItemFragment extends ListFragment { private DatabaseHandler dbHelper; private static final String TITLE = "Items"; private static final String LOG_TAG ..

How to pull remote branch from somebody else's repo

I've got a project hosted on GitHub which somebody has forked. On their fork, they've created a new branch "foo" and made some changes. How do I pull their "foo" into a new branch also named "foo" in..

Why would Oracle.ManagedDataAccess not work when Oracle.DataAccess does?

I'm developing a very simple application which I intend to use to troubleshoot an issue I am having on a few machines but before I even got that far I ran into a few issues, including cpu architecture..

How to change the interval time on bootstrap carousel?

I have a bootstrap carousel on my web page, I'm trying the increase the time interval between each slide. The default delay of 5000 milliseconds is too fast, I need about 10 seconds...

Convert Swift string to array

How can I convert a String "Hello" to an Array ["H","e","l","l","o"] in Swift? In Objective-C I have used this: NSMutableArray *characters =..

ERROR Error: Uncaught (in promise), Cannot match any routes. URL Segment

I have simple navigation in angular 6 app, Here is HTML <nav class="main-nav> <ul class="main-nav__list " ng-sticky [addClass]="'main-sticky-link'" [ngClass]="ref.click === true? 'Navbar__..

Sort array of objects by single key with date value

I have an array of objects with several key value pairs, and I need to sort them based on 'updated_at': [ { "updated_at" : "2012-01-01T06:25:24Z", "foo" : "bar" }, { ..

Sublime Text 2 multiple line edit

I want to edit multiple lines and every "word" within that line. For example: 45 28 42 65 24 87 47 95 01 25 87 98 I want to select every whole number in all lines and put a "0x" before it so it wou..

How can I group by date time column without taking time into consideration

I have a bunch of product orders and I'm trying to group by the date and sum the quantity for that date. How can I group by the month/day/year without taking the time part into consideration? 3/8/201..

Finding modified date of a file/folder

I am very new to PowerShell, and I was hoping I could get some help creating a script that tells me the modified date of a file. I wish I knew more about PowerShell, as I feel like I am asking a lot ..

$.focus() not working

The last example of jQuery's focus() documentation states $('#id').focus() should make the input focused (active). I can't seem to get this working. Even in the console on this site, I'm trying it..

Add hover text without javascript like we hover on a user's reputation

In stackoverflow, when we hover on a user's reputation we see a text. I have seen this at many places and the source code tells me that it can be done without js. And i tried and got only this- <..

Programmatically select a row in JTable

When the application is started, none of the rows is selected. But I would like to show that the first row is already selected. How to do this? Do I need to set the color of a row in JTable? Updat..

Upload Image using POST form data in Python-requests

I'm working with wechat APIs ... here I've to upload an image to wechat's server using this API http://admin.wechat.com/wiki/index.php?title=Transferring_Multimedia_Files url = 'http://file.api.we..

Managing SSH keys within Jenkins for Git

I'm trying to get Jenkins up and running with a GitHub hosted repository (using the Jenkins Git plugin). The repository has multiple git submodules, so I'm not sure I want to try and manage multiple d..

How to send a POST request from node.js Express?

Could someone show me the simplest way to send a post request from node.js Express, including how to pass and retrieve some data? I am expecting something similar to cURL in PHP...

check if file exists in php

if (!(file_exists(http://mysite.com/images/thumbnail_1286954822.jpg))) { $filefound = '0'; } why won't this work?..

Converting any string into camel case

How can I convert a string into camel case using javascript regex? EquipmentClass name or Equipment className or equipment class name or Equipment Class Name should all become: equipmentClassName...

Separation of business logic and data access in django

I am writing a project in Django and I see that 80% of the code is in the file models.py. This code is confusing and, after a certain time, I cease to understand what is really happening. Here is what..

Formatting a Date String in React Native

I'm trying to format a Date String in React Native. Ex: 2016-01-04 10:34:23 Following is the code I'm using. var date = new Date("2016-01-04 10:34:23"); console.log(date); My problem is, when I'm..

Accessing a local website from another computer inside the local network in IIS 7

Ok, so here is the scenario: I have computer A inside my local network running IIS 7. I added a new website, let's say samplesite.local, through IIS Manager, and edited the hosts file inside %systemr..

What is the difference between a web API and a web service?

Is there any difference between a web API and a web service ? Or are they one and the same ? ..

Python using enumerate inside list comprehension

Lets suppose I have a list like this: mylist = ["a","b","c","d"] To get the values printed along with their index I can use Python's enumerate function like this >>> for i,j in enumerate(..

How can I disable HREF if onclick is executed?

I have an anchor with both HREF and ONCLICK attributes set. If clicked and Javascript is enabled, I want it to only execute ONCLICK and ignore HREF. Likewise, if Javascript is disabled or unsupported,..

How to force a hover state with jQuery?

Please, considere this CSS code: a { color: #ffcc00; } a:hover { color: #ccff00; } This HTML code: <a href="#" id="link">Link</a> <button id="btn">Click here</button> And..

SQL Server remove milliseconds from datetime

select * from table where date > '2010-07-20 03:21:52' which I would expect to not give me any results... EXCEPT I'm getting a record with a datetime of 2010-07-20 03:21:52.577 how can I make th..

How to disable text selection using jQuery?

Does jQuery or jQuery-UI have any functionality to disable text selection for given document elements?..

Performance differences between ArrayList and LinkedList

Yes, this is an old topic, but I still have some confusions. In Java, people say: ArrayList is faster than LinkedList if I randomly access its elements. I think random access means "give me the nth..

How to alter a column and change the default value?

I got the following error while trying to alter a column's data type and setting a new default value: ALTER TABLE foobar_data ALTER COLUMN col VARCHAR(255) NOT NULL SET DEFAULT '{}'; ERROR 1064 ..

How do I link to a library with Code::Blocks?

C++ GUI Tutorial: undefined reference to TextOut I have the same problem, but I'm new to programming and Code::Blocks, and I want to use the GDI32 library. How can I install it? I'm very confused bec..

'console' is undefined error for Internet Explorer

I'm using Firebug and have some statements like: console.log("..."); in my page. In IE8 (probably earlier versions too) I get script errors saying 'console' is undefined. I tried putting this at th..

How to capture multiple repeated groups?

I need to capture multiple groups of the same pattern. Suppose, I have a following string: HELLO,THERE,WORLD And I've written a following pattern ^(?:([A-Z]+),?)+$ What I want it to do is, cap..

Calling an executable program using awk

I have a program in C that I want to call by using awk in shell scripting. How can I do something like this?..

Make the current Git branch a master branch

I have a repository in Git. I made a branch, then did some changes both to the master and to the branch. Then, tens of commits later, I realized the branch is in much better state than the master, so..

MongoDB or CouchDB - fit for production?

I was wondering if anyone can tell me if MongoDB or CouchDB are ready for a production environment. I'm now looking at these storage solutions (I'm favouring MongoDB at the moment), however these p..

How to execute two mysql queries as one in PHP/MYSQL?

I have two queries, as following: SELECT SQL_CALC_FOUND_ROWS Id, Name FROM my_table WHERE Name LIKE '%prashant%' LIMIT 0, 10; SELECT FOUND_ROWS(); I want to execute both these queries in a single a..

what is the difference between json and xml

What is the difference between JSON and XML?..

How to Publish Web with msbuild?

Visual Studio 2010 has a Publish command that allows you to publish your Web Application Project to a file system location. I'd like to do this on my TeamCity build server, so I need to do it with the..

how to set the default value to the drop down list control?

I have a drop down list control on my web page. I have bind the datatable to the dropdownlist control as follows - lstDepartment.DataTextField = "DepartmentName"; lstDepartment.DataValueField = "..

How to initialize a private static const map in C++?

I need just dictionary or associative array string => int. There is type map C++ for this case. But I need only one map forall instances(-> static) and this map can't be changed(-> const); I have f..

How to capitalize the first letter in a String in Ruby

The upcase method capitalizes the entire string, but I need to capitalize only the first letter. Also, I need to support several popular languages, like German and Russian. How do I do it?..

Should I use the datetime or timestamp data type in MySQL?

Would you recommend using a datetime or a timestamp field, and why (using MySQL)? I'm working with PHP on the server side...

Adding value labels on a matplotlib bar chart

I got stuck on something that feels like should be relatively easy. The code I bring below is a sample based on a larger project I'm working on. I saw no reason to post all the details, so please acce..

How do I convert an NSString value to NSData?

How do I convert an NSString value to NSData?..

How to find where gem files are installed

I can finds gems that are installed using gem list, but it doesn't show me where the gems are installed. How can I find where the gems are, and how can I know before installing a gem where it will be..

How to use a PHP class from another file?

Let's say I've got two files class.php and page.php class.php <?php class IUarts { function __construct() { $this->data = get_data('mydata'); } } ?> That..

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

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

How to post ASP.NET MVC Ajax form using JavaScript rather than submit button

I have a simple form created using Ajax.BeginForm: <% using (Ajax.BeginForm("Update", "Description", new { id = Model.Id }, new AjaxOptions { UpdateTargetId = "DescriptionDiv", ..

Disable all gcc warnings

I'm working on a project that will read compiler error messages of a particular variety and do useful things with them. The sample codebase I'm testing this on (a random open-source application), and ..

Can I stretch text using CSS?

Can I stretch text in CSS? I don't want the font to be bigger, because that makes it appear bolder than smaller text beside it. I just want to stretch the text vertically so it's kind of deformed. Th..

Convert bytes to int?

I'm currently working on an encryption/decryption program and I need to be able to convert bytes to an integer. I know that: bytes([3]) = b'\x03' Yet I cannot find out how to do the inverse. What a..

Align nav-items to right side in bootstrap-4

I just switched to bootstrap 4 and reworking all my html and scss to work with it and I cant seem to find how to put a group of nav-items on the right side of the navbar. This is my navbar code: <..

how to create dynamic two dimensional array in java?

I want to create a two dimensional array dynamically. I know the number of columns. But the number of rows are being changed dynamically. I tried the array list, but it stores the value in single dim..

Converting double to integer in Java

In Java, I want to convert a double to an integer, I know if you do this: double x = 1.5; int y = (int)x; you get y=1. If you do this: int y = (int)Math.round(x); You'll likely get 2. However, I..

What is the purpose of a self executing function in javascript?

In javascript, when would you want to use this: (function(){ //Bunch of code... })(); over this: //Bunch of code... ..

Do we need to execute Commit statement after Update in SQL Server

I have done some update to my record through SQL Server Manager. As Update statement is not having explicit commit, I am trying to write it manually. Update mytable set status=0; Commit; I am gett..

Git - fatal: Unable to create '/path/my_project/.git/index.lock': File exists

I am still getting this error message, when I try to move my project tree on to git repo. I checked the permissions of my directory with this project and these are set on 777. In terminal in the dir..

Integer expression expected error in shell script

I'm a newbie to shell scripts so I have a question. What Im doing wrong in this code? #!/bin/bash echo " Write in your age: " read age if [ "$age" -le "7"] -o [ "$age" -ge " 65" ] then echo " You can..

CSS z-index not working (position absolute)

I am trying to make the black div (relative) above the second yellow one (absolute). The black div's parent has a position absolute, too. _x000D_ _x000D_ #relative {_x000D_ position: relative;_x000D..

Pandas convert dataframe to array of tuples

I have manipulated some data using pandas and now I want to carry out a batch save back to the database. This requires me to convert the dataframe into an array of tuples, with each tuple correspondin..

How do I add a tool tip to a span element?

In the following code, I want a tool-tip to come up when the user hovers the span, how do I do that? I don't want to use any links. <span> text </span> ..

How do I get a consistent byte representation of strings in C# without manually specifying an encoding?

How do I convert a string to a byte[] in .NET (C#) without manually specifying a specific encoding? I'm going to encrypt the string. I can encrypt it without converting, but I'd still like to know wh..

Hide a EditText & make it visible by clicking a menu

I have a layout having the contact deatils of the phone. When i click the option menu i need make an edittext visible in that screen. I have done it. But there is problem facing that the edit text he..

Output to the same line overwriting previous output?

I am writing an FTP downloader. Part of to the code is something like this: ftp.retrbinary("RETR " + file_name, process) I am calling function process to handle the callback: def process(data): ..

What does the "~" (tilde/squiggle/twiddle) CSS selector mean?

Searching for the ~ character isn't easy. I was looking over some CSS and found this .check:checked ~ .content { } What does it mean?..

Finding the max value of an attribute in an array of objects

I'm looking for a really quick, clean and efficient way to get the max "y" value in the following JSON slice: [ { "x": "8/11/2009", "y": 0.026572007 }, { "x": "8/12/2009", "y": ..

How to encode URL parameters?

I am trying to pass parameters to a URL which looks like this: http://www.foobar.com/foo?imageurl= And I want to pass the parameters such as an image URL which is generated itself by another API, and..

How to set a JVM TimeZone Properly

I am trying to run a Java program, but it is taking a default GMT timezone instead of an OS defined timezone. My JDK version is 1.5 and the OS is Windows Server Enterprise (2007) Windows has a Centra..

How to "z-index" to make a menu always on top of the content

I have a problem and I can't figure how to correct this. What I want is that the "Red box" stay on top of the page in a z-index 2, while the all the content on the background stay on index 1 but someh..

Add a user control to a wpf window

I have a user control that I've created, however when I go to add it to the XAML in the window, Intellisense doesn't pick it up, and I can't figure out how to add it to the window...

How to write UPDATE SQL with Table alias in SQL Server 2008?

I have a very basic UPDATE SQL - UPDATE HOLD_TABLE Q SET Q.TITLE = 'TEST' WHERE Q.ID = 101; This query runs fine in Oracle, Derby, MySQL - but it fails in SQL server 2008 with following error: ..

How can I change UIButton title color?

I create a button programmatically.......... button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button addTarget:self action:@selector(aMethod:) forControlEvents:UIControlEventTouchDown]; [..

json: cannot unmarshal object into Go value of type

I can't decode the json code below ... any ideas why it doesn't work ? See also play.golang package main import ( "encoding/json" ) type LocationReadable struct { ..

How to move up a directory with Terminal in OS X

When I launch a new Terminal window, it starts me in 'Macintosh HD/Users/MyName'. How can I back out of my user directory, back up to the top level?..

Subset data.frame by date

I have a dataset called EPL2011_12. I would like to make new a dataset by subsetting the original by date. The dates are in the column named Date The dates are in DD-MM-YY format. I have tried ..

Create timestamp variable in bash script

I am trying to create a timestamp variable in a shell script to make the logging a little easier. I want to create the variable at the beginning of the script and have it print out the current time wh..

matching query does not exist Error in Django

I have implemented a password recovery functionality in django. With my method, the new password will be sent to the email id entered. It works fine when given the correct email (e-mail id which exist..

Is there an onSelect event or equivalent for HTML <select>?

I have an input form that lets me select from multiple options, and do something when the user changes the selection. Eg, <select onChange="javascript:doSomething();"> <option>A</opt..

In Java, how do I parse XML as a String instead of a file?

I have the following code: DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlFile); How can I get it to parse XML contained within a String instead of a file?..

How to apply a CSS class on hover to dynamically generated submit buttons?

I have the following piece of HTML/CSS code which is used to display pages based on the number of rows retrieved from a database. _x000D_ _x000D_ .paginate {_x000D_ font-family:Arial,Helvetica,sa..

display HTML page after loading complete

Is there a way to force the browser to display a page only after all of the page's contents are completely loaded (such as images, scripts, css, etc)?..

Android : Fill Spinner From Java Code Programmatically

How do you fill a spinner from java code programmatically? I have a spinner in the layout like this: <Spinner android:id="@+id/consultation_deseases" android:layout_width="@dimen/bigSp..

How to force a UIViewController to Portrait orientation in iOS 6

As the ShouldAutorotateToInterfaceOrientation is deprecated in iOS 6 and I used that to force a particular view to portrait only, what is the correct way to do this in iOS 6? This is only for one are..

what is the difference between ajax and jquery and which one is better?

I am confused about using ajax or jquery so I want to know what the differences are and which one is better such as performance and complexity ...

Detecting when the 'back' button is pressed on a navbar

I need to perform some actions when the back button(return to previous screen, return to parent-view) button is pressed on a Navbar. Is there some method I can implement to catch the event and fire o..

What is the best way to connect and use a sqlite database from C#

I've done this before in C++ by including sqlite.h but is there a similarly easy way in C#?..

How to Execute a Python File in Notepad ++?

I prefer using Notepad ++ for developing, How do I execute the files in Python through Notepad++?..

Including a .js file within a .js file

I'd like to know if it is possible to include a .js file within another .js file? The reason for me wanting to do this is to keep client includes to a minimum. I have several .js files already writte..

How to use the command update-alternatives --config java

I am installing Apache Solr on Linux Debian (Squeeze). I have been instructed to install sun-java jdk 1st. Then am told that I should use the command sudo update-alternatives --config java to make sur..

How to detect if javascript files are loaded?

Is there an event that fires when JavaScript files are loaded? The problem came up because YSlow recommends to move JavaScript files to the bottom of the page. This means that $(document).ready(func..

Writing BMP image in pure c/c++ without other libraries

In my algorithm, I need to create an information output. I need to write a boolean matrix into a bmp file. It must be a monocromic image, where pixels are white if the matrix on such element is true. ..

Can local storage ever be considered secure?

I'm required to develop a web application that will function offline for long periods. In order for this to be viable I cannot avoid saving sensitive data (personal data but not the kind of data you w..

How can I implement static methods on an interface?

I have a 3rd party C++ DLL that I call from C#. The methods are static. I want to abstract it out to do some unit testing so I created an interface with the static methods in it but now my program e..

Split and join C# string

Possible Duplicate: First split then join a subset of a string I'm trying to split a string into an array, take first element out (use it) and then join the rest of the array into a seperat..

Converting String To Float in C#

I am converting a string like "41.00027357629127", and I am using; Convert.ToSingle("41.00027357629127"); or float.Parse("41.00027357629127"); These methods return 4.10002732E+15. When I conver..

Why does C# XmlDocument.LoadXml(string) fail when an XML header is included?

Does anyone have any idea why the following code sample fails with an XmlException "Data at the root level is invalid. Line 1, position 1." var body = "<?xml version="1.0" encoding="utf-16"?>&l..

Difference between Console.Read() and Console.ReadLine()?

I'm new to this field and I'm very confused: what is the real difference between Console.Read() and Console.ReadLine()?..

How to style the parent element when hovering a child element?

I know that there does not exist a CSS parent selector, but is it possible to style a parenting element when hovering a child element without such a selector? To give an example: consider a delete bu..

How do I force Sublime Text to indent two spaces per tab?

Is there a way to force Sublime Text 2 to always indent two spaces per tab when working with Ruby files? I know that indentation can be set under the view -> indentation menu option, but it does n..

Change a Django form field to a hidden field

I have a Django form with a RegexField, which is very similar to a normal text input field. In my view, under certain conditions I want to hide it from the user, and trying to keep the form as simila..

PostgreSQL JOIN data from 3 tables

I'm new to PostgreSQL and trying to get a query written. I'm pretty sure it's easy for someone who knows what they are doing - I just don't! :) Basically I have three tables. In the first, I store de..

Uninstall Node.JS using Linux command line?

How do you uninstall node.js using the cmd line in linux?..

SVN Commit failed, access forbidden

Recently I am facing problem of commit to SVN. The SVN server I am using is VisualSVN Server 2.5.9 and the client is TortoiseSVN 1.7.12. At first, one user is having problem to commit files to SVN. B..

In Python, how do I loop through the dictionary and change the value if it equals something?

If the value is None, I'd like to change it to "" (empty string). I start off like this, but I forget: for k, v in mydict.items(): if v is None: ... right? ..

Unable to find a @SpringBootConfiguration when doing a JpaTest

I'm new to frameworks (just passed the class) and this is my first time using Spring Boot. I'm trying to run a simple Junit test to see if my CrudRepositories are indeed working. The error I keep ge..

Javac is not found

I'm running Windows 8 and I can not get javac to work. I have set my PATH in environmental variables to C:\Program Files (x86)\Java\jdk1.7.0_17\bin I have tried both with and without ';' but to ..

How to print something when running Puppet client?

I want to print out messages and variables when Puppet runs. I saw there are two functions that might help but couldn't really use them. My site.pp file: info "running site.pp info" debug "running si..

Loop through a Map with JSTL

I'm looking to have JSTL loop through a Map<String, String> and output the value of the key and it's value. For example I have a Map<String, String> which can have any number of entries, ..

How to create a sticky left sidebar menu using bootstrap 3?

I want to create a left-sticky bar menu with bootstrap 3 like: http://getbootstrap.com/getting-started/ I'd read the given documentation http://getbootstrap.com/javascript/#affix I try with .affix ..

Python Pandas : group by in group by and average?

I have a dataframe like this: cluster org time 1 a 8 1 a 6 2 h 34 1 c 23 2 d 74 3 w 6 I would like to calc..

Convert hex string (char []) to int?

I have a char[] that contains a value such as "0x1800785" but the function I want to give the value to requires an int, how can I convert this to an int? I have searched around but cannot find an answ..

Trying to Validate URL Using JavaScript

I want to validate a URL and display message. Below is my code: $("#pageUrl").keydown(function(){ $(".status").show(); var url = $("#pageUrl").val(); if(isValidURL(url)){ ..

design a stack such that getMinimum( ) should be O(1)

This is one of an interview question. You need to design a stack which holds an integer value such that getMinimum() function should return the minimum element in the stack. For example: consider the..

Can not connect to local PostgreSQL

I've managed to bork my local development environment. All my local Rails apps are now giving the error: PGError could not connect to server: Permission denied Is the server running locally and ..

Bootstrap fullscreen layout with 100% height

I want to develop a kiosk-app which should stretch itself to 100% of the complete touch-screen. When I'm nesting for each application-view/template the rows and cols, it becomes horrible complicated..

How to fix 'Object arrays cannot be loaded when allow_pickle=False' for imdb.load_data() function?

I'm trying to implement the binary classification example using the IMDb dataset in Google Colab. I have implemented this model before. But when I tried to do it again after a few days, it returned a ..

What ports does RabbitMQ use?

What ports does RabbitMQ Server use or need to have open on the firewall for a cluster of nodes? My /usr/lib/rabbitmq/bin/rabbitmq-env is set below which I'm assuming are needed (35197). SERVER_ERL_..

Change value of input onchange?

I am trying to create a simple JavaScript function. When someone inserts a number in an input field, the value of another field should change to that value. Here is what I have at the moment: function..

How do I fix "for loop initial declaration used outside C99 mode" GCC error?

I'm trying to solve the 3n+1 problem and I have a for loop that looks like this: for(int i = low; i <= high; ++i) { res = runalg(i); if (res > highestre..

How to display a list using ViewBag

Hi i need to show a list of data using viewbag.but i am not able to do it. Please Help me.. I tried this thing: ICollection<Learner> list = new HobbyHomeService().FetchLearner(); ICollection&..

How to print full stack trace in exception?

For example, in one place... //---------------a try { // some network call } catch(WebException we) { throw new MyCustomException("some message ....", we); } ...and in another place... //-..

The network adapter could not establish the connection - Oracle 11g

I wrote a servlet program and I want it to connect to my Oracle database but its giving me an error. I am using Eclipse Helios, Tomcat 6.0.37, Oracle 11g (11.2.0.1.0), ojdbc6.jar(added in run configur..

C# Create New T()

You can see what I'm trying (but failing) to do with the following code: protected T GetObject() { return new T(); } Any help would be greatly appreciated. EDIT: The context was as follows. ..

Move all files except one

How can I move all files except one? I am looking for something like: 'mv ~/Linux/Old/!Tux.png ~/Linux/New/' where I move old stuff to new stuff -folder except Tux.png. !-sign represents a negatio..