FAQ Database Discussion Community


Publishing android app: This app is incompatible with all of your devices

android,google-play
Publishing and Android app I can see the app in the market but I everyone is watching this text This app is incompatible with all of your devices. Here is the permissions and features of my manifest <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.USE_CREDENTIALS" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission...

T-SQL Get Rows With Similar Company Name Using Levenshtein

sql-server,tsql
I'm using this Levenshtein function for T-SQL which works well (I'm not worried about performance). Now I want to write a query that returns all rows where the Levenshtein distance is less than x (where x might be 5 for example) using the Company name field to do the comparison....

Ajax calls inside loop need sequential responses

javascript,jquery,ajax,queue,promise
I need to make 3 or less ajax calls, and the responses need to be appended to the dom in the same order they were requested. I have the following function, but the problem is that the responses that I get are not necessarily in the correct order when they...

AVFoundation concatenating videos

avfoundation,avmutablecomposition
I am pulling my hair out over this. I try to concatenate videos and it just won't do what I want it to do. Specifically, I have videos that have a different orientation and I try to set it right with a Layer instruction. Alas, not matter what I try,...

jQuery: Prevent child from inheriting the parent's attributes?

javascript,jquery,html,css,exclude
With jQuery: How do I prevent the children (<span>) from inheriting the parents' (<p>) attributes? I've been working on and researching this for 2+ hours; nothing has worked. Problem section: $("p").not("span").css("cursor", "pointer"); <p>...<span>...</span></p> Full code: <script src="https://code.jquery.com/jquery-1.10.2.js"></script> <style>body {font-family:Arial,san-serif;font-size:25pt;}</style> <body> <p>Always shown |...

Unable to make socket Accept Non Blocking ruby 2.2

ruby,multithreading,sockets
I have been searching the whole day for socket accept non blocking. I found recv non blocking but that wouldn't benefit me in anyway. My script first starts a new socket class. It binds to the client with ip 127.0.0.1 and port 6112. Then it starts multi threading. Multi threading...

Block element inside inline-block acting strangely in Firefox

css,firefox
Can anyone explain this behavior in FF? Fiddle: http://jsfiddle.net/4mrt8wq3/ <style> .b { display: inline-block; } #a { display: block; } </style> <div class="b"> <label>xxxxxxxxxx</label> <input type="text" id="a"/> </div> <div class="b"> <label>xxxxxxxxxx</label> <div> / </div> </div> Only in firefox, the first div is positioned one line lower than the second. It...

Loop through AnyObject Array

ios,arrays,swift
My data contains user data of various values (which I can parse out) then balances for each user in a number of currencies. I can parse out the user data. For example: if let add2 = parsed["address"] as? String { println("Alert: \(add2)") } I can get the lists of balances:...

How do I get the textbox value to the database within a repeater?

