FAQ Database Discussion Community


Saving ref to a User login

node.js,mongoose
I'm having a trouble to write a simple User and Tweet Schemas relation. I created a middleware that will check a user token once he logged in. This is a token based authentication. The problem lies in the '/tweet' route section of how to save a tweet to a Logged...

Configuring Android Studio to use NDK (android-ndk-r10d, Windows 64-bit)

android,android-studio,android-ndk
I have an application I'm trying to compile, which uses *.c files. To compile this I must use NDK. Downloaded the 64bit version and browsed the net to find tips on configuring gradle. It seems the config is ok, and gradle attempts to run the NDK build process. It does...

Render a Wordpress page as a variable

wordpress
Is it possible to get Wordpress to render a page and return it as HTML ? I'm thinking about a function that'd look like this : $html = render_page($id); echo $html; // prints the page My goal is to have all my sections' HTML and my corresponding logic in different...

Get Max(id) from one to many table

sql-server,greatest-n-per-group
I know this question was asked many times but I was tring and trying without success I have one to many relationship between two tables and some more inner-joins to get more data. Here is my query: SELECT ShopOffer.OfferID, ShopOffer.OfferMessage, Shop.ID, Shop.Name, Shop.Phone, [User].Name, [User].UserID, ShopOfferStatus.Name AS StatusName, BlockedShopInUser.IsBlocked FROM...

angularJS interceptor: access parent controller method

javascript,angularjs
In my app i have different manipulations with http request's, for example: $scope.getArticle = function(id) { $http.get('/app/' + id, { headers: { 'Content-Type': 'application/json', } }) .success(function(response) { }) .error(function(data, status, headers, config) { }); }; $scope.displayAlert = function (message) { var modalHtml = '<div class="modal-header"><h3>Warning</h3></div>'; modalHtml += '<div class="modal-body"><strong>'...

Can an Rx Observable gracefully handle exceptions in an operator and continue?

system.reactive,reactive-programming,rx-java
i.e., by passing the error condition and not halting the entire Observable? My Observable starts with a user-supplied list of package tracking numbers from common delivery services (FedEx, UPS, DHL, etc), looks up the expected delivery date online, then returns those dates in terms of number of days from today...

Convert Excel CSV to XML format Asp.net C#

c#,asp.net,csv,xml-parsing
I am looking for a way to convert my CSV files into XML format and ultimately display the XML in an HTML table. I have found various ways on doing this on Stack Overflow. First, the technologies I'm using are: ASP.NET MVC 4.0 with WCF REST service in C#. I...

Logon failure: unknown user name or bad password - service credentials

biztalk,biztalk-2010
I have just installed Biztalk 2010 server on my machine. While configuring the server, in the service credentials, no matter what username password I provide, I get the above error. I used the username password which I use to log into my machine. Any thoughts?...

Check if a MySQL field value is equal to a certain number

php,mysql
I'm new with PHP and MySql and I've searched all over the Internet but couldn't find a proper answer. Using PHP, I need to grab a value from a single cell of a MySQL Database and check if that value is equal to 0 or to 1. If it's equal...

Express / hbs not registering partial changes unless restarted

express,gruntjs,handlebars,nodemon
So, I'm using Express, hbs, and compass for my project. I'm also running things with nodemon to pick up any *.js changes. Everything is working fine except I have to completely restart nodemon anytime I make changes to a partial. I'm going to wager this has something to do with...

Binding JSON with property of name “event” in asp.net MVC controller

