Questions Tagged with #Ontology

Ontology is a formal representation of knowledge as a set of concepts within a domain, and the relationships between those concepts. Those concepts and relationships create graph-structures and can be described by the lattice theory or other mathematical models.

How to get raw text from pdf file using java

I have some pdf files, Using pdfbox i have converted them into text and stored into text files, Now from the text files i want to remove Hyperlinks All special characters Blank lines headers footers..

Parsing XML with namespace in Python via 'ElementTree'

I have the following XML which I want to parse using Python's ElementTree: <rdf:RDF xml:base="http://dbpedia.org/ontology/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ow..

How to add a local repo and treat it as a remote repo

I'm trying to make a local repo act as a remote with the name bak for another local repo on my PC, using the following: git remote add /home/sas/dev/apps/smx/repo/bak/ontologybackend/.git bak which..

What are the differences between a program and an application?

What are the differences between a program and an application? I am trying to understand this to form a concept in ontology. Can anyone explain?..

Date query with ISODate in mongodb doesn't seem to work

I don't seem to be able to get even the most basic date query to work in MongoDB. With a document that looks something like this: { "_id" : "foobar/201310", "ap" : "foobar", "dt" : ISODa..

how to use math.pi in java

I am having problems converting this formula V = 4/3 p r^3. I used Math.PI and Math.pow, but I get this error: ';' expected Also, the diameter variable doesn't work. Is there an error there? im..

Resize image in PHP

I'm wanting to write some PHP code which automatically resizes any image uploaded via a form to 147x147px, but I have no idea how to go about it (I'm a relative PHP novice). So far, I've got images ..

Why does CSV file contain a blank line in between each data line when outputting with Dictwriter in Python

I am using DictWriter to output data in a dictionary to a csv file. Why does the CSV file have a blank line in between each data line? It's not a huge deal, but my dataset is big and doesn't fit int..

How do you get the list of targets in a makefile?

I've used rake a bit (a Ruby make program), and it has an option to get a list of all the available targets, eg > rake --tasks rake db:charset # retrieve the charset for your data... rake db:..

LINUX: Link all files from one to another directory

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

nuget 'packages' element is not declared warning

not a showstopper but when using nuget in a project, it creates a packages.config file with this shape <?xml version="1.0" encoding="utf-8"?> <packages> ... your packages </packages..

how to display full stored procedure code?

How do you view a stored procedure/function? Say I have an old function without the original definition - I want to see what it is doing in pg/psql but I can't seem to figure out a way to do that. u..

Beginner Python: AttributeError: 'list' object has no attribute

The error says: AttributeError: 'list' object has no attribute 'cost' I am trying to get a simple profit calculation to work using the following class to handle a dictionary of bicycles: class Bi..

How to use 'find' to search for files created on a specific date?

How do I use the UNIX command find to search for files created on a specific date?..

Concatenation of strings in Lua

In many languages you can concatenate strings on variable assignment. I have a scenario, using the Lua programming language, where I need to append the output of a command to an existing variable. I..

Sort an ArrayList based on an object field

Possible Duplicate: Sorting an ArrayList of Contacts I am storing DataNode objects in an ArrayList. The DataNode class has an integer field called degree. I want to retrieve DataNode object..

TypeError: 'DataFrame' object is not callable

I've programmed these for calculating Variance import pandas as pd import xlrd import numpy as np import matplotlib.pyplot as plt credit_card=pd.read_csv("default_of_credit_card_clients_Data.cs..

Pass a list to a function to act as multiple arguments

I think 'unpack' might be the wrong vocabulary here - apologies because I'm sure this is a duplicate question. My question is pretty simple: in a function that expects a list of items, how can I pass..

What does IFormatProvider do?

I was playing around with the Datetime.ParseExact method, and it wants an IFormatProvider... It works inputting null, but what exactly does it do?..

How to set a Default Route (To an Area) in MVC

Ok this has been asked before but there is no solid solution out there. So for purpose of myself and others who may find this useful. In MVC2 (ASP.NET) I want it so when someone navigates to the webs..

SQL multiple columns in IN clause