c#,asp.net,sql-server,repeater
I have a repeater that I populate from a database: using (SqlConnection conn = new SqlConnection(connString)) { SqlCommand cmd = new SqlCommand(@"SELECT CommunityName, CID, Budget FROM Donation WHERE Year = year(getdate()) ORDER BY CommunityName", conn); conn.Open(); SqlDataAdapter adp = new SqlDataAdapter(cmd); DataSet myDataSet = new DataSet(); adp.Fill(myDataSet); myRep.ItemDataBound += new...

AWS CLI not working on Mac OSX Yosemite

python-2.7,amazon-web-services,pip,amazon,command-line-interface
I've successfully downloaded the AWS CLI using PIP onto Mac OSX Yosemite. I'm running Python version 2.7. I can see the AWS executable in /Library/Frameworks/Python.framework/Versions/2.7/bin. But when I try to run aws help in my Terminal to test that the AWS CLI works, I get -bash: aws: command not found...

Find cause of multiple System.Web.Mvc references

c#,asp.net-mvc,asp.net-mvc-5,nuget,projects-and-solutions
Using dotPeek to examine the references of the main assembly of a web project, I see: System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 The project references in Visual Studio only shows version 5.2.3.0. I've also searched the .csproj files of referenced projects. Manage NuGet Packages only shows v5.2.3 of...

Web API Routing Conflicts

asp.net-mvc,asp.net-web-api,web-api
FYI, I have no custom routing, no usage of MapHttpRoute. My Web API controller is as follows: [RoutePrefix("api/stat")] public class StatController : ApiController In that controller I has these methods: [Route("{statType}")] public StatState GetCurrentStat(string statType, UserInfo userInfo) [Route("getAllAccount")] public Dictionary<string, StatState> GetAllAccountCurrentStat(UserInfo userInfo) [Route("getScoreHistory")] public StatHistory GetStatAccountScoreHistory(string statType, UserInfo userInfo)...

Show More / Show Less JavaScript not working properly

javascript,html,show
I am trying to make a div tag appear when I select a "show more" link. So far, the div appears when the page loads, which I don't want. Then when I select the "Show" link, the div disappears. I need the opposite to happen, and then make the div...

Android - Change text colour of the bottom button bar

android,android-actionbar,android-button,android-styles
I'm modifying downloads (for 4.3 Jellybean) and I can't change the colour of the text on the bottom button from black to white. Is it possible to change the text colour without giving the button its own style by adding an item in the app theme? Here is my Styles.xml:...

Generating e value in RSA Encryption

c++,encryption,rsa
I've generated p,q,n, and totient, and need to generate e where 1 < e < totient and e and totient are coprime. The problem I'm running into with my code is that I'm first generating totient (normal (p-1)*(q-1) way) but when i try to generate a coprime e, it usually...

Using an index to find a position in a matrix

javascript
My title might be terrible, but I can explain exactly what I want here. First of all, I am challenging myself to something very specific. Even if you guess what I'm trying to accomplish, please keep your answers on topic to what I am asking here, and not the overall...

Regex to match this: “Late Fee 81245 on 11/29/2014”?

regex
The Late Fee number is any integer and the Date will always be in that format. Thanks in advance....

Ternary Operator in For Loop causing infinite iterations

c,for-loop,infinite-loop,ternary-operator,operator-precedence
I was working on a function to transpose an NxN matrix which is stored in an array of floats. My first implementation seemed to cause the function to loop infinitely and I can't seem to figure out why. Here is the original code: for(int i = 0; i < numRows...

How to undo changes?

jquery,twitter-bootstrap
I am making an educational game for kids, but I have a big problem. This is level one: <div class="row" id="one"> <div class="col-md-12"> <div class="col-md-3"> <img src="img/ananas.png" class="img-responsive dimenzii"> <h3 class="drop1" id="drop1">______________</h3> </div> <div class="col-md-3"> <h1 class="green" id="dr2">Кокос</h1> </div> <div class="col-md-3"> <h1 class="green" id="dr1">Ананас</h1> </div> <div class="col-md-3">...

Can I POST multiple patch requests to RavenDB's /bulk_docs HTTP API endpoint?

ravendb,ravendb-http
I'm in the process of writing a node wrapper for RavenDB. I'm using version 3 but as there are no HTTP docs for it, I've been relying on the 2.0 and 2.5 docs. In regards to single document operations, I've used this doc page successfully for PUTs, DELETEs and multiple...

implement General Update Pattern for d3.js force layout

javascript,d3.js,force-layout
Beginning with this example (possibly not the best choice), I set about trying to develop an application to suit my purposes, and learn d3.js in the process. After a lot of naive tinkering, I managed to get a toy force layout for my test data that satisfied me in its...

mongo-mongoose how to make this query mongoose?

mongodb,mongoose
Models Models -> id, name, makeid Makes -> id, name how to make this query mongoose using the make name and not the id ("mitsubishi") ?ex: SELECT * FROM models LEFT JOIN makes on models.makeid = makes.id where makes.name = "mitsubishi" How can realize this same query in mongo -...

Smart handling of Python array with many indices

python,arrays,numpy,multidimensional-array
I have the following piece of code: p1 = np.array([[[[[[[[[[0.]*2]*2]*2]*2]*2]*2]*2]*2]*2]*2) s = [0]*10 # # Do something with s # p1[s[0],s[1],s[2],s[3],s[4],s[5],s[6],s[7],s[8],s[9]] += 1 Is there a smarter way of: Creating p1 without all those brackets, and Access the components of p1 with a string or a list? I have in...

Replacing the parts of a string with a given index position of the actual string Java

java
I'm just a little short handed on understanding how I can proceed with my code. I'm basically doing a hang-man game and I made a copy of the the actual word. The copy is replaced with blank spaces and I'm wondering how I can replace the blank spaces when the...

How to define a Haskell function with an argument of “newtype”?

haskell,types,newtype
I've defined a newtype called Poly. Poly is a list representation of a polynomial (a list of Num's), and I'm trying to define a function "chop" that takes off excess 0's from the end of a Poly. Chop takes one Poly as an argument, and then returns a Poly. For...

