Posts

Showing posts from July, 2014

asp.net core - OSX Error dnvm: command not found -

i newbie osx. after following step step instructions https://github.com/aspnet/home . brew tap aspnet/dnx brew update brew install dnvm i got following error when run dnvm upgrade: $ dnvm upgrade error: -bash: dnvm: command not found i have tried locate dnvm , looks installed in \usr\local directory. is there step missing? run source dnvm.sh after brew install dnvm , try run dnvm then. preferably, put on shell profile (e.g. inside .profile file) persist.

utf 8 - Specifying a character set in HTTP headers -

when using google pagespeed tester, following: the following resources have no character set specified in http headers. specifying character set in http headers can speed browser rendering. http://www.ntainc.com/ i have searched everywhere, , can't seem figure out why isn't "reading" charset. have listed in html document header: <meta charset="utf-8"> and in web.config file: <?xml version="1.0" encoding="utf-8"?> and there .htaccess file: adddefaultcharset utf-8 i believe our server iis. missing? the warning referring http content-type header. being sent webserver client this: content-type: text/html it needs sent instead: content-type: text/html; charset=utf-8 you need check webserver configuration. .htaccess addition should adding charset attribute header, apparently not. either put in wrong .htaccess file, or server ignoring it. the fact html contains <meta charset>

scala - What exactly ~> operator means in Spray.io? -

reading through code, can't understand meaning of operator. appreciated! see file: https://github.com/spray/spray/blob/master/spray-httpx/src/main/scala/spray/httpx/transformerpipelinesupport.scala it custom operator in spray similar function1.andthen used compose functions bit more convenient when used futures. supports chaining these 3 types of functions: a => b , b => c a => c (same andthen ) a => future[b] , b => c a => future[c] (similar future.map ) a => future[b] , b => future[c] a => future[c] (similar future.flatmap )

java - Using Jackcess to retrieve numeric values stored in a text field gives ClassCastException -

Image
i working jackcess read , categorize access database. it's meant open database, loop through each line, , print out individual row data console meet conditions. works fine, except when try read numeric values. code below. (this code built swing gui , gets executed when jbutton pressed.) if (inv == null) { // check see if inventory file has been set. if not, set default reference path. inv = rpath; } if (inventoryfile.exists()) { // check see if reference path exists. list<string> testtypes = jlist1.getselectedvalueslist(); list<string> evaltypes = jlist3.getselectedvalueslist(); list<string> graintypes = jlist2.getselectedvalueslist(); stringbuilder sb = new stringbuilder(); (int i=0; i<=evaltypes.size()-1; i++) { if (i<evaltypes.size()-1) { sb.append(evaltypes.get(i)).append(" "); }

reference - Understanding the Debug implementation for Vec<T> -

trying implement debug trait custom type stumbled upon implementation vec<t> . have difficulties understanding how works. the implementation goes this: impl<t: fmt::debug> fmt::debug vec<t> { fn fmt(&self, f: &mut fmt::formatter) -> fmt::result { fmt::debug::fmt(&**self, f) } } i understand calls fmt implementation other type. cannot understand type is. i've tried figure out of another question , , searching among implementations of debug looks appropriate (maybe &[t] ), no success. what exact meaning of &**self in context? implementation of debug being called? in cases this, find useful make compiler tell type is. cause type error , let compiler diagnostics you. easiest way try assign item of type () : fn main() { let v = &vec![1,2,3]; let () = v; let () = &**v; } the errors are: <anon>:3:9: 3:11 error: mismatched types: expected `&collections::vec::vec<_>`

ios - Facebook login with parse is only allowing developer to login -

i created fb login parse ios , sent test flight file testing other user. surprise, can login through fb developer account. how can solve problem? your app on developer.facebook has sandboxed turn on , thats why not available general public. do following go https://developers.facebook.com apps > select app status , reviews select yes make app , live features available general public. hope helps

How can i get form->field() value? -

in short, have following code: <?= $form->field( $isntmodel, 'id')->textinput() ?> <?= html::a('<i class="mdi-action-done"></i>', ['add-item', 'id' => ???], [ 'class' => 'btn-btn-add pull-right', ]) ?> this code wrong. so. need value input user. , set instead ??? $form->field() must have $model, $attribute, $options = [] . how can write field not using $model , $attribute? not table column, need value , set instead ??? i try that public function actionadditem($id) { $model = $this->$model; $product = product::findone($id); $orderitem = new orderitem(); $orderitem->order_id = $model->id; $orderitem->title = $product->title; $orderitem->price = $product->getprice(); $orderitem->product_id = $product->id; $orderitem->save(); return $this->redirect(['index']); } but throws exception. @ row $m

