Questions Tagged with #Uiq3

Entity Framework is Too Slow. What are my options?

I have followed the "Don't Optimize Prematurely" mantra and coded up my WCF Service using Entity Framework. However, I profiled the performance and Entity Framework is too slow. (My app processes 2 ..

How to find the location of the Scheduled Tasks folder

I have seen references online that state that 'Scheduled Tasks' in Windows are stored in %SystemRoot%\Tasks, which I think usually equates to C:\Windows\Tasks. However, I observe that while that fold..

jQuery-UI datepicker default date

I have a problem with the jQuery-UI datepicker, I have searched and searched but I didn't find the answer. I have the following code: <script type="text/javascript"> $(function() { ..

How to read pickle file?

I created some data and stored it several times like this: with open('filename', 'a') as f: pickle.dump(data, f) Every time the size of file increased, but when I open file with open('file..

Create an empty list in python with certain size

I want to create an empty list (or whatever is the best way) that can hold 10 elements. After that I want to assign values in that list, for example this is supposed to display 0 to 9: s1 = list(); ..

How can I grep for a string that begins with a dash/hyphen?

I want to grep for the string that starts with a dash/hyphen, like -X, in a file, but it's confusing this as a command line argument. I've tried: grep "-X" grep \-X grep '-X' ..

Preprocessing in scikit learn - single sample - Depreciation warning

On a fresh installation of Anaconda under Ubuntu... I am preprocessing my data in various ways prior to a classification task using Scikit-Learn. from sklearn import preprocessing scaler = preproces..

Generate your own Error code in swift 3

What I am trying to achieve is perform a URLSession request in swift 3. I am performing this action in a separate function (so as not to write the code separately for GET and POST) and returning the U..

How to decompile to java files intellij idea

IDEA has a great built-in feature - decompiler. It works great.I can copy source code, but I cannot find option to extract all decompiled java classes to java files. This project has a lot of java cla..

Initialize class fields in constructor or at declaration?

I've been programming in C# and Java recently and I am curious where the best place is to initialize my class fields. Should I do it at declaration?: public class Dice { private int topFace = 1;..

Blurry text after using CSS transform: scale(); in Chrome

Seems like there has been a recent update to Google Chrome that causes blurry text after doing a transform: scale(). Specifically I'm doing this: @-webkit-keyframes bounceIn { 0% { opacity: 0; ..

Delete all files of specific type (extension) recursively down a directory using a batch file

I need to delete all .jpg and .txt files (for example) in dir1 and dir2. What I tried was: @echo off FOR %%p IN (C:\testFolder D:\testFolder) DO FOR %%t IN (*.jpg *.txt) DO del /s %%p\%%t In some..

java.net.SocketException: Software caused connection abort: recv failed

I haven't been able to find an adequate answer to what exactly the following error means: java.net.SocketException: Software caused connection abort: recv failed Notes: This error is infrequent a..

How to align absolutely positioned element to center?

I am trying to stack two canvas together and make it a double layers canvas. I've saw an example here: <div style="position: relative;"> <canvas id="layer1" width="100" height="100" st..

How to get a DOM Element from a JQuery Selector

I'm having an impossibly hard time finding out to get the actual DOMElement from a jquery selector. Sample Code: <input type="checkbox" id="bob" /> var checkbox = $("#bob").click(function() ..

ng-if, not equal to?

I have a simple ng-reapt that displays a list of values.. On some of the outputs, i have a couple of ng-if to show/hide DIVs. HTML: <div ng-repeat="details in myDataSet"> <p>{{ deta..

How to run cron once, daily at 10pm

I had entered: * 22 * * * test > /dev/null However, I am being notified via email that this is running every minute. I am confused I guess because I thought this was correct for what I am wantin..

Spring MVC: How to perform validation?

I would like to know what is the cleanest and best way to perform form validation of user inputs. I have seen some developers implement org.springframework.validation.Validator. A question about that:..

Why is the <center> tag deprecated in HTML?

I am just curious as to why the <center> tag in HTML was deprecated. The <center> was a simple way of quickly center-aligning blocks of text and images by encapsulating the container in a..

How to get div height to auto-adjust to background size?

How do I get a div to automatically adjust to the size of the background I set for it without setting a specific height (or min-height) for it?..

SQL JOIN - WHERE clause vs. ON clause

After reading it, this is not a duplicate of Explicit vs Implicit SQL Joins. The answer may be related (or even the same) but the question is different. What is the difference and what should go in..

How to change time in DateTime?

How can I change only the time in my DateTime variable "s"? DateTime s = some datetime; ..

DNS problem, nslookup works, ping doesn't

I am setting up a development server in my flat. I have set up an Ubuntu DNS server on it and have added the zone weddinglist (just weddinglist - no TLD. It's just an internal domain.) This works fin..

In PowerShell, how do I define a function in a file and call it from the PowerShell commandline?

I have a .ps1 file in which I want to define custom functions. Imagine the file is called MyFunctions.ps1, and the content is as follows: Write-Host "Installing functions" function A1 { Write-Ho..

What does ==$0 (double equals dollar zero) mean in Chrome Developer Tools?

In Google Chrome's developer tools, when I select an element, I see ==$0 next to the selected element. What does that mean? ..

How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

There is an online HTTP directory that I have access to. I have tried to download all sub-directories and files via wget. But, the problem is that when wget downloads sub-directories it downloads the ..

How print out the contents of a HashMap<String, String> in ascending order based on its values?

I have this HashMap that I need to print out in ascending order according to the values contained in it (not the keys). But the order when I print it out is seemingly random. What's the best way t..

How can I copy a conditional formatting from one document to another?

Google Spreadsheets can copy cell format to destination cell, but it seems "Conditional formatting" information didn't be copied. Can we just copy the "Conditional formatting" from one document to an..

How to `wget` a list of URLs in a text file?

Let's say I have a text file of hundreds of URLs in one location, e.g. http://url/file_to_download1.gz http://url/file_to_download2.gz http://url/file_to_download3.gz http://url/file_to_download4.gz ..

Spring: return @ResponseBody "ResponseEntity<List<JSONObject>>"

In controller I create json array. If I return List<JSONObject> it is ok: @RequestMapping(value="", method=RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE) public @ResponseBody Lis..

Angularjs $http.get().then and binding to a list

I have a list that looks like this: <li ng-repeat="document in DisplayDocuments()" ng-class="IsFiltered(document.Filtered)"> <span><input type="checkbox" name="docChecked" id="doc..

MYSQL into outfile "access denied" - but my user has "ALL" access.. and the folder is CHMOD 777

Any ideas? SELECT * INTO OUTFILE '/home/myacnt/docs/mysqlCSVtest.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '*' LINES TERMINATED BY '\n' FROM tbl_property WHERE managerGroupID = {$manager..

Formatting ISODate from Mongodb

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

How to return a boolean method in java?

I need help on how to return a boolean method in java. This is the sample code: public boolean verifyPwd(){ if (!(pword.equals(pwdRetypePwd.getText()))){ txtaError.setEditab..

How to scroll page in flutter

My code for a page is like this. i need to scroll part below appbar. @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar(... ), body: new Stack( ..

PHP refresh window? equivalent to F5 page reload?

Is there anything in PHP that is the equivalent of manually pressing the F5 page reload button? My php script is in a frame and isn't the parent script but it needs to refresh the entire page and not..

Calculate time difference in Windows batch file

How can I get the difference between two times in a Batch file? Because I want to print it in an HTML file. I thought this would be possible, but it isn't. Set "tijd=%time%" echo %tijd% echo %time%-..

How to fix: Error device not found with ADB.exe

In cmd when I try to do the command: adb shell it shows device not found error. Can someone help me please. It'll be appreciated...

If Python is interpreted, what are .pyc files?

I've been given to understand that Python is an interpreted language... However, when I look at my Python source code I see .pyc files, which Windows identifies as "Compiled Python Files". Where ..

Using querySelectorAll to retrieve direct children

I am able to do this: <div id="myDiv"> <div class="foo"></div> </div> myDiv = getElementById("myDiv"); myDiv.querySelectorAll("#myDiv > .foo"); That is, I can succes..

How to increase executionTimeout for a long-running query?

In my application, one query takes 3 minutes to execute. I found that Default ExecutionTimeout value is 110 sec.I tried to change this to 500 (seconds) but it didn't fix my problem. Somewhere I found ..

Recursive Fibonacci

I'm having a hard time understanding why #include <iostream> using namespace std; int fib(int x) { if (x == 1) { return 1; } else { return fib(x-1)+fib(x-2); } } ..

How to resolve "Input string was not in a correct format." error?

What I tried: MarkUP: <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <asp:Label ID="Label1" runat="server" AssociatedControlID="TextBox2" Text="Label"></asp:L..

JavaScript get element by name

Consider this function: function validate() { var acc = document.getElementsByName('acc').value; var pass = document.getElementsByName('pass').value; alert (acc); } And this HTML part: <..

Running a simple shell script as a cronjob

I have a very simple shell script I need to run as a cronjob but I can't get even the test scripts to run. Here's and example script: /home/myUser/scripts/test.sh #!/bin/bash touch file.txt cronta..

javascript: optional first argument in function

I have a typical javascript function with some parameters my_function = function(content, options) { action } if I call the function as such : my_function (options) the argument "options" is pas..

How to move an element down a litte bit in html

That sounds weird I know, but I am having trouble getting a piece of text to move down a tiny bit so it's centered on the tab it's on. here's what it looks like: I want buy to be centered vertica..

sql query distinct with Row_Number

I am fighting with the distinct keyword in sql. I just want to display all row numbers of unique (distinct) values in a column & so I tried: SELECT distinct id, ROW_NUMBER() OVER (ORDER BY id) A..

Table scroll with HTML and CSS

I have a table like that which i fill with a data <table id="products-table" style="overflow-y:scroll" > <thead> <tr> <th>Product (Parent Product)<..

How can I pass arguments to anonymous functions in JavaScript?

I'm trying to figure out how to pass arguments to an anonymous function in JavaScript. Check out this sample code and I think you will see what I mean: <input type="button" value="Click me" id="m..

Get user's current location

How can I determine user's current location based on IP (I guess it works this way)...

Copy to Clipboard for all Browsers using javascript

I was trying to make "Copy to Clipboard" work on all browsers but no luck. Am using javascript and I don't want to use Zero Clipboard to do. Please let us know what wrong in my code. Appreciate for..

Is there a naming convention for MySQL?

Here's how I do it: Table names are lower case, uses underscores to separate words, and are singular (e.g. foo, foo_bar, etc. I generally (not always) have a auto increment PK. I use the following c..

Delete all rows in table

Normaly i would do a delete * from XXX but on this table thats very slow, it normaly has about 500k to 1m rows in it ( one is a varbinary(MAX) if that mathers ). Basicly im wondering if there is a q..

What does @media screen and (max-width: 1024px) mean in CSS?

I found this piece of code in a CSS file I inherited, but I can't make any sense out of it: @media screen and (max-width: 1024px){ img.bg { left: 50%; margin-left: -512px; } } S..

Error:Unable to locate adb within SDK in Android Studio

Does anyone know what this means? I'm kind of noobish to Android. When I click the "run" button on my simulator I get this message. Throwable: Unable to locate adb within SDK I am running the la..

Installing Java 7 on Ubuntu

to install java I have always used the classic way from the terminal. I would like to install java manually. I placed the folder of the JDK on the desk and I set environment variables (PATH, CLASSPATH..

Curl command without using cache

Is there a way to tell curl command not to use server's side cache? e.g; I have this curl command: curl -v www.example.com how can I ask curl to send a fresh request to not use the cache? Note: I ..

'ng' is not recognized as an internal or external command, operable program or batch file

I tried running npm install -g angular-cli I also tried adding it to the Enviorment Variables under PATH: (C:\Users\Administrator\AppData\Roaming\npm\node_modules\angular-cli\bin\ng) , with no succ..

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

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

Make body have 100% of the browser height

I want to make body have 100% of the browser height. Can I do that using CSS? I tried setting height: 100%, but it doesn't work. I want to set a background color for a page to fill the entire browse..

Setting the character encoding in form submit for Internet Explorer

I have a page that contains a form. This page is served with content type text/html;charset=utf-8. I need to submit this form to server using ISO-8859-1 character encoding. Is this possible with Inter..

Change collations of all columns of all tables in SQL Server

I imported a database with some data to compare with another database. The target database has collation Latin1_General_CI_AS and the source database has SQL_Latin1_General_CP1_CI_AS. I did change the..

How to change the port of Tomcat from 8080 to 80?

I want to execute my web app as http://localhost...

Why is Event.target not Element in Typescript?

I simply want to do this with my KeyboardEvent var tag = evt.target.tagName.toLowerCase(); While Event.target is of type EventTarget it does not inherit from Element. So I have to cast it like this..

Python Pandas counting and summing specific conditions

Are there single functions in pandas to perform the equivalents of SUMIF, which sums over a specific condition and COUNTIF, which counts values of specific conditions from Excel? I know that there ar..

How do I view the SQLite database on an Android device?

I have a set of data in an SQLite database. I need to view the database on a device. How do I do that? I have checked in ddms mode. The data in file explorer is empty...

Selecting default item from Combobox C#

I have few items on my ComboBox items collection, and i'd like to select one item from this list and set it as default item - when app starts - this item is already on comboBox. I'm trying something ..

Get element of JS object with an index

Ok so let's say that I have my object myobj = {"A":["Abe"], "B":["Bob"]} and I want to get the first element out of it. As in I want it to return Abe which has an index of A. How can I do something..

Get Time from Getdate()

I would like to take the Getdate() results of, for example 2011-10-05 11:26:55.000 into 11:26:55 AM I have looked other places and found Select RIGHT(CONVERT(VARCHAR, GETDATE(), 100),7) wh..

SHA512 vs. Blowfish and Bcrypt

I'm looking at hashing algorithms, but couldn't find an answer. Bcrypt uses Blowfish Blowfish is better than MD5 Q: but is Blowfish better than SHA512? Thanks.. Update: I want to clarify that..

"Unable to find remote helper for 'https'" during git clone

I am unable to clone HTTPS repositories. I can clone SSH repos fine, but not HTTPS repos. I cannot test the GIT protocol since I am behind a corporate firewall. This is what I am trying to do: $ git..

Set the intervals of x-axis using r

I plot a distribution of visit time of a scenic spot from 0 to 23 hours in a day. And I want to adjust the intervals of x-axis letting all hours be displayed. How can I do that? d = c(42,13,10,3,2,6,..

How to embed a video into GitHub README.md?

Is it possible to embed a flash video into README.md on GitHub? It isn't showing up: https://github.com/mattdipasquale/PicSciP..

Failed to install android-sdk: "java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema"

When installing the android sdk tools the following error is emitted: java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Why is this happening and how can it be fixed? Debug ou..

How to check if running in Cygwin, Mac or Linux?

I have a shell script that is used both on Windows/Cygwin and Mac and Linux. It needs slightly different variables for each versions. How can a shell/bash script detect whether it is running in Cygw..

Importing large sql file to MySql via command line

I'm trying to import an sql file of around 300MB to MySql via command line in Ubuntu. I used source /var/www/myfile.sql; Right now it's displaying a seemingly infinite rows of: Query OK, 1 row af..

Remove commas from the string using JavaScript

I want to remove commas from the string and calculate those amount using JavaScript. For example, I have those two values: 100,000.00 500,000.00 Now I want to remove commas from those string a..

Unable to generate an explicit migration in entity framework

I am adding a new migration but this message shows: Unable to generate an explicit migration because the following explicit migrations are pending: [201203170856167_left]. Apply the pending ex..

What is @ModelAttribute in Spring MVC?

What is the purpose and usage of @ModelAttribute in Spring MVC?..

What is the return value of os.system() in Python?

I came across this: >>> import os >>> os.system('ls') file.txt README 0 What is return value of os.system()? Why I get 0?..

Variable used in lambda expression should be final or effectively final

Variable used in lambda expression should be final or effectively final When I try to use calTz it is showing this error. private TimeZone extractCalendarTimeZoneComponent(Calendar cal, TimeZone..

Maintaining Session through Angular.js

I am working a project using the AngularJS framework. I am pretty new to using this framework; in the past I have only worked with pure JavaScript and jQuery. The project is a kind of web designer app..

How to switch text case in visual studio code

How does one switch the case of highlighted text in Visual Studio Code? VS allows this via CTRL+SHIFT+U and CTRL+U. Is there a command binding that I can set up to do this, or is it by default some ..

Staging Deleted files

Say I have a file in my git repository called foo. Suppose it has been deleted with rm (not git rm). Then git status will show: Changes not staged for commit: deleted: foo How do I stage this i..

How to create localhost database using mysql?

I download mysql installer here: http://dev.mysql.com/downloads/installer/ And then I downloaded MySql WorkBench. At workbench's connection configuration I put hostname as "127.0.0.1", port "3306",..

Select where count of one field is greater than one

I want to do something like this: SELECT * FROM db.table WHERE COUNT(someField) > 1 How can I achieve this in MySql?..

What is the best way to implement nested dictionaries?

I have a data structure which essentially amounts to a nested dictionary. Let's say it looks like this: {'new jersey': {'mercer county': {'plumbers': 3, 'programmers..

Config Error: This configuration section cannot be used at this path

I've encountered an error deploying a site to a server. When trying to load the home page, or access authentication on the new site in IIS, I get the error: Config Error: This configuration secti..

java.util.zip.ZipException: duplicate entry during packageAllDebugClassesForMultiDex

I am not sure what this error means. Execution failed for task ':excelSior:packageAllDebugClassesForMultiDex'. > java.util.zip.ZipException: duplicate entry: android/support/v4/util/TimeUtils.cla..

Timeout for python requests.get entire response

I'm gathering statistics on a list of websites and I'm using requests for it for simplicity. Here is my code: data=[] websites=['http://google.com', 'http://bbc.co.uk'] for w in websites: r= requ..

Pass props in Link react-router

I am using react with react-router. I am trying to pass property’s in a "Link" of react-router var React = require('react'); var Router = require('react-router'); var CreateIdeaView = require('./..

What is context in _.each(list, iterator, [context])?

I am new to underscore.js. What is the purpose of [context] in _.each()? How should it be used?..

Why is git push gerrit HEAD:refs/for/master used instead of git push origin master

I've just started using gerrit and I want to know why we need to do git push gerrit HEAD:refs/for/master instead of doing git push origin master If I do git push origin master I get the error saying ..

JAXB: how to marshall map into <key>value</key>

The question is about JAXB Map marshalling - there is plenty of examples on how to marhsall a Map into a structure like follows: <map> <entry> <key> KEY </key> <v..

Remove border from buttons

I tried to create buttons and insert my own images instead of the standard button images. However, the gray border from the standard buttons still remains, showing on the outside of my black button im..

How to create/make rounded corner buttons in WPF?

I need to create a rounded corner glossy button in WPF. Can anyone please explain me what steps are needed?..

Bootstrap 3 Carousel Not Working

My carousel from Bootstrap won't display my images or react to the controls. This is my HTML: <!DOCTYPE HTML> <html> <head> <title>Skates R Us</title> ..

How to retrieve Key Alias and Key Password for signed APK in android studio(migrated from Eclipse)

I have an android app currently published in Google Play which I update periodically. I follow the following process to sign the app before a new push: Press right-mouse on the project, the 'Android..

Issue with background color in JavaFX 8

Looks like there is an issue with setting background colors for panels in JavaFX 8. I had been trying the below, but none of them set the appropriate background colors. VBox panel = new VBox(); pane..

Magento - Retrieve products with a specific attribute value

In my block code I am trying to programmatically retrieve a list of products that have a attribute with a specific value. Alternately if that is not possible how would one retrieve all products then ..

Adding Counter in shell script

I have below code in my shell script which will keep on sleeping if it doesn't finds any file. And it sleeps for half an hour but currently I don't have any counter like only execute the below code 20..

Send raw ZPL to Zebra printer via USB

Typically, when I plug in my Zebra LP 2844-Z to the USB port, the computer sees it as a printer and I can print to it from notepad like any other generic printer. However, my application has some bar ..

How to set minDate to current date in jQuery UI Datepicker?

This is my code and it is not working correctly. I want to set minDate to the current date. How can I do it? $("input.DateFrom").datepicker({ changeMonth: true, changeYear: true, dateFo..

JavaScript Chart.js - Custom data formatting to display on tooltip

I have looked at various documentation and similar questions on here, but cannot seem to find the particular solution. Apologies if I have missed anything obvious or have repeated this question! As a..

Python strftime - date without leading 0?

When using Python strftime, is there a way to remove the first 0 of the date if it's before the 10th, ie. so 01 is 1? Can't find a %thingy for that? Thanks!..

Connect Bluestacks to Android Studio

I have recently shifted to android studio. I would like to know how I can test my apps in Bluestacks app player. I had already had the bluestacks connected and working with eclipse using adb connect l..

How do I set up CLion to compile and run?

I just downloaded CLion from https://www.jetbrains.com/ because I just love the rest of their products. However, I'm having problems configuring it. I'm not able to compile and run my application (a s..

This Handler class should be static or leaks might occur: IncomingHandler

I'm developing an Android 2.3.3 application with a service. I have this inside that service to communicate with Main activity: public class UDPListenerService extends Service { private static fin..

How to add text to a WPF Label in code?

I feel stupid but cannot find out how to add a text to a WPF Label control in code. Like following for a TextBlock: DesrTextBlock.Text = "some text"; What is equivalent property in Label for doing ..

SQL Server FOR EACH Loop

I have the following SQL query: DECLARE @MyVar datetime = '1/1/2010' SELECT @MyVar This naturally returns '1/1/2010'. What I want to do is have a list of dates, say: 1/1/2010 2/1/2010 3/1/201..

How to check for a Null value in VB.NET

I have this: If String.IsNullOrEmpty(editTransactionRow.pay_id.ToString()) = False Then stTransactionPaymentID = editTransactionRow.pay_id 'Check for null value End If Now, when editTransaction..

Installing MySQL Python on Mac OS X

Long story short, when I write the following: sudo easy_install MySQL-python I get the error EnvironmentError: mysql_config not found All right, so there are plenty of threads and the like on..

.htaccess: where is located when not in www base dir

I may need to modify our .htaccess file. Problem is I can't find it. We have several subdomains along side each other in the vhosts directory, and each subdomain has an associated .htpasswd file. H..

Loop code for each file in a directory

I have a directory of pictures that I want to loop through and do some file calculations on. It might just be lack of sleep, but how would I use PHP to look in a given directory, and loop through each..

How do I block or restrict special characters from input fields with jquery?

How do I block special characters from being typed into an input field with jquery?..

How to concatenate a std::string and an int?

I thought this would be really simple but it's presenting some difficulties. If I have std::string name = "John"; int age = 21; How do I combine them to get a single string "John21"?..

How can I store and retrieve images from a MySQL database using PHP?

How can I insert an image in MySQL and then retrieve it using PHP? I have limited experience in either area, and I could use a little code to get me started in figuring this out...

How to create a file in Linux from terminal window?

What's the easiest way to create a file in Linux terminal?..

Save range to variable

I wrote some functional VBA: Sheets("Src").Range("A2:A9").Copy Destination:=Sheets("Dest").Range("A2") I want to extract the source range into a variable for flexibility. SrcRange = Sheets("Src")...

Using OR operator in a jquery if statement

I need to use the OR operator in a jQuery if statement to filter out 10 states. My code works wile only excluding one state, but fails when i try to include multiple states. Is there a correct way to ..

How to see the changes between two commits without commits in-between?

How do you make git diff only show the difference between two commits, excluding the other commits in-between?..

How to get only numeric column values?

Using SQL Server 2005 I want to get only numeric values from the table Column1 12345 asdf 2312 ase acd ..., Tried Query Select Isnumeric(column1) from table Showing Result as 1 0 1 0 0 .., ..

iOS 7.0 No code signing identities found

certificate is valid xcode 5 iOS 7 Code Sign error: No codesigning identities found: No codesigning identities (i.e. certificate and private key pairs) that match the provisioning profile sp..

Using .NET, how can you find the mime type of a file based on the file signature not the extension

I am looking for a simple way to get a mime type where the file extension is incorrect or not given, something similar to this question only in .Net...

Center text output from Graphics.DrawString()

I'm using the .NETCF (Windows Mobile) Graphics class and the DrawString() method to render a single character to the screen. The problem is that I can't seem to get it centred properly. No matter wha..

Filter rows which contain a certain string

I have to filter a data frame using as criterion those row in which is contained the string RTB. I'm using dplyr. d.del <- df %>% group_by(TrackingPixel) %>% summarise(MonthDelivery = as...

What does the KEY keyword mean?

In this MySQL table definition: CREATE TABLE groups ( ug_main_grp_id smallint NOT NULL default '0', ug_uid smallint default NULL, ug_grp_id smallint default NULL, KEY (ug_main_grp_id) ); ..

MongoDB: How to query for records where field is null or not set?

I have an Email document which has a sent_at date field: { 'sent_at': Date( 1336776254000 ) } If this Email has not been sent, the sent_at field is either null, or non-existant. I need to get th..

Uninstall Eclipse under OSX?

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

Android: show soft keyboard automatically when focus is on an EditText

I'm showing an input box using AlertDialog. The EditText inside the dialog itself is automatically focused when I call AlertDialog.show(), but the soft keyboard is not automatically shown. How do I m..

How to open VMDK File of the Google-Chrome-OS bundle 2012?

As you all know, Google-Chrome-OS is released in VMWare Image File, VMDK. I've downloaded it , however, I couldn't open it with VMWare Work Station and VMWare Player. Also I've tried to open with V..

How do I invoke a Java method when given the method name as a string?

If I have two variables: Object obj; String methodName = "getName"; Without knowing the class of obj, how can I call the method identified by methodName on it? The method being called has no param..

How to make a new List in Java

We create a Set as: Set myset = new HashSet() How do we create a List in Java?..

Why does Java have transient fields?

Why does Java have transient fields?..

Best way to store password in database

I am working on a project that has to have authentication (username and password) It also connects to a database, so I figured I would store the username and password there. However, it seems like no..

How to get some values from a JSON string in C#?

I have a string and I want to get some values from it. My strings seem like: string1: "{\r\n \"id\": \"100000280905615\", \r\n \"name\": \"Jerard Jones\", \r\n \"first_name\": \"Jerard\", \r..

What data type to use in MySQL to store images?

I need to store image and resume of user in the data base. I am using mysql data base and php5. I need to know which data types I should use. And also how do I set a limit (maximum size) for upload..

When to use references vs. pointers

I understand the syntax and general semantics of pointers versus references, but how should I decide when it is more-or-less appropriate to use references or pointers in an API? Naturally some situat..

PHP - remove <img> tag from string

Hey, I need to delete all images from a string and I just can't find the right way to do it. Here is what I tryed, but it doesn't work: preg_replace("/<img[^>]+\>/i", "(image) ", $content);..

adb command not found

I need to run an adb forward command before I could use the ezkeyboard application which allows user to type on the phone using browser. When I run adb forward tcp:8080 tcp:8080 command I get the ad..

PHP : send mail in localhost

I would like to send email through php code hosted locally. <?php $email = "[email protected]"; $titre = "My subject"; $message = "Text message !"; mail($email, $titre, $message); ?> ..

Change values on matplotlib imshow() graph axis

Say I have some input data: data = np.random.normal(loc=100,scale=10,size=(500,1,32)) hist = np.ones((32,20)) # initialise hist for z in range(32): hist[z],edges = np.histogram(data[:,0,z],bins=n..

How to add a Try/Catch to SQL Stored Procedure

CREATE PROCEDURE [dbo].[PL_GEN_PROVN_NO1] @GAD_COMP_CODE VARCHAR(2) =NULL, @@voucher_no numeric =null output AS BEGIN DECLARE @NUM NUMERIC DECLARE @PNO NUMERIC ..

How to make my layout able to scroll down?

I can not scroll down the screen to view the data in the "Replied By:" section. How can I make my layout scrollable? ..

How can I determine the direction of a jQuery scroll event?

I'm looking for something to this effect: $(window).scroll(function(event){ if (/* magic code*/ ){ // upscroll code } else { // downscroll code } }); Any ideas?..

Default text which won't be shown in drop-down list

I have a select which initially shows Select language until the user selects a language. When the user opens the select, I don't want it to show a Select language option, because it's not an actual op..

Check if key exists and iterate the JSON array using Python

I have a bunch of JSON data from Facebook posts like the one below: {"from": {"id": "8", "name": "Mary Pinter"}, "message": "How ARE you?", "comments": {"count": 0}, "updated_time": "2012-05-01", "cr..

Are loops really faster in reverse?

I've heard this quite a few times. Are JavaScript loops really faster when counting backward? If so, why? I've seen a few test suite examples showing that reversed loops are quicker, but I can't find ..

jQuery add class .active on menu

I've got a problem. I want to add the class "active" on item menu when the relative page is on. the menu is very simple: <div class="menu"> <ul> <li><a href="~/link1/">LINK..

You should not use <Link> outside a <Router>

I'm trying to set up react-router in an example application, and I'm getting the following error: You should not use <Link> outside a <Router> My app is set up like so: Parent componen..

A fast way to delete all rows of a datatable at once

I want to delete all rows in a datatable. I use something like this: foreach (DataRow row in dt.Rows) { row.Delete(); } TableAdapter.Update(dt); It works good but it takes lots of time if I have ..

undefined reference to 'std::cout'

Shall this be the example: #include <iostream> using namespace std; int main() { cout << "Hola, moondo.\n"; } It throws the error: gcc -c main.cpp gcc -o edit main.o main.o: In fu..

Cannot bulk load because the file could not be opened. Operating System Error Code 3

I'm trying to set up a Stored Procedure as a SQL Server Agent Job and it's giving me the following error, Cannot bulk load because the file "P:\file.csv" could not be opened. Operating system error..

Are HTTP headers case-sensitive?

In a blog post I use the following PHP to set the content-type of a response: header('content-type: application/json; charset=utf-8'); I just got a comment on that post saying that content-type nee..

How to calculate the width of a text string of a specific font and font-size?

I have a UILabel that displays some chars. Like "x", "y" or "rpm". How can I calculate the width of the text in the label (it does not ues the whole available space)? This is for automatic layouting, ..

Set NOW() as Default Value for datetime datatype?

I have two columns in table users namely registerDate and lastVisitDate which consist of datetime data type. I would like to do the following. Set registerDate defaults value to MySQL NOW() Set last..

I want to load another HTML page after a specific amount of time

I have one html page "form1.html" which has an animated image. I want to load another page "form2.html" after 5 seconds. How do I do this?..

How to normalize a 2-dimensional numpy array in python less verbose?

Given a 3 times 3 numpy array a = numpy.arange(0,27,3).reshape(3,3) # array([[ 0, 3, 6], # [ 9, 12, 15], # [18, 21, 24]]) To normalize the rows of the 2-dimensional array I thought..

How does Java handle integer underflows and overflows and how would you check for it?

How does Java handle integer underflows and overflows? Leading on from that, how would you check/test that this is occurring?..

Can I access variables from another file?

Is it possible to use a variable in a file called first.js inside another file called second.js? first.js contains a variable called colorcodes...

How do I get whole and fractional parts from double in JSP/Java?

How do I get whole and fractional parts from double in JSP/Java ? If the value is 3.25 then I want to get fractional =.25, whole = 3 How can we do this in Java?..

Center fixed div with dynamic width (CSS)

I have a div that will have this CSS: #some_kind_of_popup { position: fixed; top: 100px; min-height: 300px; width: 90%; max-width: 900px; } Now, how can i make this div centered..

Unable to negotiate with XX.XXX.XX.XX: no matching host key type found. Their offer: ssh-dss

I am trying to create a git repository on my web host and clone it on my computer. Here's what I did: I created a repository on the remote server. I generated a key pair: ssh-keygen -t dsa. I added ..

Int division: Why is the result of 1/3 == 0?

I was writing this code: public static void main(String[] args) { double g = 1 / 3; System.out.printf("%.2f", g); } The result is 0. Why is this, and how do I solve this problem?..

Use of alloc init instead of new

Learning Objective-C and reading sample code, I notice that objects are usually created using this method: SomeObject *myObject = [[SomeObject alloc] init]; instead of: SomeObject *myObject = [Som..

How to dynamic new Anonymous Class?

In C# 3.0 you can create anonymous class with the following syntax var o1 = new { Id = 1, Name = "Foo" }; Is there a way to dynamic create these anonymous class to a variable? Example: var o1 =..

Downloading jQuery UI CSS from Google's CDN

I am planning on using Google to download the jQuery lib for both UI and Core. My question is, do they allow me to download the CSS for it or should I have to host it myself? Also if I use Google to ..

mailto using javascript

I want to open a new outlook mail template with the 'To address' whenever a user clicks an image. I have return my code in a html page(linked with the image), whenever it loads the javascript should o..

HTTP post XML data in C#

I need to HTTP post XML data to a URL that has Textarea with the name of XMLdata. My XMl data is ready and is inside of XDocument Sendingxml = xml; but the post code that I have tried is not workin..

CMake unable to determine linker language with C++

I'm attempting to run a cmake hello world program on Windows 7 x64 with both Visual Studio 2010 and Cygwin, but can't seem to get either to work. My directory structure is as follows: HelloWorld -- C..

How to get week numbers from dates?

Looking for a function in R to convert dates into week numbers (of year) I went for week from package data.table. However, I observed some strange behaviour: > week("2014-03-16") # Sun, expecting ..

Error: Execution failed for task ':app:clean'. Unable to delete file

I'm trying to rebuild my Android Studio Gradle project (containing mostly Kotlin code), but it started to throw an UnableToDeleteFileException during the cleaning/rebuilding process: Execution failed..

How can I URL encode a string in Excel VBA?

Is there a built-in way to URL encode a string in Excel VBA or do I need to hand roll this functionality? ..

How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?

I can't seem to connect to my database from a site. I get this error: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server I tried using the local IP address to connect as..

Get the filename of a fileupload in a document through JavaScript

var fu1 = document.getElementById("FileUpload1"); How can I get the filename of the fileupload control with id FileUpload1?..

How to write oracle insert script with one field as CLOB?

I want to create an insert script which will be used only to insert one record into one table. It has 5 columns and one of them is of type CLOB. Whenever I try, it says can not insert string is so l..

Java: Difference between the setPreferredSize() and setSize() methods in components

What is the main difference between setSize() and setPreferredSize(). Sometimes I used setSize(), sometimes setPreferredSize(), sometimes one does what I want, sometimes the other. What call should I ..

Can I use Homebrew on Ubuntu?

I just tried to use Homebrew and Linuxbrew to install packages on my Ubuntu Server but both failed. This is how I tried to install them: sudo apt-get install build-essential curl git m4 ruby texinfo ..

Detect Route Change with react-router

I have to implement some business logic depending on browsing history. What I want to do is something like this: reactRouter.onUrlChange(url => { this.history.push(url); }); Is there any way..

Explode string by one or more spaces or tabs

How can I explode a string by one or more spaces or tabs? Example: A B C D I want to make this an array...

Converting string to double in C#

I have a long string with double-type values separated by # -value1#value2#value3# etc I splitted it to string table. Then, I want to convert every single element from this table to double type and I..

Single huge .css file vs. multiple smaller specific .css files?

Is there any advantage to having a single monster .css file that contains style elements that will be used on almost every page? I'm thinking that for ease of management, I'd like to pull out differe..

Cause of No suitable driver found for

I'm trying to unit test (JUnit) a DAO i've created. I'm using Spring as my framework, my DAO (JdbcPackageDAO) extends SimpleJdbcDaoSupport. The testing class (JdbcPackageDAOTest) extends AbstractTra..

Bootstrap: Position of dropdown menu relative to navbar item

I have the following dropdown <label class="dropdown-toggle" role="button" data-toggle="dropdown" data-target="#"> Action <b class="caret"></b></label> <ul class="dropd..

File Upload to HTTP server in iphone programming

Can anyone provide me some links or examples to upload files to the HTTP server using iphone APIs...

How do I implement IEnumerable<T>

I know how to implement the non generic IEnumerable, like this: using System; using System.Collections; namespace ConsoleApplication33 { class Program { static void Main(string[] arg..

SQL Statement with multiple SETs and WHEREs

I am wondering if this is a valid query: UPDATE table SET ID = 111111259 WHERE ID = 2555 AND SET ID = 111111261 WHERE ID = 2724 AND SET ID = 111111263 WHERE ID = 2021 AND SET ID = 111111264 W..

How to get the data-id attribute?

I'm using the jQuery quicksand plugin. I need to get the data-id of the clicked item and pass it to a webservice. How do I get the data-id attribute? I'm using the .on() method to re-bind the click ev..

Sql connection-string for localhost server

I am newbie in this .NET and please don't mind in answering my simple question. I am trying to write a windows application, where in I am using a localhost SQLserver for database. I need to know what..

"The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe"

I am on JDK 8u25 on Windows 8, and I am experiencing a problem with my Java installation. I can run javac perfectly fine, but running java produces this error message: The system cannot find the file..

AngularJS: ng-show / ng-hide not working with `{{ }}` interpolation

I am trying to show / hide some HTML using the ng-show and ng-hide functions provided by AngularJS. According to the documentation, the respective usage for these functions are as follows: ngHide..

Find which version of package is installed with pip

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

How to install Google Play Services in a Genymotion VM (with no drag and drop support)?

How can I install Google Play Services in a Genymotion emulator with no drag and drop support? I can't install it as mentioned in Stack Overflow post How do you install Google frameworks (Play, Accou..

Factorial in numpy and scipy

How can I import factorial function from numpy and scipy separately in order to see which one is faster? I already imported factorial from python itself by import math. But, it does not work for num..

What's onCreate(Bundle savedInstanceState)

Can anyone help me to know about the Bundle savedInstanceState in onCreate(Bundle savedInstanceState) I am newbie in Android. I try to understand it from developer.android.com. But I am not able to un..

While loop to test if a file exists in bash

I'm working on a shell script that does certain changes on a txt file only if it does exist, however this test loop doesn't work, I wonder why? Thank you! while [ ! -f /tmp/list.txt ] ; do sle..

Correct way to set Bearer token with CURL

I get my bearer token from an API end point and set the following: $authorization = "Bearer 080042cad6356ad5dc0a720c18b53b8e53d4c274" Next I want to use CURL to access the secure endpoint however I..

How to get the difference (only additions) between two files in linux

I have two files A1 and A2 (unsorted). A1 is previous version of A2 and some lines have been added to A2. How can I get the new lines that are added to A2? Note: I just want the new lines added and ..

Send HTTP GET request with header

From my Android app I want to request a URL with GET parameters and read the response. In the request I must add a x-zip header. The URL is something like http://example.com/getmethod.aspx?id=111&a..