FAQ Database Discussion Community


Calling Methods From Class Not Working

python,class,methods
I have made a sonar finding game and some functions for it. I have put these functions into a class and now I want to call them so I can play the game, however when I define the class call it now returns things to me like game.getNewBoard() takes 0...

External resources fail to load when using HTML5 cache

javascript,html,html5,html5-appcache
I'm trying to get app cache to work: CACHE MANIFEST /css/style.css /js/colors.js /js/dropzone.js /js/jquery.min.js /js/script.js /img/icon_analytics.png /img/icon_exit.png /img/icon_expand.png /img/icon_list.png /img/icon_lock.png /img/icon_menu.png /img/icon_more_content.png /img/icon_settings.png /img/icon_settings_black.png /img/svg_icons/close_fullscreen.svg /img/svg_icons/go_fullscreen.svg /img/loader.gif But here is what I'm getting in the console: GET https://www.google.com/jsapi net::ERR_FAILED (index):517 Uncaught...

RabbitMqBundle connection not enstablished

symfony2,rabbitmq
I installed https://github.com/videlalvaro/RabbitMqBundle in my sf2 project, with this configuration: old_sound_rabbit_mq: connections: default: host: 'localhost' port: 5672 user: 'guest' password: 'guest' vhost: '/' lazy: false producers: processing: connection: default exchange_options: { name: 'processing', type: direct } class: Assignment\Bundle\MainBundle\RabbitMq\Producer\ProcessingProducer Service configuration: processing_producer: class: Assignment\Bundle\MainBundle\RabbitMq\Producer\ProcessingProducer arguments: [] Producer...

Pass arguments to inner anonymous function

jquery,wordpress,scope,closures
I try to make a function in WordPress to add customizer color settings with JS. My function is: function customize_color(id,selector,prop){ wp.customize(id, function(value) { value.bind(function(to) { $(selector).css({ prop:to }); }); }) } And I want to call it like this: customize_color('body_background','body','background') With the debugger I notice that inside the function(to) I...

How to make fixed navbar inside column to resize properly?

html,css,html5,css3,twitter-bootstrap
Ive created a left navigation bar which is fixed to the top when user is scrolling, this part is working great. However, when i resize the resolution, at some point left navigation bar is moving on top of the MAIN content, and i cant figure out how to prevent this...

Efficiently identify all FK items with n>3 dates within any 8 week period from a SQL table?

sql,sql-server
I have a ~400,000 row table containing the dates at which a collection of ~30,000 people had appointments. Each row has the patient ID number and an appointment date. I want to efficiently select people who had at least 4 appointments in an 8 week span. Ideally, I would also...

CheckBoxTreeItems always independent, not rendered properly. Why?