c#,asp.net,asp.net-mvc,json,model-binding
How can I bind the property named "event" below with the class I have listed through an ASP.NET MVC controller action? Class public class SendGridWebhookRequest { public string email { get; set; } public int timestamp { get; set; } public string smtp_id { get; set; } } Request {...

Whole document scrolls in IE11, but not Chrome

jquery,html,css,internet-explorer
I have an HTML page that is generated from two different frameworks. I can't make huge changes to it, because of those frameworks, but I can adjust the html with jquery. Basically, I have an application that has a header, and a second reporting application that has a header (let's...

JSF 1.2 application not getting deployed on websphere 8.5

jsf,websphere,jsf-1.2,websphere-8,websphere-portal
I am trying to deploy JSF 1.2 application on WAS 8.5 server. But it is throwing below error on deployment. Note: In the WAS admin, Under JSF implementation use console, I have selected the "Sun Reference Implementation 1.2 " option . But still problem persist. [12/17/14 15:12:41:222 PST] 00000095 webapp...

loading program with irb when using rspec

ruby,rspec,irb
I am creating a simple program of blackjack with ruby. I am doing this to work on my TDD skills therefore i am using Rspec for test coverage. In order to keep the work cleaner the structure of my files is a main folder called blackjack. Within this are lib...

JavaFX maximize the size of node children

layout,javafx
I want to have squares added to a pane, and those squares maximized. One square takes up the whole pane. Two squares split the pane. Three squares make it all in thirds. When it overflows it goes to the next "row" and continues the process. All the squares should be...

How can I reload the data in a WatchKit tableview?

ios,iphone,core-data,watchkit,wkinterfacetable
I have an app for iPhone with a Tableview, whose data comes from CoreData. The same data are also displayed in a watch app: If I add a row from the iPhone app: and I reload data in the Watch app: I see the old rows empty! If the stop...

Update my content into XML-file

javascript,php,jquery,xml
I just gratefully managed to load the content of an XML-file into my php-document, like so: $(document).ready(function () { $.ajax({ type: "GET", url: "abstimmer.xml", dataType: "xml", success: function (xml) { var $lis = $(".abstimmer li"); $(xml).find('klick').each(function (index) { if (index < $lis.length) { $lis.eq(index).html($(this).text()); } }); } }) }) By...

facebook android user getUsername

android,facebook,session,user
i'm trying to get ,in my app, the username of user that is connected to facebook working on the active session in that moment. In many post I read that the method getUsername() is deprecated. Really? This is my piece of code: if(session!=null && session.isOpened()){ Log.i("LandingActivity", "session not null..."); Request.newMeRequest(session,...

Encoding a unicode string to utf-8 and getting question marks

python,unicode,utf-8
System: Python 2.7.5 , IPython 2.3.1 , OSX terminal (local), sys.stdout.encoding : 'UTF-8' (venv) toz$ locale LANG="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_CTYPE="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_ALL= – I am expecting both commands print the same but the latter prints question marks for ord(c)>128. Why is that? How can I encode this unicode...

Can someone please tell me what is wrong with the for loop

java
So I'm supposed to make a deck of cards and I'm doing it in this way. No CT error but I get IndexOutOfBound Exception. I dont know why. The class Card is already defined. The value goes up to 12 and the suit goes up to 3, inclusive. Thank you!...

Laravel Flash Data in View with Joins

laravel
I feel bad for asking this question and may receive down votes. But my mind is fried... I am trying to access flash data in my view. The flash data is an array from a query that has joined data. Usually I can just access in the view like $Flashdata->columnname;...

With the trueskill algorithm, given two players' ratings, how can I calculate the win/loss probability?

python,algorithm
I see this question come up a lot in discussions of trueskill, but I've yet to come across a conclusive answer. I'm using the Python implementation here: https://github.com/sublee/trueskill I've put together a simple simulation using that library here: https://gist.github.com/klenwell/3a15eca6b83ce575d0ca The question is submitted as the first issue for the Python...

Safari Webkit animation (Rotation) not working

css3,animation,safari,webkit
Good afternoon. Im playing around with webkit animations and somehow I can't get it to work in Safari. The animation worked in IE and Firefox but somehow not in Safari (8.0.2). Can somebody spot any mistakes ? I would be really happy if someone can help me out. Many greetings...

How to make a horizontal list start in the center of the page?

css
just a quick CSS question. Does anyone know how to display a horizontal list at the center of the div tag. The number of elements in the list can change from page to page and I was hoping for them to start in the middle of the page. For example...

Generic FunctionalInterface and type erasure

java,generics,lambda,java-8
What does the following compilation error mean? The method apply(Sample.Foo, capture#5-of ?) in the type FooSetter is not applicable for the arguments (Sample.Foo, capture#6-of ?) It occurs in the code below (at the bottom where I've indicated with a comment) which tries to map setters of one bean to the...

Implementing MultiDex results in compiling for so long, and finally heap space error

android,multidex
I have a big Android project where I got the Unable to execute dex: method ID not in [0, 0xffff]: 65536 error; I believe some of you guys have definitely gone through this issue before. This is an error due to too many methods referenced in the app. I have...

Why do I get a reference error when assigning to a variable without the var keyword?

javascript
This came up at work today. Take the following assignment, commonly used to initialize a variable. // bill is undeclared var bill = bill || []; The value assigned to bill is []. Why does this fail with a reference error when you omit the var keyword? // bill is...

What is an array linked structure or node array?

java,arrays,data-structures,arraylist,linked-list
I am a couple of java data data structure exercises. Here is the exercise I am currently doing Add an array-linked hierarchy to the overall structure. Use the following names: AbstractNodeArrayMyList, NodeArraySorted, and NodeArrayUnsorted I've already implemented abstract array list, sorted array list, unsorted array list, abstract linked list, sorted...

How do I take last n elements from nested collection

asp.net-mvc,linq,entity-framework
I am buinding a chat for an application, so when a user logs in I need to send them all 'unseen' messages, I am using entityframework, Id like to return only the last 20 unseen messages. but my query is not working, currently I get this exception Count must be...

How do I generate a `x,y` co-ordinates that is always 90 degrees either left or to the right of the current position of a UIImage?

objective-c,math,angle
How do I generate a x,y co-ordinates that is always 90 degrees either left or to the right of the current position of a UIImage? I have a location which is a random x, y in generateRandomLocation. I require to generate a new x,y which is 90 degrees to the...

Dock an element to the bottom of a div as well to the bottom of the screen

javascript,jquery,html,css,twitter-bootstrap
To be honest, I don't really know how to explain my problem. I'm trying to dock an element to the bottom of a div (which works great), but it should also dock to the bottom of the screen if the bottom of the div is below the bottom of the...

Can't convert 'bytes' object to str implictly HTML Parser Python3 Error

python,python-3.x,html-parsing,python-3.4,html-parser
I am trying to create an HTML Parser in Python 3.4.2 on a Macbook Air(OS X): plaintext.py: from html.parser import HTMLParser import urllib.request, formatter, sys website = urllib.request.urlopen("http://www.profmcmillan.com") data = website.read() website.close() format = formatter.AbstractFormatter(formatter.DumbWriter(sys.stdout)) ptext = HTMLParser(format) ptext.feed(data) ptext.close() But I get the following error: Traceback (most recent call...

SQL, 2 tables sum of a field

php,mysql
I have 2 tables, student and family. Half of the students come Sundays, the other half Saturdays Some families have more than one child. Families pay fees for the school. Some families because of some critearia have a discount. "discount" is a field in 'family' table In a report I...

Uncaught TypeError: Cannot read property 'style' of null(index):110 onclick

javascript,html
I've got a problem with my alert box. I want to design a cross for closing the box by clicking on it: <div id="alert"> <img src="cross.png" onclick="document.getElementById(alert).style.display = 'none'" width="15px" height="15px" style="float: right; margin-top: 3px; cursor:pointer;"/> <p style="margin-top: 20px;">alert text</p> </div> When I click at the cross an error appears....

Enabling Guest Payments by default in Adaptive Payments

paypal
I have a website that allows people to come and create events. I like to allow these people to charge for the events (where I take a cut). However, most of the people coming to the events may not have PayPal accounts, and so I want the default to show...

Tomcat Server Installation

apache,environment-variables
I was installing Tomcat server on my system (Windows XP). It was required to set three environment variables namely path,JAVA_HOME and CLASSPATH. But for Windows 8 , another environment variable CATALINA_HOME was required to be set. Why this difference ?...

SCNLight cast shadow in all direction

ios,scenekit
Suppose we have a room where the lamp is right in the middle of the room, both vertically and horizontally. How can it cast shadows in all directions? Is there anyway to fake it? I have objects that move. SCNLightTypeSpot can cast shadows in a cone, but that doesn't work...

InfoWindow Android - Not Working

android,google-maps,infowindow,marker
I have a google Map v2 code in Android Studio, its showing the results from an json, this part works fine, when the user click in the marker it open a InfoWindow (OK) but Id like to insert an + (plus) button that will lead to other page with the...

Not sending message, subject, or from who it is?

php,forms,email,post,contact
I made a contact form but it's not sending the message, subject, and the e-mail of the person that contacts me? Contact.php : prntscr.com/5uj9mo Index.php : prntscr.com/5uj9zt What I get actually : prntscr.com/5ujaqd Kind regards and thanks ALOT, Musa....

Send a value with action:@selector

ios,objective-c
my code : UIButton *boutonSuppr = [UIButton buttonWithType:UIButtonTypeRoundedRect]; boutonSuppr.frame = rectBoutonSuppr; [boutonSuppr setBackgroundImage: [UIImage imageNamed:@"croixTest.png"] forState:UIControlStateNormal]; [monScrollView addSubview: boutonSuppr]; int numb = 10; [boutonSuppr addTarget:self action:@selector(boutonSupprAppuye) forControlEvents:UIControlEventTouchUpInside]; My method declared : - (void)boutonSupprAppuye:(int) numero; My problem is that I need to send a parameter in the method because I have...

How to open localhost:8080 in Cloud9 IDE?

google-app-engine,go,localhost,cloud9-ide
I am developing an app engine project (golang) in Cloud9 IDE. For testing in desktop i would go to localhost:8080 in my desktop browser. In Cloud9, I tried https://workspace-username.c9.io with $PORT set as 8080, but somehow its not working for appengine project. But it is working for normal go web...

FBO + texture: strange results from offscreen generation of geometry data

c++,gpgpu,fbo,off-screen
I have 2+ pass rendering where the first stage generates the positions of the vertices of a rectangular mesh and stores them in a 2D float texture. The shaders look this way: vertex: #version 330 core out vec2 vfTexCoords; const float halfSide = 1.0f; const vec2[] pos = vec2[ 4...

Controlling a CSS Animation with Buttons

html,css,animation,scroll
I need to have scrolling images controlled by two arrows (scroll up and scroll down). I have a CSS "scrollUp" animation written as well as a "scrollDown" animation. How can I have these animations occur to the images when the arrows are clicked? I think I need to have a...

TextWrangler - move text to the end of the line

sorting,text,grep,textwrangler
I have a text file containing only text lines like this: (abc) defghjklmnop I want the whole bracket to be at the end. So it should look like this: defghjklmnop (abc) The text in the bracket and the text after it vary from line to line. How can I do...

Display HTML options based on separately selected options with Angular

javascript,angularjs,angularjs-ng-repeat
I have some data that consists of various brands, and each brand has a nested array (of strings) containing range names: [ { "brandName" : "Brand 1", "ranges" : [ "Range A1", "Range A2", "Range A3" ] }, { "brand" : "Brand 2", "ranges" : [ "Range B1", "Range B2",...

How do I apply unknown arguments to a function in Python 3.x?

python,function,arguments,apply
I'm developing my own GUI for my engine, and I've created an "object" called EwConsole (A simple "drop-down" console to input commands). In order to do that, I simply store an ID for the function to be "triggered with enter/return" as the key to the function-object itself in a dict....

Rails and queries - Custom query to get duplicated records

mysql,sql,ruby-on-rails,ruby,postgresql
For the most part I try not to write custom SQL queries with my apps but I came acros a case and I was wondering if this would be one those cases where I would be better off doing it. I'm using PostgreSQL with this specific app. I want to...

Bind a java swing gui and c++ backend for a standalone application, which form two different projects

java,c++,swing,jni
I want to bind a JAVA Swing GUI with C++ back end for a standalone application. These two form two different projects. I've read about Java Native Interface. Though JNI appears to be the best solution for this, I have few questions regarding JNI: Can JNI help me bind different...

How to set name of the column using union

mysql,sql
I making a SQL statement using union all as the following image: But the name of the column is the first name used in SQL query. How make this SQL statement without this my error? Thanks a lot!...

How to apply where cause in mysql join query to different tables

mysql,sql
I have the following mysql statement based on Mysql intersection based on single field: SELECT m1.* FROM mytable m1 INNER JOIN mytable2 m2 ON m1.history = m2.history WHERE `insert_date` >= DATE_SUB(CURDATE(), INTERVAL 3 DAY) Does the where clause applies to the first table. How do you apply the where clause...

Export a function within it's namespace?

c++,function,dll,namespaces,export
I'm fairly certain this isn't possible from what I've read, and tried. Although for ease and continuity in code I would like to ask here. Is it possible to export a function along with it's namespace container example: namespace Continuity { int Foo(void); } Standard usage would be: Continuity:Foo(); I...

IndexedDB: Can you use an array element as a key or an index?

javascript,arrays,database,html5,indexeddb
Consider the following object store, with the domain key set as the keyPath var tags = [ //codes: 0 - markdown wrap tag // 1 - HTML wrap tag // 2 - single tag { domain: "youtube", bold:["*",0], strikethrough:["-",0], italic:["_",0] }, { domain: "stackoverflow", bold:["<strong>",1], italic:["<em>",1], strikethrough:["<del>",1], superscript:["<sup>",1], subscript:["<sub>",1], heading1:["<h1>",1],...

GetListAdapter returning null in Android

android,android-listview,listactivity
I have an activity that extends ListActivity. In its onCreate method I perform below: ListView listView = (ListView) findViewById(android.R.id.list); listView.setAdapter(new InteractiveArrayAdapter(this, model)); I set a custom adapter for my listview widget defined in xml layout. My custom adapter, InterativeArrayAdapter, extends ArrayAdapter. Model is a class that I have built to...

Turn off marginal distribution axes on jointplot using seaborn package

python,matplotlib,seaborn
I like this particular plot and the ability to pass a function to the stat_func keyword to quickly plot up and visualize relationships between variables, but there's one thing. How do I 'turn off' or not plot the marginal distribution axes? It looks nice but sometime I don't want this...

typecasting with StringTokenizer [duplicate]

java,stringtokenizer,typecasting-operator
This question already has an answer here: Converting String to int in Java? 17 answers I need to convert the output of nextToken() to type int and double. The way i'm doing it currently does not work and gives me the error saying java.lang.String cannot be converted to int....

rename an internal class with Obfuscar

obfuscar
I need Obfuscar to obfuscate (rename) internal classes such as Secret1 in the following. This is a minimal WPF application with ancillary public and internal classes for exercising Obfuscar. namespace WpfApp { public enum Category { Low, High } public partial class MainWindow : Window { private ViewModel ViewModel; public...

How to get next 2 or 3 characters after specific word

java,android,bash
I have many lines like this: <mixer name="Adif2 Input Volume" value0="96" value1="96" /> <mixer name="Adif2 Input Switch" value0="1" value1="1" /> <mixer name="Voice Input Volume" value0="101" value1="96" /> <mixer name="Voice Input Switch" value0="1" value1="1" /> <mixer name="Ext Input Volume" value0="96" value1="96" />` I would like to get numbers after value0=" text...

Auth redirect isn't working. Prefix doesn't show

php,authentication,laravel,routing,prefix
Everything is working fine except when I try to open some link that requires authentication I get the wrong route. Route::group(array('prefix' => 'admin'), function(){ Route::get('login', array('as' => 'admin.login', 'uses' => 'AdminA[email protected]')); Route::post('login', array('as' => 'admin.login.post', 'uses' => '[email protected]')); Route::get('logout', array('as' => 'admin.logout', 'uses' => '[email protected]')); }); Route::group(array('prefix' => 'admin', 'before'...

Android XML Layout with imagebuttons in a row

android,xml,grid,android-imagebutton
Im trying to create a row of image buttons, so lets say 3 rows and 3 columns. I keep trying to make the images all the same size but the design just messes up. Trying to get something like this: Image Image Image Image Image Image Image Image Image Can...

Ideas to deal with “unsigned” integers in Java 8

java,annotations,java-8,unsigned
I'm working on code that is hardware and and math related and makes extensive use of unsigned integer values, 32- and 64-bit. Bugs have been steady and difficult to work through without any javac support. Java 8 added a few functions on the boxed Long class for division, mod, and...

java.lang.VerifyError: Verifier rejected class on Lollipop when using release APK

java,android,butterknife
I get this error when I install my release APK on a 5.x device. The error does not occur when I push the same code from Android Studio, or if I run it on a 4.x device. java.lang.VerifyError: Verifier rejected class com.myapp.android.ui.activity.MainActivity$$ViewInjector due to bad method void com.myapp.android.ui.activity.MainActivity$$ViewInjector.reset(com.myapp.android.ui.activity.MainActivity) (declaration of...

Conditional index in PostgreSQL

postgresql,indexing
I know from using Oracle that conditonal index with CASE statement is possible. But is it possible in PostgreSQL? For example index is following: CREATE INDEX IX_INDEXNAME ON SOME_TABLE ( CASE WHEN COLUMN1 = 0 AND COLUMN2 = 'value' THEN SOME1_ID ELSE SOME2_ID END); This is already modified version for...

BackColor property not changing properly in code. Any ideas as to what I'm doing wrong?

c#,windows,winforms
Intermediate C# dev here. Trying to transition into game programming by writing a simple Simon clone (private learning only, I do not own any copyrights or intend to distribute/sell) and I'm stuck. Here's a link to the full code thus far: Simon The problem lies in the PlayTile() method below:...

Updating pseudo-element content property when HTMLElement.dataset updates

javascript,html,css,internet-explorer,pseudo-element
I am using the CSS attr function to dynamically link the value of a data-* attribute to the content of a pseudo element: body::after { content: attr(data-after) } I am then regularly updating that data attribute via the HTMLElement.dataset property: setInterval(function () { document.body.dataset.after = new Date; }, 1000); I'm...

Check if group of checkboxes are checked but not disabled

jquery,html,checkbox
This code: if ($('[id*="cat' + cat_id + '_sk"]').is(':checked') && $('[id*="cat' + cat_id + '_sk"]').not(':disabled')) { $('[id*="cat' + cat_id + '_sk"]').prop('checked', false); } else if ($('[id*="cat' + cat_id + '_sk"]').not(':checked') && $('[id*="cat' + cat_id + '_sk"]').not(':disabled')) { $('[id*="cat' + cat_id + '_sk"]').prop('checked', 'checked'); } Seems to ignore the second part of...

Shutdown netty programmatically

java,netty,server,shutdown
I'm using netty 4.0.24.Final. I need to start/stop netty server programmatically. On starting the server, the thread gets blocked at f.channel().closeFuture().sync() Please help with some hints how to do it correctly. Below is the EchoServer that is called by the Main class. Thanks. package nettytests; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import...

How to retrieve only a predefined number of results in Azure Tables

azure,azure-table-storage
I am trying to perform an azure table query. My table (that saves logs) has thousands of rows of data, and it gets populated with more each second. Right now i have only 1 partition key, but it doesn't affect the next question. How can i get back lets say...

Sublime Text - Run projects on apache tomcat without refreshing eclipse project

javascript,editor,sublimetext3
Last night only i installed sublime text 3 and found it amazing. But i have been facing one problem with it. Before sublime i was using eclipse editor for editing code. I had created Dynamic Web Project and was running it on Apache Tomcat Server which is installed. As most...

Is there any easy way to .zip up my source code with Visual Studio 2013?

git,visual-studio-2013,zip,pkzip
When playing around creating new Visual Studio projects to try out various technologies, or a weekend project, I want an easy way to zip up my source and not worry about .pdb, obj/bin files, etc. So many years ago, I came up with a set of .bat files, one of...

ComboBox ItemTemplate triggering TargetException when selected item is removed?

c#,wpf,xaml,mvvm-light,mef
I have a WPF application (.NET 4.5) using MEF and MVVMLight. There is a shared MEF Export called "DeviceSupervisor" which holds an ObservableCollection of a custom class, DeviceConfiguration, which isnt much more than a few string properties. In the main app, you can add and remove devices to/from this collection....

Setting primefaces calendar end date after setting start date

jsf-2,primefaces,calendar,mindate
I'm using primefaces calendar for the creation of an event. With the "mindate" parameter i have disabled the days before the current day. I want to do this even with the end date, disabling the days before the start date. I don't know how to handle this, since the backing...

Dart polymer 'does not have default constructor'

templates,constructor,dart,dart-polymer
I have several templates (Polymer and Dart) working fine. But I cannot understand the Dart editor complaining in the case where I have a (my) template within another of (my) templates. I have a template for "staff" - it extends PolymerElement. I have a template for "person" - it extends...

Recursively select (with limited depth) relationships in SQLAlchemy using ORM, declarative style, and Association objects

python,postgresql,recursion,sqlalchemy,flask-sqlalchemy
Given: DIRECTIONS = db.Enum('N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW', name='directions') class Exit(BaseModel): __tablename__ = 'exits' src = db.Column(db.Integer, db.ForeignKey('room.id'), primary_key=True) dst = db.Column(db.Integer, db.ForeignKey('room.id'), primary_key=True) direction = db.Column(DIRECTIONS, primary_key=True) from_room = db.relationship('Room', foreign_keys=[dst], backref=db.backref('exits', lazy='dynamic')) to_room = db.relationship('Room', foreign_keys=[src])) Using: SqlAlchemy 0.9.8, PostgreSQL 9.3.5 How do I query...

Linker fails to find 32-bit libraries under 64-bit Mint OS when compiling with Clang

c++,linux,gcc,clang,mint
I just installed Clang 3.5 on 64-bit Mint OS (version 17). I'm trying to compile my program in 32-bit, however I'm running into problems. I have a file called test.cpp in my home directory with the following code: #include <iostream> int main() { std::cout << "Hello" << std::endl; } I...

What do three dots “./…” mean in Go command line invocations?

go
If you run Golang tests on Travis CI, it will download all of your dependencies with three dots: go get -d -v ./... && go build -v ./... What does ./... indicate or expand to there? I've done some research but it doesn't seem to be a Unix convention....

form_dropdown set_value in CodeIgniter

php,codeigniter-2
I am new in CodeIgniter and I'm using form_dropdown in CodeIgniter from the admin panel, but I'm not able to update the set_value in real Time.So maybe you can help me with this? This is my model: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Update_Pages_Model extends...

How can I change the label “Cancel” from modal segue in Apple Watch

ios,iphone,swift,watchkit,apple-watch
How to change the label appearing at the top left corner that says "Cancel" when I open a modal view... I would like it to be a button with an image.

Creating a RESTful API using Flask?

python,api,rest,flask
The Flask tutorial site here says that to create a RESTful API, you would write classes that extend restful.Resource, then add them to the API by: app = Flask(__name__) api = restful.Api(app) class HelloWorld(restful.Resource): def get(self): return {'hello': 'world'} api.add_resource(HelloWorld, '/') However, I've looked at quite a few tutorials that...

Error using ExpandoObject in ASP.NET MVC

c#,expandoobject
I have an ASP.NET MVC app. I am using the ExpandoObject in my app. Currently, I have the following block in my .cshtml file: foreach (System.Dynamic.ExpandoObject expo in ViewBag.ExpandoObjects) { <div>@filter.GetType().FullName</div> } This code works fine. In fact, it prints out System.Dynamic.ExpandoObject onto the screen like I'd expect. However, when...

How to stop centering inside a table cell?

html,css,css3
My question will become more clear with the linked JSFiddle below. I would simply like each to not be centered (height-wise) in the table cell it may be in. Here the example showing my problem: http://jsfiddle.net/qc1st2t9/ So, how can I use CSS to prevent a from being centered inside of...

Cannot connect to Compute Engine CentOS Virtual Machine

virtual-machine,google-compute-engine,centos6
I am new to Virtual Machines and CLI so please bear with me. I have a CentOS 6.5 running on Compute Engine. I ran yum update (without creating a snapshot of the previous disk - Yes I am an idiot) and not I cannot connect to the machine using the...

Error when running make for my Makefile.cpp

c++,makefile
I'm getting the error "No targets specified and no makefile found. Stop." however I'm running the "make" command for my Makefile.cpp in the same directory. So I just wanted to do a simple makefile to run my three separate files: all: g++ gameoflife.cpp functions.cpp header.hpp -o gameoflife The second line...

How to fix Dataflow unable to serialize my DoFn?

google-cloud-dataflow
When I run my Dataflow pipeline, I get the exception below complaining that my DoFn can't be serialized. How do I fix this? Here's the stack trace: Caused by: java.lang.IllegalArgumentException: unable to serialize [email protected] at com.google.cloud.dataflow.sdk.util.SerializableUtils.serializeToByteArray(SerializableUtils.java:51) at com.google.cloud.dataflow.sdk.util.SerializableUtils.ensureSerializable(SerializableUtils.java:81) at...

Anorm with Java 8 Date/Time API

scala,datetime,playframework,playframework-2.3,anorm
I try to save timestamp field to postgresql using anorm. In scala code date/time stored as instance of java.time.Instant (someTime variable) DB.withConnection() { implicit c => SQL("INSERT INTO t_table(some_time) values ({someTime})").on('someTime -> someTime) } But anorm can't work with it now (Play 2.3.7). What is the best way to make...

Is there a way to global set the platform toolset to v110 on VS 2013?

visual-studio,visual-studio-2013,msbuild,npm
I've been perusing through similar questions on stack overflow and could not find a specific or definitive enough answer to this question: I am currently using MSVS 2013 Ultimate, and have separately downloaded MS build tools 2013 as well. I am trying to install some npm modules that use the...

How to add foreign key to entity

c#,entity-framework
An error occurred while saving entities that do not expose foreign key properties for their relationships. The EntityEntries property will return null because a single entity cannot be identified as the source of the exception. I'm using EF Code first and I'm getting error above when I trying do...

Big Gaps Between HTML Elements in Grid

html,css,grid,spacing
I'm trying to create a 3 column grid for one of the pages on my website. Some of the elements span 2 columns while others only span 1 column. This has created a spacing issue for me as I'd like the elements to kind of "float" up to the closest...

Connecting git on new computer to previous repo

git,github
I have searched all over but can't seem to find the answer. I got a new computer, copied all my files from my previous machine over and want to reconnect to an existing repo on github. What is the best way to do this? I cloned the directory but that...

Stalled HTTP request (chrome) using own web server

c#,sockets,google-chrome,internet-explorer
I'm writing an embedded HTTP server for educational purposes in C# (getting more into the rfc and learning something about winsock). For now I can serve static web pages. The server itself seems to be reasonable fast with one great exception. Chrome loads my test page very slowly in comparison...

Data transfering between services, repositories and model

php,design-patterns,laravel,domain-driven-design,dto
I'm having a hard time to decide the best practice to translate data between application layers in my case between the UserService which receive an update request that contains the following : { "first_name" : "somename", "last_name" : "somename", "gender" : "male" } And the UserRepository which expect to receive...

Combining data from columns w/ a conditonal

excel
I have two columns, column O and column P, along with a new blank column Q. I want column Q to be filled with values from column P, unless the cell is blank, in which case I'd like that cell to be filled with the value from column O. I'm...

Can I use other tables in database with single model cakephp?

php,cakephp
Is there any way in cakephp where I can use (insert delete update) tables data without creating controller files and view folder. I have table user with controller usercontroller.php. Can I use one model to use (insert delete update in) other table's data instead of making individual files of controller...

ZendFramework2 Navigation with # added

navigation,zend-framework2
I'm working on a webpage in ZF2, where i need a few items in the menu using #. I'm using the build Navigation, and i need a item that would look like. http://webpage.com/blog/1#subscript At this time my menu item looks like this 'Blog' => array( 'label' => 'News', 'route' =>...

jQuery noConflict issue 1.7.0 and 1.10.2

javascript,jquery,countdown
I have tried to figure this out for 2 days now reading every post on 10 or 12 sites including this one. Can someone tell me what i did wrong here? I am calling the first jQuery library and implimenting noconflict and still the first jquery plugin will not load....

How can I push down the footer of my page so that it always wraps to the left?

html,css
I made a page that has a menu on the left, some content on the rest of the page and a footer on the bottom. Everything works perfectly if I have a big wall of text as content, because that will push the footer down and it will make the...

How do I use a function multiple times in Python?

python,function,loops,arguments,call
I am having some trouble with some code. When I use a function once calling it again doesn't appear to call the function again. credit=0 x=1 d=1 def sum1(): global x global credit while x>0: g=int(input("Press 1 to continue inputting money or press 0 to select and item")) if g==1:...

Manage different codebases using single git repository instead of submodules

git,github,chef,git-submodules
After reading this article on submodules, it seems like they exist only to link to external git repositories from within your own. However, I am expecting submodules to simply allow you to manage multiple, separate commit histories from within one repository. Is it possible to have non-external git repositories? I'd...

Desiging restful API for user resource

php,angularjs,api,rest
I am designing a restful API by using Laravel & AngularJS. I know the basic of restful API, but having trouble to figure out what will be the best way to design it for user resource. Let's guess, user can have his profile & can update profile. So, the URL...

Scrapy, Parse items data from page then follow link to get additional items data

python,callback,web-scraping,scrapy
I have a problem to scrape additional fields which are on other pages after scraped data from first page e.g: Here is my code: from scrapy.selector import HtmlXPathSelector from scrapy.http import HtmlResponse from IMDB_Frompage.items import ImdbFrompageItem from scrapy.http import Request from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor URL...

Valid XHTML: Document type does not allow element “p”; missing one of “object”

xhtml
I am trying to validate my document as XHTML 1.0 Transitional (W3C). I have the following error: Line 322, Column 3: document type does not allow element "p" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag Which corresponds to this code: <p><strong>Q: How much?</strong></p> <h2>Top Four...