JTextField from separate class

java,jtextfield
Can anyone tell me why I keep getting a Null pointer exception for this. I have a JTextField in one class with a set and get method and in my second class i want to assign the JTextField value to a string variable. What am i missing here? Heres the...

How to recover deleted .swift file

ios,xcode
this question was probably asked before in some sort but I have a very weird issue in swift. I left my project open for about a week in Xcode without working on it and today when I wanted to get back to it the main.storyboard is missing and the most...

Exporting a new object in Node.js

node.js
How can I pass the variables port,host,database into this function? //myjs.js var redisCaller = function(port,host,database){ }; module.exports = new redisCaller(); if I do: var myjs = require('./myjs'); how do I pass those variables? seems like the only way to do it is like this: module.exports = function(port,host,database){ return new redisCaller(port,host,database);...

Can't return objects from User class in Parse.com iOS

ios,objective-c,parse.com,nsmutablearray,uisearchbar
I am trying to return users from my User class with a UISearchBar and UITableView. For some reason I can't retrieve any objects from the User class in Parse. Do you have any idea why I can't get any objects, even if there are a lot of users in the...

Should I use Neo4j's Import Tool or Load Command to Insert Several Million Rows?

csv,neo4j,graph-databases
I have several CSV files that range from 25-100 MB in size. I have created constraints, created indices, am using periodic commit, and increased the allocated memory in the neo4j-wrapper.conf and neo4j.properties. neo4j.properties: neostore.nodestore.db.mapped_memory=50M neostore.relationshipstore.db.mapped_memory=500M neostore.propertystore.db.mapped_memory=100M neostore.propertystore.db.strings.mapped_memory=100M neostore.propertystore.db.arrays.mapped_memory=0M neo4j-wrapper.conf changes: wrapper.java.initmemory=5000...

Active nav color but different color in submenu

jquery
Hello i have this js script to get the url and show an active link on main nav menu and in sub menu. The only problem is that if i click a link in main menu and get the active color for that link then the sub menu will also...

Jquery calculation price of hotel and room with additional price

jquery,html,calculator
DEMO : http://jsfiddle.net/sando779/16wws4w1/ <select name="one" id="one"> <option value="0">Select Hotel</option> <option value="3000">Nirvana</option> <option value="6000">Laguna</option> <option value="9000">Palm beach</option> </select> <br /> <br /> <select name="two" id="two"> <option>Room Type</option> </select> <br/> <br/> <p> <input type="checkbox" name="tri" id="tri" value="50"/> <label...

Setting global and confirm flags as default for Vim search and replace

vim
When I use vim's search and replace, I always use the global and confirm flags as demonstrated in the following lines: :%s/foo/bar/gc :5,10s/foo/bar/gc :+10s/foo/bar/gc Is there a way to make the g & c flags the default for vim's search and replace?...

Clear input fields when checkbox is checked

angularjs,checkbox,input,clear,checked
I have a check box and two input fields. Either the check box has to be checked or the two input fields have to be filled in. I'm doing validation using Angular i.e. ng-show, ng-required. When the checkbox is checked the two input fields are disabled i.e. ng-disabled="$parent.vm.selectAllDates". Now I...

Cant Figure Out Why VideoDeviceInput Isn't Being Added To My AVCaptureSession

ios,swift,avfoundation
Everything is working just fine. Outputs are added correctly, everything is initialized correctly, camera pops up, etc. The ONLY thing that is not working is adding the video device as an input to the capture session or this camera and I cannot gather why this is happening. Maybe a different...

pgadmin importing csv file errors

postgresql,pgadmin
I'm using pgadmin 1.18. I have a copy of a table that I truncated. I simply want to load an import csv file which essentially looks like this: 20151228,12/28/2015,53,12,December,4,2015,1,Monday 20140828,08/28/2014,35,8,August,3,2014,4,Thursday 20150208,02/08/2015,6,2,February,1,2015,7,Sunday I'm getting an error: extra data after last expected column CONTEXT: COPY tblname, line 1: "20151228,12/28/2015,53,12,December,4,2015,1,Monday" This is the...

Laravel Blade html image

image,laravel,blade
My image file path is public/img/logo.png and my app.blade.php file path is resources/views/app.blade.php Inside of my app.blade.php file I use {{HTML::image('/img/stuvi-logo.png')}} to display an image. I don't understand why this won't find the image. What is the root folder of the image() method?...