java - How to make JOOQ generate both enum types and custom types? -

i using jooq-codegen 3.6.1. when generate code generates enum types fine. jooq stops generating enums when add custom type so: <customtypes> <customtype> <name>localdatetime</name> <type>java.time.localdatetime</type> <converter>com.example.util.localdatetimeconverter</converter> </customtype> </customtypes> <forcedtypes> <forcedtype> <name>localdatetime</name> <types>timestamp</types> </forcedtype> </forcedtypes> the localdatetime data type generated fine in case. can't seem find way generate both enums , custom data type. it seems jooq not detect enums when there custom data type, log message: info: enums fetched : 0 (0 included, 0 excluded) any ideas? i believe bug in jooq, reported here: https://groups.google.com/forum/#!topic/jooq-user/enpvgqtvww0 as workaround avoid using <

angularjs - Is there any advantage of using angular js with magento? -

angular js new in market there advantage of using angular js magento ? if yes knows how can use both in single project ? angular not new in market, it´s pretty old already. anyway, benefit of using angular (or client framework) shop can lot faster - instead of page refresh every click, can load data/templates angular. example, rest api. meaning: load need , server can handle more users. there many resources topic already, here´s small list: https://github.com/wildhoney/magento-on-angular http://www.webspeaks.in/2014/03/integrating-angular-js-with-magento.html https://firebearstudio.com/blog/moa-magento-on-angular.html http://www.neevtech.com/blog/2013/04/12/lightning-fast-magento-store-with-json-angularjs-and-magento-j-a-m/ https://www.reddit.com/r/magento/comments/33mcgq/we_did_it_we_converted_our_magento_site_to_a/ read through links , know why it´s , how can done.

Android Asynchronous Http Client "Invalid cookie header" Error -

i trying use http post request login, server response ok in log there multiple entries this: w/responseprocesscookies﹕ invalid cookie header: "set-cookie: _boss_session=2e3aef5b7a0ffc7946127f791223aea6e09dfbcc; version=1; expires=thu, 21-may-2015 14:42:47 gmt; max-age=525600; path=/". unable parse expires attribute: thu my client: public static void get(string url, requestparams params, asynchttpresponsehandler responsehandler){ mclient.get(getabsoluteurl(url), params, responsehandler); } public static void post(string url, requestparams params, asynchttpresponsehandler responsehandler){ mclient.post(getabsoluteurl(url), params, responsehandler); } private static string getabsoluteurl(string relativeurl){ return url + relativeurl; } and use client: client.post("tools/ident/login", new requestparams(loginparams), responsehandler); how can solve problem ?

php - SimpleXML children's attributes behaves different with and without namespace -

the simplexml examples page , section "example #5 using attributes" states: access attributes of element elements of array. and example #1 in simplexmlelement::children() works using $element['attribute'] syntax access children's attributes; adding namespace code, disable access attributes: $xml = new simplexmlelement( '<person xmlns:a="foo:bar"> <a:child role="son"> <a:child role="daughter"/> </a:child> <a:child role="daughter"> <a:child role="son"> <a:child role="son"/> </a:child> </a:child> </person>'); foreach ($xml->children('a', true) $second_gen) { echo ' person begot ' . $second_gen['role']; foreach ($second_gen->children('a', true) $third_gen) { echo ' begot ' . $third_gen['role'] . ';'; foreach ($thir

c++ - QT select from mysql -

i'm beginner in qt. i'm using qt5 in ubuntu. want select columns table in mysql database 1 column(id) equal variable in integer type. should do? wrote code have error! qsqlquery query; int k=10; query.exec("select name,family employees id='"+k+"'"); while(query.next()){ qdebug()<<query.value(0).tostring(); qdebug()<<query.value(1).tostring(); } and error: invalid operands of types 'const char*' , 'const char [2]' binary 'operator+' query.exec("select name,family employees id='"+k+"'"); i not familiar qt, simple google search return : https://stackoverflow.com/a/15902962/4421474 so in case be: qsqlquery query; query.prepare(qstring("select name,family employees id = :id")); query.bindvalue(":id", k); query.exec(); by way have typo "selecr must "select .

php - How to localize a language and redirect the user to a specific url with CodeIgniter -

