Posts

Showing posts from April, 2013

merge - Combine vectors and tables in R -

i encountered problem during simple merging task , i'm looking better solution. i'm creating tables series of surveys (which cannot merge). tables have same values, different dimensions. the data below. table x x <- structure(c(44l, 167l), .dim = 2l, .dimnames = structure(list( c("similar", "compete")), .names = ""), class = "table") table y y <- structure(c(69l, 213l, 154l, 4l, 29l, 32l), .dim = c(3l, 2l), .dimnames = structure(list( c("other", "compete", "similar"), c("college", "no college" )), .names = c("", "")), class = "table") table z z <- structure(c(13l, 38l, 43l, 46l, 131l, 172l, 37l, 177l, 122l, 8l, 34l, 12l, 16l, 114l, 70l, 20l, 17l, 27l), .dim = c(3l, 6l ), .dimnames = structure(list(c("other", "compete", "similar" ), c("skipped", "democrat", "independe

asp.net web api - System.PlatformNotSupported exception with service stack -

i trying run service stack application, works fine on dev machine when deployed on box, system.platformnotsupported exception. stack trace below: unhandled exception: system.platformnotsupportedexception: operation not supported on platform. @ system.net.httplistener..ctor() @ servicestack.host.httplistener.httplistenerbase.start(ienumerable`1 urlbases, waitcallback listencallback) @ servicestack.host.httplistener.httplistenerbase.start(string urlbase) @ excaliburapphost.program.main(string[] args) i trying build restful app self hosting (with no iis support on other box). var listeningon = args.length == 0 ? "http://*:8090/" : args[0]; var apphost = new apphost() .init() .start(listeningon); error occurs in apphost().start() method if have unmanaged .dlls e.g. sqlite3.dll may need set platform target of project x86 . you can try running console app administrator / sudo in-case it's permission

html - Dynamic tables with JavaScript KnockoutJS -

hello i'm trying create dynamic table input values using knockout. table later work data matrix, can multiplicate input value of "product brands". this have now: var group = function(brand,value) { this.brand = ko.observable(brand); }; var viewmodel = function(groups) { var self = this; self.optionvalues_brand = ko.observablearray(["brand1","brand2","brand3"]); self.selectedbrand = ko.observable(); self.groups = ko.observablearray(ko.utils.arraymap(groups, function(group) { return new group(group.brand); })); self.addgroup = function() { self.groups.push(new group(self.selectedbrand())); } } var initialgroups = []; var viewmodel = new viewmodel(initialgroups); ko.applybindings(viewmodel); <scri

c# - web api self host custom ioc inject data to controllers -

i have property in web api self hosted app inject controllers, loaded via reflection using custom ioc framework, here startup code: public customclass stuffinstance { get; set; } // method required katana: public void configuration(iappbuilder app) { configureoauth(app); var webapiconfiguration = configurewebapi(); // use extension method provided webapi.owin library: app.usewebapi(webapiconfiguration); } my controllers scaffolded , like: // put: api/eventtypedescriptions/5 [responsetype(typeof(void))] public ihttpactionresult putstuff(int id, int something) { //do stuff //here use stuffinstance singleton return statuscode(httpstatuscode.nocontent); } how can inject stuffinstance controllers? information relevant making ioc framework btw since mentioned autofac potential candidate, recommend follow tutorial on webapi integration. you'll need define interface on customclass can inject it. you'll need inject instance you&#

database - oracle grammar to h2 grammar (+) join table -

i have following query oracle select distinct count(pa.payment_id) location c, inventory e, inventory_stock es, payment_client ep, payment pa, currency cur, location s, exchange_country exc, exchange_rate sso, exchange_hike so, exchange_margin sov cur.outstate = 'n' , c.location_id = e.location_id , e.inventory_id = ep.inventory_id , e.inventory_stock_id = es.inventory_stock_id , ep.client_id = pa.end_client , pa.cur_id = cur.cur_id , cur.location_id = s.location_id , c.client_id not null , cur.cur_id = exc.cur_id(+) , exc.exchange_id = sso.exchange_id(+) , sso.account_id = so.account_id(+) , so.option_name(+) = 'premium' , exc.exchange_id = sov.exchange_id(+) , sov.name(+) = 'value'; right using h2 database , syntax error got so.option_name(+) , sov.name(+); know (+) oracle's way of right join , left join there possible way convert h2 error ,

jquery - MVC AJAX returns only partial view -

trying ajax form update tbody of table browser submits controller returning partial view. think javascript files mentioned in other posts referenced correctly. following code test application can forwarded if needed. this form should change data in table 8 rows instead of 4 when checkbox checked, doesn't update table , returns contents of partial view 8 rows. main view (index.cshtml): @{ ajaxoptions options = new ajaxoptions { updatetargetid = "notestablebody", insertionmode = insertionmode.replace }; } @using (ajax.beginform("notespartial", options)) { <h3 class="csgorange ib" style="margin-top:-20px;">notes |</h3> <span class="f14">@html.checkbox("showmorenotes") show more notes</span> <input type="hidden" id="num" name="num" value="8" /> } <table class="table table-striped tableautowidth"> <tr>

asp.net mvc - How to ignore required field in form in Entity Framework, MVC C# -

i ask if possible ignore required field in form. problem have complex form in mvc using entity framework want create insurance , bind insurance firm or person, not both. when leave example form person empty, shout out personrodnecislo required field. firm table , person table in 1...n relationship insurance table , coz person can have multiple insurances same firm, cannot opposite side. for table firm primary key ico table person primary key personrodnecislo table insurance primary key insurancenumber so in database model insurance table has 2 foreign keys (ico , personrodnecislo) i tried use isnullorwhitespace method problem wont reach create method have force ef somehow ignore 1 of 2 field if 1 of them filled code [post] create method public actionresult create([bind(include = "personrodnecislo, firstname, lastname, street, city, psc, phonenumber, secondarystreet, secondarycity, secondarypsc")]person person, [bind(inc

Not able to run app on MobileFirst 7.1 Android simulator -

import sample hello world app (v7.0 version) mobilefirst 7.1 (7.1.0.00-20150913-2345), deploy , run on android simulator, getting alert dialog entry gap_init:2 , 2 buttons, if dismiss dialog ok or cancel button, hello world page shown. however, if run our app has adapter call server, app doesn't run after dismiss dialog. same app can run in iphone simulator without problem. browser console log has error after alert dialog pops : typeerror: this.vectorlayer undefined after dismiss dialog, console log add error: typeerror: cordova.exec not function found other people have reported similar error v7.0. , wonder whether fixed or not. edit: in fact not related android emulator, previewing android environment in mobilefirst console's mbs. happens due regression , taken care of in apar pi50036 cordova "gap_init:2" error when previewing android in mbs . i cannot confirm this. using latest 7.1 ifix available ibm fix central (i using ibm mobilefirst platfor

haskell - How can I create a value with a specific TypeRep -

using data.typeable , can reify type of value - typeof :: typeable => -> typerep however, given typerep , there seems no way "set" value type. for example - maybeinttype :: typerep maybeinttype = typeof (just 100 :: maybe int) but how use maybeinttype create (nothing :: maybe int) ?

sql - ORA-00922: missing or invalid option on changing the user password -

this plsql returning error: ora-00922: missing or invalid option declare begin execute immediate 'alter user upper(:username) identified :new_password replace :old_password'; end; ddl statements alter belongs cannot contain bind variables - :username, :new_password, :old_password use execute immediate 'alter user ' || upper(:username) || ' identified ' || :new_password || ' replace ' || :old_password; instead.

javascript - jQuery $.ajaxSetup headers applies to all ajaxRequests even when overwritten -

i have in below parameters ajax calls in <head> of document. (i need ios ajax bug @ https://stackoverflow.com/a/12856562/627473 $.ajaxsetup ({ cache: false, headers: { "cache-control": "no-cache" } }); i have service communicating denies cache-control header in way. so tried below before making ajax request. $.ajaxsetup ({ cache: true, headers: { 'invoke-control': 'emvx' } }); the above request still includes "cache-control": "no-cache" header. requirement of service making request prohibits cache-control header being in request (even if blank or has cache value. my request includes invoke-control (which want); not want cache-control show @ all. i tried specifying headers in $.post request , still merges headers $.ajaxsetup. i using jquery v1.11.1. there workaround? there no way can it. according jquery documentation of jquery.ajaxsetup, the settings specif

jsonschema - Why doesn't this JSON validate against this schema? -

user_definition.json { "definitions": { "user": { "type": "object", "properties": { "first_name": { "type": "string" }, "last_name": { "type": "string" }, "email": { "type": "email" } }, "required": ["first_name", "last_name", "email"] } } } user_schema.json { "allof": [ { "$ref": "../definitions/user_definition.json#/definitions/user" }, { "properties": { "id": { "type": "string" }, "created_at": { "type": "date-time" }, "updated_at": { "type": "date-time" } }, "required": ["id", "created_at", "updated_at"]

c# - Is there a language that supports a way to mark a parameter as not getting modified by a function? -

in c# there keywords allow 1 mark parameter ref , out , or ordinary parameter. are there languages support marking parameter being passed in won't modified function? if parameter list , function called clear() on list, in order language know parameter wasn't changing, guess such language need way of marking whether or not method modified object's internal state. yes, in pascal can specify constant parameter , tells compiler programmer won't change parameter in function.

Java List of Pairs -

i'm trying create list of pairs of integers. think have basic idea right i'm getting error whenever try add new pair list. here pair class: public class pair<l,r> { private l l; private r r; public pair(l l, r r){ this.l = l; this.r = r; } public l getl(){ return l; } public r getr(){ return r; } public void setl(l l){ this.l = l; } public void setr(r r){ this.r = r; } } here create new list of pairs: private arraylist<pair<short,short>> dominolist = new arraylist<pair<short,short>>(); and here example of try add new pair dominolist : dominolist.add(0, pair<0,0>); does see blatantly wrong way doing this? feel i'm missing simple, cant figure out what's wrong. feel adding new pairs incorrectly. you should call constructor create new pair instance. use dominolist.add(0, new pair(0, 0)); you said want pairs of integers. shouldn't use short integer instea

Turn page upside down using javascript when an image is clicked -

i making troll website , 1 of things website needs able turn page upside down when image clicked. want using javascript. use function onclick? you can add css rule transform: rotate(180deg); body tag when clicking image

php - Best method for storing multiple ID's in MySQL for querying large result sets -

i save email lists client subscribes to. might have: email_lists: id name 1 coupons 2 monthly newsletter 3 company news now, users can subscribe many lists want. let's have 3 users: users: id name lists 1 bob 1,3 2 jane 2,3 3 tom 1 now need query user id's subscribed list #1: select id users lists '%1%' is there better way of storing list id's each user queries can performed more efficiently? a third table subscrib best here: userid listid 1 1 // bob, coupons 1 3 // bob, company news 2 2 // jane, monthly newsletter 2 3 // jane, company news 3 1 // tom, coupons and query (for company news ): select userid subscrib listid = '3'; or select s.listid, u.email, u.name subscrib s left outer join users u on u.id = s.userid s.listid = '3';

objective c - how to detect user clicked iOS remote notification? -

when user taps on remote notification, following callback triggered in app delegate: -application:didreceiveremotenotification:fetchcompletionhandler: in scenario, application launched , app state uiapplicationstateactive interpret user actioned on remote notification. the problem: method can called when remote notification arrives , app in foreground with inactive state . example : when notification center view open(swipe top edge of screen down) or uialert open. in both case application state uiapplicationstateactive , there no way tell whether it's user actioned notification or system push received. q : how can determine if didreceiveremotenotification callback response user tapping on remote notification vs arrival of remote notification? uiapplicationstate state = [application applicationstate]; if (state == uiapplicationstateactive) { //when app in foreground , received push notification } else if (state == uiapplica

java - javafx: bug when trying to close window properly -

i designing close window functionality desktop application. high level explanation of functionality listed: if click exit menuitem, prompts confirmbox user confirm whether wants save or not before closing application. if user click on closebutton on window force close window (i.e. setoncloserequest function), exit menuitem event fire off, brings user case (1) again. within confirmbox code, have bind enter key save things, n key not save things , escape key close confirmbox. i have set accelerator exit menuitem (metakey + e). everything works fine. however, there minor bug if follow special sequence of steps. whenever use accelerator exit menuitem (i.e. metakey + e) and press either 1 of 3 keys(enter, escape, n), confirmbox closes pops again. i wondering why happening in special case? public class confirmbox { // answer[0] determines need save // answer[1] determines whether close application or not private static boolean[] answer = new boolean[]{false,fa

ios - MusicPlayerSetPlayRateScalar causes hang/freeze in __psynch_mutexwait -

i'm using avfoundation 's musicplayer play midi music in game, , periodically call musicplayersetplayratescalar set tempo. ported game objective-c swift, , since i've been getting hanging/freezing after couple dozen calls function. when freeze happens , pause execution, main thread sitting in following state: * thread #1: libsystem_kernel.dylib`__psynch_mutexwait + 8, queue = 'com.apple.main-thread', stop reason = signal sigstop * frame #0: libsystem_kernel.dylib`__psynch_mutexwait + 8 frame #1: libsystem_pthread.dylib`_pthread_mutex_lock_wait + 96 frame #2: audiotoolbox`camutex::lock() + 52 frame #3: audiotoolbox`sequenceplayer::settemposcalefactor(double) + 36 frame #4: audiotoolbox`musicplayersetplayratescalar + 136 cpu usage jumps 100% when happens, , memory usage starts growing steadily. don't have other threads of own running. other thread activity varies, here's example (top level of other threads' stack traces): t

ios - Button Text not showing -

Image
when try post following code, app shows empty rectangle button's text should be. beginner @ xcode , have determined code other tutorials. - (void)viewdidload { [super viewdidload]; uilabel *player1 = [[uilabel alloc]initwithframe:cgrectmake(35, 120,130, 30)]; [player1 settext:@"player"]; player1.layer.borderwidth = 1.0; player1.layer.bordercolor = [uicolor blackcolor].cgcolor; player1.textalignment = uitextalignmentcenter; [self.view addsubview: player1]; uibutton *score1 = [[uibutton alloc]initwithframe:cgrectmake(165, 120, 60, 30)]; [score1 settitle:@"0" forstate:uicontrolstatenormal]; score1.layer.borderwidth = 1.0; score1.layer.bordercolor = [uicolor blackcolor].cgcolor; [self.view addsubview: score1]; uilabel *player2 = [[uilabel alloc]initwithframe:cgrectmake(35, 150, 130, 30)]; [player2 settext:@"opponent"]; player2.layer.borderwidth = 1.0; player2.layer.bordercolor = [ui

How Do I Run Multiple instances .java Files (running one of them as an Object or Method) -

i using netbeans ide java 1.8.0 what doing wrong here? want use output.java - believe - method. possible or not? as mentioned earlier, using netbeans gui editor, automatically added main attribute. (please keep in mind have started using java week now, concept of methods , objects.) *edit public class main { output.main. = new jtextfield(); } and public jtextfield getin() { return in; } where jtextfield = getin(); string out = out.settext(); in , out jtextfields in java, run program, class needs have method "public static void main(string[] args)" defined. when attempt run java object compiling "javac myclass.java" , "java myclass", main method begins running.

javascript - Is it a good idea to resolve promises for all arguments when writing a function? -

if project uses promise lot, idea resolve promises arguments when writing function? example, function foo (arg1, arg2, arg3) { // stuff arg1, arg2, arg3 } let parg1 = getarg1async(); let parg2 = parg1.then(calcarg2async); let parg3 = getarg3async(); let p = promise.join(parg1, parg2, parg3, foo); becomes function foo(parg1, parg2, parg3) { return promise.join(parg1, parg2, parg3, function(arg1, arg2, arg3) { // stuff arg1, arg2, arg3 }); } let parg1 = getarg1async(); let parg2 = parg1.then(calcarg2async); let parg3 = getarg3async(); let p = foo(parg1, parg2, parg3); this called "lifting" method. it's useful , known technique , can write helper you: function lift(fn){ return function(){ return promise.all.call(this, arguments).then(fn); } } or in "modern node" , ignoring this : const lift = fn => (...args) => promise.all(args).then(fn) which let do: var lifted = lift(myfn); // fn run when

.net - Add friendly name attribute to xml element using c# attribute for serialization? -

i have entities generated database , wanted serialize them xml. problem of entities have column names not user friendly , reflected in fields of generated entity. is there c# attribute apply class fields add xml attribute, contains friendly-name value, xml element itself? example, using similar xmlattribute: public class book { public string title { get; set; } [xmlattribute("friendlyname","international standard book number")] public string isbn { get; set; } } should result in when serialized: <book> <title>to kill mockingbird</title> <isbn friendlyname="international standard book number">9780061120084</isbn> </book> there not attribute that. not common mix element documentation xml data. usually, want document xml schema xsd document or other means. that being said, here how it. you'd need change isbn property string custom type has friendlyname property can serialize.

jquery - Javascript Check all the custom checkbox? -

i tried script, create custom checkbox name parameter. function customcheckbox(checkboxname){ var checkbox = $('input[name="'+ checkboxname +'"]'); $(checkbox).each(function(){ $(this).wrap( "<span class='custom-checkbox'></span>" ); if($(this).is(':checked')){ $(this).parent().addclass("selected"); } }); $(checkbox).click(function(){ $(this).parent().toggleclass("selected"); }); } $(document).ready(function (){ customcheckbox("name1"); customcheckbox("name2"); }) display looks on css. want make checkbox checkall , uncheckall .. tried script ... $("#checkall").click(function(){ $('input:checkbox').not(this).prop('checked', this.checked); }); only default checkbox successful. custom checkbox mine not working. please fix. simple html <label><input type=

sql - Textboxes inside gridview validation -

i have gridview in have 100 rows of textboxes. textboxes have same id 'txtempcode'. user enters data in rows of gridview. how validate textboxes such 1 employee code entered once in textboxes. avoid duplicate entry of data. suppose user enters employee code '1234', should not allowed in other rows of textboxes. if enter, message should appear 'employee code has been entered'. can tell how achieve this? <asp:gridview id="gridview2" runat="server" style="margin-left: 23px; margin-top: 11px;" width="420px" cellpadding="4" autogeneratecolumns="false" forecolor="#333333" gridlines="none" height="213px" > <alternatingrowstyle backcolor="white" /> <columns> <asp:templatefield headertext="employee code"> <itemtemplate> <asp:tex

angularjs - angular : duplicate in calling controller's function -

i have following angular code <!doctype html> <html> <script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> <body> <div ng-app="myapp" ng-controller="myctrl"> test : {{mytest()}} </div> <script> var app = angular.module('myapp', []); app.controller('myctrl', function($scope) { $scope.name= "john "; $scope.mytest = function () { console.log('my test'); return 'something'; }; }); </script> </body> </html> for more detail, please refer http://plnkr.co/edit/uiu50aolmwkijnaphib5 problem: when view in chrome browser 'inspect element' console, function 'my test' called 3 times ! why ? because you've asked angular that. expression {{mytest()}} is in fact in

how to convert XML to JSON in angularjs? -

i want load xml file , convert json in angularjs on client side. you have 2 options. return data api in format require prevent conversions (recommended). convert xml json using javascript. for approach #2 i'll recommend solution http://goessner.net/download/prj/jsonxml/ and please sure read the article 'converting between xml , json' (by stefan goessner) overview details of problems conversions.

javascript - How to make Angular ng-switch animate(enter/leave) in more than one way? -

i write angular directive called 'cardviewer', can show images inside animation. when press "prev" button, image slides left. when press "next" button, image slides right. i try ng-switch , supports .ng-enter , .ng-leave animation class. need 2 ways enter(enter left , right), 2 ways leave(leave left , right). so try ng-class solve problem. hope can add toleft class before switch, can apply specific css animation. but seems not working properly. when press "next" button twice, works fine. when press "next", press "prev", new image enter in right direction, old image leave in wrong direction. my directive template: <h1>hahaha</h1> <div> <button ng-click='prev()'>prev</button> <button ng-click='next()'>next</button> </div> <div>current card index: {{displaycard}}</div> <div class="card-container" ng-switch="

URL Validation in PHP -

the topic has been discussed lot here @ stackoverflow answers managed explore fail produce results need. want check before inserting url database value url. default function of php filter_validate_url returns true if provide httpp://exampl but need validate value if true domain example.net, example.com etc.. let's try example: case 1: $url = "http://example"; if(!filter_var($url, filter_validate_url) === false) { return true; } this above returns true domain isn't valid. case 2: $url = "http://google.com"; if(!filter_var($url, filter_validate_url) === false) { return true; } returns true , that's okay. but possible solution case 1? please help. p.s.: used curl , works response slow (more 5 seconds). solid solution appreciated. i've coded quick script may achieving need : <?php //error_reporting(e_all); //ini_set('display_errors', 1); $url = "http:

ios - Iphone application works fine on simulator but crashes on actual devise -

my application works on simulator , doesn't show warning or error in console when test application on actual device crashes when start application. have local notification service enabled. storing large image file server local database when first view loads. tried launch application without storing images also,still not working. following crash report getting. let me know if knows it. in advance. incident identifier: b92ec717-8391-4f9a-8c34-3cf9aa2e697c crashreporter key: e06a9cfad6f483253b1278ac34a2f38ab1b5cd18 hardware model: iphone7,2 process: timestamp [268] path: /private/var/mobile/containers/bundle/application/e87aee22-e2d8-407f-bda4-ea626d287c98/timestamp.app/timestamp identifier: sg.timestamp version: 1 (1.0) code type: arm-64 (native) parent process: launchd [1] date/time: 2015-10-02 10:44:13.13 +0530 launch time: 2015-10-02 10:44:13.13 +0530 os version: ios 9

android - why not show existing raw in SQLite browser -

Image
i'm fire query in sqlite manager select * all_post activityid =020150928163171054; but can not show data of row all_post table, because raw data present in all_post table .what wrong . you not have row value in actitivyid column 020150928163171054 . for reason, values in table strings. in sql, string value must written '020150928163171054' .

c# - Problems with creating two routes which won't generate 404 error in ASP.NET MVC -

Image
i'm trying build tutorial project routing. main objective build 2 routes won't generate 404 error in case. mean if path wrong want routing use /home/index path. have 2 following routes - routes.maproute("default", "{controller}/{action}", new {controller = "home", action = "index"} ); routes.maproute("second", "{*catchall}", new {controller = "home", action = "index", id = urlparameter.optional} ); it works fine when use nonexistent path doesn't matches first route, - but if does, have following - or i understand reason why happens. @ present moment, managed find 'some sort' of solution. adding following code web.config file - <customerrors mode="on"> <error statuscode="404" redirect="~/home/index"/> </customerr

DBFit - Could not invoke constructor for Connect[4] -

my script: !contents -r2 -g -p -f -h !path lib/*.jar |import | |dbfit.sqlservertest| !|dbfit.sqlservertest| !|connect|sukhi-pc\sqlexpress|sukhi-pc\xxx|xxx|xxx| masked few details error message is: could not invoke constructor connect[4]. don't understand. i've read online may path not correct no idea it's looking connect command not fixture. appreciated. i know old post, future reference purposes; "could not invoke constructor connect[4]" error thrown fitnesse when trying connect sql server in dbfit test using slim server without calling databaseenvironment constructor. can overcome error planning dbfit test below.. !define test_system {fit} |import | |dbfit.fixture| |dbfit.sqlservertest| !|databaseenvironment|sqlserver | |connect |11.11.11.11:8888|username|password|databasename|

php - Codeigniter - Multiple Resize Image not working -

i've tried on clearing, un-setting config resizing orignal image different dimensions, no avail, under current controller code. upload_news_images() called when user selects images (orignal images uploaded, thumbs created shown user: (using ajax). when user hits submit form, i've resize each image using resize() funtions using different dimensions, no error being displayed. <?php defined('basepath') or exit('no direct script access allowed'); class datahandler extends ci_controller { public function insert_news(){ // uploaded images array $uploaded_images = $this->input->post('uploads'); // move images foreach($uploaded_images $img){ $j = 0; for($k=0; $k<3; $k++){ if($k==0){ $this->resize($img, 176, 176); } if($k==1){ $this->resize($img, 360, 360); } if($k==2){ $this-&

php - Inserting multiple row records using mysqli bind_param? -

i have code here works using mysql query. $n = count($fullname); for($i=0; $i < $n; $i++) mysql_query("insert famcomp(fullname,fage,frel,fcivil,fedu,foccup,finco,app_id) values ('$fullname[$i]','$fage[$i]','$frel[$i]','$fcivil[$i]','$fedu[$i]','$foccup[$i]','$finco[$i]','$id')"); how convert mysqli bind_param here's did: (i have connection.php ( mysqli )) $n = count($fullname); for($i=0; $i < $n; $i++) $stmt = $conn->prepare("insert famcomp(fullname,fage,frel,fcivil,fedu,foccup,finco,app_id) values (?,?,?,?,?,?,?,?)"); $stmt ->bind_param("ssssssss",$fullname[$i],$fage[$i],$frel[$i],$fcivil[$i],$fedu[$i],$foccup[$i],$finco[$i],$id); } but still not getting data. with code: $n = count($fullname); for($i=0; $i < $n; $i++) $stmt = $conn->prepare("insert famcomp(fullname,fage,frel,fcivil,fedu,foccup,finco,app_id) values (?,?,?,?,?,

performance - how can i implement android animation of printing a receipt like on MobilePay? -

i building pos android app , implement animation of receipt printing. similar in mobilpay https://youtu.be/2b4992fh-pa . cant seem know start from. you have make animation folder in project , put code there(res->animation). these links may out, https://github.com/2359media/easyandroidanimations https://github.com/lgvalle/material-animations

.htaccess - PHP GET Variable containing forward slashes rewrite -

i'm trying achieve following: rewrite: http://url.com?subfolder=folderone/foldertwo/folderthree to: http://url.com/subfolder/folderone/foldertwo/folderthree and call $_get['subfolder'] within php, should retrieve folderone/foldertwo/folderthree this works expected when defining ?subfolder= not following tries find folder path: rewriteengine on rewriterule ^subfolder/([^/.]+)/?$ index.php?subfolder=$1 [l] is above possible? thanks! use one: rewriteengine on rewriterule ^subfolder/(.*)$ index.php?subfolder=$1 [l]

string - PHP substr() function is not working as expected -

Image
i removing first character of string , using substr(); function that. example : <?php $amount = '€300'; echo substr($amount ,1); ?> this code doing work fine have bug. when display substr() function applied string display other symbol @ beginning of string. below image has output. in above image can see displaying unwanted symbol. when apply substr() function again works successfull. want know why function having symbol? symbol mean? why coming in output? i managed solve problem using utf8_decode , i.e.: $amount = utf8_decode('€300'); echo substr($amount ,1); //300

ios - How do we constrain items to the navigation bar programmatically using Swift? -

please advise if there method constraining items (e.g. uiview) navigation bar programmatically? idea constrain view directly below navigation bar bar not block view collectionview.topanchor.constraint(equalto: uinavigationbar.bottomanchor),

python - Extracting specific string after specific character -

new = ['mary 2jay 3ken +', 'mary 2jay 3ken +', 'steven +john '] print(new): mary 2jay 3ken + mary 2jay 3ken + steven +john - how sign/number after each person's name? i'm wondering whether dict work in case expected output is: mary:2 jay:3 ken:+ steven:+ john:- to index of "+" in string, can use: index = a_string.index("+") to check if "+" exist in string, use: if "+" in a_string: # ... to iterate list of string, can do: for text in new: # ... there fifty ways want. suggest read python tutorial . edit you can use regex extract fields name/number for text in next: couples = re.findall(r"(\s+)\s+(\d+|\+|\-|$)", text) name, num in couples: print(name, num)

android - How to implement pouchdb in cordova with an app packaged by webpack? -

i ask if knows how integrate pouchdb in cordova app? have created app in webpack/vue-cli , have successful run them in browser environment when try package app mobile development, seems database used (pouchdb) not working anymore. have tried googling every topic know implement logic no avail. to give idea how developed app here steps: used vue-cli create boilerplate app. have used vuetify, vuex, , vue-router, pouchdb inside app. after developing app , run through browser(with database connection working), package app using npm run build of webpack create browser compatible distribution. then went create cordova project using cordova cli, , went www folder , replaced index.html webpack app. then ran webpack/cordova app, difference is not load data pouchdb database anymore if run cordova run browser command. thank you

elixir - Access foreign relationship field through template -

let's have model in phoenix app. defmodule rumbl.video use rumbl.web, :model schema "videos" field :url, :string field :title, :string field :description, :string belongs_to :user, rumbl.user belongs_to :category, rumbl.category timestamps() end @required_fields ~w(url title description) @optional_fields ~w(category_id) def changeset(model, params \\ :empty) model |> cast(params, @required_fields, @optional_fields) end end and category field represents relationship category model has field called name. then in template have this: <%= video <- @videos %> <tr> <td><%= video.user_id %></td> <td><%= video.url %></td> <td><%= video.title %></td> <td><%= video.description %></td> <td><%= video.category_id %></td> <td class="text-right"> <%= li

android - How to prevent keyboard from closing when bottom dialog is open? -

Image
is there way not close keyboard, show dialog insted of keyboard(over it). after dialog closed need continiue typing without opening keyboard again? this dialog simple child of bottomdialogsheet: public class bottompage extends bottomsheetdialog { public bottompage(@nonnull context context) { super(context); view v = view.inflate(context, r.layout.layout_bottom_sheet, null); setcontentview(v); } } i've got implementation popup window covers keyboard other layout, there same problem when first opent popup , after press edit text show keyboard - popup hides, keyboard shows. how can prevent it, , let keyboard show without popup hiding? you can't simple. have window , keybord height that. look @ library , make own: https://github.com/ankushsachdeva/emojicon

amazon web services - AWS Tomcat SSL browser errors - what have I missed? -

i'm attempting set tls (ssl) domain hosted on aws bitnami users can access on https. running on apache tomcat standalone , not fronted lb. to generate certificate signing request (csr) have: sudo openssl genrsa -out /opt/bitnami/apache-tomcat/conf/server.key 2048 and entered correct information i.e. hostname in www.hostname.com format, then: sudo openssl req -new -key /opt/bitnami/apache-tomcat/conf/server.key -out /opt/bitnami/apache2/conf/cert.csr following have copied .csr file contents ca (ssl.comodo.com) & saved resulting files: .ca-bundle , .crt file. following have uploaded files tomcat directory , loaded them java keystore: keytool -import -trustcacerts -alias root -file www_domainname_com.ca-bundle -keystore keystore.jks and .crt: keytool -import -trustcacerts -alias tomcat -file www_domainname_com.crt -keystore keystore.jks tomcat configured use keystore following config in server.xml : <connector port="443" protocol="org.ap

c# - tilde `~` use in Enum -

iv'e through answer . can not seem understand line of code: i'm trying many cultures can. cultureinfo[] cinfo = cultureinfo.getcultures(culturetypes.allcultures & ~culturetypes.neutralcultures); public enum culturetypes { neutralcultures = 1, specificcultures = 2, installedwin32cultures = 4, allcultures = 7, usercustomculture = 8, replacementcultures = 16, [obsolete("this value has been deprecated. please use other values in culturetypes.")] windowsonlycultures = 32, [obsolete("this value has been deprecated. please use other values in culturetypes.")] frameworkcultures = 64, } does tilde makes constructor behave this?: cultureinfo[] cinfo = cultureinfo.getcultures(culturetypes.allcultures | culturetypes.neutralcultures | culturetypes.specificcultures | culturetypes.installedwin32cultures | culturetypes.usercustomculture | culturetypes.replacementcultures ); this expression: culture