FAQ Database Discussion Community


html anchors with whole div as link

html,anchor
I have a div which contains some text (icon font icon), and a paragraph that shows what the icon means underneath. I want to link the whole thing to an anchor on my page, but so far it's not working. First time using anchors following this tutorial, and can't figure...

Module not getting injected in another module

angularjs,dependency-injection,angularjs-module
I am trying to inject a module as a dependency of another module. Here's my code for that - USER.JS - 'use strict' var module = angular.module('startUp', ['ngMaterial', 'ngRoute', 'signUpModule']); module.controller('myController', function($scope) { }); module.config(['$mdThemingProvider','$routeProvider', function($mdThemingProvider, $routeProvider){ // Configure a dark theme with primary foreground yellow $mdThemingProvider.theme('default') .primaryPalette('teal') .accentPalette('brown') .dark();...

Can't remove properties java

java,properties
I'm trying to delete users(key) and passwords(key value) in a properties file, but after removing them, I can still "log in" using the username. My code for deleting the properties is: FileReader fileReader = new FileReader("File.properties"); properties.load(fileReader); properties.remove(username); fileReader.close(); FileWriter fileWriter = new FileWriter("File.properties", true); properties.store(fileWriter, "Updated"); System.out.println(username + properties.getProperty(username));...

Writing a background program with command line interaction [closed]

c++,linux,shell,command-line,background
I'm just playing around and want to write a c++ program that monitors my CPU temperature, (i know there is no need to do it, i know i can get that info without writing a program). I'm willing to design the whole thing as a background process in linux and...

Enabling Mink Extension in Behat

bdd,behat,mink
I'm trying to add the Mink extension to Behat. I've installed Behat, Mink and Mink-Extension through composer. However, now I'm having trouble with enabling the extension. Here is my behat.yml: default: extensions: Behat\MinkExtension\Extension: base_url: http://en.wikipedia.org goutte: ~ selenium2: ~ Here is my example test: Feature: New In order to test...

Can a container with STATUS “Exited (-1)” be fixed?

docker
As a result I can't seem to start it or attach to it: $ sudo docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 17d34ecd8c24 ubuntu:latest "bash" 2 hours ago Exited (-1) 27 minutes ago fervent_kowalevski ... $ sudo docker start 17d34ecd8c24 Error response from daemon: Cannot start...

SQL Query between tables

mysql,sql
I was wondering if it is possible with SQL to make a query that gets the output of the TABLE A and use it as a SQL query for Table 2? Let me explain myself bij using some code. First i got the following table (TABLE A): ID TIMESTAMP --------------------------------...

Suppressing verbs in Outbound Message in WCF-WebHttp Transport

rest,biztalk,msdn,biztalk-2013
I'm practicing the tutorial here - Invoking REST Interface using BizTalk Server In that page, the step 3(e) indicates to provide GET as the verb to be suppressed in the outbound message for the property - Suppress Body for Verbs. The explanation given is not clear to me. As an...

Intellij's scala console not working

scala,intellij-idea
I just updated my IntelliJ and scala plugin and now the scala console won't work (i.e. Ctrl+Enter has no affect). Intellij version: 14.1.1 Scala plugin version 1.4.15...

Add event listener to dropdown list dynamically in code behind

asp.net,vb.net
I am updating an ASP.NET web site the Framework is 2.0. It is written in VB. I create a dropdown list and populate it dynamically. That is working. I need to add an event, onselectchange() to the dropdown. This event will change menu items. This is the method creates the...

Matlab audioread doubles instead of singles

matlab,audio,reshape,sampling
I have the following code at the moment: [y,fs] = audioread('some_audio_file.wav'); y is a <8131546 x 2 double>. Why is that? How come the samples are not a 1 x 8131546? Also when I reshape y to get columns of 30 milliseconds I get a <1324 x 6146 double>? Can...

Limit sed to certain character range in a line

sed
I have a large one line file containing hex codes and I'd like to use sed to find patterns within certain character range of that line. So far i've tryed this witout succes something like echo abc123abc123abc123 | sed 's/^\(123\{8,14\}\)/\456/g' I'd like it to output abc123abc456abc123 (replace the pattern 123...

JMS Translation Bundle does not extract keys from controllers in Symfony2 - getTranslationMessages()