i have created website in 2 languages codeigniter: english (en) , german (de). the default page is: www.mysite.com the url en is: www.mysite.com/en/ url de www.mysite.com/de/ now redirect user according his/her device language. know, script below it's not right way. $lang = substr($_server['http_accept_language'], 0, 2); switch($lang){ case 'en': return redirect(site_url('en/')); break; case 'de'; return redirect(site_url('de/')); break; default: return redirect(site_url('en/')); } how can manage it? i found there syntax error in code @ case 'de'; it case 'de': $lang = substr($_server['http_accept_language'], 0, 2); switch($lang){ case 'en': redirect(site_url('en/')); break; case 'de': redirect(site_url('de/')); break; default: redirect(site_url('en/')); } and make sure have load url helper $this->load->helper('url'); als

mesosphere - connecting to a mesos development cluster on ubuntu 14 machine via opevpn -

can has settup mesos development cluster on google cluster me out.. have clutser running having hard time creating vpn conect clutser though have openvpn installed on machine , have downloded openvpn file provided mesos. using ubuntu 14. have followed instruction create cluster in order access mesos, marathon need configure vpn connection using openvpn file provided mesosphere not how on ubuntu 14.. have tried openvpn --config <file.ovpn> ?

How can we remove the current date from gradle generated .html and .xml file while running JMeter script from build.gradle file? -

i running jmeter script build.gradle file. after executing generating html , xml report files script name. problem current date present script name. please tell me how remove current date output files. gradle- gradle-2.4 version , html report publisher plugin in jenkins i'm assuming you're using com.github.kulya/jmeter-gradle-plugin ? the date tacked on testplan name while generating results, used while generating reports. intention believe results not overwritten each time run test. the way implemented , isn't configurable. if have 1 set of result , report per jmx file, should able define new task though strip out date/timestamp results , report files. task stripdatefromreport() { new file("build/jmeter-report").eachfilematch(~/.*.[xml|html]/){ file -> def m = file.getname() =~ /^(.*?)-[0-9]{8}-[0-9]{4}(.*?)$/ file.renameto(new file(file.getparentfile().getcanonicalpath()+ file.separator + m[0][1] + m[0][2])) } } note: if have

c# - Page Navigation Error WP RT -

everytime press button go second page main page debugger error: unhandledexception += (sender, e) => { if (global::system.diagnostics.debugger.isattached) global::system.diagnostics.debugger.break(); }; my button pressed event this: private void hardwarebuttons_backpressed(object sender, backpressedeventargs e) { frame rootframe = window.current.content frame; if (rootframe != null && rootframe.cangoback) { e.handled = true; rootframe.goback(); } } in mainpage inicializate camera using <captureelement> , when press button, error: the requet invalid in current state in part of code: await _mediacapture.capturephototostreamasync(imgprop, stream);

jquery - Get H3 and build link with ID -