java,javafx,javafx-8
I am new to JavaFX and I am trying to create a simple TreeTableView, containing a single Boolean column and is rendered with a CheckBoxTreeTableCell. The problem I am having is that the two CheckBoxTreeItems seem independent (selecting the root doesn't select the child and the other way around). I...

How to get filename and location of file that starts a visual basic application?

vb.net,filenames,parent
Am on Windows 8 I have a visual basic 2010 express application that plays mp3 files. It has a button which opens an openfiledialog box to select the mp3 you want to play. However I have also set my vb app to be the default opener of mp3 files. When...

OpenCV: Check whether cv::Point has been set a value

c++,opencv
I want to write a program similar to below: cv::Point keyPoint keyPoint = outputOfFunction(); // Return value is not set to anything if no valid results. if( //keyPoint was set by the function above... ){ // Do something with this value else{ // Do nothing } However cv::Point does not...

how to add more values to variable string

javascript,jquery
i have this variable below, var arr = { lines: 1, angle: 2 }; how would i append / push this into my arr variable? var arr2 = { hi : 3 } I've tried push() and just simply adding the two. but failed var r = arr+''+arr2; alert(r.toSource()); the...

Should I add engine's code to the app itself if I'm going to modify it a lot (Spree, Rails)?

ruby-on-rails,e-commerce,spree,rails-engines
I'm starting a new app with Spree and I'm going to heavily modify it. It seems impractical to go to source every time I need to change something. Should I just copy paste contents of spree/front_end engine to my app or should I do: Spree::Product.class_eval do def some_method ... end...

Quote macro for defining string

c,c-preprocessor
Is it possible to quote the "content" of a macro? Something like the following code for printing the string "AAA". #include <stdio.h> #include <stdlib.h> #define _L 5 #define _QUOTE(a) #a #define _TEXT AAA #define _STRINGAAA _QUOTE(_TEXT) const char STRINGAAA[ _L ] = _STRINGAAA; int main(void) { printf( "%s\n", STRINGAAA );...

Why won't the UIImage change?

ios,swift,uiimage
I looked trough many resources and none have worked for me. I am trying to get an image to change based on the day of the week. I tested out the calendar method in a playground and it would return the correct expected number. However, I am pretty new to...

C++ having probelm with my vairable going back to zero.

c++,curly-brackets
Having a problem with the value the user score not going back to 0 after the program is done i think I messed up the brackets somewhere and help will be highly appreciated. the point of this code is to make a simple text based c++ program that will have...

Internal Server Error apache issue

php,apache,.htaccess
I've got a strange problem while trying to add pages to my website. I'm actually trying to create a "test.php" in my directory, but when I try to access it, I've got Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request....

Concatenate two big pandas.HDFStore HDF5 files

python,pandas,hdf5,pytables
This question is somehow related to "Concatenate a large number of HDF5 files". I have several huge HDF5 files (~20GB compressed), which could not fit the RAM. Each of them stores several pandas.DataFrames of identical format and with indexes that do not overlap. I'd like to concatenate them to have...

Why Waiting Thread Doesn't wait forever

java,multithreading,concurrency
I found below code for replicating the join() behavior in Java. There are two possible execution path: When Main thread continues execution and enters into the synchronized block. It then has to wait for thread t to finish. When Thread t starts first and calls the run method, then Main...

PHP outputs content after a “->”

php
I try to post a form to trello via their api. This is my code: <?php require_once '/src/Trello/trello.php'; $key = '[KEY]'; $token = '[TOKEN]'; $trello = new \Trello\Trello($key, null, $token); $title = $_POST['title']; $desc = $_POST['content']; $fileSource = $_POST['file']; Trello->post("cards", { name: $title, desc: $desc, idList:"54f882603b3b0af795078283", pos: "top", fileSource: $file});...

Moving UIButton position, animated

ios,objective-c,animation,uibutton
I have a UIButton, which when it's pressed I want to move the position of it. I've managed to do this by this code: ans2.frame = CGRectOffset(ans2.frame, 0, 20); However this just moves the button instantly. I've also tried just moving it by doing ++ to the position until the...

jQuery UI - resizable. Check direction

jquery,jquery-ui
I would like to ask how to check direction of resizable element in jQuery UI - resizable. I know I can check it horizontally: $(this).data(ui-resizable).axis I would like to know that I resize it to left or to right....

R: Extract complete cases/included observations from linear model or formula variables

r,data.table
After running m1 <- lm(f1, data=DT) I want to save the observations that are included (akin to "obs <- complete.cases(m1)", but something that works) so that I can run a second regression on the same observations: m2 <- lm(f2, data=DT[obs]). Alternatively, I would like to get the observations that are...

Barcode4j + qr not working

java,xml,fop,barcode4j
I have problems trying to generate an image with qr code via barcode4j library. I've read the following guide but that didn't work out. So here is my code: pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>fopqr</groupId>...

Navigation drawer icons are missing

android
My app currently has a strange behavior When I run for the first time is ok, but after a few clicks, the navigation drawer icons dissapear. My code @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mTitle = mDrawerTitle = getTitle(); menu_array = getResources().getStringArray(R.array.menu_array); GCMRegistrar.checkDevice(MainActivity.this); GCMRegistrar.checkManifest(MainActivity.this); final String regId =...

Optimization (with scipy.optimize.minimize) with multiple variables

python,optimization,scipy,minimization
I want to implement the Nelder-Mead optimization on an equation. But it does not contain only one variable, it contains multiple variables (one of them which is the unknown, and the others known.) For instance at this example: http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html If my rosen(x) was def rosen(x,y): ... """The Rosenbrock function""" ......

Android: Can't find outer most view inside included layout

java,android,xml
Current behavior The contents of the include tag are being displayed, however, when I try finding the outer view within the included layout, it returns null. Question What am I doing wrong? Code Here's the java code inside onCreate(): input_box_wrapper = findViewById( R.id.input_box_layout ).findViewById( R.id.input_box_wrapper ); if ( input_box_wrapper ==...

how to make a new object of an type variable in a Dictionary if the type has constructor arguments c#

c#,generics,inheritance,dictionary
class baseClass { public baseClass(int x,int y) {} } class class1 : baseClass { public class1(int x,int y) : base (x,y) {} } public void Main() { Dictionery<int,Type> classes = new Dictionery<int,Type>(); classes.add(1,typeof(Class1)); baseClass x = new classes[1] (10 , 12); // doesent work //tried baseClass x = Activator.CreateInstanceFrom(classes[2](10, 12))...

How do I test in a LibreOffice python macro whether I'm in a Writer or Calc document? [closed]

python,macros,libreoffice,uno
I am working in libreoffice and need a python macro that can insert data into the current document from an external source. Given that the insert methods are different for a spreadsheet and a document using the UNO API, how do I code the macro to discover whether I am...

“Unable to parse URL” exception after SOAP request

php,web-services,soap,wsdl,soap-client
I'm trying to use a soap service with php, but it seems that the request format that php creates couldn't be interpreted by the service. Simple example I have so far: ini_set("soap.wsdl_cache_enabled", "0"); $client = new SoapClient('http://publicbetawebservices.hotel.de/V2_8/FreeHotelSearchWebService.svc?WSDL',array("trace"=>1)); try { $response = $client->GetWebservicesVersion(); } catch(Exception $e){ print_r($e); } Output: SoapFault Object...

Return other View without Redirect

asp.net-mvc,redirect
I have two controller actions: public ActionResult Menus() { // Build view model and display Menus view } public ActionResult MenuCommand(string commandArg) { // Perform the specified action // Now return new Menus views return Menus(); } The idea that is, after my MenuCommand action is finished, it defers back...

Does securing a REST application with a JWT and Basic authentication make sense?

spring-security,basic-authentication,jwt
I have a Spring REST application which at first was secured with Basic authentication. Then I added a login controller that creates a JWT JSON Web Token which is used in subsequent requests. Could I move this: tokenAuthenticationService.addTokenToResponseHeader(responseHeaders, credentialsResource.getEmail()); out of the login controller and into the security filter ?...

operator overloading in abstract class(interface)

c++,interface,operator-overloading,abstract-class
I want to have an abstract class IMatrix which contains pure virtual members and one of them is an operator overloading member. template <typename T> class IMatrix { public: virtual T operator+(const T& b)=0; }; and for the implementation I want to use a third party matrix class as for...

Using POSIX regex in php to remove comments from C source code

php,regex
I have a problem with removing single line comments from C source code using php and regex. /* */ comments are removed so all that is left are // comments. First: I have this regex: $content = ereg_replace('^\/\/.*$', '', $content); This will remove whole file (not only all lines that...

Why does input[type=“text”] change size on focus?

html,css,input
Say I have an input. html <input type="text"> css: input, input:focus { border: none; outline: solid 1px grey; box-shadow: none; } When clicked, the input changes size. How do I stop this? http://codepen.io/mildrenben/pen/QwVvZK...

How do I create a loop which checks these values? [closed]

java,loops,substring,condition
If I had a numberical idno value, how would I find the ones >=5000 and < 5000? Would i use idno.substring(7,11) and then check the conditions if >=5000 print Male if <5000 print Female How would I perform this?...

Place icons above the text and in the center of the tab

android,android-styles
The layout image Hi! I'm using the ActionBar tabs, one activity and four fragments and what I'm trying to do is place the icon and the text in the center of the tab. I tried this technique but it didn't work. I also tried setting the name="android:gravity to center. Also,...

How to create a directory on my cloudfoudry account?

lucene,cloud,command-line-interface,cloudfoundry
I deploy to cloudfoundry an application which need a directory for lucene. This application failed to start because there is not the configured directory. I search on Cloundfoundry forums but i did not found how to create a directory on my server on CloudFoundry. If someone have a documentation or...

How do I know which scene has called a particular scene?

ios,objective-c,sprite-kit
I have a scene where the scores are shown. There are multiple levels and for each level there is a different scene. I tried this to know which scene called the score scene: Created a BOOL for every scene and set them to YES in their respective didMoveToView. Transferred that...

Load data from .txt into SQL Server database

sql,sql-server
I am using SQL Server and I need to load some data from a .txt file into my database table which I already created and set its columns properly. The .txt has this format all along and it is really big (170MB). The first line simply shows the columns, so...

404 after attempting to implement Django(1.5.4) Sitemaps

django,sitemap
I've gone through the process, which is seemingly fairly straightforward of setting up an sitemap.xml file.. I'm getting 404 page when I go to www.example.com/sitemap.xml 'page not found' and a message (I've still got debug settings turned on..) along the lines of: " Django tried these URL patterns, in this...

Make a draggable black box

python,python-2.7,pygame
I'm trying to make a black box which I can click and drag but I seem to be stuck. Could anybody help me see where I'm going wrong? def main_game(): import pygame import math from time import * pygame.init() displayWidth = 268 displayHeight = 552 cyan = (0,255,255) red =...

shared preferences for storing a single score

android,sharedpreferences
I am developing this quiz game. at the end of the game I show the user a detailed total score. What I want to develop here is a using sharedpreferences to store the value, be able to retrieve it using other activity showing the user's total score. I am only...

LINQ Project properties into a new anonymous type with Contains

c#,linq,linq-to-objects,anonymous-types
I have the following code which I am trying to make work but it still does not compile. Thank you. List<Employee> emploees = new List<Employee>() { new Employee { ID = 101, Name = "Rosy" }, new Employee { ID = 102, Name = "Sury" } }; var result =...

Django xhtml2pdf 'HttpResponse' does not have the buffer interface

python,django,httpresponse,xhtml2pdf
I'm trying and making some tests for outputting pdfs with Django. I'm using the xhtml2pdf project installed with pip. I looked at an example for sending a pdf to the browser and succedeed, but when trying with a template of mine, an error appears. It reads: 'HttpResponse' does not have...

Showing multiple Tooltips in highcharts simultaneously

javascript,jquery,charts,highcharts
I want to show multiple tool tips at the same time in a Highchart. The basic requirement is like whenever the mouse is hovered over a point in the series I need to show the tool tip for all the points within a radius X of the hovered point. I...

Why are my settings saved in this situation?

c#,wpf,mvvm,settings.settings
I am rewriting my current program to make use of MVVM, and I am very much a beginned at MVVM - I feel very overwhelmed with it, so I apologise if this is obvious... What is happening is a good thing, not a bad thing... But I want to understand...

Angular, click through array

javascript,angularjs
I have a variable that is set to an array index, and I want to try and loop through it on click. I have it initially set like: $scope.calenderState = ["day","week","month","year"]; $scope.mod2m4 = $scope.calenderState[0]; and a click function connected that sends mod2m4 like: ng-click ="changeCal(mod2m4)" So right now it would...

C# Regex command-line argument parsing with single hyphen word wrapping inside argument names

c#,regex,parsing,command-line-arguments
I am developing an opensource/libre command-line parser for .NET which will be restrictive but clear. It seemed to be an easy task at first but for 2 days being trapped with regex problems, not so fun. :( I've been reading hours of tutorials about word matching and grouping but it...

eigenvalue and eigenvector calculation with cusolver from cuda 7.0 RC

c++,cuda,eigenvalue,eigenvector,cusolver
I'm trying to calculate the largest eigenvalue/eigenvector pair with cuSolver released in CUDA 7.0 RC. The problem is that I'm getting CUSOLVER_INTERNAL_ERROR, and I don't know what can I do about it. This is my handy stuff, used to call cuda/cusparse/cusolver functions. // my handy stuff #define CUDA_CALL(value) do {...

PHP move_uploaded_file to upload video into MySQL not working

php,html,sql,database,localhost
Hello I tried reading through similar problems and couldn't find answer. So I want to upload a video into my server, right now I'm testing locally using XAMPP in my Macbook. I one data base table I've a column named "path" this is meant to store the file path and...

Why is my System.out.println not executing? [closed]

java
I cant figure out why this wont execute. Any ideas? Is my syntax wrong or did I not initialize count correctly? Here's the code: int product = 0, count=0; while (product < 2500){ product *= 5; count++; } System.out.println(product); ...

How can I get my right mouse button to do things in a turtle application?

python,turtle-graphics
I'm trying to get my right mouse button to do something (skip the turtle to a new location without drawing a line, in this particular case) in Python. I'm in Lambert's Python Programming for Teens, which I love because the code all works. Except now, on page 130, we have...

Stuck on Installing PHP plugin PDT on eclipse luna

php,eclipse,plugins,eclipse-pdt,eclipse-luna
I'm facing a boring situation i am unable to install PDT on my eclipse luna using Downloaded zip of PDT v3.4 or the url link with the eclipse's tool Install new Software lead to the same situation even with even with version 3.3. I'm using eclipse luna x64bit, jdk8 x64...

Python File Renaming Issue

python,python-3.x
import os for filename in os.listdir("."): if not filename.startswith("renamefilesindir"): for filename2 in os.listdir(filename): if filename2.startswith("abcdefghij"): newName = "[abcdefghij.com][abcde fghij][" + filename + "][" + filename2[11:16] + "].jpg" print(filename2) print(newName) os.rename(filename2, newName) I have a folder with a few hundred other folders inside of it. Inside each secondary folder is a...

Regex string with pattern

javascript,regex,regex-group
For Regex fans... What I have is this string: "Lorem ipsum dolor FOO IO BAR BA" I'd like to extract the Title, and an Array of the UPPERCASE suffixes: "Lorem ipsum dolor" ["FOO", "IO", "BAR", "BA"] Here's my attempt: function retrieveGroups( string ) { var regexp = new RegExp(/(FOO|BAR|BA|IO)/g); var...

How to make a prompt box input invoke a function?

javascript,function,if-statement,prompt
How do I get rid of the button onclick="clickMe()" and just have the input from the prompt box execute the function? I need the input from a prompt box to invoke the if statement, i think? <!DOCTYPE html> <html> <head> <title>Demo</title> <script> function clickMe(){ var valueInput=prompt("Please input weekday, weekend?"); var...

In what order does java sort through files/directories?

java
I am somewhat new to java and am trying to create a program which loops through and prints out all of the directories that are inside of a specified location. Here is what I have so far: import java.io.File; public class main{ public static void main(String[] args) { File[] files...

Fortran generic procedure error: may not be generic

fortran,procedure,generic-programming,fortran2003
I know that you can make generic procedures using abstract types, like in here: fortran class declaration of dummy argument But can I do the same sort of thing with the following code? module proc_mod public :: forced,ideal interface forced; module procedure forced1; end interface interface forced; module procedure forced2;...

Create a big image out of several other small images in MonoGame

monogame
How can I create one big Texture2D out of several other small Textures2Ds? Then display that image instead of all the small images.

Finding all instances of a word in a string in C++

c++,string
So I am trying to make a program that gets an input from a text file, and has the user enter the term they want to search for. From there, the file should be printed out with 3 asterisks in front and behind all of the terms. It works currently,...

Removing values from key - value pairs in a dictionary

python,dictionary
I have a dictionary that holds a student's name and their score on a quiz: scores = {'Sam': ['8'], 'Ben': ['8', '10', '9' ,'4'], 'Jack': ['6', '5'], 'Tim': ['9', '10', '7', '9']} I would like to check the number of values in each key-value pair in the dictionary and remove...

Retrieving data from SQLite and displaying in Listview

android,sqlite,listview,android-listview
Am trying to display the contents of my mysqlite database into a listview, I am able to get the contents and display them in a textview, but for some reason I cant add the details to an arraylist ?? am not too sure what am doing wrong. I have looked...

Is there a proper HTTP status code for unprocessable Content-Type?

http,status
What is the most correct/meaningful HTTP status code to return when your web server cannot handles the incoming request because it does not understands what the Content-Type of the incoming request body is? Returning straight 400 seems like a bad idea since, according to Wikipedia: e.g., malformed request syntax, invalid...

How to add scroll bar to the edit text in an Android application?

android
<ScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/etName" android:layout_marginTop="20dp" android:hint="Your Name" android:scrollbars="vertical" /> </ScrollView> This is what i'm trying to do, but not working, what's the correct way to do this?...

Change the background color of some lines in QPlainTextEdit

pyqt
This does not work: def lineError(self): block= self.firstVisibleBlock() while block.isValid(): if block.blockNumber() in self.lineError: block.blockFormat().setBackground(QBrush(self.errorColor)) block.charFormat().setBackground(QBrush(self.errorColor)) block= block.next() Have you any idea?...

What is the type of this function in Scala?

scala
What function type should I specify instead AnyRef? case class Fun() { val anonFun: AnyRef = { (x: Int) => x + 1 } } My calling code: val f = Fun() val result = f.anonFun(1) PS As @jarandaf said the return type of this specific function is Function1[Int, Int]....

open file for random write without truncating?

python
In python, there are a few flags you can supply when opening a file for operation. I am a bit baffled at finding a combination that allow me to do random write without truncating. The behavior I am looking for is equivalent to C: create it if it doesn't exist,...

What exactly does 'serving static files' mean, and should you do it?

javascript,html,node.js
So far I've always been developing my clientside applications without any of my own servers running behind it, using Webstorm's built-in webserver to serve my content. What I frequently see when people use Node with Express to act as their webserver is the debate on if you should put your...

How to create single image from cell array of matrices in Matlab?

arrays,image,matlab,cell
I needed to split a grayscale image in equal parts so I used the function mat2cell. Then I had to equalize each of the parts separatelly, for this purpose I used the function histeq. I reused the same cell array variable for this. Here is the code: height=round(size(img,1)/number_of_divisions); length=round(size(img,2)/number_of_divisions); M=zeros(number_of_divisions,1);...

Deque index-iterator conversion

c++,iterator,deque
Say I have deque element index "i". Deque allows element access by index in constant time. So it looks like we can quickly find element position in memory. But when it comes to get an iterator (to pass to erase() for example), we need to make begin() + i which...

Creating validation for user input in windows forms via visual basic code? [closed]

vb.net
I have 5 fields on my form which I need to validate on lost focus and save button. These fields must be mandatory. Searching through google I have find useful tutorial http://www.codeproject.com/Articles/13922/Validate-user-input-in-Windows-Forms but I don't want to install some "Validator.dll" in order to achieve this, I want to have code...

LLVM: How to Cross Compile C++ Programs

c++,llvm,cross-compiling,clang++,libstdc++
I tried to use LLVM to compile C++ source code to arm binaries. Here's an example: //hello.cpp #include <iostream> int main() { std::cout << "Hello World!\n" << std::endl; return 0; } I use the following commands: clang++ -emit-llvm -c hello.cpp -o hello.bc llc -march=arm hello.bc -o hello.s // I do...

Selenium IDE: How to verify Contents when it contains a mix of tags and
breaks

javascript,selenium,ide,newline
My goal is to verify the contents of a complicated TD cell. It contains a SPAN tage and many BR tags. I'm restricted to using Selenium IDE for this test. The source text looks like this: <td> <span><b style="whatever">TEXT_1</b></span> <br style="whatever"> TEXT_2 <br style="whatever"> TEXT_3 <br> </td> Neither TEXT_1 /...

error while loading file in dom php

php,dom
I am using the below code to create a div <-- successfully. The problem is when i try to create a child div and select $pagenameselected.php to load. Here I get an error because when it loads $pagenameselected <-- it load the php script to create the div and not...

Literal Control in ASP.NET HTML Table

c#,html,asp.net
I have a HTML table like following in my aspx markup file. <table runat="server" id="tblSubstantialOwners"> <tr id="tr_header" runat="server"> <td> <asp:Label ID="lblOnwerName" Text="Name" runat="server"></asp:Label> </td> <td> <asp:Label ID="lblOwnerAddress" Text="Address" runat="server"></asp:Label> </td> <td> <asp:Label ID="lblOwnerTIN" Text="TIN" runat="server"></asp:Label> </td> </tr> <tr> <td> <asp:TextBox ID="txtOwnerName1"...

Cuda Unknown Error(ErrNo: 30) on cudaMalloc()

cuda,malloc
I have searched for the reason but no luck. It fails on such a simple program: #include <iostream> using namespace std; int main() { int* n; cout << cudaMallocManaged(&n, 4 * sizeof(int)) << endl; return 0; } The return code is 30, unknown error. cudaMalloc also fails with same code....

MySQL Query result based on another table result

mysql
I need to query a datas from a table which should be present in another table. for example, I have 2 tables Table 1 comp col1 col2 col3 a 0 v v b 0 v v c 0 v v d 0 v v Table 2 name col4 a 0...

Having trouble solving a Django test for page content

django,testing
I'm currently working my way through the Django tutorial and I'm having trouble getting one of the tests from chapter 5 to pass. Specifically this one: def test_detail_view_with_a_past_question(self): past_question = create_question(question_text='Past question.', days=-5) response = self.client.get(reverse('polls:detail', args=(past_question.id,))) self.assertContains(response, past_question.question_text, status_code=200) I see the response does contain 'Past question'. But it's...

what does a method of which name is same with the class name do in Objective c?

objective-c,classname
Sorry I saw a piece of code in https://developer.apple.com/library/ios/documentation/General/Conceptual/CocoaEncyclopedia/ClassClusters/ClassClusters.html, I don't understand what does the method with the same name as the class name does in Objective c? #import <foundation/foundation.h> @interface MonthArray : NSArray { } + monthArray; // what is this function, a constructor? - (unsigned)count; - (id)objectAtIndex:(unsigned)index; @end...

Importing CSV into Matlab

matlab,csv,cell-array
Chemical composition of a certain material Hi, I am trying to import the below mentioned data in CSV format in matlab, which is [1000x10] in dimensions. HCL;H2SO4;CH4; SULPHUR;CHLORINE;S2O3;SO2;NH3;CO2;O2 144 2 3 141 140 6 7 137 136 10 11 133 13 131 130 16 17 127 126 20 21 123...

How can I implement double dispatch when I don't know all the classes in advance?

c++,inheritance,typeid,double-dispatch,extensible
I've got a base class with (potentially) a lot of subclasses, and I would like to be able to compare any two objects of the base class for equality. I am trying to do this without invoking the blasphemous typeid keyword. #include <iostream> struct Base { virtual bool operator==(const Base&...

Eclipse showing caution sign on the project folder icon whenever I add an external JAR file to the project

java,eclipse,jar
I was revisiting how to connect to a database using JDBC in Eclipse. I created a project (Dynamic Web Project) and added the relevant JAR file for database connection in the external JAR files section (Project Java Build Path --> Libraries --> Add external jars). But still I was getting...

if condition always returns true (Java)

java,date,if-statement,condition
I am trying to implement a date system that inevitably displays tomorrows day, month and year. The problem I am having is that the one of the if statements always returns true, and the ones after this one always return false. Here is part of my code: public class dateVerification...

Performance issue because of sql query

sql,oracle,oracle11g
Below is a simple query running against oracle 9.2.0.7. The parameters come from an application designed for old Boreland drivers. The application has performance issues due to following query takes more than 1hr to run. Prior the data was less but after years the data has grown. The tables has...

Move items between two listviews in activity in Android?

android,android-activity,android-listview
I want to implement todo list, takes two listviews in the activity, listview1 and listview2 stacked vertically, listview1 will allow to add items, each item has a label and checkbox, when item's checkbox is clicked, I need to move the item to listview2, the item now in listview2 should show...

Whats faster: echo or print? - PHP [duplicate]

php
This question already has an answer here: Reference: Comparing PHP's print and echo 1 answer Which statement should I be using in PHP? Print or Echo? In PHP, Echo and Print do the same thing. Whats the difference? is one of them faster? Thanks!...

WordPress thumbnail ID as thumbnail size

php,wordpress
<img class="icona" src="<?php $src = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID) , array(85, 85 ) , false, ''); echo $src[0]; ?>" /> I'm trying to get the "thumbnail" size src for the image. Instead with array(85, 85 ) I just get it with width and height tags set to 85px (but the image src can...

jPanel not showing up inside jLayeredPane

java,swing,dynamic,jpanel,jlayeredpane
I've read all the topics regarding this issue,and i can't figure out what's the problem. The following code is inside a method that gets called on button click, the buttons were dynamically generated, and yes the console output is showing, so the method is getting called. System.out.println("loaditems method"); final JPanel...

Chat Application Lobby ListView

android,android-listview
I've created a chat application GCM service and broadcast receivers and i have a Lobby which is a ListView. When user clicks plus button on the top right corner it launches a new chat window and when back button pressed it goes back to lobby creating a item that indicates...

Exclude selected options from multiple dropdowns in angularjs?

angularjs
I have five dropdowns. All five dropdowns have same source for options. An option selected in one dropdown should not appear in options of remaining dropdowns. What is best way to achieve it in angularjs? And source for ng-options is array of objects....

Is there a pre-defined built-in function to convert a number to its binary format in C++?

c++
Integer.toString(n,8) // decimal to octal Integer.toString(n,2) // decimal to binary Integer.toString(n,16) //decimal to Hex We have these functions in java ... do we have such built-in functions in c++...

Search Multiple Strings for Character Frequencies in R

r
I recently came across a data set of 10 million passwords and decided it would be interesting to manipulate it in R to see what information the data set holds. This is only my second time using R, but I managed to successfully code a few things, such as the...

Nesting quotes in Angular expression

javascript,html,angularjs
In .js files triple nested quotes ("one'two"three"'") can be escaped (see this post) and in HTML this can also be achieved using character references (see this post). I have a problem achieving this in an AngularJS expression in my template. I need to put this: {{ 'PLURAL' | translate:"{ GENDER:...

How to call DefaultTreeCellRenderer for specific nodes in the JTree

java,swing,jtree,treecellrenderer
I have a customized DefaultTreeCellRenderer that disables nodes in the JTree. Here is its code: static class CustomDefaultTreeCellRenderer extends DefaultTreeCellRenderer{ @Override public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { boolean enabled = true; // <-- here is the logic for enable/disable...

Why typing in Eclipse/PyDev editor became very slow?

eclipse,pydev
Recently, typing python code in PyDev editors became extremely slow. Slow to the point that after typing a function name I have to wait to see letters appear one after another over several seconds. Even inside comments and strings. Other editors are fine. I tried suggestions in other questions like...

Modify this node.js code to output .wav instead of .mp4?

node.js,osx,audio
I'm trying to modify the following code to output .wav instead of .mp4: node-tts text to speech synthsizer, (OS X) The issue is, I'm not a node.js developer and have no idea how to make the change, and if it is even possible. I'm attempting to speechify an app so...

Why is it not possible to place DIVs anywhere with Gridster?

javascript,jquery,html,css,gridster
I'm a little bit depressed because I need a customizable grid (moving and resizing DIVs) like Gridster, you can check the demo here: http://gridster.net/ Basically I need all the features Gridster is offering, like dragging and dropping DIVs, resizing them and saving the positions of the DIVs and loading them....

Why can't JavaScript dictionary keys start with a number using the myDict.123 syntax?

javascript,dictionary,programming-languages,language-design,identifier
Preface The answer to this question may very well be "because the creators of JavaScript decided so." Mostly I'm just curious if there's a specific reasoning behind this decision, aside from mere consistency with other identifiers/variable names and other languages. Question This is legal: var foo = { "1abc": "bar",...

JQuery addClass on scroll doesn't work

jquery,css,addclass
I have 4 buttons next to each other. What I want is when I scroll to a certain point, the 4 buttons height and width change. The button consists of 2 divs on each other so you can see only one div. When the mouse enter div, the bottom div...

Java: got an unexpected output

java
I'am learning Java and I got an unexpected output. That's the code: public class Point { protected final int x,y; private final String name; public Point(int x,int y){ this.x = x; this.y = y; name = makeName(); } protected String makeName() { return "["+x+" ,"+y+"]"; } public final String toString(){...

How to see library functions available in any Arduino library?

arduino
When I want to code about lets say zigbee library so how I will come to know that which functions are supported by zigbee object?Please help.