If we need to query a table based on some set of values for a given column, we can simply use the IN clause. But if query need to be performed based on multiple columns, we could not use IN clause(g..

Waiting on a list of Future

I have a method which returns a List of futures List<Future<O>> futures = getFutures(); Now I want to wait until either all futures are done processing successfully or any of the tasks ..

Node.js vs .Net performance

I've read a lot about Node.js being fast and able to accommodate large amounts of load. Does anyone have any real-world evidence of this vs other frameworks, particularly .Net? Most of the articles I'..

What does LINQ return when the results are empty

I have a question about LINQ query. Normally a query returns a IEnumerable<T> type. If the return is empty, not sure if it is null or not. I am not sure if the following ToList() will throw an e..

How to send string from one activity to another?

I have a string in activity2 String message = String.format( "Current Location \n Longitude: %1$s \n Latitude: %2$s", lat, lng); I want to insert this string into text field in activity1. How can ..

jQuery: How to capture the TAB keypress within a Textbox

I want to capture the TAB keypress, cancel the default action and call my own javascript function...

Aborting a stash pop in Git

I popped a stash and there was a merge conflict. Unlike the question that is listed as a duplicate, I already had some uncommitted changes in the directory which I wanted to keep. I don't just want to..

Is it possible to modify a string of char in C?

I have been struggling for a few hours with all sorts of C tutorials and books related to pointers but what I really want to know is if it's possible to change a char pointer once it's been created. ..

Java, List only subdirectories from a directory, not files

In Java, How do I list only subdirectories from a directory? I'd like to use the java.io.File functionality, what is the best method in Java for doing this? ..

Why does datetime.datetime.utcnow() not contain timezone information?

datetime.datetime.utcnow() Why does this datetime not have any timezone info given that it is explicitly a UTC datetime? I would expect that this would contain tzinfo...

Printing long int value in C

I have two variables of long int type as shown below: long int a=-2147483648, b=-2147483648; a=a+b; printf("%d",a); I am getting zero. I tried changing the type to long long int, but I'm still not..

Why can I not create a wheel in python?

Here are the commands I am running: $ python setup.py bdist_wheel usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-c..

How to read file using NPOI

I found NPOI is very good to write Excel files with C#. But I want to open, read and modify Excel files in C#. How can I do this?..

How to make shadow on border-bottom?

I need to apply the border shadow on border-bottom by CSS3. I just want to apply CSS3 shadow on bottom. Is this possible?..

Open Source Javascript PDF viewer

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

Delete directory with files in it?

I wonder, what's the easiest way to delete a directory with all its files in it? I'm using rmdir(PATH . '/' . $value); to delete a folder, however, if there are files inside of it, I simply can't del..

RAW POST using cURL in PHP

How can I do a RAW POST in PHP using cURL? Raw post as in without any encoding, and my data is stored in a string. The data should be formatted like this: ... usual HTTP header ... Content-Length: 1..

hide div tag on mobile view only?

I'm creating a fluid layout for a site. I'm trying to hide the contents of a <div> or the whole <div> itself in the mobile view, but not the tablet and desktop view. Here's what I've got ..

WPF Datagrid Get Selected Cell Value

I want to get value for selected cell in datagrid , please anyone tell how to do this. i used SelectedCell changed event , how can i do that? dataGrid1.CurrentCell ..

BEGIN - END block atomic transactions in PL/SQL

This information should be easy to find, but I haven't had any luck. When I have a BEGIN - END block in a PL/SQL, does it behave as an atomic transaction, that will try to commit on hitting the END b..

Laravel - Pass more than one variable to view

I have this site and one of its pages creates a simple list of people from the database. I need to add one specific person to a variable I can access. How do I modify the return $view->with('perso..

Delete terminal history in Linux

When you use the up key in a Linux terminal, you can use previous commands again. Great feature. However, I started logging mysql into mysql with the sensitive details in the command. How can I delet..

When do I have to use interfaces instead of abstract classes?

I was wondering when I should use interfaces. Lets think about the following: public abstract class Vehicle { abstract float getSpeed(); } and : public interface IVehicle { float getSpeed();..

Multi-Line Comments in Ruby?

How can I comment multiple lines in Ruby?..

invalid use of non-static member function

I have something like this: class Bar { public: pair<string,string> one; std::vector<string> cars; Bar(string one, string two, string car); }; ..

SQL how to check that two tables has exactly the same data?

I have 2 tables TableA and TableB which have the same format of column for example both tables TableA and TableB have columns A B C D E F where A and B are the primary keys. How to write SQL to c..

How do I perform HTML decoding/encoding using Python/Django?

I have a string that is HTML encoded: '''&lt;img class=&quot;size-medium wp-image-113&quot;\ style=&quot;margin-left: 15px;&quot; title=&quot;su1&quot;\ src=&quot;h..

Javascript "Not a Constructor" Exception while creating objects

I am defining an object like this: function Project(Attributes, ProjectWidth, ProjectHeight) { this.ProjectHeight = ProjectHeight; this.ProjectWidth = ProjectWidth; this.ProjectScale = th..

cannot open shared object file: No such file or directory

I met the share library not found on the head node of a cluster with torch. I have built the library as well as specify the correct path of the library while compiling my own program "absurdity" by g+..

UILabel - Wordwrap text

Is there any way to have a label wordwrap text as needed? I have the line breaks set to word wrap and the label is tall enough for two lines, but it appears that it will only wrap on line breaks. Do..

How to change the length of a column in a SQL Server table via T-SQL

I am looking to find out how to alter a fields properties contained in an SQL Server 2008 table via an SQL script. I'm looking to change the 'Length' property specifically. Does anybody know how to..

Adding Python Path on Windows 7

I've been trying to add the Python path to the command line on Windows 7, yet no matter the method I try, nothing seems to work. I've used the set command, I've tried adding it through the Edit Enviro..

How to exit from PostgreSQL command line utility: psql

What command or short key can I use to exit the PostgreSQL command line utility psql?..

Laravel 5.2 redirect back with success message

I'm trying to get a success message back to my home page on laravel. return redirect()->back()->withSuccess('IT WORKS!'); For some reason the variable $success doesn't get any value after run..

Creating a blurring overlay view

In the Music app of the new iOS, we can see an album cover behind a view that blurs it. How can something like that be accomplished? I've read the documentation, but did not find anything there. ..

What is the optimal algorithm for the game 2048?

I have recently stumbled upon the game 2048. You merge similar tiles by moving them in any of the four directions to make "bigger" tiles. After each move, a new tile appears at random empty position w..

Generating combinations in c++

I have been searching a source code for generating combination using c++. I found some advanced codes for this but that is good for only specific number predefined data. Can anyone give me some hints,..

Change the Blank Cells to "NA"

Here's the link of my data. My target is to assign "NA" to all blank cells irrespective of categorical or numerical values. I am using na.strings="". But it's not assigning NA to all blank cells. #..

z-index issue with twitter bootstrap dropdown menu

I'm using twitter bootstrap dropdown menu in a fixed navbar at the top of my page. It all works fine but am having issues with the drop down menu items showing behind other page elements rather than ..

string sanitizer for filename

I'm looking for a php function that will sanitize a string and make it ready to use for a filename. Anyone know of a handy one? ( I could write one, but I'm worried that I'll overlook a character! )..

How do I vertically align text in a div?

I am trying to find the most effective way to align text with a div. I have tried a few things and none seem to work. _x000D_ _x000D_ .testimonialText {_x000D_ position: absolute;_x000D_ left: 15..

How do I convert a Django QuerySet into list of dicts?

How can I convert a Django QuerySet into a list of dicts? I haven't found an answer to this so I'm wondering if I'm missing some sort of common helper function that everyone uses...

How do you use the "WITH" clause in MySQL?

I am converting all my SQL Server queries to MySQL and my queries that have WITH in them are all failing. Here's an example: WITH t1 AS ( SELECT article.*, userinfo.*, category.* FROM quest..

For files in directory, only echo filename (no path)

How do I go about echoing only the filename of a file if I iterate a directory with a for loop? for filename in /home/user/* do echo $filename done; will pull the full path with the file name. I ..

Is there an eval() function in Java?

I have a string like the following: String str = "4*5"; Now I have to get the result of 20 by using the string. I know in some other languages the eval() function will do this. How can I do this i..

What are all the uses of an underscore in Scala?

I've taken a look at the list of surveys taken on scala-lang.org and noticed a curious question: "Can you name all the uses of “_”?". Can you? If yes, please do so here. Explanatory examples are a..

How to send redirect to JSP page in Servlet

When I'm done processing in a servlet, and the result is valid, then I need to redirect the response to another JSP page, say welcome.jsp in web content folder. How can I do it? For example: protect..

How does "cat << EOF" work in bash?

I needed to write a script to enter multi-line input to a program (psql). After a bit of googling, I found the following syntax works: cat << EOF | psql ---params BEGIN; `pg_dump ----somethin..

Download data url file

I'm playing with the idea of making a completely JavaScript-based zip/unzip utility that anyone can access from a browser. They can just drag their zip directly into the browser and it'll let them dow..

Is there a minlength validation attribute in HTML5?

It seems the minlength attribute for an <input> field doesn't work. Is there any other attribute in HTML5 with the help of which I can set the minimal length of a value for fields?..

Convert to date format dd/mm/yyyy

I have the following date: 2010-04-19 18:31:27. I would like to convert this date to the dd/mm/yyyy format...

Undefined symbols for architecture i386

Possible Duplicate: symbol(s) not found for architecture i386 I have an app to complete, and when I start trying to understand what the previous developer did (it was done with Xcode 3 I th..

How do I escape a reserved word in Oracle?

In TSQL I could use something like Select [table] from tablename to select a column named "table". How do I do this for reserved words in oracle? Edit: I've tried square braces, double quotes, sing..

Creating a simple configuration file and parser in C++

I am trying to create a simple configuration file that looks like this url = http://mysite.com file = main.exe true = 0 when the program runs, I would like it to load the configuration settings int..

How to make a transparent HTML button?

I am using dreamweaver to create a website and I thought of just using Photoshop to create backgrounds. I decided to do so only because in case I'd choose to change the button name easily by just edit..

jQuery DIV click, with anchors

To make click-able divs, I do: <div class="clickable" url="http://google.com"> blah blah </div> and then $("div.clickable").click( function() { window.location = $(this).attr(..

Java Ordered Map

In Java, Is there an object that acts like a Map for storing and accessing key/value pairs, but can return an ordered list of keys and an ordered list of values, such that the key and value lists are ..

Reading input files by line using read command in shell scripting skips last line

I usually use the read command to read an input file to the shell script line by line. An example code such as the one below yields a wrong result if a new line isn't inserted at the end of the last l..

How do I determine if my python shell is executing in 32bit or 64bit?

I need a way to tell what mode the shell is in from within the shell. While I'm primarily an OS X user, I'd be interested in knowing about other platforms as well. I've tried looking at the platform m..

Convert Text to Date?

I have a column of dates (column A) stored as text in the format yyyy-mm-dd which I'm trying to convert to dates, ultimately so that I can do look ups against them. I've read a few topics on here and..

Find provisioning profile in Xcode 5

In Xcode 5, I can get list of provisioning profiles under Xcode >> preferences >> accounts >> view details. I want to copy profile and have to send it to one of my client, but I am n..

Get decimal portion of a number with JavaScript

I have float numbers like 3.2 and 1.6. I need to separate the number into the integer and decimal part. For example, a value of 3.2 would be split into two numbers, i.e. 3 and 0.2 Getting the integer ..

How to check if a service is running via batch file and start it, if it is not running?

I want to write a batch file that performs the following operations: Check if a service is running If is it running, quit the batch If it is not running, start the service The code sampl..

How to pad a string with leading zeros in Python 3

I'm trying to make length = 001 in Python 3 but whenever I try to print it out it truncates the value without the leading zeros (length = 1). How would I stop this happening without having to cast len..

Twig: in_array or similar possible within if statement?

I am using Twig as templating engine and I am really loving it. However, now I have run in a situation which definitely mustbe accomplishable in a simpler way than I have found. What I have right now..

How to make circular background using css?

I need make something like this. and I want to do it for a <div></div> which has width in % I can do this by using an image and adding another div inside and z-index. But I want to kno..

Prepend line to beginning of a file

I can do this using a separate file, but how do I append a line to the beginning of a file? f=open('log.txt','a') f.seek(0) #get to the first position f.write("text") f.close() This starts writing ..

How do I loop through rows with a data reader in C#?

I know I can use while(dr.Read()){...} but that loops every field on my table, I want to retrieve all the values from the first row, and then second... and so on. Let's say I have a table like this: ..

Scaling an image to fit on canvas

I have a form that allows a user to upload an image. Once the image is loaded, we perform some scaling on it in order to reduce its filesize before we pass it back to the server. To do this, we plac..

Clicking a button within a form causes page refresh

I have a form in Angular that has two buttons tags in it. One button submits the form on ng-click. The other button is purely for navigation using ng-click. However, when this second button is clicked..

Python 3 Building an array of bytes

I need to build a tcp frame with raw binary data, but all examples and tutorials I've found talking about bytes always involve conversion from a string, and that's not what I need. In short, I need t..

Java 8 stream map on entry set

I'm trying to perform a map operation on each entry in a Map object. I need to take a prefix off the key and convert the value from one type to another. My code is taking configuration entries from a..

What are the differences between the different saving methods in Hibernate?

Hibernate has a handful of methods that, one way or another, takes your object and puts it into the database. What are the differences between them, when to use which, and why isn't there just one int..

#1025 - Error on rename of './database/#sql-2e0f_1254ba7' to './database/table' (errno: 150)

So I am trying to add a primary key to one of the tables in my database. Right now it has a primary key like this: PRIMARY KEY (user_id, round_number) Where user_id is a foreign key. I am trying t..

js 'types' can only be used in a .ts file - Visual Studio Code using @ts-check

I am starting to use TypeScript in a Node project I am working on in Visual Studio Code. I wanted to follow the "opt-in" strategy, similar to Flow. Therefore I put // @ts-check at the top of my .js fi..

Troubleshooting BadImageFormatException

I have a Windows service written in C# using Visual Studio 2010 and targeting the full .NET Framework 4. When I run from a Debug build the service runs as expected. However, when I run it from a Rel..

How to build PDF file from binary string returned from a web-service using javascript

I am trying to build a PDF file out of a binary stream which I receive as a response from an Ajax request. Via XmlHttpRequest I receive the following data: %PDF-1.4.... ..... ....hole data represent..

How do I get a list of installed CPAN modules?

Aside from trying perldoc <module name> individually for any CPAN module that takes my fancy or going through the file system and looking at the directories I have no idea what modules we hav..

Java : Cannot format given Object as a Date

I have Date in this format (2012-11-17T00:00:00.000-05:00). I need to convert the date into this format mm/yyyy. I tried this way, but I am getting this Exception. Exception in thread "main" java.l..

Adding a UISegmentedControl to UITableView

How do I add a UISegmentedControl to a UITableView? Similar to the image found here: http://cdn.imore.com/sites/imore.com/files/styles/large/public/field/image/2012/08/iHomework-for-iPhone-managing-as..

How to get relative path of a file in visual studio?

I am trying to get the path of an image file which I added in solution explorer in Visual Studio, but I couldn't get the relative path of that image. H is the file structure of my project: /BulutDep..

How to allow download of .json file with ASP.NET

How can I enable the download of *.json files from an old ASP.NET site (IIS6 I am led to believe)? I am getting a 404 page instead of the JSON file. Do I need to create a web.config file? What goes ..

Single vs double quotes in JSON

My code: import simplejson as json s = "{'username':'dfdsfdsf'}" #1 #s = '{"username":"dfdsfdsf"}' #2 j = json.loads(s) #1 definition is wrong #2 definition is right I heard that in Python that ..

Develop Android app using C#

Is it possible to write an android app using C#? Is there an API or something? Is it free for personal and commercial development? What do I need to install to have android project template in my Vis..

Get docker container id from container name

What is the command to get the docker container id from the container name?..

Add missing dates to pandas dataframe

My data can have multiple events on a given date or NO events on a date. I take these events, get a count by date and plot them. However, when I plot them, my two series don't always match. idx ..

How can I view a git log of just one user's commits?

When using git log, how can I filter by user so that I see only commits from that user?..

Java client certificates over HTTPS/SSL

I am using Java 6 and am trying to create an HttpsURLConnection against a remote server, using a client certificate. The server is using an selfsigned root certificate, and requires that a password-pr..

Symbolicating iPhone App Crash Reports

I'm looking to try and symbolicate my iPhone app's crash reports. I retrieved the crash reports from iTunes Connect. I have the application binary that I submitted to the App Store and I have the dSY..

Is it ok to run docker from inside docker?

I'm running Jenkins inside a Docker container. I wonder if it's ok for the Jenkins container to also be a Docker host? What I'm thinking about is to start a new docker container for each integration t..

How to remove default chrome style for select Input?

How do I remove the default yellow box border of Selected input and select fields in chrome or any browser like safari? I want to customize input with custom box shadow css. How do I remove the defaul..

Python: URLError: <urlopen error [Errno 10060]

OS: Windows 7; Python 2.7.3 using the Python GUI Shell I'm trying to read a website through Python, and several authors use the urllib and urllib2 libraries. To store the site in a variable, I've se..

Optional args in MATLAB functions

How can I declare function in MATLAB with optional arguments? For example: function [a] = train(x, y, opt), where opt must be an optional argument...

Sorting an ArrayList of objects using a custom sorting order

I am looking to implement a sort feature for my address book application. I want to sort an ArrayList<Contact> contactArray. Contact is a class which contains four fields: name, home number, mo..

How to tag docker image with docker-compose

I want to build image via docker-compose and set specific tag to it. Documentation says: Compose will build and tag it with a generated name, and use that image thereafter. But I can't find a..

What is the email subject length limit?

How many characters are allowed to be in the subject line of Internet email? I had a scan of The RFC for email but could not see specifically how long it was allowed to be. I have a colleague that wan..

Python "\n" tag extra line

I am trying to build a simple board in command line. Problem: When i use "\n" for ending current line, it adds an extra blank line. How can i fix that? Code: def drawBoard(): board = [ [0,0,0,0..

HTML iframe - disable scroll

I have following iframe in my site: <iframe src="<<URL>>" height="800" width="800" sandbox="allow-same-origin allow-scripts allow-forms" scrolling="no" style="overflow: hidden"><..

How to convert an integer to a string in any base?

Python allows easy creation of an integer from a string of a given base via int(str, base). I want to perform the inverse: creation of a string from an integer, i.e. I want some function int2bas..

How to get all groups that a user is a member of?

PowerShell's Get-ADGroupMember cmdlet returns members of a specific group. Is there a cmdlet or property to get all the groups that a particular user is a member of? I fixed my mistake: Get-Member..

How to count the number of set bits in a 32-bit integer?

8 bits representing the number 7 look like this: 00000111 Three bits are set. What are algorithms to determine the number of set bits in a 32-bit integer?..

Bootstrap how to get text to vertical align in a div container

What is the best/proper way to vertically align the text in the middle of its column? The image height is statically set in the CSS. I have tried setting an outer div to display: table and an inner d..

ORACLE convert number to string

Need some help in converting numbers: select to_char(a, '99D99') , to_char(a, '90D99') from ( select 50 a from dual union select 50.57 from dual union select 5.57 from dual union select 0.35 f..

Plotting multiple time series on the same plot using ggplot()

I am fairly new to R and am attempting to plot two time series lines simultaneously (using different colors, of course) making use of ggplot2. I have 2 data frames. the first one has 'Percent change..

How do I configure PyCharm to run py.test tests?

I want to start writing unit tests for my Python code, and the py.test framework sounds like a better bet than Python's bundled unittest. So I added a "tests" directory to my project, and added test_s..

SQL Query - how do filter by null or not null

I want to filter a record.... If statusid is null, filter the record (where statusId is not null) If statusid is not null, filter the record where statusid is equal to the specified statusid. How d..

Importing larger sql files into MySQL

I have a 400MB large sql backup file. I'm trying to import that file into MySQL database using WAMP->import, but the import was unsuccessful due to many reasons such as upload file size is too large a..

Python 'If not' syntax

I'm a bit confused about how/why so many python developers use if not in their conditional statements. for example, lets say we had a function, def foo(bar = None): if not bar: bar = 2..

Deserializing a JSON into a JavaScript object

I have a string in a Java server application that is accessed using AJAX. It looks something like the following: var json = [{ "adjacencies": [ { "nodeTo": "graphnode2", ..

Check if a variable is between two numbers with Java

I have a problem with this code: if (90 >>= angle =<< 180) The error explanation is: The left-hand side of an assignment must be a variable. I understand what this means but how d..

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

Recommended way to save uploaded files in a servlet application

I read here that one should not save the file in the server anyway as it is not portable, transactional and requires external parameters. However, given that I need a tmp solution for tomcat (7) and t..

Use Font Awesome Icon in Placeholder

Is it possible to use Font Awesome Icon in a Placeholder? I read that HTML isn't allowed in a placeholder. Is there a workaround? placeholder="<i class='icon-search'></i>" ..

When to use @QueryParam vs @PathParam

I am not asking the question that is already asked here: What is the difference between @PathParam and @QueryParam This is a "best practices" or convention question. When would you use @PathParam vs..

Filter dict to contain only certain keys?

I've got a dict that has a whole bunch of entries. I'm only interested in a select few of them. Is there an easy way to prune all the other ones out?..

How do I convert a column of text URLs into active hyperlinks in Excel?

I have a column in excel, wherein I have all the website url values. My question is I want to turn the url values to active links. There are about 200 entries in that column with different urls in all..

Cross-Origin Read Blocking (CORB)

I have called third party API using Jquery AJAX. I am getting following error in console: Cross-Origin Read Blocking (CORB) blocked cross-origin response MY URL with MIME type application/json. Se..

How to load a resource bundle from a file resource in Java?

I have a file called mybundle.txt in c:/temp - c:/temp/mybundle.txt How do I load this file into a java.util.ResourceBundle? The file is a valid resource bundle. This does not seem to work: java.n..

Comparison of full text search engine - Lucene, Sphinx, Postgresql, MySQL?

I'm building a Django site and I am looking for a search engine. A few candidates: Lucene/Lucene with Compass/Solr Sphinx Postgresql built-in full text search MySQl built-in full text search Sele..

Calculate Pandas DataFrame Time Difference Between Two Columns in Hours and Minutes

I have two columns, fromdate and todate, in a dataframe. import pandas as pd data = {'todate': [pd.Timestamp('2014-01-24 13:03:12.050000'), pd.Timestamp('2014-01-27 11:57:18.240000'), pd.Timestamp('2..

Correct way to integrate jQuery plugins in AngularJS

I was wondering what is the correct way to integrate jQuery plugins into my angular app. I've found several tutorials and screen-casts but they seem catered to a specific plugin. For Example: http://..

Label word wrapping

Is there a way to do a word wrap in a .NET label control? I know there is an alternate way of using a TextBox, make property BorderStyle to none, property ReadOnly to true and set property WordWrap a..

Create list or arrays in Windows Batch

Can I declare a list or array in a batch file like this: set list = "A B C D" And then I need to write these to a file, with the spaces between: A B C D ..

How to stop docker under Linux

My version of OS Ubuntu 16.04. I want to stop docker, so I run in the terminal: sudo systemctl stop docker But this commands doesn't help me: gridsim1103 ~: ps ax | grep docker 11347 ? Sl ..

Arrays in unix shell?

How do I create an array in unix shell scripting?..

vertical divider between two columns in bootstrap

I am using twitter bootstrap, and have a row which has two columns (span6). How do I create a vertical divider between both the spans. Thanks, Murtaza ..

possible EventEmitter memory leak detected

I am getting following warning: (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Trace: at EventEmitter.<anonym..

Using R to download zipped data file, extract, and import data

@EZGraphs on Twitter writes: "Lots of online csvs are zipped. Is there a way to download, unzip the archive, and load the data to a data.frame using R? #Rstats" I was also trying to do this today, bu..

XPath - Selecting elements that equal a value

In Xpath, I am wanting to select elements that equal a specific value. Sample XML data: <aaa id="11" > <aaa id="21" > <aaa id="31" ></aaa> <bbb id="32"..

Simplest way to append data to a SQL Column

I'm sure i can figure something out using replace, etc, but just wondering if there is anything out there that lets you simply append data to a column rather than how the common Insert function works?..

How can I specify a display?

When I run some programs over SSH, such as firefox &, I get an error Error: no display specified I would like to open many displays, still showing the stdout of each program. Initial Questi..

Where does Git store files?

I just ran the following commands on my Ruby on Rails project: git init git add . git commit -a -m 'Initial' Where does Git actually store this repository? (It's on my local machine, but where?)..

Simple if else onclick then do?

How do I make it so if yes button clicked change colour? Is using .onclick the best option for this? Am I doing it the optimal way? Thanks. html: <body> <div id="box"></div> <..

PHP function to generate v4 UUID

So I've been doing some digging around and I've been trying to piece together a function that generates a valid v4 UUID in PHP. This is the closest I've been able to come. My knowledge in hex, decimal..

Add a new column to existing table in a migration

I can't figure out how to add a new column to my existing database table using the Laravel framework. I tried to edit the migration file using... <?php public function up() { Schema::create(..

How to change the cursor into a hand when a user hovers over a list item?

I've got a list, and I have a click handler for its items: <ul> <li>foo</li> <li>goo</li> </ul> How can I change the mouse pointer into a hand pointer (like ..

RecyclerView expand/collapse items

I want to expand/collapse the items of my recyclerView in order to show more info. I want to achieve the same effect of the SlideExpandableListView. Basically in my viewHolder I have a view that is ..

is vs typeof

Which of these pieces of code is faster? if (obj is ClassA) {} if (obj.GetType() == typeof(ClassA)) {} Edit: I'm aware that they don't do the same thing...

Simulating Button click in javascript

So what i want to do is when i click on a button, it will pass this click event to another element in webpage, or you can say it will create a new click event in another element. Below is my code, it ..

Get value from input (AngularJS)

I have the following inputs and need their values: <input type="hidden" ng-model="movie" value="harry_potter"/> <input type="text" ng-model="year" value="2000"/> What can I do to get th..

Find intersection of two nested lists?

I know how to get an intersection of two flat lists: b1 = [1,2,3,4,5,9,11,15] b2 = [4,5,6,7,8] b3 = [val for val in b1 if val in b2] or def intersect(a, b): return list(set(a) & set(b)) pri..

How to reset settings in Visual Studio Code?

It's a simple thing and I was pretty sure it's well described, but surprisingly it is not so obvious. Here I've found a detailed description of settings file. As it states it should be setting.json f..

How could I create a list in c++?

How can I create a list in C++? I need it to create a linked list. How would I go about doing that? Are there good tutorials or examples I could follow?..

Strip out HTML and Special Characters

I'd like to use any php function or whatever so that i can remove any HTML code and special characters and gives me only alpha-numeric output $des = "Hello world)<b> (*&^%$#@! it's me: ..

How can I find the number of elements in an array?

I have an int array and I need to find the number of elements in it. I know it has something to do with sizeof but I'm not sure how to use it exactly...

Simpler way to check if variable is not equal to multiple string values?

Current Codes: <?php // See the AND operator; How do I simplify/shorten this line? if( $some_variable !== 'uk' && $some_variable !== 'in' ) { // Do something } ?> And: ..

Error: unable to verify the first certificate in nodejs

I'm trying to download a file from jira server using an url but I'm getting an error. how to include certificate in the code to verify Error: Error: unable to verify the first certificate in nodejs ..

ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

I use the following command: mysql -u root -h 127.0.0.1 -p and the error message is : ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111) Who can help me to fix it?..

CSS image overlay with color and transparency

I am trying to figure out if I can add an overlay to an image like a tint and change the opacity without adding background color. I had no luck so I thought I would ask here. I would like to make it r..

Eclipse will not open due to environment variables

I just rebooted my computer without changing anything. Suddenly I can't open Eclipse. Instead, I get this error message: +----------------------------------------------------------------------+ ¦ E..

Disable future dates in jQuery UI Datepicker

Is it possible to disable future date from today? Let say today is 23/10/2010, so 24/10/2010 onwards are disabled. Sorry I am very new in jQuery and JavaScript...

How to change date format using jQuery?

I have a date in a format like this fecha2.value = '2014-01-06', but I want to change the format to this '01-06-14' using jQuery. How can I do this? Thanks in advance...

Extract filename and extension in Bash

I want to get the filename (without extension) and the extension separately. The best solution I found so far is: NAME=`echo "$FILE" | cut -d'.' -f1` EXTENSION=`echo "$FILE" | cut -d'.' -f2` This ..

#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation

Hello, I am currently having an issue with MySQL! What's going wrong here? I am a cPanel user, and yes I have searched this and found no definitive answers. It appears this is more specific than othe..

converting string to long in python

Python provides a convenient method long() to convert string to long: long('234') ; converts '234' into a long If user keys in 234.89 then python will raise an error message: ValueError: invalid..

SQL Server equivalent of MySQL's NOW()?

I'm a MySQL guy working on a SQL Server project, trying to get a datetime field to show the current time. In MySQL I'd use NOW() but it isn't accepting that. INSERT INTO timelog (datetime_filed) VAL..

How do you run a .bat file from PHP?

Can anyone tell me how to execute a .bat file from a PHP script? I have tried: exec("C:\[path to file]"); system("C:\[path to file]"); Nothing is working. I've checked the PHP manuals and googled ..

Retrieving the first digit of a number

I am just learning Java and am trying to get my program to retrieve the first digit of a number - for example 543 should return 5, etc. I thought to convert to a string, but I am not sure how I can co..

Android: Align button to bottom-right of screen using FrameLayout?

I am trying to put the zoom controls of the map on the bottom right corner of screen. I could do it with RelativeLayout using both alignParentBottom="true" and alignParentRight="true", but with Framel..

Best data type to store money values in MySQL

I want to store many records in a MySQL database. All of them contains money values. But I don't know how many digits will be inserted for each one. Which data type do I have to use for this purpose? ..

In python, what is the difference between random.uniform() and random.random()?

In python for the random module, what is the difference between random.uniform() and random.random()? They both generate pseudo random numbers, random.uniform() generates numbers from a uniform distri..

How to include js file in another js file?

How can I include a js file into another js file , so as to stick to the DRY principle and avoid duplication of code...

How to get client IP address in Laravel 5+

I am trying to get the client's IP address in Laravel. It is easy to get a client's IP in PHP by using $_SERVER["REMOTE_ADDR"]. It is working fine in core PHP, but when I use the same thing in Larav..

Python Pandas iterate over rows and access column names

I am trying to iterate over the rows of a Python Pandas dataframe. Within each row of the dataframe, I am trying to to refer to each value along a row by its column name. Here is what I have: impor..

Open a selected file (image, pdf, ...) programmatically from my Android Application?

I'm working on an Android application which should be able to open a selected file from a specific folder. I already tried this, but after selecting which application I want to open it, I got this me..

Date vs DateTime

I am working on a program that requires the date of an event to get returned. I am looking for a Date, not a DateTime. Is there a datatype that returns just the date?..

Formatting text in a TextBlock

How do I achieve formatting of a text inside a TextBlock control in my WPF application? e.g.: I would like to have certain words in bold, others in italic, and some in different colors, like this exa..

Generating random strings with T-SQL

If you wanted to generate a pseudorandom alphanumeric string using T-SQL, how would you do it? How would you exclude characters like dollar signs, dashes, and slashes from it?..

How do I use the lines of a file as arguments of a command?

Say, I have a file foo.txt specifying N arguments arg1 arg2 ... argN which I need to pass to the command my_command How do I use the lines of a file as arguments of a command?..

Disable/enable an input with jQuery?

$input.disabled = true; or $input.disabled = "disabled"; Which is the standard way? And, conversely, how do you enable a disabled input?..

ValueError: unconverted data remains: 02:05

I have some dates in a json files, and I am searching for those who corresponds to today's date : import os import time from datetime import datetime from pytz import timezone input_file = file(FI..

VBA (Excel) Initialize Entire Array without Looping

I am fairly new to VBA, so this may be a simple question but here goes. I would like to initialize an entire array myArray, say of integers, in VBA. I know that I can do this by a simple initializati..

jQuery check/uncheck radio button onclick

I have this code to check/uncheck a radio button onclick. I know it is not good for the UI, but I need this. $('#radioinstant').click(function() { var checked = $(this).attr('checked', true);..

How can one use multi threading in PHP applications

Is there a realistic way of implementing a multi-threaded model in PHP whether truly, or just simulating it. Some time back it was suggested that you could force the operating system to load another i..

Python coding standards/best practices

In python do you generally use PEP 8 -- Style Guide for Python Code as your coding standards/guidelines? Are there any other formalized standards that you prefer?..

Transpose a matrix in Python

I'm trying to create a matrix transpose function in Python. A matrix is a two dimensional array, represented as a list of lists of integers. For example, the following is a 2X3 matrix (meaning the hei..

What's the best way to build a string of delimited items in Java?

While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could..

Bootstrap's JavaScript requires jQuery version 1.9.1 or higher

I have all necessary files in my code and I am still getting this error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher This is my code: <script src="http://ajax.googleapis.c..

How to create a MySQL hierarchical recursive query?

I have a MySQL table which is as follows: id name parent_id 19 category1 0 20 category2 19 21 category3 20 22 category4 21 ... ... ... Now, I want to have a single MySQL query to w..

How can Perl's print add a newline by default?

In Perl most of my print statements take the form print "hello." . "\n"; Is there a nice way to avoid keeping all the pesky "\n"s lying around? I know I could make a new function such as myprint t..

ExecJS and could not find a JavaScript runtime

I'm trying to use the Mongoid / Devise Rails 3.1 template (Mongoid and Devise), and I keep getting an error stating ExecJS cannot find a JavaScript runtime. Fair enough when I didn't have any install..

S3 limit to objects in a bucket

Does anyone know if there is a limit to the number of objects I can put in an S3 bucket? can I put a million, 10 million etc.. all in a single bucket?..

How to comment out particular lines in a shell script

Can anyone suggest how to comment particular lines in the shell script other than #? Suppose I want to comment five lines. Instead of adding # to each line, is there any other way to comment the fiv..

Change keystore password from no password to a non blank password

I have a jks keystore with no password. When I run the command keytool -list -keystore mykeystore.jks And it prompts me for the keystore password, I simply hit 'enter'. Please note that the keyst..