FAQ Database Discussion Community


Determining if Excel cell contains array formula or text value

excel,excel-formula,array-formulas
I have a big table where one column contains a formula each row (an array formula, to be specific), which returns with a string. But some of the formulas are overwritten with a similar string value. I would like to create a conditional formatting to color the cells which are...

input strings in c and how to store the string into variable

c,string,input,c-strings
this is a really basic question but I couldn't find anything about this through google. So let's say a main functions gets passed some input strings. I am trying main(argc, const char* argv[]) { char* test = argv[1]; // works but gives error if not at beginning of function char*...

Consolidate two node scripts into one & group clients into rooms

node.js,socket.io
I have two separate node scripts which work individually (they are for dealing with realtime data feeds) I am trying to consolidate them into one script. Below is one complete script The other script is identical except it serves data for MAP.room2 using a different database & spawn script. I...

Guava ImmutableList… what exactly is backing it?

java,collections,guava
I downloaded the source code for Google Guava just out of curiosity to see what is backing the immutable collections. I was going through the ImmutableList and I noticed that it was still backed by an old-fashioned array, as in Object[] So I'm just curious, the Object[] array is probably...

Python Attribute Error for Binary Search Tree

python,binary-search-tree
I've made a tree with: mytree[3]="red" mytree[4]="blue" mytree[6]="yellow" mytree[2]="at". But if I try to delete the root node, 3, with mytree.delete(3), I get an AttributeError. 'TreeNode' object has no attribute 'findSuccessor'. Any idea why this happens? class TreeNode: def __init__(self,key,val,left=None,right=None,parent=None): self.key = key self.payload = val self.leftChild = left self.rightChild...

Semantic-UI Transistioning from mobile to tablet displays with the sidebar open

jquery,html,css,responsive-design,semantic-ui
This is my html where I have a pointing menu when the screen width is over 630px and a sidebar with a menu button when the screen width is less than 630px: <nav class="ui inverted sidebar menu vertical slide out" id="m_menu"> <a href="index.php" class="item"> <i class="home icon"></i>Home </a> <a href="about.php"...

Why does overflow-x add padding to my divs?

html,css,overflow
I have a setup where I have a block-display div containing inline-block-display divs in a horizontal fashion. However, if the screen is narrow, I don't want text overflowing in each div as to disrupt the div to its right. However, when I add overflow-x: hidden to my inline-blocks, it adds...

Use the attr() function inside a new plugin?

javascript,jquery,html,css
I want to know if it's possible to use the attr() function inside a new plugin : (function ($) { $.fn.resetColor = function() { var oldColor=this.attr("memColor"); this.css('background-color',oldColor); }; })(jQuery); I've tried the code above but it doesn't work. I'm sure the memColor attribute exists because I've tested it with an...

Logging JSON values using $.each

javascript,jquery,json
So I have a JSON feed and i'm simply trying to print out some values. My Javascript below sort of works. But it doesn't look very 'correct'. Is there a better way of doing this please? JSON { "info":[ { "lon":-2.1, "lat":55.2 }, { "lon":-2.12, "lat":55.23 } ] } JavaScript...

Google Scripts Sheets hide/ unhide

google-apps-script,google-spreadsheet
In writing a 'custom function' Google Script for my particular sheet, I simply want to hide a column: function hideColumn(index) { // get active spreadsheet var ss = SpreadsheetApp.getActiveSpreadsheet(); // get first sheet var sheet = ss.getSheets()[0]; sheet.hideColumns(index); } This code works fine when I run it from within the...

Using Knockout push in a function returns an error

javascript,knockout.js,requirejs
In this example, I'm using knockout with require.js. Outside Main.roll(), Main.result.push works as expected. Inside the function, it throw an error: Uncaught TypeError: Cannot read property 'apply' of undefined. I can still access Main.result() in the function. I can set values to it, but I can't use .push for some...

Trouble getting view to line up correctly

java,android
When I press my add button a view is shown and should be directly below the add button. However when I click the button there is some space between the add button and the view added. I have tried setting the gravity to top in the xml and java file....

Functions keeps returning the same value

c++,vector
I have really weird problem with my function. I am trying to loop through the vector with a type of my struct vector<address> which is built from x and y. The size is always known, nothing is being erased. What I am trying to do is with given x and...

Google App Engine Login vs Application Login

google-app-engine
I have an application deployed on GAE. It allows users to register for an account, and I use the google user id as the primary key to link to their account. I have a registration link that should be visible if either the user has not been authenticated by google...

How can I pixelate a 1d array

c++,arrays,image,image-processing
I want to pixelate an image stored in a 1d array, although i am not sure how to do it, this is what i have comeup with so far... the value of pixelation is currently 3 for testing purposes. currently it just creates a section of randomly coloured pixels along...

Use LinkedHashMap to implement LRU cache

java,insert,linkedhashmap,lru
I was trying to implement a LRU cache using LinkedHashMap. In the documentation of LinkedHashMap (http://docs.oracle.com/javase/7/docs/api/java/util/LinkedHashMap.html), it says: Note that insertion order is not affected if a key is re-inserted into the map. But when I do the following puts public class LRUCache<K, V> extends LinkedHashMap<K, V> { private int...

Play music file using Batch?

batch-file,audio,cmd
I am very confused as to how one would go about this. I want to use Batch to start an .mp3 file and while typing start file.mp3 plays the file, it opens the Media Player to do so. How would I play a music file in the background, but also...

Loop through all files in a directory and its sub directory using Unix

unix,hadoop
I have to loop through all files in a directory using Unix and find out the files that are created from a timerange.This is the command I am trying . But somehow that does't list out all files in the directory. `hadoop fs -ls $a$slash$star | awk '$6FS$7 >= "2014-12-11...

Why does 2to3 change mydict.keys() to list(mydict.keys())?

python,python-3.x,2to3
I'm looking at an output from 2to3 that includes this change: - for file_prefix in output.keys(): + for file_prefix in list(output.keys()): where output is a dictionary. What is the significance of this change? Why does 2to3 do this? How does this change make the code Python 3 compatible?...

Visual Studio how to ifstream in debugging mode

debugging,visual-studio-2013
I'm trying to open a stream in debugging mode with visual studio but the following piece of code throw an exception meaning that it failed to open : ifstream test ("./file"); if (!test){ throw runtime_error("failed"); } So how can I make it work ?...

I think my local variable isn't being updated

python,python-3.x
I'm writing a function that should return True if the parameter is a leap year and False if it isn't, but for some reason it returns True no matter what integer value gets passed. Since the local variable that it returns is initialised to True, I suspect the issue might...

Flot Pie Chart - Breaking on 1 data item

javascript,jquery,graph,flot
I am having a strange issue with trying to get my Flot pie charts to show up when there is only one data item, or only one data-item that has a non-zero value. Everything works fine with multiple data items, however when there is only one non-zero item left (where...

Eclipse will not debug play project

eclipse,playframework,typesafe-activator
I am trying to debug a Play Application in eclipse. When I try to run, eclipse gives an error stating that it timed out at packet 308. Activator constantly outputs: Debugger failed to attach: handshake failed - received >GET / HTTP/1.1< - expect ed >JDWP-Handshake< What is messing up? Eclipse...

render_to_string() got multiple values for argument 'context_instance'

django,django-views
I am trying to pass the following argument to a render to response syntax in django but i keep getting the following error: render_to_string() got multiple values for argument 'context_instance' Tried different solutions but still not getting it right. Any help? views.py: @login_required def articles(request, everyone=True): events = post.objects.filter() if...

Trouble w/ Form Processing using jQuery + PHP

javascript,php,jquery,forms
I'm having the hardest time getting a simple form to process using jQuery and PHP. I've tried getting the data via $_POST, $_GET, and $_REQUEST but I guess I'm missing a simple line of code or a complete process altogether. app.js $(document).ready(function() { $('#sucMsg').hide(); $('#errMsg').hide(); $('form').on('submit', function(event) { event.preventDefault(); var...

RelativeLayout in ArrayAdapter adds a line in bottom

android,android-layout,android-listview,android-arrayadapter,android-relativelayout
I'm using a relative layout in custom arrayadapter to show images plus text ans some buttons. When i test the app see a space between those layout: Can you please see what's causing this? Here is a screenshot: Here is the xml: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ProgressBar...

Can't see or scroll to items in ScrollViewer

c#,user-interface,uiscrollview
Ok so I have a grid that holds the menubar then in that grid I have a scrollviewer that holds another grid. If I put lets say a label on the most inner grid (one with scrollviewer) out of view all down vertically the scrollviewer cannot scroll so I can...

Can't render triangle in OpenGL C++

c++,c,opengl
I've tried to follow this tutorial for OpenGL in C but when it comes to the second tutorial, the one that is supposed to draw a triangle on the window, I couldn't see anything. So this is what I did, I took the code that creates the OpenGL context, window...

List-style-type does not remove dot

html,css
I am trying to style my drupal site, and am working my way through the site (beginning with the main menu)... But I am running into problems. It won't allow me to remove the dots made by <ul> using list-style-type: none; <nav> <div class="region region-navigation"> <div id="block-system-main-menu" class="block block-system block-menu">...

How to create a list with strings and integers as its elements?

python,string,input,type-conversion
This sounds so simple, but I cannot find anything on how to do this on the internet. I've gone through documentation but that didn't help me. I have to get inputs from the user to create a list. This is what I am using right now. t = raw_input("Enter list...

MYSQL LAST_INSERT_ID not working as intended. How do I fix?

java,mysql,procedure
I wrote MySQL StoredProcedure to create and return new ID for each table value, however, it gets wrong value on last_insert_id() from MySQL WorkBench and Java application. This procedure will be called from multiple sessions. CALL `GET_NEW_ID`('test', @test); select @test; It gives me "141215000000" and this means last_insert_id() returns 0...

Polymorphism with generics on the repository pattern

c#,asp.net-mvc,generics,design-patterns,repository
I have a problem using the Repository pattern in C# especially when I try to implement a Façade pattern too. My concept follows: When I first started the generic repository, I began with one which has all the CRUD operations in a single file (and their related interfaces in a...

What is the meaning of the “WAMP/vhosts” folder in Wamp 2.5?

wamp,virtualhost,wampserver,vhosts
I was using WAMP 2.0 for a long long time, but today I decided upgrate it to the new release version (2.5). I know that the "v-host" are te virtual hosts for Apache, but, on the older version of WAMP, we had to configure the VirtualHosts on /bin/apache/xxxx/config/extra/vhost.config (or something...

Is there a way to draw 3D lines as a series of circles with matplotlib?

python,matplotlib
I'm using matplotlib to preview the carving path for my CNC router. The path is a series of X, Y, and Z coordinates describing where the router bit moves. I'm rendering the path as a series of line segments, but this is inaccurate because of the router's circular bit. For...

write the integer value of a file descriptor to a file

c,unix
Just testing out file descriptors. My aim is to open up a file stream with fopen and using fprintf write the file descriptors integer value back into the file to see what results im getting. (I decided using fopen, fprintf etc) as it allowed me to write in variables, write()...

How to model java class after nested Json response

java,json,parsing,gson,restful-authentication
How can I model a java object after a nested json response. I'm trying to use GSON library from google in order to parse this response, so I want to go from json string to java Example Json response { "iamTicket": { "ticket": "W1-104-Q36w4qw0hdklirrgtuioqbp", "userId": "13748569064", "userIdPseudonym": null, "agentId": "839298462",...

AngularJS > Cycle through JSON files using Next, Previous buttons

json,angularjs
I have a portfolio site, where MAIN shows a list of projects from projects.json, then each project has its own page workTemplate.html, pulling in data from a titleX.json file. Main project list (click) --> Title.json (each page) [previous /next button] --> another Tile.json How would I cycle through each work...

Why doesn't maven property ${appengine.app.version} get interpolated in multi-module project?

java,google-app-engine,maven
I'm trying to get a multi-module Google App Engine project to build with Maven. I have two modules and everything builds fine. But I get the stack trace below when I go into the admin console to look at the modules (i.e. by going to http://localhost:8080/_ah/admin/modules while running mvn appengine:devserver):...

Accessing data from Wikidata json file

json
I'm trying to access the following properties from the Wikidata API: id, url, aliases, description and label but so far have been unsuccessful. I'm sure I'm making basic mistakes and so far only have the following code. Any suggestions as to the best way to access this data is much...

Dynamic javascript jSon built form not submitting through ajax - Phonegap [closed]

javascript,jquery,ajax,json
I am attempting my first Phonegap app - and my first AJAX calls. I have an xmlhttp request returning JSON provided by ColdFusion. It dynamically builds a form. This works great. But when I try to submit that form via AJAX - for an onscreen refresh, it doesn't work. Either...

Stop alloy analyser from within alloy IDE when the provided scop is large

alloy
How to stop alloy analyzer when because of a large scope in run command, it stops responding.

How to convert time object into total minutes python

python,python-2.7,datetime
I have objects of the form '00:00:00.0000000' from which I simply want to extract a float number of minutes. From import time I so far have this: >>> reformat = time.strptime('00:05:36.0100000', '%H:%M:%S.%f0') >>> print reformat time.struct_time(tm_year=1900, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=5, tm_sec=36, tm_wday=0, tm_yday=1, tm_isdst=-1) It seems like this should follow...

Sql delete value from database

sql
I have a table main with an id and sec_id. I have the sec_id and I need the id to delete something from the db. DELETE FROM main WHERE id = (get all elements where sec_id is the same) ...

ORA-00917: Missing Comma SQL Oracle error

sql,oracle
I am using Oracle SQL and have just altered a table and added a column named Date_Employed ALTER TABLE Employees ADD Date_Employed date; My problem is that whenever I try to insert a value into the Date_Employed column i get an error ORA-00917: Missing comma when I type in the...

Font anomaly in FLTK Hello World

c++,fonts,fltk
I am trying to start learning how to use the FLTK GUI tool kit to make a basic text editor and I'm having a problem with this simple Hello World from the documentation tutorial. #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_Box.H> int main(int argc, char **argv) { Fl_Window *window = new...

Get index of the struct array which holds the smallest value

c++,winapi
Edit: I appreciate the answers very much! So imagine we have a struct like this struct BadQuestion { float a; float b; } BadArray[10]; On a typical day float a will look like following { 0, 152.52, 25.26, 5.166, 263.25, 256.256, 452.25, 0, 0, 0 } Now I need to...

Random Array Error [closed]

java
Why does the program show java.lang.ArrayIndexOutOfBoundsException: 11? The program needs to print 11 numbers. 9 numbers should be random. It prints 11 numbers but it has an error. public class Main { public static void main(String[] args) { Random random = new Random(); int[] Cnum = new int[11]; Cnum[0]=0; Cnum[1]=9;...

PHP Math with an array [closed]

php,arrays,math,while-loop
I'm trying to code a function that will add up the earnings of the day. Here's my query SELECT company_profit FROM run_sheet_log WHERE company_id = 1 AND created_date >= $today AND created_date < $next_day" Now here is my issue, when I fetch the array how would I get the array...

looping through a string with foreach

c#,string,types,foreach,for-in-loop
Okay, so basically I have a string that looks like this: var output = "475183602"; and I want to loop through each character in the string. I currently have this: foreach (char num in output) { StringBuilder.appendFormat("<p value=\"{0}\"></p>",num); } But when I debug, set breakpoints and check the num it...

Pygame Class and __init__ [closed]

python,initialization,pygame
I'm making a game with levels. Would this be the correct way to make a level in pygame with the methods below. Is there a better way to make it? class Level(): def __init__(self,lesson, word,letter): self.lesson = lesson if self.lesson == 1: self.word = 1 self.letter = 'J' if self.lesson...

Gremlin simplePath() not working in a loop

graph-databases,titan,gremlin
I'm trying to write a DAG traversal accounting for the possibility that the there actually might be cycles (bad data, etc.). So on the toy graph: gg = TinkerGraphFactory.createTinkerGraph() gg.v(2).addEdge('knows', gg.v(4)) gg.v(4).addEdge('knows', gg.v(3)) I do this: gg.v(1).as('x').out('knows').loop('x'){it.object.out('knows').hasNext()}{true} And get expected result: ==>v[2] ==>v[4] ==>v[3] Now I add a cycle: gg.v(3).addEdge('knows',...

How to animate every element in equal speed in jQuery?

javascript,jquery,animation
I have simple animation. $(element).animate({ left: rand_value() + "px" }, 5000, "linear"); But there is one little-big problem. Animation duration is 5 seconds from point A to point B. But I want to animate every element with equal speed from point A to point B without dependences from time. And...

javascript animation, a img move in the screen and every time when they touch the screen limit, they turn direction [closed]

javascript
Hey guys i have been tried to made a code to move a image in the window, the img will keep moving to a same direction until it hits the screen limit, and them it will change the direct in order to keep moving, The code i have been made...

Bind Query Results To Combo Box

c#,winforms,combobox
This is what I have, and it is not producing any errors, but the combo box is not displaying the results of my SQL statement either? This doesn't produce any error, but my combo box gets populated with System.Data.DataRowView SqlDataAdapter adapter = new SqlDataAdapter(); DataSet ds = new DataSet(); string...

Jquery select parent parent sibling [closed]

jquery
I want to select parent sibbling. However my Jquery is not working properly although it does not contain any faults. On click class BLC4 display Modal (in class boxmo). HTML : <div id="bodypro"> <div class="product pro"> <img class="product-img pro" src="imagessc/fxynxo1413781254438.jpg"> <div class="product-actions pro"> <div class="nav titlen pro" style="margin-top: 0%;">RAJFOO Gaming...

C - undefined reference to “sqrt” even with '-lm'

c,gcc,ld,math.h
I try to compile a library in C that need "math.h", here is the begining of the .c file: #include <stdio.h> #include <stdlib.h> #include <math.h> #include <time.h> #include "sparse_matrix.h" ... and I compile with this command: gcc -c ./sparse_matrix.c -o sparse_matrix.o -lm -Wall -pedantic -std=c99 -g -O But even with...

Swift Remove Tab Bar Programmatically

ios,swift,uitabbarcontroller,segue
The main navigation for my iOS 8 app is a tab bar with 3 tabs. I also have a login screen that is a UIViewController that should not have tabs at the bottom. I only ever access the login screen programmatically from the normal flow if I detect that a...

Pressing FBLikeControl displays blank page and returns to app

ios,facebook-like,facebook-ios-sdk
I have integrated Facebook's native Like Button control in my iOS app with the following lines: FBLikeControl *likeControl = [[FBLikeControl alloc] init]; likeControl.objectID = @"http://www.facebook.com/<mypage>"; // .. add likeControl to view hierarchy .. The button appears fine and works some of the time. That is, when you press it it...

Converting from one struct to another

swift,struct,scenekit
I am converting some Objective-C code to Swift code and I have the following problem: The objective-C code is SCNNode *textNode = [SCNNode nodeWithGeometry:text]; textNode.transform = CATransform3DInvert(self.chartNode.worldTransform); This is the converted code I tried: let textNode = SCNNode(geometry: text) textNode.transform = CATransform3DInvert(self.chartNode.worldTransform) However, I get an error: 'SCNMatrix4 is not...

make clean results in no target with specific makefile name

c++,gcc,makefile,g++
I have many makefiles under the same project directory. The Makefile_prune: OBJS = main.o SOURCE = main.cpp HEADER = Division_Euclidean_space.h Find_diameter.h Find_k_max.h Householder.h IO.h Mean_variance.h Point.h Random_generator.h Random_kd_forest.h Tree.h OUT = rkd CC = g++ FLAGS = -std=c++0x -O3 -c -Wall # -c flag generates object code for separate files...

Pyramid: LookupError: Entry point 'main' not found in egg 'XXX'

pyramid
I'm trying to set up a Pyramid starter app on a mod wsgi server. I have followed other's examples with the code below. However I'm getting the error: LookupError: Entry point 'main' not found in egg 'Pyramid_starter' Any advice on what I am doing wrong? I have ran the below...

PyQt Connect to KeyPressEvent

python,pyqt4
Certain widgets will allow me to do: self.widget.clicked.connect(on_click) but doing: self.widget.keyPressEvent.connect(on_key) will fail saying that the object has no attribute 'connect'. I know that sub-classing the widget and re-implementing the keyPressEvent method will allow me to respond to the event. But how can I .connect() to the keyboard event thereafter,...

jQuery dynamic table formatting differently with different positions on leading tags

jquery,html
I've got a simple table that's dynamically printed on the page after a button click (reads a JS array). <input type="submit" id = "marimc2013" class="campbutton" value="Click"> <div id="searcharea"></div> function getArray(video) { if (searchQuery === video[4]) { if (video[6] === 1) $('#searcharea').append('<tr><td><h4>Masterclass ' + video[5] + '</h4></td></tr><tr><td>' + video[0] + '</td><td><h3>Composer:...

count number of sublist that contain 3 common elements in Python 3

python,list,count,nested-lists,sublist
I am using Python 3.4 and Wing Personal in Windows 7. I have a list of a list of ints and a second list that contains 3 ints. I would like to identify how many times all 3 elements of list [b] appear in list [a]. a=[[1, 6, 11,12, 14,...

How to find all numeric columns in data

r
I'm trying to find all names of columns that only have numeric data in them. For this I'm making use of is.numeric and applying it over my data like this: > sapply(ds[vars], is.numeric) MinTemp MaxTemp Rainfall Evaporation Sunshine WindGustDir WindGustSpeed WindDir9am WindDir3pm WindSpeed9am TRUE TRUE TRUE TRUE TRUE FALSE TRUE...

MSBuild timestamp issue with incremental build

c#,msbuild,t4
I have a C# class library project that references another class library project (EdmResources references Framework). EdmResources only contains a T4 template which is always executed when the project builds, to compile and write out EDMX files for Entity Framework. The EdmResources project always builds, regardless of whether the Framework...

Evaluate double integrals using Simpsons composite rule [closed]

c++,integral,numerical-integration
I have previously created this code to evaluate an integral using Simpsons composite rule, and now need to modify it to evaluate double integrals. Does anyone have any idea how to go about this? I would be grateful for any help.. #include <iostream> #include <cmath> using namespace std; float f(float...

how to get the difference of two points in a 2D array

c++,multidimensional-array,difference
#include <iostream> using namespace std; int main (int argc, char ** argv) { int c; int distance=0; int largestdistance=0; int sum=0; cin >> c; int point[c][2]; for (int i=0; i<c; i++){ for (int j=0; j<2; j++){ cin >> point[i][j]; } } cout << point[2][0] << " "; for (int i=0;...

A reference to a higher version or incompatible assembly cannot be added to the project

c#,windows-phone-7,visual-studio-2012,dll
I created new Windows Phone 7.1 project in Visual Studio 2012 Ultimate. I have Windows Phone 8 SDK (and I am using Windows 8.1 Pro). I am trying to add AdMob.dll (from Google) which I downloaded today (version 6.5.13). When I try to add this dll to the project, I...

URL replacement for Javascript code in ColdFusion

coldfusion
I have inherited a external page where I have no control: I have javascript sorting on that page: like http://www.exampledomain.com/javascript:void(1); Now it has many links like this, the 1 you see is dynamic, what I want to is: convert this code to ColdFusion URL like http://www.exampledomain.com/sor=1&sort=asc & desc. The 1...

What does this declaration typedef void foo(); mean? [closed]

c,typedef,variable-declaration,function-declaration
I don't understand the meaning of typedef void interrupt_handler();. Could someone explain it with some examples? typedef void interrupt_handler(); ...

How to split the following string

java,arrays,regex,string,split
I'm trying to split a string of the following format: Drops 3:6-9 and store them in separate data types one for Drops, one for 3, and another for 6-9 how could I do this? So far I have: Scanner s = new Scanner(System.in); System.out.println("Enter the name, number, and between which...

Facebook Error (#200) The user hasn't authorized the application to perform this action

c#,facebook
I have the following: // my facebook page var pageId = facebookPageId; var app = new FacebookClient(); dynamic fbResult = app.Get("oauth/access_token", new { client_id = facebookAppId, client_secret = facebookAppSecret, grant_type = "client_credentials" }); app.AccessToken = fbResult.access_token; dynamic messagePost = new ExpandoObject(); messagePost.access_token = app.AccessToken; messagePost.link = "www.google.com"; messagePost.name = "some...

div going beneath instead of to the side

html,css
I am trying to make 4 columns side by side, but the middle two are slightly shorter and have a single div underneath both of them. See image here: http://postimg.org/image/rw67rh5zf/ I'm sure it's something simple I'm screwing up but I can't tell what it is. All the other posts on...

Why doesn't DialogFragment.dismiss kill the dialog right away?

java,android,dialog,android-dialog,android-dialogfragment
I am building a very basic vocabulary application. The feature I am trying to implement right now is a go to feature, that is taking the user to a specific vocab term. i am doing this by prompting the user with a dialog fragment that asks the user for a...

mysql filtering results with subquery results

php,mysql,filter,subquery
i have two tables: titles id title entry id entry title_id user_id time (timestamp) i need to check if any new entry is submitted after my last entry at that title. looking for a query which filters the updates (different from my user_id) on each title and list the result...

how to get Python logging messages to appear for modules using custom handler

python,logging,module,handler
I'm trying to use/write a custom Python logging handler. When I use it, logging appears for my main code, but not for a module it uses. I just can't figure how to get the logging for the module mylib to appear and would welcome assistance. I'm sure I'm just doing...

Finding K-nearest Neighbour with Matlab

matlab,machine-learning,knn
I am working on classifying simple data using KNN with Euclidean distance, I have seen an example on what i would like to do that is done with the Matlab `knnsearch' function below; load fisheriris x = meas(:,3:4); gscatter(x(:,1),x(:,2),species) newpoint = [5 1.45]; [n,d] = knnsearch(x,newpoint,'k',10); line(x(n,1),x(n,2),'color',[.5 .5 .5],'marker','o','linestyle','none','markersize',10) The...

Amcharts is not displayed in modal popup

jquery,asp.net,twitter-bootstrap,amcharts
I am using bootstrap in my web application. when i click Large Modal Button, bootstrap modal showing but AMcharts is not showing. In the modal i have defined chartdiv and trying to load trend chart from amcharts(http://www.amcharts.com/demos/trend-lines/) why chart is not showing? <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPageAMcharts.aspx.cs" Inherits="BootStrapApp.TestPageAMcharts"...

Every new line add a numbered list UITextView

ios,objective-c,uitextview
I'm trying to add a number to the beginning of each row whenever the user enters a newline. I'd like the numbers to go in order (like in an ordered list), but with my current code, if the user does not add a new line at the end but instead...

Check Battery Level iOS Swift [closed]

ios,swift
I just started Swift and I have been looking for a way to check the battery level. I found this resource and have been playing around with it but for some reason can't seem to get it to work. I wasn't quite sure how to go about fixing this. Any...

Average result line in plot

plot,netlogo
In my model I have set a plot, i did it, at the end of the whole run of the model in this plot has to be average horizontal line for my trades which took place among my agents (sellers and buyers). How have I to write in plot pen?...

Filter GetFiles() on multiple criteria

vb.net,directoryinfo
Wasn't sure how to word my question title. but hopefully this will be quick. I have a bunch of PDF files within a folder, I want to get the recent modified or created date of a certain type of file. My code works but it gives me results of all...

mySQL combining data from tables query

php,mysql
Just doing some mySQL problems and have figured out all but the very last one (of course). I have two tables. The Question asked is "Write a query to return a list of all authors who live in the same city as any publisher." Apologies as I'm not allowed to...

String to Object but not Object to String?

java
this might be a trivial question but I can't really understand why this line of code doesn't compile: String str = new Object(); while the following does: Object o = new String("Hello"); To my understand, String, like every other class, extends Object. So why doesn't the first line compile? Thanks...

Determine types from a variadic function's arguments in C

printf,variadic-functions,va-arg
I'd like a step by step explanation on how to parse the arguments of a variadic function so that when calling va_arg(ap, TYPE); I pass the correct data TYPE of the argument being passed. Currently I'm trying to code printf. I am only looking for an explanation preferably with simple...

Yii2 ActiveForm fields options does not work

php,yii2
According to the official tutorial of Yii2. I have created a view for the entry form: <?php use yii\helpers\Html; use yii\widgets\ActiveForm; ?> <?php $form = ActiveForm::begin(); ?> <!-- GET Attention for the next Line --> <?= $form->field($model, 'name')->label('Your Name'); ?> <?= $form->field($model, 'email'); ?> <div class="form-group"> <?= Html::submitButton('Send!', ['class' =>...

c - Write directly to disk, bypass page cache?

c,caching,flush,disk
I am trying to determine a way to time a write to disk as accurately as possible. Calling the write() function writes the file first to the page cache, and then later the system automatically flushes it to disk (if my understanding is correct). Is there a way to bypass...

Difference between Semantic Web and NLP?

nlp,terminology,semantics,semantic-web
What exactly is the difference between Semantic Web and Natural Language Processing? Is Semantic Web a part of Natural Language Processing?...

Loading a UIView within UITableViewCell

ios,objective-c,uitableview
I am having an interesting problem creating the custom tableview I need... I found this question, but it does not really address my issue... I am trying to put a subclassed UIView inside a subclassed UITableViewCell. The custom view holds a UIButton and a couple labels. Simplified, it's like this:...

Return random set of rows from a REGEXP query

mysql,sql,regex,random
I am trying to write a MySQL query that returns a set of random rows based on a REGEXP search on a set of cities. ie... SELECT * FROM master_rets_table WHERE property_type = "Residential" and city REGEXP "(JUNO BEACH|palm beach gardens|jupiter|WEST PALM BEACH)" and listing_price > 200000 and listing_price <...

Using Grunt to Replace Text in a File

node.js,gruntjs
I'm trying to get Grunt to replace a path reference and I'm not sure what I'm doing wrong. This looks like it should work. Essentially, I'm copying a Bootstrap file up a directory and changing the @import paths, so I'm just trying to replace 'bootstrap/' with the new destination path...

Turn a datetime into days in python [closed]

python,datetime,days
I want to take in a string that is a date (ex. "2002-3-14") and turn it into total days since January 1st 1 AD (ex. 730,924). How would I do this in python 2.7? Is there a way to convert the datetime to a timedelta?

Updating data in sql from jtable

java,sql,syntax,sql-update
My last questions/problems are solved thank you for the advice. In which, I have another problem encountered says: java.lang.ArrayIndexOutOfBoundsException:-1 My code in updating is when click from a jtable it will be shown in a textfield, my code: > try{ > DefaultTableModel model= (DefaultTableModel)tbl_stud.getModel(); > model.fireTableDataChanged(); > int row=tbl_stud.getSelectedRow(); >...

Stubbing ActiveRecord result aliases

ruby-on-rails,rspec,rails-activerecord,factory-girl,rails-geocoder
I'm trying to stub an alias introduced to each ActiveRecord result by the Geocoder gem. I am using Factory Girl to mock records. In my controller I am using the near method to find some nearby venues. I am mocking the near method and returning results created by Factory girl:...

is this a infinite dimensional list

python,list,infinity
Does this code create and infinitely deep list? foo = ['Hello'] bar = [foo]*100 foo[0] = bar print foo print foo[0] == foo print foo == bar Because that is what it seems like, but how is it not taking up infinite amounts of memory then, everything is still running...

Obtain an array from an Object

c#,arrays,class,object
I have the following class definition. public class people { public string first_name { get; set; } public string last_name { get; set; } public DateTime date_of_birth { get; set; } } I've then created an array of people as follows: people[] the_people = new people[3]; the_people[0].first_name="Tony"; the_people[0].last_name="Carrot"; the_people[0].date_of_birth=new DateTime(1959-03-16);...

Imageview to fit layout with border and rounded corners

android,android-layout
I was wondering if you could help me with something. I have a relative layout with an imageview at the top. Around the relative layout I have a border (layout_bg.xml). As you can see from the image I attached, the border doesn't continue around the image, which is what I...

Creating and working with list of lists of lists: in Python [duplicate]

python,list,containers
This question already has an answer here: Python list of lists, changes reflected across sublists unexpectedly 7 answers I'm new with Python and for some needs I am trying to figure out how to work with list of lists of lists. Here's what am I doing: segment_coef = [[list()]*4]*17...

Declaring a static pointer to an inner class object in a template

templates,c++11,inner-classes,static-members
I'm trying to create a simple template binary search tree for practice, and I currently have something like the following in a header file: template <class T_Satellite, class T_Key> class bst { struct bst_node; static const bst_node* nullnode; } My problem currently stems from trying to define nullnode in the...