FAQ Database Discussion Community


Terminate all subprocesses if any one of subprocess has error

python,subprocess
I am trying to run two subprocesses simultaneously. My current program looks like if one of subprocess has error and terminated, it cannot relaunch again after 1 min. It needs to wait another subprocess failed also and both of them start together. I found some posts about how to kill...

specifing XML tags to read in a variable

xml,powershell
I'm reading an XML file using PowerShell and I need to extract the value of a specific tag, but i'd like to be able to have that tag in a variable. If I do this: [xml]$content = Get-Content "$($splitsinglehost[1])$XPfilelocation$XMLfiletoRead" $XMLvalue= $content.BT9000_XML_FILE.Config_SETX.I_Camera_Manufacturer it works, the value I'm looking for is stored...

Error in SerialPort Closes Thread but don't change it's Status and don't raise an Exception

c#,multithreading,exception,serial-port
I am reading a SerialPort in a separate thread using the code below. I open the Serial Port and try to read a line. Since there is nothing connected in the Serial Port there is an error. I was expecting some TimeoutException to be thrown, but NO! There are not...

Clear text box using jquery

jquery
I have this HTML element: <div id="setProfessionalDitailsArea"> <input type="textbox" id="instituteName" placeholder="Instetute Name"> </div> at some point I try to clear text box: $("#setProfessionalDitailsArea input[textbox]" ).val(''); But it dosen't work,while this: $("#sinstituteName" ).val(''); Works perfect! Any idea why is the first option not working?...

PHP: Return Array of Values from Key in Associative Array [duplicate]

php,arrays,multidimensional-array,key,associative-array
This question already has an answer here: Is there a function to extract a 'column' from an array in PHP? 13 answers Let's say that I have an array like this: $people = array( array( 'name' => 'Bob', 'job' => 'Carpenter' ), array( 'name' => 'George', 'job' => 'Programmer'...

Crystal Reports GetAttributes

crystal-reports
I've been asked to go through over 1000 Crystal Reports to find the Store Procedures and/or Table names used in each report. I would like to do this programmatically, but I don't see much in the way of reading such values from the CR object model. There is a GetAttributes...

Setting attrs dynamically for ui-bootstrap tooltip / popover

angularjs,angular-ui-bootstrap
I'm trying to programmatically toggle tooltips (like mentioned here: http://stackoverflow.com/a/23377441) and got it fully functional except for one issue. In order for it to work I must have tooltip-trigger and tooltip attributes hardcoded as follows: <input type="text" tooltip-trigger="show" tooltip="" field1> In my working directive, I'm able to change the tooltip...

trying to split within arrayformula inside google spreadsheet