Does halving every SHA224 2 bytes to 1 byte to halve the hash length introduce a higher collision risk?

hash,hash-collision,sha2
Let's say I have strings that need not be reversible and let's say I use SHA224 to hash it. The hash of hello world is 2f05477fc24bb4faefd86517156dafdecec45b8ad3cf2522a563582b and its length is 56 bytes. What if I convert every two chars to its numerical representation and make a single byte out of...

Scrapy prints fields but doesn't populate XML file

python,xml,xpath,scrapy,scrapy-spider
I have a problem where it prints the XML files correctly but it doesn't populate the XML file with any content. The output in terminal is this: [u'Tove'] [u'Jani'] [u'Reminder'] [u"Don't forget me this weekend!"] However the output site_products.xml results in this (which is wrong, no data): <?xml version="1.0" encoding="utf-8"?>...

JQuery - How to make a button scroll to next div, but respond if scrolled up

javascript,jquery,html,dom,scroll
So my dilemma is this: I want a button on my website that is fixed to the screen and after being clicked will scroll you to the next element in the body. BUT I also want it to know if you have scrolled up and update whichever is the next...

Can't compare string received through Bluetooth with normal String

java,android
I have a connection between Arduino and Android phone. This is the string that I'm receiving: always the string 555, I know because I tested it: final String data = new String(encodedBytes, "US-ASCII"); String toCompare = data; But this will always print false : txtArduino.setText(String.valueOf(toCompare.equals("555"))); I think that the format...

Reading value of nested key in JSON with Java (Jackson)

java,json,jackson,gson
I'm a new Java programmer coming from a background in Python. I have weather data that's being collected/returned as a JSON with nested keys in it, and I don't understand how pull the values out in this situation. I'm sure this question has been asked before, but I swear I've...

mpdf cannot generate .pdf file on the server

php,pdf,server,mpdf
My php code is something like this : $htmlOut = 'Some html code'; include("libraries/MPDF60/mpdf60/mpdf.php"); $mpdf=new mPDF('c','A4','','' , 0 , 0 , 0 , 0 , 0 , 0); $mpdf->SetDisplayMode('fullpage'); $mpdf->list_indent_first_level = 0; $mpdf->WriteHTML($htmlOut); $mpdf->Output("filename.pdf",'I'); I am using this exact same code on my localhost and everything is working perfect. I...

Program that either waits for user input or runs at defined intervals?

python,multithreading,user-input,keyboard-events
I currently have a program that runs at regular intervals. Right now the program runs continuously, checking for new files every 30 minutes: def filechecker(): #check for new files in a directory and do stuff while True: filechecker() print '{} : Sleeping...press Ctrl+C to stop.'.format(time.ctime()) time.sleep(1800) However, I'd also like...

I'm trying to build HellowWorld with Gradle; can't make it compile

java,gradle
I'm trying to build HelloWorld project with Gradle. Seems that I'm following instructions: This is my build.gradle: apply plugin 'java' This is my java file: package my; public class HelloWorld { public static void main(String args[]) { System.out.println(“hello, world”); } } my java file is in grtest/src/main/my/ folder my build.gradle...

Spock - @Subject annotation and util | helper class that's being tested