i'm trying h3 elements on page build links , create dynamic summary. so here's have : $('h3').attr('id', function() { return this.innerhtml; }); $('h3:not(:last)').append(" › "); var headers = $('h3').text(); $('.summary').append(headers); i have : header1 › header2 › header3 › header4 but don't know how use id of each h3 elements , build links have : <a href="header1">header1</a> › ... thank help. regards. edit : problem " › " added in h3 , not in summary... you should use jquery's .each() function, this: $(document).ready(function() { $('h3').each(function(index) { var id = $(this).attr('id'); var text = $(this).text(); var spacer = index ? ' > ' : ''; // don't show spacer first item var header = spacer + '<a href="#' + id + '">' + text + '</a>';

assembly - Hidden value included when putting ebx register into a DD variable -

at 1 moment while executing code turbo debugger, bx register has 0001 value in it. (i can view bx register in turbo debugger, , not find how view whole ebx . side question: how view whole eax/ebx/... registers? ) immediately after, when send ebx dd variable sum1 , sent value becomes 30310001h . what reasons , how can avoid it? my guess reason: sum1 recieved invisible value, included in ebx not bx (contained ebx ). (i new ebx/eax/... registers btw.) if guessed right, how can access unseen part of ebx ? this shortened code, loop2a converts string decimal value, char-by-char, , puts ebx . loop2a: mov eax, [di] mov ah, 0 sub eax, '0' imul eax, ecx add ebx, eax mov sum1, ebx imul ecx, ten dec di cmp di, jne loop2a mov sum1, ebx (compiler: turbo assembler, processor: intel x86.) anywhere in code initialized bx ( xor bx,bx or mov bx,0 ). change ebx

events - VBA EnableEvents fire textbox_change -

i have textbox code on change, , if press button following code private sub commandbutton1_click() application.enableevents = false textbox1.text = "new text" application.enableevents = true end sub but still fires on change event of textbox. this happens because application.enableevents allows enabling/disabling events fired application (i.e. excel). in case, parent firing textbox1 change not application rather userform . example cpearson how create own enableevents property on userform . report content of link here (to avoid "link-only answer"): to suppress events in form, can create variable @ form's module level called "enableevents" , set false before changing property cause event raised. public enableevents boolean private sub userform_initialize() me.enableevents = true end sub sub something() me.enableevents = false ' code cause event run me.enableevents = true end sub then, of con

SourceTree 1.6.14 cannot find Git 2.4.0 installation on Windows -

after installing git 2.4.0 on windows 7 system, tried change option in sourcetree 1.6.14 "use system git", rather embedded version. however, upon clicking "use system git", nothing happened , setting remained set "use embedded git". how can make sourcetree use installed version of git? this fixed in future patch sourcetree, however, until there workaround follows. git versions prior 2.0 stored git.exe in subdirectory called bin , sourcetree looking for. of git >=2.0, git.exe moved folder named cmd . therefore, easiest way sourcetree recognise git installation, create symbolic link folder using mklink follows: c:\program files (x86)\git\>mklink /d bin cmd edit: whilst above fixes git normal gui operations (commit/push etc.) not fix "terminal" button, command tries execute sh.exe via following command , fails sh.exe has been moved in git 2.4. "c:\windows\system32\cmd.exe" /c "c:\program files (

load - How to refresh only a image of a whole page, when the imagename is variabel? -

this puzzle i'm struggeling with: i have website amount of images, , i'd images refreshed each 20 seconds, this code wrote far that: <img src="imgcam/mostasquare_1.jpg" border="1" name="refresh" id="img1"> <img src="imgcam/mriehelbypass_1.jpg" border="1" name="refresh" id="img2"> <script language="javascript" type="text/javascript"> var t = 35 // interval in seconds images = new array('../imgcam/mostasquare_1.jpg','../imgcam/mriehelbypass_1.jpg'); //urls of images function start() { tmp = new date(); tmp = "?"+tmp.gettime(); (i=1;i<image.length;i++){ document.getelementbyid("img"+i).src = images[i]+tmp; } settimeout("start()", t*1000) } start(); </script> and solely works great, but, here catch: i force browser refresh/download images when opening page. so therefor appended querystring ran

c# - CollectionAssert of an nested List -

how assert nested list too, without 'unnesting' it? expected.add(new customer{ edition = "cust", rarity = "r", id = 1001, name = "john doe", types = new list<type_>{ new type_{ id = 1, name = "abc" } }, here assert: collectionassert.areequal(expected, actual); that exclude nested list. something worked me: generate object hash (such md5) includes content of list, quite rigid approach , seldom useful just write second assert in test inner list. more conventional approach (my favourite) write new test assert inner list. more tdd-purist approach edit, here example of conventional approach: var expected = new list<type_>{ new type_{ id = 1, nam

c# - Make javascript continue to play after redirect -

im using visual studio 2013. coding in .net c#. my projekt cms im using master page. on content pages got save button. when pressing load javascript class code: contentpage protected void btnsave_click(object sender, eventargs e) { sys.enigma.message m = new sys.enigma.message(); m.infomessage("post updated", 5, master.page); } class public class message { public void infomessage(string text, int seconds, page page) { seconds = seconds * 1000; text = "<div class='e-info-message'>" + text + "</div>"; page.clientscript.registerstartupscript(gettype(), "load", "<script type=text/javascript> var x = document.getelementbyid('e-info-message'); x.innerhtml = \"" + text + "\"; settimeout(function() { $('.e-info-message').fadeout('slow');}, " + seconds + "); if (ispostback){$('.e-info-message').show();} <

java - Date Parsing using SimpleDateFormat and parsePosition -

i trying parse string date object.previously used parse(string) definition date 4/1/2004 2:00:00asasasas getting correctly parsed wrong.so used parseposition signature parse(string,parseposition) , checked if index not equal length invalid date.but above logic fails string "4/1/2004 2:00:00 am.although it's valid date due index , length logic says invalid date when try parse in "m/dd/yyyy" format. parser parses correct date part , not take whole string consideration. way achieve ? formatstr can format pattern. please advise. public static void main(string[] args) { string formatstr="m/dd/yyyy"; simpledateformat sd = new simpledateformat(formatstr, locale.getdefault()); string str = "4/1/2004 2:00:00 am"; parseposition pp1 = new parseposition(0); date retdate = sd.parse(str, pp1); if(retdate==null ||pp1.getindex()!=str.length() ){ system.out.println("i have invalid date");

ios - Subtracting Currency - NSNumber -

im dealing currency values need subtract each other. read nsnumber dealing currency, unable subtract 2 nsnumbers. there better way dealing currencys or missing small? nsnumberformatter *numberformatter = [[nsnumberformatter alloc] init]; [numberformatter setnumberstyle: nsnumberformattercurrencystyle]; nsnumber* number = [numberformatter numberfromstring:bdict[@"booking_deposit"]]; if (!number) { [numberformatter setnumberstyle: nsnumberformatterdecimalstyle]; number = [numberformatter numberfromstring:bdict[@"booking_deposit"]]; } nsnumber* number2 = [numberformatter numberfromstring:bdict[@"booking_total"]]; if (!number2) { [numberformatter setnumberstyle: nsnumberformatterdecimalstyle]; number2 = [numberformatter numberfromstring:bdict[@"booking_total"]]; } nslog(@"result %@",number2 - number);//warning here an

scanf crashes program and comparing string C -

i'm beginner in c, , got crash of program when gets end. it mini game in user have guess number. when it's found, program asks user if wants play new game. please find code below : #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> int main() { int max = 100, min = 0; int nombrecoup = 0; int nombremystere = 0; int nombrejoueur; char newpartie; int continuerpartie = 0; int niveaudiffic; srand(time(null)); nombremystere = (rand() % (max - min + 1)) + min; printf("bonjour, ceci est un mini jeu dans lequel vous allez devoir deviner un nombre choisi aleatoirement entre 0 et 100.:\n"); while (continuerpartie = 1) { printf("choisissez votre niveau de difficulte entre 1 et 3 :\n"); scanf("%d", &niveaudiffic); switch (niveaudiffic) { case 1: printf("vous avez selectionne la difficulte facile. le jeu commence.\n"); break; ca

c++ - Send WM_NCMOUSEMOVE and WM_SETCURSOR messages. How to fill parameters? -

i need send aforementioned messages. documentation says: wm_ncmousemove. lparam. points structure contains x- , y-coordinates of cursor. how can create lparam structure? wm_setcursor. wparam. handle window contains cursor. how can pass it? wm_setcursor. lparam. high-order word of lparam specifies identifier of mouse message. what identifier? you can consider lparam , wparam numerical values data types. you can use makelparam , makewparam macros create own lparams , wparams , pass them. here detail them: makelaparm : https://msdn.microsoft.com/en-us/library/ms632661(v=vs.85).aspx makewparam : https://msdn.microsoft.com/en-us/library/ms632664(v=vs.85).aspx so, pass appropriate values , return lparam. when documentation says : wparam. handle window contains cursor. can create lparam this: lparam lparam = m_hwnd; //where m_hwnd handle window. otherwise can specify high , low macro , create lparam , wparam you. , pass points lparam this:

css - How to manipulate SVG background image with JavaScript -

i want remove viewbox property of root svg element in background image javascript. how that? .box { background-image: url(http://upload.wikimedia.org/wikipedia/commons/8/86/cc-logo.svg); background-repeat: no-repeat; background-size: auto auto; width: 300px; height: 150px; border: 1px solid; } <div class="box"> stretch background </div> here first few characters svg file. <?xml version="1.0" encoding="utf-8"?><svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewbox="0 0 512 123"> you can use svg fragment identifier viewbox(none) change url to http://upload.wikimedia.org/wikipedia/commons/8/86/cc-logo.svg#svgview(viewbox(none)) this work in firefox (and did work in opera 12). not sure how many other uas support viewbox(none) svg 1.2 tiny though.

Is it possible to add and configure Dynamics CRM workflows with Powershell -

is possible deploy managed solution microsoft dyanamics crm 2013/2015 plugin assemblies via ui, use powershell script add workflows, , steps? short answer: yes. long answer: yes - need create .net cmdlets access crm service powershell can run. if don't want roll own solution, make of use. http://waelhamze.com/2013/08/20/automated-crm-deployments-powershell/

regex - Python: Reggular Expressions filtering for Self Learning program -

i making program has small way of self learning, want "information" output like: >>>#ff0000 hexcode color red i want filter reggular expressions user filled sentence is hexcode color , , retrieve name of color , hexcode. have put small code below how want works: #main.py strinput = raw_input("please give fact:") if "{0} hexcode color {1}" in strinput: # {0} name of color # {1} hexcode of color print "you give me color" if "{0} vehicle" in strinput: # {0} vehicle print "you give me vehicle" is possible reggular expressions , , best way reggular expressions ? you can read regular expressions in python in standard library documentation. here, i'm using named groups store matched value dictionary structure key choose. >>> import re >>> s = '#ff0000 hexcode color red' >>> m = re.match(r'(?p<hexcode>.+) hexcode color (?p<

Call C++ library in C# -

i have lot of libraries written in c++. want call these libraries c#, however, have met many problems. want know if there book or guideline tell me how that. dllimport - http://msdn.microsoft.com/en-us/library/aa984739(vs.71).aspx wrapper class - http://social.msdn.microsoft.com/forums/en-us/vcgeneral/thread/67cc9eea-a4fe-48bd-b8d5-f3c8051ba896

need to select an array in an array of arrays in c++ -

i have foo[x][my_array[]] i need store x number of my_array . another script sent my_array , script sent array , need check difference. i send 5 my_arrays , script return 5 arrays need check see if each my_array sent same array received.(this done in while loop) while (i<5){ if (foo[i][my_array]!= array) print error }//just example my_array sent script without been broken up. ie script takes array earlier had my_array[] , send values sending 'my_array' answer: turns out can foo[i] select ith my_array just use array[4] in void print(const int (&a)[10]) { (auto e : a) { std::cout << " " << e; } std::cout << std::endl; } int main() { int a[10][10] = { {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, {10, 11, 12, 13, 14, 15, 16, 17, 18, 19}, {20, 21, 22, 23, 24, 25, 26, 27, 28, 29}, {30, 31, 32, 33, 34, 35, 36, 37, 38, 39}, {40, 41, 42, 43, 44, 45, 46, 47, 48,

how to avoid overriding the file from merged branch in git -

we have 3 branches master, develop , release. made changes in release branch's file , tried merge developer happened. we have test.html in both branches developer , release , lost develop branch's file content after merging release. know caused this. used below commands: >git checkout release >git checkout develop >git merge release no conflict lost develop branch file content. strange me. never happened before. i tried merge cherry-pick , specific file merge nothing workout these commands overriding develop branch file content. it's hard understand problem without log. if merge done without conflict, possibly fast-forward merge. might happen if release child of develop 's head commit. also, above commands merge release develop . meant? please run following command , post results here: git log --oneline --graph --decorate --all

PHP Sort array by field? -

possible duplicate: how sort multidemensional array inner key how sort array of arrays in php? how can sort array like: $array[$i]['title']; array structure might like: array[0]( 'id' => 321, 'title' => 'some title', 'slug' => 'some-title', 'author' => 'some author', 'author_slug' => 'some-author'); array[1]( 'id' => 123, 'title' => 'another title', 'slug' => 'another-title', 'author' => 'another author', 'author_slug' => 'another-author'); so data displayed in asc order based off title field in array? use usort built explicitly purpose. function cmp($a, $b) { return strcmp($a["title"], $b["title"]); } usort($array, "cmp");

r - How to add/merge dataframes in a list -

i used following loop read 7 csv files , add them list. list <- list() l <- 1 for(i in 1:7){ data <- read.csv(paste("file",i,".csv",sep=""),header=false) list[[l]] <- data l <- l + 1 } so have list named "list" containing 7 dataframes, right? each of 8 dataframes contain same 3 columns (name, surname, age). want add: df <- dataframe(name,surname,age) ## each dataframe in list. did @ all? question is, how can achieve 7 objects in list automatically! if 'lst' has 7 data.frames , want 'rbind' 8th dataset each of datasets in list, can use map map(rbind, lst, list(d1)) or using lapply lapply(lst, rbind, d1) update if 'lst' of length 8, , wants rbind first 7 elements dataset in 8th element, can do map(rbind, lst[-8], lst[8]) data set.seed(24) lst <- lapply(1:7, function(i) as.data.frame(matrix(sample(0:10, 3*10, replace=true), ncol=3)))

javascript - Create table if data from ajax not empty -

first have html: <div class="showtable" style="display: none;"> <table id="example" class="table table-responsitive" cellspacing="0" width="100%" style="margin-top:30px;"> <thead> <tr> <th>id</th> <th>broj računa</th> <th>kupac</th> <th>datum izdavanja</th> <th>rok za plaćanje</th> <th>status</th> <th></th> </tr> </thead> </table> </div> <div class="showinfo" style="display: none"> </div> after write js: $(document).ready(function() { drawvisualization(); }); function drawvisualization() { console.log('proba'); $.a

c# - Access all users from active directory -

i want active directory users. have tried following code cn property available. these other properties not returned: 1)username 2)email 3)phoneno an objectreferance error thrown. using (var context = new principalcontext(contexttype.domain, "mydomain.com")) { using (var searcher = new principalsearcher(new userprincipal(context))) { foreach (var result in searcher.findall()) { directoryentry de = result.getunderlyingobject() directoryentry; string str = de.properties["sn"].value.tostring(); } } } public class users { public string email { get; set; } public string username { get; set; } public string displayname { get; set; } public bool ismapped { get; set; } } try { string domainpath = ""; directoryentry sea

Executing an XML with number of xls-transformations in sequence using Java Method -

i able succeed writing method 1 xml , 1 xsltranformation. but requirement executing more 1 xsl transformations in sequence. i.e output of first transformation should used input of subsequent transformation,...something follows public static string transformer(inputstream xml, list<inputstream> xsltinputstreamchain) { } i not getting idea how can achieved. can me out

ios - WKWebView programmatically reload trigger didFailProvisionalNavigation -

a uisplitviewcontroller base app, master uitableviewcontroller , detail uiviewcontroller . when uitableviewcontroller cell taps, nsnotificationcenter post notification , reload wkwebview in detailviewcontroller . reload successlly, trigger wknavigationdelegate [webview:didfailprovisionalnavigation:witherror:], why???? masterviewcontroller - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { dispatch_async(dispatch_get_main_queue(), ^{ [[nsnotificationcenter defaultcenter]postnotificationname:anotification object:nil]; }); } detailviewcontroller - (void)viewdidload { [super viewdidload]; [[nsnotificationcenter defaultcenter]addobserver:self selector:@selector(__shouldreload:) name:anotification object:nil]; } - (void)__shouldreload:(nsnotification *)sender { [_webview reload]; } this caused "app transport security". can e

javascript - Border-radius on iframe not working on MAC (safari) -

Image
i facing css problem. border radius on not working on mac book (safari).. when try on widows working well.. here html <div class="map"> <div class="map-border"> <iframe width="295" height="295" src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d3160.515465008442!2d-122.40503609999998!3d37.6135611!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x808f77776e3c0101%3a0x78bd162ebe8e8904!2s1699+el+camino+real+%23201!5e0!3m2!1sen!2s!4v1403695117548"> </iframe> </div> here css code. .map { width: 315px; height: 315px; overflow: hidden; position: relative; border: 10px rgba(0, 0, 0, 0.1) solid; -webkit-border-radius: 190px; -moz-border-radius: 190px; -ms-border-radius: 190px; -o-border-radius: 190px; border-radius: 190px; -webkit-transition: 0.4s ease-in; -moz-transition: 0.4s ease-in; -o-transition: 0.4s ease-in; transition: 0.4s ease-in; z-index: 10; } .map .m

I want to insert image path in database using MYSQL in PHP -

i want insert image path in database. in browser when user selects image path , image store in image folder , path store in database. tried if ($type==...) part not working. going else statement. edited : if (isset($_post['bsubmit'])) { var_dump($_files); $name = $_files['file']['name']; $type=var_dump($_files['file']['type']); if ($type == 'image/jpeg' || $type == 'image/png' || $type == 'image/gif') { if (file_exists(dirname($_server['document_root']) . '/htdocs/amit_404_store/img/' . $name)) { echo 'file present'; } else { $uploadimage = move_uploaded_file($_files['file']['tmp_name'], dirname($_server['document_root']) . '/htdocs/amit_404_store/img/' . $name); echo "stored in: " . "" . $name . "<br />"; $destination = $name;

android - Custom widget cannot be cast to custom widget -

i created custom widget extending edittext looks edittext acts little different, code, although don't think content of class problem: public class salutationedittextlikebutton extends edittext { charsequence[] options; string selection; context context; long performclickcatch = 0; public void dontperformclickformilliseconds(long milliseconds) { performclickcatch = system.currenttimemillis() + milliseconds; } public salutationedittextlikebutton(context context) { super(context); this.context = context; disableinput(); } public salutationedittextlikebutton(context context, attributeset attributeset) { super(context, attributeset); this.context = context; disableinput(); } public salutationedittextlikebutton(context context, attributeset attrs, int defstyle) { super(context, attrs, defstyle); this.context = context; disableinput(); } priva

html5 - Simulate an Excel worksheet on HTML page -

i working on page visitors need copy-paste hundreds of rows excel spreadsheet on page. easier way display text area , parse different columns. but there way display spreadsheet? more user friendly. tried ckeditor option this, doesn't appear exist. you can display excel spreedsheet in asp code either c# or vb. try link displaying spreedsheets, displaying spreedsheet on webpage

telerik - Issue with Rad grid inside Rad Ajax panel row edit not firing -

i'm facing problem rad gird inside rad ajax panel first in kept radgrid inside asp:panel here works fine <asp:panel id="panel1" runat="server"> when replace asp:panel radajaxpanel edit , add buttons not working here code <telerik:radscriptmanager id="radscriptmanager1" runat="server"> </telerik:radscriptmanager> <telerik:radajaxpanel id="div" runat="server" enableajax="true" > <telerik:radgrid id="rdgopdata" runat="server" cssclass="value" allowpaging="true" allowsorting="true" allowfilteringbycolumn="false" onneeddatasource="rdgopdata_needdatasource" onitemdatabound="rdgopdata_itemdatabound" oninser

Only else part is being executed in If-else statement in matlab -

i'm working on counting numbers using if-else statement. i'm getting result, it's executing else part , not looking @ other part. this code i'm working with i = 0; j = 0; if sum( abs( f1(:) - f2(:))) == 0.0 = + 1; else j = j + 1; end if sum(abs(f2(:) - f3(:))) == 0.0 = + 1; else j = j + 1; end if sum(abs(f3(:) - f4(:))) == 0.0 = + 1; else j = j + 1; end msgtext = sprintf('matching = %d',i); h = msgbox(msgtext); msgtxt = sprintf(' not matching = %d',j); h = msgbox(msgtxt); any suggestions? thanks in advance! your question extremely vague i'm going pretend asked 1 of if s: if sum( abs( f1(:) - f2(:))) == 0.0 = + 1; else j = j + 1; end i think there fair chance ever fall else clause because trying equate floating point numbers, , bad idea due precision errors. depends on nature of f1 , f2 , doubles, how calculated etc have given no indication of in question. if want understand why can't equ

angularjs - $anchorScroll not functioning properly -

on click of button want page scroll particular div bottom . the 1st time click, page going top , initial url http://localhost:8000 becomes http://localhost:8000/#/bottom ( why not going div mentioned ). the 2nd time click button, url becomes http://localhost:8000/#/bottom#bottom , goes div bottom ( which want ). how deal ? code snippet $location.hash('bottom'); $anchorscroll(); thanks in advance do ask more explanation if required . . . i don't know if still need help, have checked this question? anyway, use 1 button anchor scroll: <button ng-click="app.gotoanchor('destination')">go!</button> (...) <div id="destination" style="height:1px;"></div> and used combination of angularjs documentation examples , question mentioned before, make function: function gotoanchor(anchor){ if ($location.hash() !== newhash) { // set $location.hash `newhash` , // $anc

c++ - Passing iterator by reference gives an error: cannot convert parameter 1 from 'const data' to 'data & -

i have function int func(data& dt) . it s need use list of structures lst . it s proposed map , list has elements (but in example has 1 element). have iterate through list , push each element func function reference. #include <iostream> #include <map> #include <algorithm> #include <list> #include <string> typedef struct{ char inf[3]; }data; std::map<int, data*> mp; std::list<data> lst; int func(data& dt){ ... } int main(){ ... //iterate through list std::list<data>::const_iterator iterator; (iterator = lst.begin(); iterator != lst.end(); ++iterator) { data param = *iterator; func(param); //func(*iterator); // doesn`t work! } return 0; } the problem is: func doesn t work *iterator. why should this: data param = *iterator` make work? thank help! iterator const_iterator : std::list<data>::const_iterator iterator; but function try pass tar

javascript - Getting WebDriver to re-size using protractor and cucumber -

i have been unable resize selenium webdriver in protractor/cucumber testing. these of commands have tried. webdriver.webdriver.window().setsize(width, height); webdriver.webdriver.window().setsize(width, height); webdriver.webdriver.window.setsize(width, height); webdriver.webdriver.window.prototype.setsize(width, height); from here browser.driver.manage().window().setsize(width, height); how set default browser window size in protractor/webdriverjs and: browser.driver.manage().window().maximize(); webdriver.webdriver.window.prototype.maximize(); webdriver.webdriver.window.maximize(); browser.driver.manage().window().maximize(); this article, example, no don't know imports come from. i have had no luck understanding root of issue return promises , not sure how debug them. i using protractor version 2.0.0 thank help! browser.manage().window().setsize(width, height); works me. notice i'm not trying call driver in examples. full step def looks

android - Dividers didn't display in RecyclerView after addItemDecoration() called -

a recyclerview nested in cardview . tried call additemdecoration() add dividers recycylerview ,but didn't work. <android.support.v7.widget.cardview xmlns:card_view="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="wrap_content" card_view:cardbackgroundcolor="@color/white_color" android:layout_marginleft="10dp" android:layout_marginright="10dp" card_view:cardelevation="3dp"> <android.support.v4.widget.swiperefreshlayout android:id="@+id/swipe_saleproduct_list" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.v7.widget.recyclerview android:id="@+id/recycler_saleproduct_list" android:layout_width="match_parent" android:layout_height="match_parent"