regex,split,google-spreadsheet,sheet
I am trying to use the split function within the ARRAYFORMULA function inside a google spreadsheet. I want "1.2.3.4" to become "1", "2", "3", "4" This is the code for a one-liner (working for 1 row only): =SPLIT(A2;".") This is what I want to achieve (to work on multiple rows...

Using jQuery Dialog

php,jquery,dialog
I have a HTML table and I get data for each cell from database.Some cells have an edit icon, so when the user clicks on it, he should see a pop up dialog. In this dialog there should be a drop down menu with 3 options.And after the user selects...

How to move excel sheets saved in a folder to a new workbook?

excel,vba,excel-vba
"C:\Users\New folder\" in this path I do have 10 workbooks and each has budget tab...I want to move this tab to "code2.xlsm My code is this: Option Explicit Sub move_filesinto_masterWB() Dim Myfile As String Myfile = Dir("C:\Users\New folder\") Dim Masterwb As Workbook Set Masterwb = Workbooks("code2.xlsm") Do While Len(Myfile) >...

Are checked events firing “late” or “early”?

c#,xaml,windows-phone-8,telerik
I am using a Checkbox control inside an ItemTemplate of a Telerik RadJumpList. The ItemTemplate is defined like this: <DataTemplate x:Key="ItemTemplate"> <StackPanel Orientation="Horizontal" Margin="4"> <Image Source="/Assets/Weather.png" Width="64" Height="64" Margin="0,4,12,4" Stretch="Fill" /> <CheckBox x:Name="checkBox" IsChecked="{Binding IsChecked, Mode=TwoWay}" Checked="checkBox_CheckedChanged" Unchecked="checkBox_CheckedChanged" /> <TextBlock FontSize="{StaticResource PhoneFontSizeExtraLarge}"...

Increment javascript variable function onclick

javascript,jquery,html,function
This the page I'm working on: http://gacc.nifc.gov/gbcc/predictive/PSA_ERCmap/Dev/PSAERCmap1.html When you click on a shaded area the chart associated with the area pops up. What I'm trying to figure out is how to get the "Next PSA" link at the bottom to advance the chart in the popup to the next PSA...

Html layout for emails [closed]

html,css
I am creating the following layout that is to be used in emails and must be table-based, margins can not be used in it: http://i60.tinypic.com/14ch2js.jpg I tried a table-based approach, but can't get it to work. How can I produce such a layout? Thank you for your help....

Bootstrap responsive not centering elements below 482px

css,html5,twitter-bootstrap,responsive-design
A simple page which I've designed with bootstrap framework stops becoming responsive once the screen width is below 482px? The only thing i can spot is that it stops adjusting elements once the screen reaches the width of the form input fields plus an equal amount of padding either side,...

how to define an abstract class in python and force implement variables

python
So, I am trying to define an abstract base class with couple of variables which I want to to make it mandatory to have for any class which "inherits" this base class.. So, something like: class AbstractBaseClass(object): foo = NotImplemented bar = NotImplemented Now, class ConcreteClass(AbstractBaseClass): # here I want...

AWS Instance Type For 3,000+/Second Outgoing HTTP Requests?

amazon-web-services,amazon-ec2,cloud,server,amazon
I'm currently scaling up an application on AWS, we send thousands of outgoing HTTP requests per second to 3rd party API's and services. Are there any EC2 instances optimized for this type of work?

Syntax Error Missing Operator VBA

vba,access-vba,runtime-error
I have a Dlookup in Access 2010 that's supposed to pull a value from a query table that counts the number of checkboxes untoggled. When I run it, it gives me a 'Missing operator in query expression' here. Countboxes = DLookup("Expr1", "qryCountUntoggled", "[ProjNo =]" & Me.ProjNo & "'") I can't...

What is the correct way to adjust bootstrap columns to specified widths

css,twitter-bootstrap,responsive-design,less
In bootstrap 3.0, assuming you are stuck with a 12 column grid, and you have a 3 column sidebar (col-md-3) and a 9 column main content area (col-md-9) but your sidebar content fills roughly 2 and a half columns of the sidebar width, and you are left with about a...

BMP reader not functioning correctly

c++,binary-data,bmp
I wrote a small BMP loader for 24-bit BMP, and it works, except it does not display the colors. Everything is grayscale with bits of color (not the correct ones) here and there. The loader for my code is below void BMP::Read(char* filename) { FILE* f; unsigned char info[54]; if...

CSS Precedence Issue

html,css,css3
I have in my style.css the rule which applies to entire web site: a:hover{text-decoration:underline;color:#E35B00;} I have also in my button.css: .button { display: inline-block; zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */ *display: inline; vertical-align: baseline; margin: 0 2px; outline: none; cursor: pointer; text-align: center; text-decoration:...

Kivy 1.8 and Cython 0.21.2

cython,kivy,buildozer
Using Buildozer I get 12 times: #error Do not use this file, it is the result of a failed Cython compilation. And eventually: Command failed: ./distribute.sh -m "kivy" -d "myapp" According to the Kivy docs, I use Cython 0.21.2. See the full log. Any help would be very much appreciated!...

Xcode 6 crashes when attempting to run swift app

swift,xcode6
So ever since I updated to Xcode 6, I can no longer run my app that I have been building with swift on my iPhone. Every time I attempt to build it through Xcode, it builds, but when it tries running it on my phone Xcode crashes. I first noticed...

Rails 4 How Do You Make 'date_select' Form Field Helper Required?

ruby-on-rails,forms
I've been trying to work this date_select form field helper in my Rails 4 app to be required but I have had no success. <div class="field"> <%= f.label :birthday, "Your Date of Birth" %><br /> <%= f.date_select :birthday, order: [:month, :day, :year], prompt: { day: 'Select day', month: 'Select month',...

Trello Manatee adding attachment

c#,attachment,trello,manatee.trello
I am trying to add an attachment to a pre-created Trello card using Manatee API. This is how I create the card, I have no problems with it: /// <summary> /// This function creates a card on Trello <Board_Name> board, into the list named <List_Name>. /// It creates a card...

ListBox to be filled based on the selection in the previous List Box (Module-pool)

abap
Masters: I have an issue and i cannot fix it. I have a DYNPRO 010, this has 2 listbox(dropdownlist), And i want to fill the second one after selected the first one ( automatically, with no enter key pressed) It works when i choose a value in listbox1 and i...

Finding content of Excel file in Powershell

excel,powershell
I am currently working on a fairly large powershell script. However, I got stuck at one part. The issue is the following. I have various reports with the same file name, they just have a different time stamp at the end. Within the report, I have a field displaying the...

Nemo - Custom Places for “Move to”?

linux,linuxmint,file-manager
How can I add custom places to the "Copy to" and "Move to" option of the Nemo file manager (see picture below)? I have some special folders reserved for pdf files and I like to use the ease to move files into them via the respective options. How can I...

select values from several tables using get method

cakephp,cakephp-2.3,cakephp-3.0
$pilot = $this->Pilots->get($id, [ 'contain' => ['Cars'] ??? ]); Entity Pilots "has many" cars, so does cars "has many" models and last but not least models has many brands. I want to get all the cars , it's models and brands that bellong to pilot....

General questions + How: object that can copy another object's values?

java
General part first: This is for my Java 1 final: I need to make an NFL playoff simulator. So, I would make a "Team" object that holds values for "Offense" and whatnot. I would need a method that holds an algorithm to calculate who wins each matchup. However, I don't...

Asterisk (*) in Android XML attributes [duplicate]

android,xml
This question already has an answer here: What is the meaning of the asterisk (*) when referring to Android XML resources? 2 answers Can anyone explain the asterisk means in Android XML attributes? <style name="DocumentsTheme" parent="@style/DialogWhenReallyLarge"> <item name="android:actionBarTheme">@*android:style/ThemeOverlay.Material.Dark.ActionBar</item> <item name="*android:windowFixedWidthMajor">@null</item> </style> ...

How to perform operation between JSON joined data?

javascript,jquery,json
Suppose I have two JSON strings: json1 = [{"hc-key":"ar-tf","value":221},{"hc-key":"ar-ba","value":10820},{"hc-key":"ar-sj","value":230}] json2 = [{"hc-key":"ar-ba","value":2890151},{"hc-key":"ar-sj","value":15625084},{"hc-key":"ar-tf","value":367828}] what I'd like to do is to join them by "hc-key", into a new JSON string, where the new "value" is the result of dividing the value in json1 by the value in json2. In JavaScript. Note that...

Pandas merging a Dataframe and a series

python,pandas
I have two pandas DataFrames: one containing the anonymous hashes of customer numbers (here for simplicity the hashes of the numbers 0-19) import pandas as pd import numpy as np from hashlib import sha1 df_customers = pd.DataFrame( [ sha1(i).hexdigest() for i in np.arange(20)] ) df_customers.columns = ["customer"] Now I have...

Why DFS doesn't check children of a node, that was chosen for development, for a goal state

algorithm,search,time,time-complexity,depth-first-search
Sorry if my grammar is far from being perfect, English is not my native language. If i understand correctly, DFS does a goal test for a node only if it was chosen for development and not while it's been generated. It seem odd to me because after DFS chooses a...

Inserting variable values into URL (or any string)

python,json,urllib
I am currently using urllib and json to perform a JSON request against a REST API as below: import urllib, json url = "http://www.cvedetails.com/json-feed.php?numrows=5&vendor_id=26&product_id=0&version_id=0&hasexp=1&opec=1&opov=1&opcsrf=1&opfileinc=1&opgpriv=0&opsqli=1&opxss=0&opdirt=0&opmemc=0&ophttprs=0&opbyp=0&opginf=0&opdos=0&orderby=0&cvssscoremin=0" response = urllib.urlopen(url) data = json.loads(response.read()) for index, entry in...

How to use mod rewrite to serve child site off of parent

regex,apache,.htaccess,mod-rewrite
I'm attempting to configure Apache with a rewrite rule such that a "parent" site can point to a "child" site. The directory structure I'm trying to get to work looks like this: parent/ index.html children/ # Logically this should point to container/000 .htaccess some-other-file.html container/ 000/ childA/ index.html I want...

Auth0 in Go Martini

go,martini,auth0
I'm trying to use Auth0 with Martini in Go. I'm using their examples but I can't seem to get it working no matter what I try. Here is my code: package main import ( "flag" "github.com/go-martini/martini" "github.com/martini-contrib/render" "github.com/auth0/go-jwt-middleware" "encoding/base64" "github.com/dgrijalva/jwt-go" "net/http" ) func main() { m := martini.Classic() port :=...

How to print the unix time in a binary representation in bash [duplicate]

bash,unix,time
This question already has an answer here: Bash shell Decimal to Binary conversion 4 answers I recently came across information that on the 15th of May at 02:09:25 Unix time will be equal to 1010101010101010101010101010101 in binary representation. I wanted to find out wheter it is a fake or...

Use a different row as labels in pandas after read

python,data,pandas
I need to use the third row as the labels for a dataframe, but keep the first two rows for other uses. How can you change the labels on an existing dataframe to an existing row? So basically this dataframe A B C D 1 2 3 4 5 7...

How to create round plus minus using css?

jquery,css
I have the following code which has plus and minus image to display toggle, how can make this purely CSS based so plus and minus are bold and circular and not image based. HTML <div class="toggle"> Show and hide < plus minus icon will show here> </div> CSS toggle{ display:inline-block;...

STL Algorithm element wise multiplication WITHOUT sum [duplicate]

c++,algorithm,stl
This question already has an answer here: element-wise multiplication of two vectors in c++ 2 answers I would like to multiply two vectors (element-wise), save the result, and then take the sum. I know the function from stl algorithm std::inner_product(x.begin(), x.end(), y.begin(), 0); This doesn't save the result of...

SQL Server Full Text search for numeric string with commas

sql-server,sql-server-2012,full-text-search
I have a full-text indexed nvarchar(max) column on a SQL Server 2012 install. If one row of the column has 'blah blah $1,234,567 blah blah' as data. When I run the following queries, the ones that return the row are shown: SELECT ftext FROM dbo.Test WHERE Contains([ftext], '"1,234,567*"') --true SELECT...

Angular-slick external arrows

javascript,angularjs,slick.js
How do you create external arrows with Angular Slick? The documentation doesn't really give a clue for it. I already know how to do it with jQuery, but that's not quite the same since slick uses an actual tag in angular: <p class="left">left</p> $('.left').click(function(){ $('.slider').slickPrev(); }) http://codepen.io/anon/pen/KwMZao...

Parse an f-style interpolated string to recover arguments

scala,parsing,string-formatting,string-interpolation
What's the best way to create the complement for an f-style string interpolation, i.e. a way to parse the arguments/numbers in a formatted string? E.g. val format = "frame%04d.png" val i = 123 val out = f"frame$i%04d.png" assert(out == "frame0123.png") def parse(s: String, pat: String): Int = ??? val j...

insertion in a binary tree ( not BST ) not working

c++,pointers,binary-tree
In the following code I have written a insertion function for a binary tree. But after each call it doesn't inserting any node to the tree. I have checked the algorithm for insertion in a binary tree. I think there is some pointer issue but can't figure it out why...

Type encapsulation in Coq

types,module,encapsulation,coq
Is there a way in which I can define a type inside a Coq module but encapsulate the constructors? I want a client of the module to be capable to use the type but not to construct members of that type, similar to what can be done in OCaml with...

Where to find older versions of Android Support Library?

android,teamcity,android-support-library
I am setting up CI server using TeamCity and I get a Gradle bust where it cannot find an Android Support Library that one of the modules uses. This is the error: ##teamcity[buildProblem identity='-1301271058' description='org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.support:support-v4:21.0.3.|nSearched in the following locations:|n https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom|n...

recursive serialization in java

java,serialization
I am working with serialization in Java for the first time. I have read that Java recursively serializes objects. Say I have a class Diet that holds objects of typefruitwhich holds objects likeapple, banana, pineapple`. As I have understood it, once I serialize an object of type Diet java stores...

c++ static vs thread storage duration destruction order

c++,multithreading,c++11,thread-local-storage,storage-duration
Consider how in c++ there are these two storage duration (among others): static storage duration and thread storage duration.. Next consider this code: static MyClassA a; thread_local static MyClassB b; Additional pretend that "a" and "b" might not be in the same compilation unit. I "believe" that the destructor of...

How to deal with 'optional' T in ISO-8601 timestamp in Java 8 / JSR 310 / threeten.org ?

java,datetime,java-8,java-time
In Java 8 time / JSR 310 / threeten.org backport ... Q: How do I parse ISO-8601 timestamps with either a 'T' or a space ' ' between the date portion and the time portion? ISO-8601 format for timestamps specifies the literal 'T' to separate the date specification from the...

'Provisioning profile' options missing from 'Code signing' Xcode 6.3

ios,xcode
I'm no longer able to view or change my provisioning profile in Xcode 6.3. I'd like to switch back and forth between dev and adhoc whenever, but I can't get the options back and it seems that all of my certificates, signing identities, and other provisioning profiles are fine. I...

List items being duplicated when moving to new column

jquery
I pieced together a list where you can move one item from the left column to the right, and vice versa. This also supports an accordion toggle. Fiddle $('.list-arrows button').unbind().click(function () { var $button = $(this), actives = ''; if ($button.hasClass('move-left')) { actives = $('.list-right ul li.active'); actives.clone(true, true).removeClass('active').appendTo('.list-left ul');...

Disturbed digital out at 4Mhz on Arduino NANO

arduino
I've written a simple program - it generates signals over Port D at 4 MHz: #include <Arduino.h> int main(void) { DDRD = B11111111; PORTD = B00000000; while (true) { PORTD = 0; PORTD = 5; PORTD = 10; PORTD = 15; PORTD = 20; PORTD = 25; PORTD = 30;...

C++ Save a string from a struct into a text file

c++,arrays,string,file
In my program, I have a clock timer and I need it to be saved into a char array[10] which is then implemented into my highscore function. Through my program, I already have a formatted time. Example, if the clock's seconds is lower than ten, I have to add a...

Why is MFMailComposeViewController crashing on iOS 8.3?

ios,mfmailcomposeviewcontroll
I recently submitted an app for review, which crashed when an email link was brought up. I tried this several times with multiple devices, and was unable to recreate it, but do not have an iPad Air 2. However, it looks as though it may have to do with not...

Invalid Pointer while realloc()

c,realloc
Caller Function: void caller_func(){ char *c = malloc(strlen("Hi") + 1); c = "Hi"; //c is a pointer char* char **s = &oi; //s is a pointer to a pointer: char **; called_func(s, 3, 'A'); } Called Function void called_func(char **s, int p, char c){ char *w = *s; //w =...

Auto Layout - How to add a subview to match the size of a UIView?

ios,swift,autolayout
I am stuck on a issue I have encountering with Auto Layout. I have a UIView that has constraints set so it is in the same position for every size class. I am trying to get my video to fit perfectly inside of this UIView videoViewBox. I got it working...

JavaScript code does not execute in a window opened by a script

javascript,jquery,html
I'm trying to open a new window, with some code in it and a button that should alert when you click on it. My code is something like this: $('#PREVIEW').click(function() { n = window.open("preview.html", "_blank"); var result = DSLExGenerator.parse($('#original').val()); var res = result.replace(/>,</g, "><"); n.document.write(res + '<br/><button id=\"results\">Resultados</button><script type=\"text/JavaScript\"...

Keep selected option in window when moving up/down

javascript,angularjs
I have a fiddle here http://jsfiddle.net/BB3JK/47/ that I adapted from this previous question (Move item up and down in select using button). I'm writing my code in AngularJS actually, but the issue is more basic I believe. I have a select box that is 10 high: <select multiple id="selectedList" size="10">...

laravel 5 - enable caching of local asset files

php,google-chrome,laravel,caching,artisan
I'm currently developing an App with Laravel 5, and I ran into the following problem: When I include a, for example, .js file from a foreign server, the script is loaded with a 304 not modified - which is fine. It loads in 146ms according to chrome's network tab. When...

Angular, limitTo and track by $index

javascript,angularjs
I am trying to limit an object coming in by filtering (because there will be an option to show all eventually), however I am running into issues when trying to limitTo and track by index. Here is the code : <div ng-repeat="item in filter.values track by $index | limitTo:filterLimit" class="cengage-builder-result-filter-value"...

Android BluetoothGatt writeCharacteristic with response

android,ios,bluetooth-lowenergy
From the documentations I see how to write without response like this: BluetoothGattCharacteristic characteristic = ... characteristic.setValue(bytes); mBluetoothGatt.writeCharacteristic(characteristic); How do you preform a write request operation WITH response? (In iOS there is option to select write type CBCharacteristicWriteWithResponse and CBCharacteristicWriteWithoutResponse)...

SQL searches using php

php,sql
ok so I need to search a database for names of people that were born between two dates, the website asks the user to input a date in this format dd/mm/yyyy so i need to manipulate is so that it will work in my sql search. What I did was...

C++: saving derived class in shared_ptr of base class

c++,c++11,polymorphism,shared-ptr
I want to have a class that has a shared pointer as member: class MyClass { public: shared_ptr<MyAbstractBaseClass> myPointer; } How can I make the pointer point to an instance of a derived class?...

Nutch Error: JAVA_HOME is not set

java,ubuntu,nutch
I followed this tutorial http://saskia-vola.com/nutch-2-2-elasticsearch-1-x-hbase/ When I finally tried to run Nutch sudo bin/nutch inject urls I got this error Error: JAVA_HOME is not set. but when I echo JAVA_HOME it returns /usr/lib/jvm/java-7-openjdk-amd64 and it is also in /etc/environment JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64" and also I added line to end of file ~/.bashrc...

Converting null value to dummy ip address

hadoop,hive
I have a table where one of the column is ip address. I need to convert/select any value in that column that has null value to ip address e.g. 0.0.0.0. I have below table schema where ip column is the ip address: hive> desc ad_data; OK ad_id string id_segment bigint...

How to filter an odata $expand query in a Web-Api controller

entity-framework,odata,web-api,asp.net-web-api2
I have got two models. A Product model: public class Product { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set; } public virtual ICollection<Categories> Categories { get; set; } } And a Categories model: public class Categories {...

When in a Polymer component's life cycle are changed watchers fired for declaratively-specified values?

javascript,polymer,web-component
From the Polymer docs, the life cycle for most callbacks is clear: created -> ready -> attached -> domReady ^ | | | ---------- detached <---------- And I imagine attributeChanged() will be fired at any point in this lifecycle when an attribute is modified, e.g. even as early as when...

How to implement feedback loop for PLL in Matlab?

matlab,feedback-loop
I am trying to implement PLL demodulator for FM signal in Matlab, without using Simulink. (FM Signal) >----Multiply---Loop Filter------> (Demodulated signal) | | ^ V |--------VCO---------| My plan is to use above configuration. I have filter, VCO as functions, now I should combine them in a feedback mechanism. What kind...

Why is there no authentication for the asp.net 5.0 preview - web api template -

c#,asp.net,visual-studio-2015
I have created a web project in the new Visual Studio 2015. I can choose asp.net 4.6 or 5.0 preview web api template. The old 4.6 has authentication but I want to use the new 5.0 preview also web api. But this template lacks the authentication, but why?...

SQL Server does not support the equivalent of ORACLE's %TYPE and %ROWTYPE

sql-server,oracle,tsql
I writing a cursor to select data from a table into variables. Using oracle I could simply use a single declare statement that in effect creates a variable for every column with a data type that matches the type of the underlying table (as it is currently defined at runtime).....

sqlite order by random groups

sql,sqlite
I have a table of songs with track and album columns and I want to get them in a random album order. i.e. such that in each album the songs will be sorted but the albums will be in random order. For example, if the table is: ----------------- | track...

Ionic header hide content despite class “has-header”

html,css,ionic
On an app with Ionic and AngularJs, I try to create a new template with a header. Unfortunately some content is hidden by the header. Here is my code: <link href="http://code.ionicframework.com/1.0.0/css/ionic.min.css" rel="stylesheet"/> <div class="bar bar-header bar-stable"> <h1 class="title">XXX</h1> </div> <ion-content class="has-header"> <div class="padding-horizontal"> <h4 class="center">Sign in</h4> <button class="button button-block button-positive">Sign...

Share Headless Fragment Between Activities

android,android-fragments
For some reason my understanding was that a headless Fragment lives for the duration of your application. With this understanding, in my attempt to persist an object between startActivityForResult() I put the object in a Headless Fragment like this private HeadlessFragment modelFragment; modelFragment = (HeadlessFragment) getSupportFragmentManager().findFragmentByTag(Constants.HEADLESS_FRAGMENT_TAG); if (modelFragment == null){...

Duplication of data in explicit authorization

permissions,authorization,relational-database,rdbms
Our current authorization strategy on our site is very tightly coupled to our RDB's schema - which in some ways is a good thing, since it means the permissions available to a user exactly match what he should have, assuming a correct interpretation of the data. So when we query...

how can i vary the sizes of the pie charts based on pie chart totals?

d3.js
I am trying to use d3 to construct an array of pie charts that vary in size based on the total value of the data in the pie chart. Does anyone know how i could take the html file from the d3 example: http://bl.ocks.org/mbostock/3888852 And modify the pie charts radii...

How can I use only one set of fields when i use an inline_formset?

python,django,inline-formset
I'm a bit of Django noob, and I have this problem: I have an inline_formset, but when I'm going to use it in my template, it shows me 3 sets of fields. This is my inline_formset: StorageFormSet = inlineformset_factory(WorkOrder, Storage, fields=('sto_type', 'paper_type', 'paper_qnty', 'web_paper_qnty',)) And this is my template: {%...

Why does this token based Spring Security filter not get called?

java,angularjs,spring,spring-mvc,spring-security
I am currently working on a project in which I use Angular JS and Spring REST services. These last few days I've been trying to get some security into the system (see my previous post). I'm implementing token based security. I got the basic stuff working, but the XAuthTokenFilter doesn't...

Illegal string offset when displaying data from array

php,mysql
I got the following code: <?php require('connect.php'); if(isset($_GET['region'])) { $region = mysql_real_escape_string($_GET['region']); if ($region == "eu") { $rows = mysql_fetch_array(mysql_query("SELECT * FROM `daily_leaderboard_eu`")); } elseif ($region == "na") { $rows = mysql_fetch_array(mysql_query("SELECT * FROM `daily_leaderboard_na`")); } } else { $rows = mysql_fetch_array(mysql_query("SELECT * FROM `daily_leaderboard_eu`")); } ?> <table> <tr> <td>Rank</td>...

How to update Datagrid with an ItemsSource that doesn't know when an item is added?

c#,wpf,data-binding,datagrid
I know I Should implement the INotifyPropertyChanged interface if I want to notify the grid that it should update for the properties in the items, So I did and it was working before. I decided to change the getter of the bound ObservableCollection so that it would be relative to...

How do I change output format to currency?

sql,sql-server,sqlcmd
I'm trying to make the following sqlcmd output the totaled amount in USD Currency and remove unnecessary trailing 0's declare @today datetime = '2015-5-2' set nocount on;select [Day Total] = sum(case when AccountingDate > dateadd(DAY, -1, @today) then [TotalJackpotAmount] else 0 end), [Week Total] = sum(case when AccountingDate > dateadd(WEEK,...

Keeping Track of Dynamic UIViews - Best Practices

ios,objective-c,uiview
So lets say I have 4 UIViews. Each UIView has been created and added to the main view dynamically from backend data. I have a model. This model contains an array of 4 objects, each object is the same. We have a UIView for each object in the array of...

How to add item in list in angularJS?

javascript,jquery,html,angularjs
I want that on click of "Add to Cart" button, item will add on "My Cart". Here is my angularJS code app.controller("OnlineShopping", function($scope) { $scope.items = [ {Product:"Moto G2", Desc: "Android Phone", Price: 10999}, {Product:"The Monk who sold his ferrari", Desc: "Motivational book", Price: 250}, {Product:"Mi Power Bank", Desc:...

Custom Authentication with Azure Mobile Apps

.net,authentication,azure,azure-web-sites,custom-authentication
I'm using the new Azure Mobile Apps (not the old Mobile Services) as backend for my Xamarin-App. Mobile Apps comes with a bunch of Social Authentication Options (e.g. Twitter, Facebook...), but I want my own authentication with my own account table. For the old mobile services custom auth is described...

How to create a Custom Select List for a netsuite field?

netsuite
I have a field on a custom record. The name of the field is reference_code. I want to populate "reference_code" with my own dynamic list which would be presented as a drop down to the user. How do I do this? I defined my field as Free-Text. Do I need...

Why one need different table aliases If the table appears more than once in the FROM clause?

sql,join
Currently I'm reading a book about SQL which provide following explanation: you will need to give each instance of the branch table a different alias so that the server knows which one you are referring to in the various clauses. But I can't understand why it's not possible to JOIN...

R - How to change values in one Matrix based on elements in another Matrix

r,if-statement,matrix,subset,covariance
I have the following covariance matrix in R: AB-2000 AB-2600 AB-3500 AC-0100 AD-0100 AF-0200 AB-2000 6.5 NA -1.8 3.65 -17.96 -26.5 AB-2600 NA 7.18 NA NA NA NA AB-3500 -1.79 NA 5.4 NA -4.63 NA AC-0100 3.65 NA NA 4.22 9.8 NA AD-0100 -17.96 NA -4.63 9.8 5.9 NA AF-0200...

Overhead in networkx reverse function?

python,graph,reverse,networkx
I have the following code: import networkx def reverse_graph(g): reversed = networkx.DiGraph() for e in g.edges(): reversed.add_edge(e[1], e[0]) return reversed g = networkx.DiGraph() for i in range(500000): g.add_edge(i, i+1) g2 = g.reverse() g3 = reverse_graph(g) And according to my line profiler I am spending WAY more time reversing the graph...

Not all the output is redirected into file in Python

python
I am trying to redirect all the stdout to a file, out.txt. But first commands's output display's on the terminal and the rest is fed to the file. I am not sure whats wrong in the piece of code below. import os import sys import subprocess orig_stdout = sys.stdout f...

Why does DateTime::createFromFormat() fails and returns a boolean in my second example?

php,string,datetime,format
When I run this the first one is correctly created into a date. The second one fails, returning a boolean and so I cannot format. Is the time out of range? //works correctly $startDate = "2015-05-06 10:49:20.637133"; $start = DateTime::createFromFormat('Y-m-d h:m:s.u',$startDate); echo $start->format('m/d/y'); //doesn't work correctly $startDate = "2015-05-12 15:49:06.821289";...

How to aggregate data.table on multiple dimensoins

r,data.table
I have a data table for which I want to aggregate the data based on multiple fields. Here is a simplified example of my data: # each record is the number of pages read # by a student in a given day pages_per_day <- data.table( student_id = c(1,1,1,2,2,2), week_of_semester =...

I get the same text my first id in all my tooltips, even though it doesn't belong to that id

javascript,php,html
I'm trying to learn some Javascript, and combine it with PHP and HTML. For the moment, I'm having the problem that when I mouseover my second or third div, It'll write whatever I'm having in the first div. $posts = get_posts(((isset($_GET['id'])) ? $_GET['id'] : null)); foreach($posts as $post){ ?> <div...

Highcharts multiple column chart with drilldown, correct formatting of drilldown axes

charts,highcharts,drilldown
I have a HighCharts chart with two series plotted. Each data point can be drilled down to show a sub-plot: http://jsfiddle.net/9phfzewj/21/ The problem I have is that when I click on an x-axis label I am taken to a sub-plot with two series shown. The x-axis labels of this sub-plot...

Add Item To kendoDropDownList

javascript,jquery,kendo-ui,kendo-dropdown
I am trying to add a item to the kendoDropDownList, it seems to add the option but not set the value and text. Inspecting the select it just adds a new option <option></option> Here is what I am using $("#nameList").data("kendoDropDownList") .dataSource.add({ "text": "Joe", "value": "Joe" }); UPDATE Here is my...

replace double qoute with inch PHP [duplicate]

php,regex,preg-replace,preg-match,preg-split
This question already has an answer here: Replace characters in a string? 3 answers I have an variable $query which holds for example 5.6" display or 5.6 " display is there anyway to change it to 5.6 inch display for both of the previous given examples? I tried using...

Eclipse Luna stop working in Debian when pop-up open

eclipse,crash,debian,eclipse-luna,kali-linux
every time I go to the Eclipse-luna IDE and enter a line of code in a class that I created and code assist opens the pop-up with suggestions, stop working the eclipse and only runs again if I kill process and re-run the eclipse. My OS is the latest stable...

From XQuery to XHTML

xml,xhtml,xquery
I would need some help. I'm trying to write an XQuery, whose output would be an XHTML file. The problem is, that "An XHTML document must have an XHTML DOCTYPE declaration" and I'm unable to put the DOCTYPE line in my XQuery file to generate a valid XHTML file. I...

R: Shapiro test by group won't produce p-values and corrupt data frame warning

r
This question has been asked before, but the solutions posed only partially solve my problem, and I've been working on this for days now. I felt it was time to seek help, even if the topic has been addressed previously. I apologize for any inconvenience. I have a very large...

Storing object as property in Neo4j

c#,neo4j,neo4jclient
I need to store an array of User objects inside a Tile node. Each User object contains three primitive properties; Id(a single alpha-character string) , fName and lName. This list of objects is a property of the Tile node with several other primitive properties. The entire Tile node needs to...

Is there a Python HTTP client that lets you set the size in Content-Disposition for posting files?

python,http,python-requests
I am POSTing files from Python to a vendor's API, and the vendor's API is complaining that the content is missing size in the Content-Disposition header. The example they give is like: Content-Disposition: form-data; filename=filename; name=name; size=1234 Is there a Python HTTP client that will let me include the size...

Files Upload on AWS S3 Bucket [android studio]

java,android,amazon-web-services,android-studio,amazon-s3
I am trying to upload files from android studio to AWS S3 Bucket. I have created a new AWS account. This seems to be validation/Authorization Code issue. Can someone please help in figuring out the root cause for this and how can this be solved ? Please Let me know...