unit-testing,groovy,spock
I got a question regarding convention of tests in Spock. Let us say we got A class to test, which is util class with static methods. Classic way to test it, would be A.method() in each test method. However, in Spock we got @Subject annotation (and also Groovy let us...

IsNumeric/IsError returns an error

excel,vba,excel-vba
I'm quite new to VBA and working on a custom function (which will be used for more complicated purposes in the future - that is the reason for which I want to do this using VBA instead of standard formulas) whose task should be to get the date from the...

Javascript issue: pulling up checked items and displaying them (like a shopping cart)

javascript
Okay so here is my HTML <!--Enveloppe principale - wrapper --> <div id="wrapper"> <h1> Magasin de musique </h1> <form id="musictems" name="musicitems"> <!--Enveloppe magasin - storewrapper --> <div id="storewrapper"> <div class="collections"> <h2>Collections de musique </h2> <table> <tr> <th></th> <th>Nom</th> <th class="lrpadding">Prix</th> <th>Quantit&eacute;</th> </tr> <tr> <td><input...

Removing a block of text with regex, matching first occurrences only

c#,regex
I need to remove a stored procedure from a generated script using regex. For example, I need to remove usp_Remove: ... GO /****** Object: StoredProcedure [dbo].[usp_Remove] ******/ ... GO /****** Object: StoredProcedure [dbo].[usp_Keep] ******/ ... GO I tried the following regex: \/*\*\*\*\*\*\* Object: StoredProcedure \[dbo\]\.\[usp_Remove\][\s\S]*GO Which properly selects the beginning...

Combine a button and a progress bar, inline, inside grid element

twitter-bootstrap
I'm learning Bootstrap. I have a simple grid view divided into two as follows: <div class="row"> <div class="col-md-6">cell 1</div> <div class="col-md-6">cell 2</div> </div> I'd like to place a button and a progress bar into cell 2, while keeping them inline. I've started with the following: <div class="row"> <div class="col-md-6">cell 1</div>...

How to understand use-cases in specific scenerio

drawing,uml,modeling,use-case
I am drawing a diagram of use-case using ArgoUML, I have a scenario in which user can update status but after sign in to the application , in that sense i need to extends update status after sign in or make it a new separate usecase or generalize it. Thank...

Save & Close Open Excel 2007 Files Automatically BEFORE Shutdown Due To Power Loss

windows,excel,vbscript,uac,psexec
I have spent days trying to find a way to save users' open Excel 2007 files before a shutdown.exe or psshutdown.exe is issued. I'm using Windows 7 Pro 64-bit machines w/UAC enabled, including remote restrictions. I don't want to bypass these security measures. I have developed vbscript that can do...

generate sets of normal distribution values within for loop

r
I'm trying to capture 500 samples of a linear model, where each sample contains 20 error terms that are randomly-generated values of a normal distribution. Because I'm interested in results per sample, I don't want to just generate a vector of 500 * 20 = 10000 values of a normal...

webview doesn't show up underneath button in android layout

android,android-layout,webview
Before I implemented a linear layout with button and webview, my standalone webview worked fine. I added the following and now only the button shows up: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="match_parent"> <ImageButton android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/back_nav" /> <WebView...

CUDA 2d Array Mapping

cuda
#include <cuda_runtime.h> #include <stdio.h> void initialint(int *ip,int size) { for(int i=0;i<size;i++) ip[i]=i; } void printmatrix(int *C,const int nx,const int ny) { int *ic=C; printf("\n Matrix: (%d.%d) \n",nx,ny); for(int i=0;i<ny;i++){ for(int j=0;j<nx;j++){ printf("%3d",ic[j+nx*i]);} printf("\n"); } printf("\n"); } __global__ void printthreadindex(int *A,const int nx,const int ny) { int ix=threadIdx.x+blockIdx.x*blockDim.x; int iy=threadIdx.y+blockIdx.y*blockDim.y; unsigned...

MD5 function not functioning properly [closed]

c++,windows
This is my current MD5 function. When used on windows 8.1 it always returns a value, but when run on windows 7 it only returns a value about 50% of the time. That is pretty peculiar to me. Any ideas? It turns out that it is dodgy on both...

Nginx Rewrite Not rewriting the url

nginx,url-rewriting
I have tried this for hours and can't seem to get it. I copied other examples and still can't get rewrite to work. I need my url on nginx to look like http://myurl.com/main/login, http://myurl.com/somethigelse/home, est. Any Help Appreciated. I'm new to nginx, seems a lot faster. My nginx rewrite looks...

JSQMessages.h not found

ios,xcode,swift,jsqmessagesviewcontroller
I added JSQMessageViewController to my project. I went to the bridging header file and added #import <JSQMessages.h>' and I get the errorJSQMessages.h not found'. Why is Xcode not able to find it? ...

Retrieving count and summing from many different tables with shared ID in SQL

sql,sql-server
I need to retrieve the number of related subprograms where there is a shared master Prgm_ID in all of the tables in a SQL Server database. There's the master table T_Program which stores the basic info about the parent program, but there are about 20 other tables which contain info...

Numbered ManyToMany In Django

python,django
I am using Django as a game server, and need to group players. My group can contain up to n players, each assigned a player number (player1, player2, etc). How can I store players and record their player number? One obvious option is the following: class Group(models.Model): player1 = models.ForeignKey(Player)...

Portable XAML Styles in a Class Library

c#,wpf,visual-studio,xaml,portability
So I have an application with a style put directly into the App.xaml file as such: <Application x:Class="Test.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="OnStartup"> <Application.Resources> <Style x:Key="SpecialButtonStyle" TargetType="Button"> <Setter Property="Content" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" /> <Setter Property="OverridesDefaultStyle" Value="true"/>...

making stackable two columns in WordPress

css,wordpress,responsive-design,wordpress-theming,responsiveness
I'm working with a theme that is supposed to be responsive but when the two column shortcode is used and a page is viewed on smaller browsers or mobiles, the columns shrink to fit the browsers width side by side instead of stacking. It looks awful on smartphones, I am...

Accessing fields, methods of Java classes that aren't imported in Clojure

java,clojure
I'm starting to get more into Clojure-Java interop. If I create a Java class in Clojure, I need to import it, but if I merely use fields or methods of a class, I don't have to import it. For example: (ns students.Student (:import [sim.util Double2D]) (defn -step [this students] ;...

How to I chain methods from a list so that the result from one becomes the input of the next?

c#,.net
I have a list of processor objects that contain an execute method. Now I want to execute each processor.Execute() in order from the List, but want the result from one to become the input to the next and so on until the last one in the list becomes the final...

how to print the last login time in shell script?

linux,shell
For example, I use last | grep pts/ | awk '{print $1 " "$4 " "$5 " "$6 " "$7}' > who_log.txt to get the login information: samuelli Fri Apr 24 19:51 pi Fri Apr 24 19:50 liuly Fri Apr 24 19:50 pi Fri Apr 24 19:46 liuly Fri Apr...

Override list's builtins dynamically in class scope

python,python-2.7,inheritance,scope,builtins
Purely curiosity question: class Li(list): pass m, n= Li([1]), Li([2]) def r(*args, **kwargs): raise Exception('hop') setattr(m, '__iadd__', r) m += n print m # [1, 2] setattr(Li, '__iadd__', r) m += n Output: [1, 2] Traceback (most recent call last): File "C:\...\test_override.py", line 8, in <module> m+=n File "C:\...\test_override.py", line...

Can't write unknown attribute using rails_admin

ruby-on-rails,rails-admin
Im' using rails_admin to save a project that has a category within. I didn't define project_id and category_id because I thought they should be created by rails. The problem I got were using the method def category_id=(id) defined in project model (see below). The error is: can't write unknown attribute...

Create links to map markers in map created with Fusion Table

javascript,google-maps,google-fusion-tables
A map is being created like so (also see code at end of post). What I'm trying to create is a list of links which would point to the markers on the map, in order to recenter the map and display infowindows when the links are followed. This question and...

How do I change each pixel

python,image-processing,pyqt,qimage
I am new to Python and I still don't know what exactly Qimage's pixel returns (it seems to a tupel of rgb or rgba -the lack of type declaration doesn't help) I want to grab each each pixel and change it. newqim = QImage(imWidth, imHeight, QImage.Format_ARGB32) for xstep in range(0,...

Does AVPlayer stop the user's music?

ios,sprite-kit,avplayer
I want to know -- what happens to a user's music when an AVPlayer starts to play? Does nothing happen, does it stop, or does the action cancel itself? If so, how would I check and see if the user is playing music? Apple's Documentation for this confused me....

ruby user.profile link_to

ruby,ruby-on-rails-4
I am trying to make the user profile a link on my project. originally, my code would be: <%= gig.user.profile %> which would just display the user profile name. I want to set a link to but all i can get to work is: <%= link_to "user", gig.user.profile %> It...

toLeftOf resource not found

android,xml,android-layout
I've used toLeftOf many times before but it suddenly stopped working. I tried: android:layout_toLeftOf="@id/spacer" Here is the view: <View android:id="@+id/spacer" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_marginLeft="@dimen/center_margin" android:layout_marginStart="@dimen/center_margin" android:layout_marginRight="@dimen/center_margin" android:layout_marginEnd="@dimen/center_margin" /> And it gave me the errors: Error:(16, 34) No resource found that...

Using Exceptions to control application flow

php,oop,exception
I am currently writing a web app in PHP and have decided to use exceptions (duh!). I could not find an answer to whether putting try and catch blocks in all functions would be considered bad code. I am currently using Exceptions to handle Database errors (Application errors are handled...

“this” keyword type when called on an object of derived class from base class

c#,inheritance,method-hiding
If I have something like this: class Base { public void Write() { if (this is Derived) { this.Name();//calls Name Method of Base class i.e. prints Base ((Derived)this).Name();//calls Derived Method i.e prints Derived } else { this.Name(); } } public void Name() { return "Base"; } } class Derived :...

How to get and replace data from form serialize() before submitting?

jquery,forms,serialization
I need to submit a form using jQuery but before it's submitted I want to change the value of one of the form fields without showing the change to the user. I know it's not the best way but my software demands that. Currently I use: var submit = $("#submitform").serialize();...

Is it possible to retrieve text files content from a parameter and display in HTML?

html,jsp
Say I have a product listing with descriptions. Can I store the descriptions in text files and call them by setting a parameter path in web.xml? Is that even possible? Calling txt file extensions? It may be a stupid question but I have no clue... Would it slow down the...

PowerShell syntax error on { used in foreach loop

powershell
I found some awesome code on this page that has syntax error when trying to use with PowerShell version 3 or 4 can anyone help to fix the issues? http://jeffwouters.nl/index.php/2012/06/scvmm-custom-inventory-about-vm-and-vhd-with-powershell/ $VMS = Get-VM -VMMServer localhost | Sort-Object -Property Name -Descending “<HTML><HEAD><TITLE>VM Inventory</TITLE></HEAD><BODY><TABLE BORDER=1>” | Out-File $Env:Temp\VMInventory.html “<TR><TD>VM Name</TD><TD>VM...

Compute the “lower contour” of a set of segments in the plane in `O(n log n)`

c++,algorithm,big-o,computer-science
Suppose you've a set s of horizontal line segments in the plane described by a starting point p, an end point q and a y-value. We can assume that all values of p and qare pairwise distinct and no two segments overlap. I want to compute the "lower contour" of...

AngularJS empty input model after mvc postback

javascript,asp.net-mvc,angularjs,asp.net-mvc-4
Using AngularJS with ng-model all my fields are cleared after postback from mvc controllers. Can prevent this somehow and put the values from the postback into the model? Every time the user make a postback with an validation error all fields get cleared because of the ng-model. Any ideas? @using...

Why doesn't Android Studio recognize Base64.encodeBase64?

java,android,android-studio,libraries
I'm trying run the following code, however I cannot use encodeBase64(). I've already tried to import such libraries using Alt + Enter. How can I make it work?...

How do I slide between two images on mouse over? [closed]

jquery,image,transition
How can I create a section contaiinng 2 images side by side which will expand one of the images to full width when hovering over it. i.e when I hover over the left hand side image the image will expand to the right to display the full image and cover...

Trigger jQuery animated number counter on window scroll

javascript,jquery,html,animation
I'm trying to get this jQuery animated counter to trigger as soon as the user scrolls more than 200 pixels down the page: Original jQuery code from here $('.Count').each(function () { var $this = $(this); jQuery({ Counter: 0 }).animate({ Counter: $this.text() }, { duration: 1000, easing: 'swing', step: function ()...

Symfony2 : Add method to an Entity

php,symfony2,entity,add
I would like to add a method to an Entity. This method returns X characters from the Entity's title, and i would like to print this title in my twig file. Is it possible ? twig : <ul class="nav nav-pills nav-stacked"> {% for blog in listBlogs %} <li> <a href="{{...

Proper way to pass functions to directive for execution in link

angularjs,angularjs-directive,angularjs-scope
I know we usually pass functions to directives via an isolated scope: .directive('myComponent', function () { return { scope:{ foo: '&' } }; }) And then in the template we can call this function like such: <button class="btn" ng-click="foo({ myVal: value })">Submit</button> Where myVal is the name of the parameter...

Find the count of records by quarter year [closed]

mysql,sql,database
Can anyone help me with this? I need to create a SQL query. I got this table called "slt_especificidade_caso": I need to create a SQL query which brings me back this structure in 1 row: epc_id_pergunta : the value in column first_quarter: Quantity of registers (eg. number of rows) in...

It is possible use AutoScaling with Elastic Mapreduce?

amazon-web-services,amazon-ec2
I would like to know if I can use AutoScaling to automatically scaling up or down Amazon Ec2 capacity according to cpu utilization with elastic map reduce. For example, I start a mapreduce job with only 1 instance, but if this instance arrive to 50% utilization for example I want...

Checking NULLS in an OPTIONAL MATCH

neo4j,cypher
I have a cypher query like this: MATCH (start:StartLabel) OPTIONAL MATCH (start)-[:A]->(end1:EndLabel) OPTIONAL MATCH (start)-[:B|C]->(middle:MiddleLabel)-[:D]->(end2:EndLabel) WHERE NOT(end1 IS NULL AND end2 IS NULL) RETURN * In this graph model there are multiple valid ways to reach (end) from (start) but I want to make sure that the result matches at...

Measuring against a future time in Ruby

ruby
I'd like to be able to run a method which will measure Time.now against a future date, something like this: def graduated? Time.now == # future date ? (puts "Congrats!") : (puts "Not there yet!") end I've tried entering the syntax from ruby docs for the future date as such:...

Query failed in php

php,mysql,sql,html5
$query = "SELECT * FROM Student WHERE student_id = $child AND school_id = $college"; $result = mysqli_query($conic, $query); if(!$result){ die(" query failed"); echo 'error here'; } else { i am trying to retrieve some information from the SQL database but the query seems to fail any ideas?...

Using a cursor in a stored procedure

stored-procedures,plsql,oracle11g
I want to find the min, max and average for each quarter using stored procedure and cursors. Can't figure out where am I going wrong. SET SERVEROUTPUT ON CREATE OR REPLACE PROCEDURE seven2 IS CURSOR c1 IS SELECT qtrcode as QTR, cast(MIN(salaryoffered) as decimal(4,2)) as MIN, cast(MAX(salaryoffered) as decimal(4,2)) as...

SharePoint 2013 App Deploy Error: “A different version of this App is already installed with the same version number”

visual-studio,visual-studio-2012,sharepoint,sharepoint-2013
I have developed a very simple Provider-Hosted App which I was deploying to our SharePoint Online Developer Site. Testing was going fine, and I had deployed it several times to the site, before I suddenly received this error in Visual Studio 2012 after I hit F5: Error occurred in deployment...

Dealing with Sprites and Collisions Using Pygame

python,pygame,sprite
I am learning python using pygame and I am working on something that involves sprites and collisions. I've looked at some examples but I still don't quite understand it. What I am attempting to do is to be able to add sprites(a ball) when the user presses the "=" key...

SVG filter bump mapping with diffuse lighting spills out

svg,svg-filters,bump-mapping
I am trying to create a bump mapping effect in SVG using luminanceToAlpha conversion of an image and then altering the location of a point light on the overall surface. Here is the short fiddle I created, https://jsfiddle.net/5g2qncq8/6/ Code snippet: <defs> <filter id="bump" x="0" y="0" height="100%" width="100%" > <feColorMatrix in="SourceGraphic"...

CSS3 Trigger mouseover state on document ready

jquery,html5,css3,triggers,mouseover
I know, there are plenty of posts relating to this topic, but for some reasons I wasn't able to apply the answers to my case and hope someone can help me with that in particular. Basically, I want my menu to blink once in the style of the navigation class...

Preserving referenceness when passing variadic arguments

c++,c++11,variadic-templates,variadic-functions,variadic-parameter
Consider the following code snippet: class Base { public: template <typename...Ts> void fun(Ts... vs) { cout << "Base::fun" << endl; cout << __FUNCSIG__ << endl; } }; template <typename...Ts> class Derived : public Base { public: void dfun(Ts... vs) { cout << "Derived::dfun" << endl; cout << __FUNCSIG__ << endl;...

Cant access methods from another class

java,methods,static
Im calling DataComparison() public class SteganographyGUI { ... DataComparison dataComp; dataComp = new DataComparison(); } public int getLSB(){ String x = fileChooser1.getSelectedFile().getAbsolutePath(); x = x.substring(x.length() - 10, x.length() - 9); return Integer.parseInt(x); } when some criteria are met. My problem is that, when I try to access getLSB by using...

Matlab: Explicitly specifying pie graph slice color

matlab,pie-chart,colormap
I'm creating a pie graph. pie([a,b,c,d]); Is it possible to explicitly change the color of the individual slices? For example; if I wanted the slices for a and b to always be green and c and d to always be blue, regardless of their size, how would I do that?...

using an array member in a data structure

c
I have the following data structure: typedef struct node { int key; int *v; }node; ... and the global variables: node *multiway[10]; int contor=0; I am trying to insert inside this structure all the nodes of a multiway tree, and all the kids of each node. In order to do...

MarGo for Sublime [closed]

go
I tried to install MarGo for GoSublime go get github.com/DisposaBoy/MarGo However it appears that the path is not correct. Has MarGo moved, or it's not needed anymore for GoSublime ? Update MarGo is part of GoSublime apparently....

Using LED with ngcordova barcode scanner

barcode-scanner,ngcordova
When trying to use barcode scanner in bad lighting conditions, it would be very beneficial if possible to light the LED/Flash that comes with the phone/tablet