Questions Tagged with #Omml

Could not load file or assembly 'CrystalDecisions.ReportAppServer.CommLayer, Version=13.0.2000.0

I have developed a simple project. where i have to print some crystal report. the project runs very well in local machine, but when i up this on a web hosting server, it shows me an error when crystal..

SQL: How to properly check if a record exists

While reading some SQL Tuning-related documentation, I found this: SELECT COUNT(*) : Counts the number of rows. Often is improperly used to verify the existence of a record. Is SELECT COUNT(*) re..

Tomcat 7 is not running on browser(http://localhost:8080/ )

Actually the apache-tomcat 7 server running at The Eclipse.but in browser getting error "The requested resource is not available." .Any reasons Please..?..

How to synchronize or lock upon variables in Java?

Let me use this small and simple sample: class Sample { private String msg = null; public void newmsg(String x){ msg = x; } public String getmsg(){ String temp = msg..

MySQL date formats - difficulty Inserting a date

I am trying to further a question I asked yesterday where I wanted to know how to query a date in a different format. But now I am trying to do an insert using this method (see below) however I can't ..

Struct like objects in Java

Is it completely against the Java way to create struct like objects? class SomeData1 { public int x; public int y; } I can see a class with accessors and mutators being more Java like. cla..

Removing white space around a saved image in matplotlib

I need to take an image and save it after some process. The figure looks fine when I display it, but after saving the figure, I got some white space around the saved image. I have tried the 'tight' op..

Paste Excel range in Outlook

I want to paste a range of cells in Outlook. Here is my code: Sub Mail_Selection_Range_Outlook_Body() Dim rng As Range Dim OutApp As Object Dim OutMail As Object Set rng = Nothing On Error Resume..

Opening a remote machine's Windows C drive

I'm trying to locally mount a machine's C drive that is on my LAN. I need to able to browse the contents of the other machine when tracing through code. I once saw a sys admin do some crazy windows ..

Google Maps API V3 : How show the direction from a point A to point B (Blue line)?

I have latitude and longitude for 2 points on database, I want my Google Map to display a route from point A to point B... Just like we see here (Google Maps Directions) How to draw that direction..

Adding text to ImageView in Android

I want to use an ImageView to show some message in a fancy way. How do I add text to an ImageView?..

I need an unordered list without any bullets

I have created an unordered list. I feel the bullets in the unordered list are bothersome, so I want to remove them. Is it possible to have a list without bullets?..

Trying to mock, but not working

Can anyone tell me why this isn't working? >>> import mock >>> @mock.patch('') ... def today(cls): ... return date(2010, 1, 1) ... >>> from datetime imp..

What is the difference between Spring, Struts, Hibernate, JavaServer Faces, Tapestry?

May I know what is the difference between:- Spring Struts Struts 2 Hibernate JavaServer Faces JavaServer Pages Tapestry Are these technologies/framework complementary to each other? Or they are al..

Rename all files in directory from $filename_h to $filename_half?

Dead simple. How do I rename 05_h.png 06_h.png to 05_half.png 06_half.png At least, I think it's simple, but it's hard to Google for this kind of thing unless you already know. Thanks......

What does the arrow operator, '->', do in Java?

While hunting through some code I came across the arrow operator, what exactly does it do? I thought Java did not have an arrow operator. return (Collection<Car>)

Adding backslashes without escaping [Python]

I need to escape a & (ampersand) character in a string. The problem is whenever I string = string.replace ('&', '\&') the result is '\\&'. An extra backslash is added to escape the ori..

Is it possible to pull just one file in Git?

I am working on a Git branch that has some broken tests, and I would like to pull (merge changes, not just overwrite) these tests from another branch where they are already fixed. I know I can do gi..

Set a Fixed div to 100% width of the parent container

I have a wrapper with some padding, I then have a floating relative div with a percentage width (40%). Inside the floating relative div I have a fixed div which I would like the same size as its par..

Inserting image into IPython notebook markdown

I am starting to depend heavily on the IPython notebook app to develop and document algorithms. It is awesome; but there is something that seems like it should be possible, but I can't figure out how..

How can I get the current user directory?

Using this: Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) I get this output: "C:\\Documents and Settings\\[USER]\\Application Data" How can I get the root directory of all..

How to fix error with xml2-config not found when installing PHP from sources?

When I try to install php 5.3 stable from source on Ubuntu (downloading compressed installation file from and I run ./configure I get this error: configure: error: x..

Using a cursor with dynamic SQL in a stored procedure

I have a dynamic SQL statement I've created in a stored procedure. I need to iterate over the results using a cursor. I'm having a hard time figuring out the right syntax. Here's what I'm doing. SELE..

How to output to the console in C++/Windows

When using iostream in C++ on Linux, it displays the program output in the terminal, but in Windows, it just saves the output to a stdout.txt file. How can I, in Windows, make the output appear in the..

Javascript replace all "%20" with a space

Is there a way to replace every "%20" with a space using JavaScript. I know how to replace a single "%20" with a space but how do I replace all of them? var str = "Passwords%20do%20not%20match"; v..

Origin http://localhost is not allowed by Access-Control-Allow-Origin

I'm trying to do a fetch from backbone.js to my node.js server. However, I get the following error in the console: Origin http://localhost is not allowed by Access-Control-Allow-Origin. I added the ..

How can I delete a service in Windows?

I have a couple old services that I want to completely uninstall. How can I do this?..

How to easily consume a web service from PHP

Is there available any tool for PHP which can be used to generate code for consuming a web service based on its WSDL? Something comparable to clicking "Add Web Reference" in Visual Studio or the Eclip..

Android Animation Alpha

I've got animation: <set xmlns:android="" android:interpolator="@android:anim/linear_interpolator"> <alpha android:fromAlpha="0.2..

How to make sure docker's time syncs with that of the host?

I have dockers running on Linode servers. At times, I see that the time is not right on the dockers. Currently I have changed the run script in every docker to include the following lines of code. yu.."#element") not working when code above the html element

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

Unbound classpath container in Eclipse

I have checked out a project using Subversive for Eclipse and I am getting the following errors: The project cannot be built until build path errors are resolved Unbound classpath container: 'JRE Sy..

Does bootstrap 4 have a built in horizontal divider?

Does bootstrap 4 have a built in horizontal divider? I can do this, <style type="text/css"> .h-divider{ margin-top:5px; margin-bottom:5px; height:1px; width:100%; border-top:1px solid gray..

Extracting Path from OpenFileDialog path/filename

I'm writing a little utility that starts with selecting a file, and then I need to select a folder. I'd like to default the folder to where the selected file was. OpenFileDialog.FileName returns the ..

Difference in System. exit(0) , System.exit(-1), System.exit(1 ) in Java

I'd like to know the difference between the following in Java System.exit(0); System.exit(-1); System.exit(1); When do I have to use the above code appropriately?..

Determine the process pid listening on a certain port

As the title says, I'm running multiple game servers, and every of them has the same name but different PID and the port number. I would like to match the PID of the server which is listening on certa..

How do you set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER for building Assimp for iOS?

When I try to build Assimp by running, it tells me: CMake Error: your C compiler: "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc" was not found. Please set CMAKE_C_..

Importing class/java files in Eclipse

I'm new to Java Programming using Eclipse, so would really appreciate your help for this question. I have doing Java programming both at college and home. At home, I have all my Java classes under a .. no protocol

I am getting Java exception like: no protocol My program is trying to parse an XML string by using: Document dom; DocumentBuilderFactory dbf = DocumentBuilderFacto..

How to start MySQL with --skip-grant-tables?

I locked my root user out from our database. I need to get all privileges back to the root user. I have my password and I can log in to MySQL. But the root user has no all privileges...

Disable eslint rules for folder

Is there a way to disable specific rules for a folder? For example, I don't want to have required JSDoc comments for all my test files in the test folder. Is there a way to do this?..

How do I find the parent directory in C#?

I use this code for finding the debug directory public string str_directory = Environment.CurrentDirectory.ToString(); "C:\\Users\\Masoud\\Documents\\Visual Studio 2008\\Projects\\MyProj\\MyProj\\b..

Oracle - What TNS Names file am I using?

Sometimes I get Oracle connection problems because I can't figure out which tnsnames.ora file my database client is using. What's the best way to figure this out? ++happy for various platform soluti..

Get UIScrollView to scroll to the top

How do I make a UIScrollView scroll to the top?..

Non-alphanumeric list order from os.listdir()

I often use python to process directories of data. Recently, I have noticed that the default order of the lists has changed to something almost nonsensical. For example, if I am in a current directory..

What is the purpose of the var keyword and when should I use it (or omit it)?

NOTE: This question was asked from the viewpoint of ECMAScript version 3 or 5. The answers might become outdated with the introduction of new features in the release of ECMAScript 6. What exactly..

Change limit for "Mysql Row size too large"

How can I change the limit Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 ..

How add "or" in switch statements?

This is what I want to do: switch(myvar) { case: 2 or 5: ... break; case: 7 or 12: ... break; ... } I tried with "case: 2 || 5" ,but it didn't work. The purpose is to ..

The ScriptManager must appear before any controls that need it

I have created a new ASP.NET Web Application, and after debugging i got Server Error The control with ID 'WaitingPopup1' requires a ScriptManager on the page. The ScriptManager must appear before ..

Replacing blank values (white space) with NaN in pandas

I want to find all values in a Pandas dataframe that contain whitespace (any arbitrary amount) and replace those values with NaNs. Any ideas how this can be improved? Basically I want to turn this: ..

Bash script error [: !=: unary operator expected

In my script I am trying to error check if the first and only argument is equal to -v but it is an optional argument. I use an if statement but I keep getting the unary operator expected error. this..

Re-order columns of table in Oracle

I have a table with 50+ columns and I need to swap the order of the first two columns. What is the best way to accomplish this using Oracle? Assume the table name is ORDERDETAILS and as it is, the fir..

Difference between getAttribute() and getParameter()

What is the difference between getAttribute() and getParameter() methods within HttpServletRequest class?..

Does functional programming replace GoF design patterns?

Since I started learning F# and OCaml last year, I've read a huge number of articles which insist that design patterns (especially in Java) are workarounds for the missing features in imperative langu..

How to resume Fragment from BackStack if exists

I am learning how to use fragments. I have three instances of Fragment that are initialized at the top of the class. I am adding the fragment to an activity like this: Declaring and initializing: Fr..

Test or check if sheet exists

Dim wkbkdestination As Workbook Dim destsheet As Worksheet For Each ThisWorkSheet In wkbkorigin.Worksheets 'this throws subscript out of range if there is not a sheet in the destination 'wo..

How to catch segmentation fault in Linux?

I need to catch segmentation fault in third party library cleanup operations. This happens sometimes just before my program exits, and I cannot fix the real reason of this. In Windows programming I co..

how to return a char array from a function in C

I want to return a character array from a function. Then I want to print it in main. how can I get the character array back in main function? #include<stdio.h> #include<string.h> int main..

Make XAMPP / Apache serve file outside of htdocs folder

Is it possible to configure xampp to serve up a file outside of the htdocs directory? For instance, say I have a file located as follows: C:\projects\transitCalculator\trunk\TransitCalculator.php a..

print memory address of Python variable

How do I print the memory address of a variable in Python 2.7? I know id() returns the 'id' of a variable or object, but this doesn't return the expected 0x3357e182 style I was expecting to see for a..

How do I serialize a Python dictionary into a string, and then back to a dictionary?

How do I serialize a Python dictionary into a string, and then back to a dictionary? The dictionary will have lists and other dictionaries inside it...

How can I add 1 day to current date?

I have a current Date object that needs to be incremented by one day using the JavaScript Date object. I have the following code in place: var ds = stringFormat("{day} {date} {month} {year}", { ..

Rounding up to next power of 2

I want to write a function that returns the nearest next power of 2 number. For example if my input is 789, the output should be 1024. Is there any way of achieving this without using any loops but ju..

MySQL error 1449: The user specified as a definer does not exist

When I run the following query I get an error: SELECT `a`.`sl_id` AS `sl_id`, `a`.`quote_id` AS `quote_id`, `a`.`sl_date` AS `sl_date`, ..

Convert XML to JSON (and back) using Javascript

How would you convert from XML to JSON and then back to XML? The following tools work quite well, but aren't completely consistent: xml2json Has anyone encountered this situation before?..

Update Row if it Exists Else Insert Logic with Entity Framework

Does anyone have suggestions on the most efficient way to implement "update row if it exists else insert" logic using Entity Framework?..

JavaScript style.display="none" or jQuery .hide() is more efficient?

document.getElementById("elementId").style.display="none" is used in JavaScript to hide an element. But in jQuery, $("#elementId").hide(); is used for the same purpose. Which way is more efficien..

Get random sample from list while maintaining ordering of items?

I have a sorted list, let say: (its not really just numbers, its a list of objects that are sorted with a complicated time consuming algorithm) mylist = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ,9 , 10 ] I..

Ignore duplicates when producing map using streams

Map<String, String> phoneBook = .collect(toMap(Person::getName, Person::getAddress)); ..

Limiting floats to two decimal points

I want a to be rounded to 13.95. >>> a 13.949999999999999 >>> round(a, 2) 13.949999999999999 The round function does not work the way I expected...

Input length must be multiple of 16 when decrypting with padded cipher

I have a server and client socket program, a server send a encrypted message to client, i.e. the server side code: cipher2 = Cipher.getInstance("AES"); secretKeySpec = new SecretKeySpec(decryptedT..

Best way to load module/class from lib folder in Rails 3?

Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore, what would be the best way to load them? From github: A few changes were done in this commit: Do not auto..

Avoid Adding duplicate elements to a List C#

string[] lines3 = new string[100]; List<string> lines2 = new List<string>(); lines3 = Regex.Split(s1, @"\s*,\s*"); if (!lines2.Contains(lines3.ToString())) { lines2.AddRange(lines3.Di..

Click a button with XPath containing partial id and title in Selenium IDE

Using Selenium IDE, I'm trying to click a button within a table on a webpage using XPath with a partial id and a title from the element. The XPath I'm using is: xpath=//*[contains(@id, 'ctl00_btnAirc..

Best tool for inspecting PDF files?

How can I inspecting PDF files, preferable with a tool? Use case: I'm trying to programmatically generate PDF files (using iText). I'm having trouble achieving certain layouts, but I have PDF files w..

Hash String via SHA-256 in Java

By looking around here as well as the internet in general, I have found Bouncy Castle. I want to use Bouncy Castle (or some other freely available utility) to generate a SHA-256 Hash of a String in Ja..

How to use sessions in an ASP.NET MVC 4 application?

I am new to ASP.NET MVC. I have used PHP before and it was easy to create a session and select user records based on the current session variables. I have looked everywhere on the Internet for a sim..

How can I run a php without a web server?

I would like to ask if I can run a php without having installed a web server. Do I have to use the php like CGI and run my page via command line? And if so, what are the steps that I do I have to choo..

How to use an array list in Java?

I need to know if I store my data in an ArrayList and I need to get the value that I've stored in it. For example : if I have an array list like this ArrayList A = new ArrayList(); A = ..

ngOnInit not being called when Injectable class is Instantiated

Why isn't ngOnInit() called when an Injectable class is resolved? Code import {Injectable, OnInit} from 'angular2/core'; import { RestApiService, RestRequest } from './rest-api.service'; @Injectabl..

SQL query return data from multiple tables

I would like to know the following: how to get data from multiple tables in my database? what types of methods are there to do this? what are joins and unions and how are they different from one ano..

SQL Server Operating system error 5: "5(Access is denied.)"

I am starting to learn SQL and I have a book that provides a database to work on. These files below are in the directory but the problem is that when I run the query, it gives me this error: Msg 5..

How to use a TRIM function in SQL Server

I cannot get this TRIM code to work SELECT dbo.COL_V_Cost_GEMS_Detail.TNG_SYS_NR AS [EHP Code], dbo.COL_TBL_VCOURSE.TNG_NA AS [Course Title], LTRIM(RTRIM(FCT_TYP_CD)& ') AND (' & ..

How to connect Android app to MySQL database?

I have a website already setup which uses mysql database. I want to know how can i connect my app to that database. What i wanna achieve is that my app should make a request to find a table of a defi..

How to export a mysql database using Command Prompt?

I have a database that is quite large so I want to export it using Command Prompt but I don't know how to. I am using WAMP...

Python: list of lists

Running the code listoflists = [] list = [] for i in range(0,10): list.append(i) if len(list)>3: list.remove(list[0]) listoflists.append((list, list[0])) print listoflists ..

The server principal is not able to access the database under the current security context in SQL Server MS 2012

I am trying to access my hosting server’s database through SQL Server Management Studio, everything till login is fine but when I use the command use myDatabase it gives me this error: The server p..

Error:Execution failed for task ':app:transformClassesWithDexForDebug'

The error Error:Execution failed for task ':app:transformClassesWithDexForDebug'. org.gradle...

Is there a need for range(len(a))?

One frequently finds expressions of this type in python questions on SO. Either for just accessing all items of the iterable for i in range(len(a)): print(a[i]) Which is just a clumbersome way ..

PHP cURL error code 60

Whilst trying to setup a php environment on windows (using wamp) to use the Amazon PHP SDK, when i try to run a sample test I get the following error: Fatal error: Uncaught exception 'cURL_Exception'..

What is the MySQL VARCHAR max size?

I would like to know what the max size is for a MySQL VARCHAR type. I read that the max size is limited by the row size which is about 65k. I tried setting the field to varchar(20000) but it says th..

How do I compare two columns for equality in SQL Server?

I have two columns that are joined together on certain criteria, but I would also like to check if two other columns are identical and then return a bit field if they are. Is there a simpler solution..

Convert R vector to string vector of 1 element

Im working with the programming language R now. I have a vector: a <- c("aa", "bb", "cc") And I want to paste these to a system command, I'm trying it this way now: args <- paste(a, sep=" ")..

ECMAScript 6 arrow function that returns an object

When returning an object from an arrow function, it seems that it is necessary to use an extra set of {} and a return keyword because of an ambiguity in the grammar. That means I can’t write p =>..

Object Required Error in excel VBA

Dim g1val, g2val As Integer Set g1val = 0 Set g2val = 0 For i = 3 To 18 If g1val > Cells(33, i).Value Then g1val = g1val Else g1val = Cells(33, i).Value End If Next i ..

How to write a Python module/package?

I've been making Python scripts for simple tasks at work and never really bothered packaging them for others to use. Now I have been assigned to make a Python wrapper for a REST API. I have absolutely..

Am I trying to connect to a TLS-enabled daemon without TLS?

I'm trying to learn about Docker, but I keep getting cryptic (to me) error messages. Possibly the simplest example of this is trying to print the version of Docker I installed: $ sudo docker version..

Call a function from another file?

Set_up: I have a .py file for each function I need to use in a program. In this program, I need to call the function from the external files. I've tried: from import function(a,b) But I g..

sequelize findAll sort order in nodejs

I'm trying to output all object list from database with sequelize as follow and want to get data are sorted out as I added id in where clause. exports.getStaticCompanies = function () { return Co..

ClassCastException, casting Integer to Double

ArrayList marks = new ArrayList(); Double sum = 0.0; sum = ((Double)marks.get(i)); Everytime I try to run my program, I get a ClassCastException that states: java.lang.Integer cannot be cast to java..

JPA or JDBC, how are they different?

I am learning Java EE and I downloaded the eclipse with glassfish for the same. I saw some examples and also read the Oracle docs to know all about Java EE 5. Connecting to a database was very simple...

How to loop an object in React?

New to React and trying to loop Object attributes but React complains about Objects not being valid React children, can someone please give me some advice on how to resolve this problem? I've added cr..

Python: Binary To Decimal Conversion

Possible Duplicate: Convert binary string to int How would I convert this binary value '101011111' to decimal form in Python? The function converts binary numbers into decimal numbers. In..

python re.split() to split by spaces, commas, and periods, but not in cases like 1,000 or 1.50

I want to use python re.split() to split a string into individual words by spaces, commas and periods. But I don't want "1,200" to be split into ["1", "200"] or ["1.2"] to be split into ["1", "2"]. E..

How to indent a few lines in Markdown markup?

I want to write a few lines of text. They should be formatted normally except each line should start at the 6th column. I.e. I don't want the code block formatting rule to make this chunk of text look..

Remove 'standalone="yes"' from generated XML

Do you know of a JAXB setting to prevent standalone="yes" from being generated in the resulting XML? <?xml version="1.0" encoding="UTF-8" standalone="yes"?> ..

Should jQuery's $(form).submit(); not trigger onSubmit within the form tag?

I have the following: <script type="text/javascript"> function CancelFormButton(button) { $(button.form).submit(); } </script> <form onsubmit="alert('here');"> <input type="..

Webpack.config how to just copy the index.html to the dist folder

I am trying to automate assets going into /dist. I have the following config.js: module.exports = { context: __dirname + "/lib", entry: { main: [ "./baa.ts" ] ..

Java: splitting a comma-separated string but ignoring commas in quotes

I have a string vaguely like this: foo,bar,c;qual="baz,blurb",d;junk="quux,syzygy" that I want to split by commas -- but I need to ignore commas in quotes. How can I do this? Seems like a regexp ap..

How to parse XML to R data frame

I tried to parse XML to R data frame, this link helped me a lot: how to create an R data frame from a xml file But still I was not able to figure out my problem: Here is my code: data <- xmlPar..

Check if a file exists with wildcard in shell script

I'm trying to check if a file exists, but with a wildcard. Here is my example: if [ -f "xorg-x11-fonts*" ]; then printf "BLAH" fi I have also tried it without the double quotes...

String.Format like functionality in T-SQL?

I'm looking for a built-in function/extended function in T-SQL for string manipulation similar to the String.Format method in .NET...

Convert a string to datetime in PowerShell

I am using PowerShell to try and convert a string to a datetime. It should be easy, right? I am getting the string from a CSV import, and it comes in the format of Jul-16. I have tried multiple ways ..

Set iframe content height to auto resize dynamically

I was myself searching for a simple solution to change the height of an iframe with the content in it. It seems like the rules are that you can't get the height of the iframe from the page holding it..

How to select distinct query using symfony2 doctrine query builder?

I have this symfony code where it retrieves all the categories related to a blog section on my project: $category = $catrep->createQueryBuilder('cc') ->Where('cc.contenttype = :type') -..

How to disable <br> tags inside <div> by css?

<br> won't let me to display 3 buttons inline, so i need to disable it inside div, and I can't just delete them, they are automatically there. I have: <div style="display:block"> <p&g..

Adding text to a cell in Excel using VBA

I've been working with SQL and Excel Macros, but I don't know how to add text to a cell. I wish to add the text "01/01/13 00:00" to cell A1. I can't just write it in the cell because the macro clears..

XmlWriter to Write to a String Instead of to a File

I have a WCF service that needs to return a string of XML. But it seems like the writer only wants to build up a file, not a string. I tried: string nextXMLstring = ""; using (XmlWriter writer = Xm..

Get the current URL with JavaScript?

All I want is to get the website URL. Not the URL as taken from a link. On the page loading I need to be able to grab the full, current URL of the website and set it as a variable to do with as I plea..

Difference between Parameters.Add(string, object) and Parameters.AddWithValue

I read the MSDN documentation and examples here and I know that the correct syntax for a Paramters.Add call is : command.Parameters.Add("@ID", SqlDbType.Int); command.Parameters["@ID"].Value = ..

How do you add UI inside cells in a google spreadsheet using app script?

I'd like to add buttons to specific cells in Google docs spreadsheet. The apps script UI documentation talks about how to add a new panel, but it's not clear how UI in that panel could be attached t..

Str_replace for multiple items

I remember doing this before, but can't find the code. I use str_replace to replace one character like this: str_replace(':', ' ', $string); but I want to replace all the following characters \/:*?"&l..

HTTP Status 500 - Error instantiating servlet class pkg.coreServlet

I am creating simple servlet and deploying it in tomcat server but I am getting the following error: HTTP Status 500 - Error instantiating servlet class pkg.coreServlet File Structure on the tom..

Install msi with msiexec in a Specific Directory

I want to install a msi with msiexec in a specific directory. I'm using: msiexec /i "msi path" INSTALLDIR="C:\myfolder" /qb It is not working with the "INSTALLDIR", because the msi is installing i..

How do CSS triangles work?

There're plenty of different CSS shapes over at CSS Tricks - Shapes of CSS and I'm particularly puzzled with a triangle: _x000D_ _x000D_ #triangle-up {_x000D_ width: 0;_x000D_ height: 0;_x000D_..

What are the Android SDK build-tools, platform-tools and tools? And which version should be used?

I know this is a very rudimentary question, but to my surprise, I could not find any document about Android SDK Build-tools. Besides Android SDK Tools and Android SDK Platform-tools, there are a bunch..

How to use the CSV MIME-type?

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

How to set the default value for radio buttons in AngularJS?

I need to make a system to change the total price by number of tickets selected. I created some radio buttons to choose the number of ticket. The ploblem is that the default value is unset and the res..

Using Jquery Ajax to retrieve data from Mysql

list.php: A simple ajax code that I want to display only records of the Mysql table: <html> <head> <script src="jquery-1.9.1.min.js"> </script> <scri..

How to directly move camera to current location in Google Maps Android API v2?

Without clicking any button, how to directly get the current location and move the camera to it. Also, I found that there is a button on the right top of the map. When click on it, it will go to curre..

Toolbar navigation icon never set

I'm trying the new Toolbar component and having some trouble with the navigation icon. I want to implement a custom icon for back navigation : In my manifest i set a parent to my activity : <activi..

How to write :hover condition for a:before and a:after?

How to write :hover and :visited condition for a:before? I'm trying a:before:hover but it's not working..

li:before{ content: "¦"; } How to Encode this Special Character as a Bullit in an Email Stationery?

After proudly coloring my liststyle bullet without any image url or span tags, via: ul{ list-style: none; padding:0; margin:0; } li{ padding-left: 1em; text-indent: -1em; } li:before { content: ..

Number input type that takes only integers?

I'm using the jQuery Tools Validator which implements HTML5 validations through jQuery. It's been working great so far except for one thing. In the HTML5 specification, the input type "number&quo..

Calculating distance between two points (Latitude, Longitude)

I am trying to calculate the distance between two positions on a map. I have stored in my data: Longitude, Latitude, X POS, Y POS. I have been previously using the below snippet. DECLARE @orig_lat D..

webpack is not recognized as a internal or external command,operable program or batch file

I am Learning React.js and i am using windows 8 OS.i have navigate to my root folder 1.Created the package.json file by npm init 2. install webpack by npm install -S webpack has been down..

Is an HTTPS query string secure?

I am creating a secure web based API that uses HTTPS; however, if I allow the users to configure it (include sending password) using a query string will this also be secure or should I force it to be ..

Comparing two byte arrays in .NET

How can I do this fast? Sure I can do this: static bool ByteArrayCompare(byte[] a1, byte[] a2) { if (a1.Length != a2.Length) return false; for (int i=0; i<a1.Length; i++) ..

Extending from two classes

How can I do this: public class Main extends ListActivity , ControlMenu Also, I would like to know that is this approach is okay that I have made the menus in class which is ControlMenu and I am e..

Entity Framework Join 3 Tables

I'm trying to join three tables but I can't understand the method... I completed join 2 tables var entryPoint = dbContext.tbl_EntryPoint .Join(dbContext.tbl_Entry, ..

Convert date field into text in Excel

I have an Excel file which has a column formatted as date in the format dd-mm-YYYY. I need to convert that field to text. If I change the field type excel converts it to a strange value (like 40603)...

How to set an button align-right with Bootstrap?

I am learning Bootstrap. The structure is a container within some context. At the bottom of the container, I put a button next to an description. Now, I want to set the button align to the right with..

How can I open a .tex file?

I'm trying to open a .tex file. I'm not sure I've got to the bottom of the (possibly) surprisingly complex process. I was told I could do it with Notepad++, which I proceeded to download. Here is the..

What is memoization and how can I use it in Python?

I just started Python and I've got no idea what memoization is and how to use it. Also, may I have a simplified example?..

C# WinForms - custom button unwanted border when form unselected

I'm having a problem with a custom button I have created in c# win forms.. The button appears fine when the form is selected but as soon as I click away from the form a border appears on the button. A..

How to convert a String to JsonObject using gson library

Please advice how to convert a String to JsonObject using gson library. What I unsuccesfully do: String string = "abcde"; Gson gson = new Gson(); JsonObject json = new JsonObject(); json =

How to run .APK file on emulator

Possible Duplicate: How do you install an APK file in the Android emulator? I download an APK file and I want to run it on an Android emulator but I don't know how. Please help me. Thanks..

How do I correctly setup and teardown for my pytest class with tests?

I am using selenium for end to end testing and I can't get how to use setup_class and teardown_class methods. I need to set up browser in setup_class method, then perform a bunch of tests defined as c..

Using Server.MapPath in external C# Classes in ASP.NET

I'm trying to get the absolute path of certain files in a C# class. Server.MapPath works great of course for ASPX and their code-behind pages, but that doesn't exist in another class file. I tried H..

How to make input type= file Should accept only pdf and xls

I used <input type= "file" name="Upload" > Now I would like to restrict this by accepting only .pdf and .xls files. When I click the submit button it should validate this. And when I click th..

How can getContentResolver() be called in Android?

I want to know the context in which getContentResolver() is called? I have a scenario like this: I have an activity A that calls a method myFunc() of class B which is not an activity. So, in class B ..

MySQL SELECT WHERE datetime matches day (and not necessarily time)

I have a table which contains a datetime column. I wish to return all records of a given day regardless of the time. Or in other words, if my table only contained the following 4 records, then only ..

Type of expression is ambiguous without more context Swift

I am getting a 'Type of expression is ambiguous without more context ' on this part of code from a project I am trying to upgrade to latest Swift version. I can't seem to figure it out. I tried differ..

Why do some functions have underscores "__" before and after the function name?

This "underscoring" seems to occur a lot, and I was wondering if this was a requirement in the Python language, or merely a matter of convention? Also, could someone name and explain which functions ..

Cannot find the object because it does not exist or you do not have permissions. Error in SQL Server

I have a database and have a Sql script to add some fields to a table called "Products" in the database. But when i am executing this script, I am getting the following error: Cannot find the object..

Disable button in jQuery

My page creates multiple buttons as id = 'rbutton_"+i+"'. Below is my code: <button type='button' id = 'rbutton_"+i+"' onclick=disable(i);>Click me</button> In Javascript function disa..

Can I use GDB to debug a running process?

Under linux, can I use GDB to debug a process that is currently running?..

Reading JSON from a file?

I am getting a bit of headache just because a simple looking, easy statement is throwing some errors in my face. I have a json file called strings.json like this: "strings": [{"-name": "city", "#tex..

SQL - Update multiple records in one query

I have table - config. Schema: config_name | config_value And I would like to update multiple records in one query. I try like that: UPDATE config SET t1.config_value = 'value' , t2.config_value..

NameError: name 'self' is not defined

Why such structure class A: def __init__(self, a): self.a = a def p(self, b=self.a): print b gives an error NameError: name 'self' is not defined?..

How can I flush GPU memory using CUDA (physical reset is unavailable)

My CUDA program crashed during execution, before memory was flushed. As a result, device memory remained occupied. I'm running on a GTX 580, for which nvidia-smi --gpu-reset is not supported. Placin..

Using Mysql in the command line in osx - command not found?

I'm trying to get mysql up and running on my mac osx 10.9.5. I've installed the latest version14.14 5.6.21 community server. I've gone to system preferences and started the mysql server, then launch..

Error in data frame undefined columns selected

I've been working on an assignment where I have to read in some csv files from a directory "specdata". The files are very similar in that there are 332 titled 001.csv - 332.csv. They have consistent c..

CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105)

I have a database file .mdf from MS SQL EXPRESS in folder: C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA I would like to attach it to MS 2008 R2 (MSSQL10_50.MSSQLSERVER) but u..

How do I include a Perl module that's in a different directory?

How do I include a Perl module that's in a different directory? It needs to be a relative path from the module that's including it. I've tried push ( @INC,"directory_path/more_path"); also push..

If hasClass then addClass to parent

Original post: Why doesn't this simple script work? if ($('#navigation > ul > li > ul > li > a').hasClass('.active')) { $(this).parent().parent().parent().addClass(".active"); } ..

How to detect orientation change in layout in Android?

I just implemented a orientation change feature - e.g. when the layout changes from portrait to landscape (or vice versa). How can I detect when the orientation change event finished. The Orientation..

Spark difference between reduceByKey vs groupByKey vs aggregateByKey vs combineByKey

Can anyone explain the difference between reducebykey,groupbykey,aggregatebykey and combinebykey? I have read the documents regarding this , but couldn't understand the exact differences? If you can ..

Jquery mouseenter() vs mouseover()

So after reading a recently answered question i am unclear if i really understand the difference between the mouseenter() and mouseover(). The post states MouseOver(): Will fire upon entering an elem..

Can comments be used in JSON?

Can I use comments inside a JSON file? If so, how?..

How can I remove an element from a list?

I have a list and I want to remove a single element from it. How can I do this? I've tried looking up what I think the obvious names for this function would be in the reference manual and I haven't ..

Getting an odd error, SQL Server query using `WITH` clause

The following query: WITH CteProductLookup(ProductId, oid) AS ( SELECT p.ProductID, p.oid FROM [dbo].[ME_CatalogProducts] p ) SELECT rel.Name as Relationship..

What are the options for (keyup) in Angular2?

The following works great when the enter key is released. What other options are available for the keyup in addition to keyup.enter? <input #inputstring (keyup.enter)="doSomething(inputstring.valu..

Multiple WHERE clause in Linq

I'm new to LINQ and want to know how to execute multiple where clause. This is what I want to achieve: return records by filtering out certain user names. I tried the code below but not working as exp..

How to use SqlClient in ASP.NET Core?

I am trying to use SQLClient library in the Core but cant seem to get it working. I found this article online advising how to setup but its not working for me:

Finding sum of elements in Swift array

What is the easiest (best) way to find the sum of an array of integers in swift? I have an array called multiples and I would like to know the sum of the multiples...

Where and why do I have to put the "template" and "typename" keywords?

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway? I have the following code: template <typename T, typename Tail>..

How do you check if a certain index exists in a table?

Something like this: SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME ='FK_TreeNodesBinaryAssets_BinaryAssets' and TABLE_NAME = 'TreeNodesBinaryAssets' but for indexes...

How to read a file in reverse order?

How to read a file in reverse order using python? I want to read a file from last line to first line...

substring index range

Code: public class Test { public static void main(String[] args) { String str = "University"; System.out.println(str.substring(4, 7)); } } Output: ers I do not really un..

Vendor code 17002 to connect to SQLDeveloper

I'm trying to connect to a database using SQLDeveloper and I get the following error: An Error was Encountered performing The requested operation: IO Error: Conection reset Vendor code 17002. Cou..

jQuery click events firing multiple times

I'm attempting to write a video poker game in Javascript as a way of getting the basics of it down, and I've run into a problem where the jQuery click event handlers are firing multiple times. They'r..

Getting path of captured image in Android using camera intent

I have been trying to get path of captured image in order to delete image. Found many answers on StackOverflow but none of them are working for me. I got the following answer: private String getLastI..

Can I pass a JavaScript variable to another browser window?

I have a page which spawns a popup browser window. I have a JavaScript variable in the parent browser window and I would like to pass it to the popped-up browser window. Is there a way to do this? I ..

Returning JSON object from an ASP.NET page

In my particular situation, I have a couple of solutions to my problem. I want to find out which one is more feasible. In this case, I can also achieve my goal by returning a JSON object from my serve..

StringStream in C#

I want to be able to build a string from a class that I create that derives from Stream. Specifically, I want to be able to write code like this: void Print(Stream stream) { // Some code that ope..

Apache Cordova - uninstall globally

I've installed cordova via npm and i did it globally, now i would like to remove it to reinstall it on single app folder Any clue on how to do it safely?..

Return a value if no rows are found in Microsoft tSQL

Using a Microsoft version of SQL, here's my simple query. If I query a record that doesn't exist then I will get nothing returned. I'd prefer that false (0) is returned in that scenario. Looking for t..

Select query to get data from SQL Server

I am trying to run the SQL Select query in my C# code. But I always get the -1 output on int result = command.ExecuteNonQuery(); However, the same table if I use for delete or insert works... Co..

Writing a dictionary to a text file?

I have a dictionary and am trying to write it to a file. exDict = {1:1, 2:2, 3:3} with open('file.txt', 'r') as file: file.write(exDict) I then have the error file.write(exDict) TypeError: mus..

Deploying website: 500 - Internal server error

I am trying to deploy an ASP.NET application. I have deployed the site to IIS, but when visiting it with the browser, it shows me this: Server Error 500 - Internal server error. There is a problem wi..

Removing page title and date when printing web page (with CSS?)

By default, when you print a web page, the page title and and URL are printed at the top of the page, and likewise the date and time are printed at the bottom. It is possible to remove this addition..

Function is not defined - uncaught referenceerror

I have this uncaught referenceerror function is not defined error which do not understand. If I have $(document).ready(function(){ function codeAddress() { var address = document.getElementById("..

Iterate over elements of List and Map using JSTL <c:forEach> tag

If I have a JSF backing bean return an object of type ArrayList, I should be able to use <c:foreach> to iterate over the elements in the list. Each element contains a map and although the quest..

How to indent/format a selection of code in Visual Studio Code with Ctrl + Shift + F

I want to indent a specific section of code in Visual Studio Code. I read How do you format code in Visual Studio Code? that gives shortcuts to indent the whole code, but it doesn't work when selecti..

How to add line breaks to an HTML textarea?

I’m editing a <textarea> with JavaScript. The problem is that when I make line breaks in it, they won’t display. How can I do this? I’m getting the value to write a function, but it won�..

Javascript Equivalent to C# LINQ Select

Following this question here : Using the checked binding in knockout with a list of checkboxes checks all the checkboxes I've created some checkboxes using knockout that allow selection from an ..

Creating a JSON response using Django and Python

I'm trying to convert a server side Ajax response script into a Django HttpResponse, but apparently it's not working. This is the server-side script: /* RECEIVE VALUE */ $validateValue=$_POST['valid..

How do I animate constraint changes?

I'm updating an old app with an AdBannerView and when there is no ad, it slides off screen. When there is an ad it slides on the screen. Basic stuff. Old style, I set the frame in an animation block...

Excel VBA: function to turn activecell to bold

I have the following function inside my module. Function Colorize(myValue) ActiveCell.Select Selection.Font.Bold = True Colorize = myValue End Function The cell that will use this funct.., '_blank'); not working on iMac/Safari

I've build a web page that let's you select a page name from a drop down list and then transfers the browser to that page. The code that does the transfer is if (url){, '_blank')..