symfony2,internationalization,jms,translation
I am using JMS Translation Bundle in my Symfony 2 project. All translations in the twig files are working great. If I write new keys that need to be translated and run the extract command from command line they get extracted and I can then set appropriate values. My question...

Modify odata results after query

asp.net-web-api,odata
I have an ASP.NET Web API app using Entity Framework and Odata. I would like to modify the results of a query when using a GET... currently, within the controller, you effectively just pass the EntityFramework data entities back to the Odata handlers... [EnableQuery] public IQueryable<myEntity> GetLineItem() { return db.myEntities;...

Group and count returned SQL

mysql,sql,list
I have two tables abb and abb_click. abb contains information which object ident that's active. abb_click contains information from each student_id regarding each ident. I "simply" want to count the active ident in abb_click for a specific student_id. The SELECT below seems to count only the active idents, not taking...

'str' does not support the buffer interface Python 3 error for oauth

python,google-spreadsheet-api,gspread
import json import gspread from oauth2client.client import SignedJwtAssertionCredentials json_key = json.load(open('Crowds-9569176f5988.json')) scope = ['https://spreadsheets.google.com/feeds'] credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'], scope) #gc = gspread.authorize(credentials) Error: Traceback (most recent call last): File "C:\Users\sony\Desktop\Python\new.py", line 8, in <module> credentials = SignedJwtAssertionCredentials(json_key['client_email'],...

Having trouble getting user input into array without getting errors

java
I am creating a roommate bill splitter program and do not know what I am doing wrong. It gets hung up after asking what the roommates names are. Output is below code. package roomBillSplit; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new...

ZF2 directory structure for lots of applications

php,zend-framework,zend-framework2,directory,structure
I'm learning ZF2 and I need some help. I am working in a company which has an intranet. We have lots of applications like newsletter, HR, website control, helpdesk, etc. Is it correct to put all the applications in the same ZF2 directory structure as if they were modules? Like...

Open child fragment from NavigationDrawer Section

android,fragment,navigation-drawer
i'm trying to open child fragment from an fragment of Navigation Drawer. Look at the picture below for understand me better please. CODE: FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN); fragmentTransaction.replace(R.id.fragment_container, new ChatFragment(), MainActivity.CHAT_FRAGMENT_TAG); fragmentTransaction.addToBackStack(null); fragmentTransaction.commit(); ERROR DEBUG: java.lang.IllegalArgumentException: No view found...

capturing a div with jquery selector

javascript,php,jquery,html5
I'm stumped. I have a form that is dynamically populated from the results of a mysql query. Depending on how many rows are returned, the procedure will add a div for each row, and populate each div with a questionaire. Initially each div is hidden, and for each div there...

Can I configure Cloudfront so its split traffic to two origins

amazon-web-services,amazon-s3,amazon-cloudfront
Can I configure Cloudfront so its split traffic to two origins so that the incoming url looks like its all going to one server, but then depending on path go to EB for some requests and S3 for others (dynamic versus static). Even if I can do this is it...

Get redirected URL from Picasso

android,picasso
I'm fetching my images using the following code: Picasso.with(mContext) .load(myImage.getUrl()) .fetch(); myImage.getUrl() returns a URL from my server, which will redirect to the actual image hosted on another server. Is there a way to catch the URL my server returns to Picasso? I know I can use a Callback in...

Running java program through cmd ERROR: no main method found

java,batch-file
I am trying to run a bat file to easily run my program. The Batch file is in the folder project folder, along side the bin folder. I have many classes in many different packages. But the main method is in my Game.class which is located in: bin\xx\xx\xxxx\xxx\xxxxxx\cards\game\Game.class So I...

SQL. Check if 2 lists are intersects

sql,postgresql
I want to check if result of sub-query intersects with list of numbers. I'm trying to use this query SELECT * FROM my_table mt WHERE EXISTS ( (SELECT at.id FROM another_table at where at.some_id = mt.id) INTERSECT (1,2,3,4) ) The (1, 2, 3, 4) will be substituted at runtime by...

Visual Studio Code Segmentation Fault on Debian

linux,segmentation-fault,debian,glibc,vscode
I downloaded and extracted VS Code in a Debian x64 VM and tried to run it. It complained about missing glibc libraries (I have 2.13, it needs 2.15). I followed these steps to get Ubuntu DEBs. Using those, VS Code throws a segmentation fault when I run it. gdb tells...

Rails: Convert string “04/30/2015” to valid datetime for storing inside postgres

ruby-on-rails,date,datetime,converter
Very simple question but could not find a solution or figure it out yet. How to convert this string "04/30/2015" to valid datetime for storing inside postgres database? I tried several ways to no avail: new_date = "#{ params[:interview][:expire_at]}00:00:00".to_datetime ...

Flask-Sqlalchemy taking non unique values for a 'unique' integer

python,flask,flask-sqlalchemy
Consider the following code: class User(db.Model): id=db.Column(db.Integer,primary_key=True) email=db.Column(db.String,unique=True) name=db.Column(db.String) password=db.Column(db.String) registration_num=db.Column(db.Integer,unique=True) def __repr__(self): return "<Name %r>, <id %r>" %(self.name,self.id) Here I am trying to create a user with unique email id (later to be used as login id) and unique registration number (later to be used as folder name to...

An object reference is required for the non-static field, why?

c#
I did some research about this error, and all awnsers i found include removing static from the method or the property, but in my code there isnt any static, so i dont know whats happening, thanks for your help. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using...

Difference between :remote => true and remote: true [duplicate]

ruby
This question already has an answer here: Is there any difference between the `:key => “value”` and `key: “value”` hash notations? 3 answers What's the difference between these two options? They seem to do the same thing....

browserify + chrome extension's getBackgroundPage()

javascript,google-chrome,google-chrome-extension,browserify
I'm using browserify to manage a Chrome extension, and while in general it appears to work well, there's a problem that comes with browserify embedding the library code in some wrappers. In particular, when accessing chrome.extensions.getBackgroundPage() from a Chrome extension plugin as described, e.g., here, not all (none?) of the...

Ruby on rails Crud for routes as namespaces

ruby-on-rails,ruby-on-rails-3,ruby-on-rails-4,crud
I am trying to create crud in rails. I think my routes in the namespace aren't working fine. When I try to create new record(country) it redirects me to index action when the request should go the create action on POST /admin/countries Following is the code: Controller: class Admin::CountriesController <...

php round a number [duplicate]

php,variables,rounding
This question already has an answer here: PHP: show a number to 2 decimal places 11 answers I have a variable $amount = 621.00; I need the 30% of the variable with output 186.30 When I calculate: $amount2 = round($amount*30/100 , 2); echo $amount2 gives the output of 186.3...

Convert TextBox string to parameters

vb.net,command
How would I convert a string from a textbox to multiple parameters/arguments and store them in an array? For example, if I was to write a command in the text box saying "setPosition label1 100 200" then this would convert this into 4 different things: The "setPosition" part would be...

After jarring images do not show

java,image,graphics,jar
public class LidPop extends Projectile { private int x; private int y; private int l = 3; private int h = 18; private int dx = -3; private Image i; public LidPop(int x, int y) { this.x = x; this.y = y; String rootPath = System.getProperty("user.dir"); String imgPath = rootPath...

dnvm can't find latest version from nuget.org

osx,dnx
Going through the steps of setting up dnvm on OSX and I can't seem to get past the dnvm upgrade step as it's returning the error: ~$ dnvm upgrade Determining latest version Error: Could not find latest version from feed https://nuget.org/api/v2 I can install based off the unstable feed using...

Get String Value of Input With Date Selector

jquery,string,datepicker
I'm trying to make a page where I can pass values chosen from a "datepicker" which comes from an "input" box, and I can't figure out how to get the values be something other than [object]. Here is my View file: <link href="~/Content/bootstrap-datepicker3.css" rel="stylesheet" type="text/css" /> <link href="~/Content/reportsPayrollStyle.css" rel="stylesheet" type="text/css"...

Stream an (SqlFile-)Stream using Nancy

memory,stream,nancy,sqlfilestream
I was wondering how to send an (in my case) SqlFileStream directly to the client through our Nancy-API without loading the stream in memory. So far I succeeded in passing the stream, but Nancy's StreamResponse copies the sourcestream (=SqlFileStream) to the outputstream which causes a massive memory increase. Where I...

Image rendered differently in firefox than in chrome

image,firefox,web,gimp
First, please tell me if this belongs in another community, but since the problem happens in a browser I felt more appropriate to post here than in graphic design. I bought a theme to make a quick website, but wanted the provided background-image to be a bit lighter. Armed with...

Syntax Error unexpected T_STRING [duplicate]

php,arrays,mysqli,foreach
This question already has an answer here: PHP Parse/Syntax Errors; and How to solve them? 10 answers I am trying to create a form that inputs data to my database however I am getting a syntax error unexpected T_String on line 56. The line in question is my SQL...

Why is a trailing
tag in one floating div able to push down another floating div on my page?

html,css,html5,css-float
Currently the page is just two divs sitting side by side inside a containing section. I had two trailing <br> tags on qtr_calc, which were pushing down sem_calc. Shouldn't qtr_calc be able to have as many newlines at the bottom as I like without affecting sem_calc? If not, is there...

Configure ViewResolver with Spring Boot and annotations gives No mapping found for HTTP request with URI error

java,spring,spring-mvc,gradle,spring-boot
I'm trying to make "hello world" application with gradle, spring boot and spring mvc with the simplest view resolver and html. I started from the thymeleaf spring boot example and I just wanted to remove thymeleaf to make a simpler mvc application using pure html and InternalResourceViewResolver. I have a...

R data frame timestamp manipulation [duplicate]

r,timestamp,data.frame
This question already has an answer here: Replacing NAs with latest non-NA value 4 answers I have the following data.frame > head(k) begin end type total_replies rpm 1 03/22/15 00:00:00 03/22/15 00:05:00 178.19 0.50 0.10 2 <NA> <NA> 178.19.6 0.50 0.10 3 03/22/15 00:05:00 03/22/15 00:10:00 178.1963 0.50 0.10...

how does tomcat know which certificaate to provide

java,tomcat,ssl,keytool
I'm using tomcat server as a servlet container, I wanted the connections to this server to be secure "https" so I created a keystore, using the command keytool -genkey -keyalg RSA -keystore tomcat.jks I filled the prompt questions and then generated a CSR from this key and signed it using...

Why does Minitest seem to not always report what the 'Actual' results of the test are?

ruby,minitest
Why does MiniTest sometimes truly display what's 'Actual' and sometimes it will just show a nil/blank/quote. Example - I know that the value of a.join has "Hi" displayed on 2 lines with a blank line. class Question def stack "Hi\n" \ "Hi\n" end def overflow a = [] a <<...

Most efficient way to read key value pairs where values span multiple lines?

r,data.frame
What is the fastest way to parse a text file such as the example below into a two column data.frame which then then be transformed into a wide format? FN Thomson Reuters Web of Science™ VR 1.0 PT J AU Panseri, Sara Chiesa, Luca Maria Brizzolari, Andrea Santaniello, Enzo Passero,...

Can AppEngine *pull* in data over 32MB?

python,google-app-engine,google-cloud-storage
I'm writing an API that needs to ingest HD videos (at least 100MB). I only have access to the videos through an HTTP XML feed, so I can only pull the videos (with a GET) once I have the video's URL. The plan is to store the videos in GCS....

How to create a popup page using javascript

javascript,jquery,html,popup
I'm new in web develop. I want to realize a function that when I click the link "click to see sample colors", it will popup a page like the picture to show all my sample colors. But I don't know what kind of technics to use to do it. I...

Convert Mathematica equations into R code

r,latex,wolfram-mathematica,mathml
Is there an easy way to convert Mathematica equations into R code? I have several equations that consist of dozens of terms with subscripts, superscripts, and greek letters. For example, here's a small part of one equation in Latex format: m_2_2= 48 b_1 c_2^2 d_1 \rho ^4+48 b_2 c_1^2 d_2...

Symfony2: How to hide default selected of range

symfony2,range
here's the line ->add('datefinProjet', 'date', array('label'=>'Date fin Projet :', 'years' => range(date('Y') - 20, date('Y') - 100),'empty_value' => array('years'=>'' , 'month' => '', 'day' =>'' ))) i want that the select list start with the empty value '' but its starting with 1995 thanks...

Autocomplete importing with PyCharm

python,pycharm
How come I can't get rid of these red underlines? And that I can't autocomplete import in PyCharm? datatype.py: class DataType: def __init__(self, name): self.name = name def set_value(self, value): self.value = value def get_value(self): return self.value Here it is being used in address.py: ...

Database data displaying on html (rails)

html,ruby-on-rails,ruby,erb
I am making a rails app that users can use to shop for products. Everything was working fine, then I adjusted the products#index page, and now the data from the database is displaying on the html under the <div> of the page like so; [#&lt;Product id: 1, name: &quot;Green&quot;, description:...

How to calculate the interpolation between two colors correctly?

c,windows,winapi
I created a progress bar, and I like to change it's color as it makes the progress. From green to red (it is counting down). The problem is, that the progress bar changes too quickly to red, and between the green and red stage, it has multiple colors. Basically I...

Access Report not showing zeroes on Currency fields

ms-access,ms-access-2007
I'm in Access 2007 and I have a few fields that are currency fields. I have a report that shows these fields. When the value is something like $180.00, it only shows $180 on the report. If the value is something like $180.80, it only show $180.8 on the report....

How can I save a path criteria when I import from folders?

excel,powerquery
I import many textfiles from a folder with subfolders, everything works fine so far. My folder has the same text file in many folders for different Periods, so e.g.: AllData\201501\Revenues.txt AllData\201502\Revenues.txt AllData\201502\Revenues.txt ..... I need a Part from the path like "201501" inside my query which is preparing the Revenues....

Is there a way to turn on ES6/ES7 syntax support in vscode?

vscode
Edit: You can vote for this feature on user voice Is there a way to "turn on" ES6/ES7 in Visual Studio Code? Edit Tried @sarvesh's suggestion- overrode javascript.validate.target and restarted vscode. Didn't help....

Join conditions on multiple columns versus single join on concatenated columns?

sql,oracle,join,dbvisualizer
I observe there are two ways to achieve an objective on multiple tables. A column in the resultset will be updated and speed may be a requirement. The resultset is obtained either by: Case 1: select ert.* from eval_rep_track ert inner join ( select erp.evaluation_fk, erp.report_type, LTRIM(erp.assign_group_id, '/site/') course_name from...

Using JS-variable in Yesod handler's code

javascript,yesod,julius
I know that we can use Haskell data in the Julius-code, for example: $(function(){ $("section.#{sectionClass}").hide(); }); But how can I use JS-variable in the Haskell code? For example: ... in some .julius $(function set_global_variable( value ) { window.myGlobalValue = value; }); ... in some handler, pseudocode: getMyPageR :: Handler Html...

How to customise notification in os x using applescript

osx,notifications,applescript
Say I have a file sometext.txt . I want the contents of this txt file to show up in the notification which I will trigger using displaynotification in applescript. In other words I want to be able to: display notification "File's content" with title "Title". How can I do it?...

What is the kind of Void?

haskell
Seeing as the type of Void is uninhabited, can it be regarded as a type "constructor"? Or is this just a quick or "hack" to be able to safely disregard / disable functionality and am I looking too deep into this?

List index out of range parsing CSV file

python,python-2.7,csv,if-statement
For my school assignment I have created a program which checks for an EMAIL and PASSWORD found in rows 0 and 1 in a csv file which match up, and will then print some information about that user from rows 2-6. However, I believe this is not necessarily any cause...

Large number failing validation as type xs:integer

xml,xsd,xml-dsig
If I try and validate the following XML: <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"> <SignedInfo> <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /> <Reference URI="#Id-6fa82551-828a-4d41-ab07-02f6887e32a1"> <Transforms> <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /> </Transforms> <DigestMethod...

Software back button android

java,android,button,back
I need a back button with same functionality as default back button of device but inside of app.

Azure SSL Certificate

azure,ssl,azure-web-sites
I am running into an issue when uploading my SSL certificate to Azure. I have a premium certificate from GoDaddy that has been running in IIS for the past year. As we are migrating to Azure, I exported it to a PFX, went to Azure to add it to my...

DataGridTextColumn's “TextBox” styling isn't consistent with its “TextBlock”

wpf,textbox,datagridtextcolumn
I'm having trouble styling the TextBox that's used for editing in a DataGridTextColumn. A bit of background on this column: it's bound to a property called 'Top' (numeric value) there is a property called "ShowAll" used as a trigger to disable the column if the column is enabled, I want...

Why can't you access memory allocated by vector::reserve

c++
Pretty simple question, but why is it that when you call std::vector<int> vec; vec.reserve(100); vec[89] = 99; // vector subscript out of range.- You are not allowed to access elements 0-99 of the vector? Doesn't make a lot of sense considering that reserving increased capacity of the vector (allocated a...

How to classify a matrix within a Matlab parfor loop?

matlab,matrix,parallel-processing,parfor
I am looking to classify the values of a matrix. The following example works outside of a parfor loop, however it does not work when used within a parfor loop. What are my options to classify matrices, following the provided example, within a parfor loop? % Sample data Imag1 =...

How do I get the current folder in NodeJS for a Browserify'd file that relies on a base file in another folder?

javascript,node.js,ampersand,ampersand.js
I'm using AmpersandJS and I'm trying to emulate the pod structure of Ember so that, instead of the typical folders-per-type structure: app |-- views |-- index.js |-- login.js |-- people.js |-- templates |-- index.jade |-- login.jade |-- people.jade you have folders-per-component instead: app |-- index |-- view.js |-- template.jade |--...

JavaScript alert is not showing in browser [closed]

javascript,css,html5
I can't seem to figure out why an alert won't show in the browser. I am using Chrome with Yosemite. Here is my code in the script.js file: $ (document).one('pageinit', function() { // add handler $ ('#submitAdd').on('tap', addWalk) ; // add a walk function addWalk() { alert (1); } );...

Increasing heap size for JRuby using jruby_opts

ruby-on-rails,rvm,passenger,jruby,jrubyonrails
I am having issues with increasing the heap size for JRuby. The application is running Phusion Passenger and I installed JRuby using RVM. I have tried export JRUBY_OPTS="-J-Xmx1024m" But it doesn't change the heap size. I tried jruby -J-Xmx1024m but it doesn't return and gets stuck. I am not sure...

What builds are using a specific build agent

tfs,tfsbuild
My company has a bunch of different builds and half a dozen different build agents, and I need to update some software for one of the builds. I don't want to break any other builds that are using said agent. I would like to get a list of all builds...

Create Bar Chart in Excel with Start Time and Duration

excel,time,charts,excel-2013
I want to create what is essentially a Gantt chart in Excel 2013 with time of day as the x-axis, date as the y-axis, and floating bars representing time durations. Example data: Date Start End Duration 21-Apr 6:45 8:20 1:35 21-Apr 10:00 11:30 1:30 21-Apr 14:00 16:00 2:00 22-Apr 6:50...

ViewPager's fragment without activity context

android,android-fragments,android-viewpager
Functionality: I'm developing some sort of configuration wizard, which may have many steps. Each step has it's own configuration, in this case, isSkippable() whether if user can skip the step or not. And a callback method when user taps on menu item to go to next step, or indeed completed...

Environment variable DHIS2_HOME: null (TrayApp.java [main])

java,postgresql,dhis-2
I am getting the error Environment variable DHIS2_HOME: null (TrayApp.java [main]) when trying to start the dhis2-live.exe with Postgres connection on my Windows Vista machine. However the same application runs fine if the H2 DB is used, but as per requirement I need to work with Postgres. Here is the...

Referencing elements from a css stylesheet

html,css
I am teaching myself css and html and I created a stylesheet and broke it up into different elements (background image, cursors, etc). I am referencing the entire css file in the main html file but when I run the application I get a blank screen. What am I missing?...

How to use a model from a Django project in another Python script

python,django
I have a directory which contains a Django project with a models.py in which I have defined some models. I have another directory somewhere else and which has a Python script. In this script I would like to import one of the models "Foo" from models.py. With the table "Foo",...

Java 8 Sorting based on 3rd value

sorting,java-8,comparator
This code sorts hashset values firstly by First Name and then by Last Name. If 2 persons have same first name and last name, i want to sort them by their ID values. Please help me to understand how to compare against 3rd value in this situation. public static void...

Designing a 7 column Week Plan, horizontal scroll

javascript,jquery,html,css,twitter-bootstrap
I'm trying to design a week plan showing three days of the week: today in middle, yesterday on left and tomorrow on right. But I want it to change on next and previous day so that clicking next day would take or scroll to (3 panels always showing) a new...

Web API with complex array parameters

c#,asp.net-mvc,asp.net-web-api
Need help on this one. I have a WebAPI who can receive multiple ids as parameters. The user can call the API using 2 route: First route: api/{controller}/{action}/{ids} ex: http://localhost/api/{controller}/{action}/id1,id2,[...],idN Method signature public HttpResponseMessage MyFunction( string action, IList<string> values) Second route: "api/{controller}/{values}" ex: http://localhost/api/{controller}/id1;type1,id2;type2,[...],idN;typeN public HttpResponseMessage MyFunction( IList<KeyValuePair<string, string>> ids)...

PHP PDO MySQL No Exception or Error

php,mysql,pdo
I've got the following script that uses PDO. $db = new PDO("mysql:host=$hostname;dbname=$database", $username, $password); $sql = "BEGIN;\n". "INSERT INTO exp_ws_gk_text (WGT_PRG_CODE, WGT_TEXT)\n". " VALUES('".$_POST['prg_code']."', ".$db->quote($_POST['text']).");\n" . "SELECT @Lid:=LAST_INSERT_ID();\n" . "INSERT INTO exp_ws_gk_state (WGS_STATE, WGS_TYPE, WGS_WGT_RID)\n". " VALUES('".$_POST['state']."', ".$_POST['type'].", @Lid);\n". "SELECT a.wgt_prg_code prg_code, b.wgs_state state, b.wgs_type type, a.wgt_rid id, a.wgt_text text\n"....

CCClippingnode causes OpenGL error 0x0502

ios,objective-c,cocos2d-iphone,opengl-es,ccsprite
I'm using cocos2d-iPhone v.2.2, updating an old game, and I have a clipping node that is causing an error. In AppDelegate.m, I switched the settings to use CCClippingNode: CCGLView *glView = [CCGLView viewWithFrame:[window_ bounds] pixelFormat:kEAGLColorFormatRGB565 depthFormat:GL_DEPTH24_STENCIL8_OES //switched from 0 preserveBackbuffer:NO sharegroup:nil multiSampling:NO numberOfSamples:0]; And then I used this code to...

Spring Boot Actuator without Spring Boot

java,spring,spring-mvc,spring-boot
I've been working on a Spring/Spring MVC application and I'm looking to add performance metrics. I've come across Spring Boot Actuator and it looks like a great solution. However my application is not a Spring Boot application. My application is running in a traditional container Tomcat 8. I added the...

Why is my command line argument being interpreted as a Boolean (Perl 6)?

command-line,perl6
Given this program: #!/bin/env perl6 sub MAIN ($filename='test.fq', :$seed=floor(now) ) { say "Seed is $seed"; } When I run it without any command line arguments, it works fine. However, when I give it a command line argument for seed, it says that its value is True: ./seed.p6 --seed 1234 Seed...

jQuery selector when a table is created dynamically

javascript,jquery
I have a table (generated at run time) and a dropdown. Before the page is up, the table does not exist. Once the page is up, the table and the dropdown look similar to this fiddle: $("#aDropDown").val($("WhatToPutHere?").text()); I am trying to do the following: when the user select the Select...

Adding a variable to a block

ios,objective-c,objective-c-blocks
I'm using a UIAlertView + block Category found here. I'm having trouble following how he has created the blocks: typedef void (^DismissBlock)(int buttonIndex); I understand this, use it on creating my own blocks. So I created mine: typedef void (^DismissBlockWithView)(UIAlertView *alertview, int buttonIndex); I think I understand what is happening...

How would I change this query to fit into Laravel's Query Builder?

php,mysql,laravel,eloquent
I've tried creating this query in Laravel and still can't get it to work with a query builder. It's giving me syntax errors yet I can run it in the tables and it run smooth. Query trying to run: select A.*, sum(RawAmt) as AmountOwed from (select Login, PatID, if(length(ApptID) >...

Receiving Insufficient Permission error from DirectoryService

google-api-dotnet-client
I am trying to setup c# code to manage our Google domain. I am receiving this error whenever I call service.Users.List() or any other method from the DirectoryService api. Google.Apis.Requests.RequestError Insufficient Permission [403] Errors [ Message[Insufficient Permission] Location[ - ] Reason[insufficientPermissions] Domain[global] ] I followed all the instructions on the...

Celery, find the task caller from the task?

python,celery
Is it possible to lookup what code called (delay(), apply_async(), apply(), etc.) a task from within the task's code? Strings would be fine. Ideally, I would like to get the caller's stack trace.

Changing styles in Word using vba

styles,word-vba
I am very new to programming, so forgive my ignorance. I am trying to create specific headings in a document that does not have any or has different heading styles assigned. What precedes the text in the headings are numbers. The numbers are specific and essentially represent the content of...

What is the API for unregistering service workers in Chrome >= 44?

service-worker
I'm trying to unregister a service worker that's already installed. I understand that the registration promise passes the registration as an argument to the success function and I could store that in some scope, but that wouldn't work after a page reload (I'd like to be able to unregister a...

In Gerrit how do I squash multiple reviews into one review

git,gerrit
In a project managed by Gerrit I have several reviews that really should be one review. The developer forgot to amend his commits. Do I fix this using git to squash the commits into one commit git rebase --interactive HEAD~7 or can I do it through the Gerrit web interface?...

C# - Unity3d save some variables in game?

c#,unity3d,save
I would make sure when I close The Game , he saved automatically some variables ( scores ), and show them once started ? To do this i need to use these to save an float? void Awake void Load or i need these? public void Load public void Save...

Is it possible to do a date-diff on a timestamp column with the current timestamp in Apache Spark?

scala,apache-spark
I am trying to load a tab separated file containing two timestamp columns and generate a calculated column which is the difference (in days) between one of the columns and current timestamp. I have applied the registerTempTable() method on the RDD to convert it into a SchemaRDD. After that I...

Export query to relational xml

sql-server,xml,ssms
In management studio is it possible to create a relational XML file? example: select a.product, a.cost, b.productType, c.brand from products a inner join productTypes b on a.productTypeID = b.productTypeID inner join brands c on b.brandID = c.brandID to create XML File <brands> <brand>SomeBrand1 <productType>SomeProductType <product>Product1</product> <Cost>$10.00</cost> </productType> <brand> <brand>SomeBrand2 <productType>SomeProductType...

Solved - Footer always at very bottom (move with content, but min at bottom)

html,css,footer
I'm trying to set up a website with header, body and footer. I want the footer to be at the very bottom of the page but move it relative to the content. Here is what I got so far html: <html> <header> </header> <body> <div id="header"> </div> <div id="body"> </div>...

Trying to open a PDF with AxAcroPDFLib

c#,pdf,adobe
I have installed the latest Adobe Reader on my PC (Adobe Acrobat Reader DC). Now I would like to use AxAcroPDFLib in C# to open and show a PDF file in my Windows Forms application. The problem is, if I am trying to use the LoadFile() method, then it says...

Move parent child picture by 1px with a timer

javascript,image,replace,timer,increment
I’m trying to recreate Space Invaders. But only in Javascript without jQuery etc. Now I create for the Rockets a “family”: var image = document.createElement('img'); image.setAttribute('src', 'Rakete.gif'); image.setAttribute("style", "position:absolute; left:" + x2 + "px; top:bottom; bottom:55px;"); And I use this to add it to the body: document.body.appendChild(image); Now my question:...

For while statements in SQL

sql,sql-server,sql-server-2008
This question has bothered me for most of the day, just can't figure it out, and I don't really know which keywords to google for. Let's say I have policies and their date, and I want to know if the policy falls within the first year since its inception or...

apply function with multiple parameter with arguments from a vector

clojure,functional-programming
I have a function that takes three arguments say somefunction [param1 param2 param3] and a vector with values say [val1 val2 val3 val4 ...] I would like to repeatedly call the somefunction with the first argument param1 as fixed and the other two parameters passed in the combination val1 val2,...

Pointers: Expression is not assignable

c,function,pointers,structure
I'm writing a function whose purpose is to change the value of struct variables. I'm getting error messages that say the expressions toward the end of my first function are not assignable. How, then, do I have the function change the values of the daate structure? Here's my code: #include...

Unable to access kABPersonNoteProperty

ios,swift,abaddressbook
I have the following code which copies data from the iPhone's contacts into an NSMutableDictionary. I'm using optional binding as discussed in this answer. The firstName and lastName fields copy properly (as well as phone and email fields not shown here), but I have never been able to access the...