Posts

Showing posts from March, 2015

android - ListView getting displayed, but App crashes on Scrolling and clicking -

i have listview custom layout named custom_ listview.xml : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> <textview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:textsize="20dp" android:padding="5dp" android:id="@+id/file_name" /> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:textsize="18dp" android:id="@+id/file_path"/> </linearlayout> and customadapter class: public class customadapter extends baseadapter { arraylist<file> result; context context; private static layoutinflater inflater=null; public customadapter(activit...

jquery - slide on iphone safari causes toggle to fire bug -

on http://inigo.nu (temporary project) i use clicking div toggle display menu ul using html: <div id="toggle-menu" class="hover">menu</div> jquery: jquery(document).ready(function(jquery) { jquery('#toggle-menu').on('click', function() { jquery('nav ul').toggle('slow'); }); }); only on iphone safari strange bug occurs. sliding after opening menu click makes opened menu dissappear again. causes strange behavior , how can fix it? sadly post: safari browser (iphone simulator): how see/monitor events being triggered? never answered. cause see triggered events. i console.log ed slide event didn't clear things my. so side question how best debug such issue. i installed developer on safari desktop , have no js errors. on slide display set inline none onclick. there no padding or overlay issues going on. any appreciated. i found question when working on solving same iss...

java - Test CheckBox on NestedTree fails -

i built tree application based on nestedtree example www.wicket-library.com/wicket-examples , i'm struggling @ testing component using wickettester. with wickettester trigger ajax event on checkbox: tester.executeajaxevent("path:to:checkbox", "onclick"); the ajaxcheckbox onupdate event fired well, it's model doesn't change. a simple page ajaxcheckbox , propertymodel works fine, model changes expected: add(new ajaxcheckbox("check", new propertymodel<>(this, "checked"))); is impossible test component wickettester? you'll have set value checkbox, executing click won't send input in request: formtester.setvalue("path:to:checkbox", true);

go - Golang: terminating or aborting an HTTP request -

what's way abort api serving error message? link call service: http://creative.test.spoti.io/api/getvastplayer?add= {"json":json}&host=api0.spoti.io&domain=domain&useragent=useragent&mobile=true to call service client need send json , params. i want test if params correct, if not want send error message. the response should json code {"result":"result","error":"error message"} i tried log.fatal , os.exit(1) stop service, not call request. panic aborts call prevents me send http.responsewriter error message. i read panic, defer, recover don't know how can use them solve problem. return works: mobile :=query.get("mobile") if mobile=="mobile" { str:=`{"resultt":"","error":"no valide var"}` fmt.fprint(w, str) fmt.println("no successfull operation!!") return} ...

wordpress - PHP 5.3.3 _server['query_string'] ERROR -

i'm using wordpress on php server 5.3.3 , got error when try $_server['query_string'] . my code below: $query_string = $_server['query_string']; if($current_user->user_nicename == "admin"){ echo '<a class="button add_to_cart_button product_type_simple" href="#" target="_blank" >lista cursos</a>'; if(isset($_get['demo'])){ if (strpos($query_string,'&demo') !== false) $enlacesindemo = str_replace("&demo","",$query_string); } } ?> <a class="button add_to_cart_button product_type_simple" href="index.php?<?= $enlacesindemo ?>" target="_self">ver todos</a> and got link: index.php?<?= $query_string ?>&demo short_open_tags in not enabled server. try using <?php ?> instead of <? ?> and <?php echo $variable;?> in...

How to color the matlab plot -

Image
is there exist way color plot in matlab? example x , y coordinate between 0 , 1. want give red zone area x times y less 0.5 , yellow rest. thank you. you can use pcolor generate pseudocolor-plot. values of x*y appropriate matrix-multiplication m . m can compared 0.5 m<0.5 . returns logical-matrix converted double double -function , passed pcolor . set colormap containing red , yellow. can apply shading flat or shading interp (additionally interpolates), lines between patches disappear. x = linspace(0,1,1000); y = x; m = x'*y; pcolor(x,y,double(m<0.5)); colormap([1,1,0;1,0,0]); shading interp this result: edit: if want several areas different colors, add new color colormap , edit color-argument of pcolor accordingly. following code generates three-zone plot: x = linspace(0,1,1000); y = x; m = x'*y; c = double(m<0.5)+double(m<0.75); pcolor(x,y,c); colormap([0,1,0;1,1,0;1,0,0]); shading flat the result looks this:

javascript - Retrieving value of b with getElementByTagName and making it integer -

first of all, new javascript. have been pulling hair getting work. have tried lot of different approaches, cannot working. want do, pull value html document javascript, , save value from: <div class="sum">sum of order: <b>530 sek</b></div> . want grab integer, 530 , , strip of else. html: <div class="order"> <div id="departdate"> <div><b>departing:</b></div> <div>2015-08-08</div> </div> <div id="returndate"> <div><b>returning:</b></div> <div>2015-08-16</div> </div> <div><b>tickets</b></div> <table> <tbody><tr> <td class="first">adult(s)</td> <td>1 x</td> <td>530 sek</td> </tr> ...

php - How to use sync() with additional pivot fields [Laravel 5] -

this question has answer here: laravel 5: synching field via pivot 1 answer here code: public function updategroupintodatabase(){ $group_id = 6; $group = group::find($group_id); $group -> name = input::get('groups'); $projectsids = input::get('projects'); $userids = array_merge(input::get('clients'),input::get('workers')); array_push($userids, auth::id()); $adminid = auth::id(); if($group -> save()){ foreach($userids $userid){ $name = user::find($userid); $group -> projects() -> sync($projectsids,array('admin_id' => $adminid, 'user_id' => $userid,'user_name' => $name -> name)); } when execute this: id project_id group_id admin_id user_id user_name 1 4 6 0 0 but should each user_id create new r...

javascript - Swipe carousel responsiveness -

Image
i'm using swipe carousel, need make responsive (decrease image height , width while resizing browser), not sure why, .swiper-slide width remaining larger, though it's width auto. did meet such problem? after browser maximize, image widths not updated. see in screenshots. html <div class="block-carousel"> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide"> <?= html::image('/assets/images/tmp/carousel/img1.jpg') ?> </div> <div class="swiper-slide"> <?= html::image('/assets/images/tmp/carousel/img2.jpg') ?> </div> <div class="swiper-slide"> <?= html::image('/assets/images/tmp/carousel/img1.jpg') ?> </div> <div class="swiper-slide"> <?= html::image('/assets/images/tmp/carousel/im...

java - Tips and advice on how to make an eclipse source-to-source compiler plugin -

i have been searching use bit of help. not sure if plugin way go this. anyway, here description of want do: i have developed java project source-to-source compiler . translates java files jquery blocks java-only files. accepts file cli arguments, transpiles , outputs result new file. used antlr this. now program working, make sort of plugin makes use of it. can create new java project, code , run program in eclipse, able create new javawithjquery project, able code, , when run eclipse, use project made transpile , run directly, instead of outputting file java -only. is possible? appreciate tips, , advice on how started. thanks in advance! :)

Setup CORS on Java Playframework 2.4.x + AngularJS -

i trying setup cors in java playframework 2.4.x withouth success. front-end app using angularjs 1.3.x. i implemented filters class per documentation preflights options requests angularjs fail without apparent reason. this application.conf values regarding filter: note: edited domain names (i not owner of example.com) ;) ... play.filters.cors { allowedorigins = ["http://example.com", "http://beta.example.com", "http://example.com/beta"] allowedhttpmethods = ["get", "post", "put", "options", "delete"] allowedhttpheaders = ["accept", "content-type"] preflightmaxage = 3 days } ... my play application hosted in separate server front-end: have sub-directory on main hosting containing angular app , subdomain pointing play server. any ideas/suggestions on should investigate? after 3 days struggling on understood problem. apparently module of cisco anycon...

html - Anyone know how to hide/remove Popout of Google Drive Embed Video? -

anyone here have same problem class="drive-viewer-v2-toolstrip" i tried lot of things somehow can't kill it. $(document).ready(function () { $('.drive-viewer-v2-toolstrip').remove(); }); any ideas on how rid of it? the embeded code video inside iframe , because of won't able access content page. in case jquery code using not have visibility of content of iframe , due same origin policies. context of page different context of page inside iframe. here can find information topic: http://javascript.info/tutorial/same-origin-security-policy

githooks - Best way to debug git-hooks -

what best way debug git-hooks? the way prefer adding statements add output log file. example, following. echo 'post-receive executed' >> hooks.log is there better approach or way logging? this old question, future readers, 1 recommendation : debugging hook shell script i doubt script needs looked at, if turns out case, next step debug shell scripts (since default commit-msg hook is). i start changing she-bang line #!/bin/sh #!/bin/sh -xv , revel in uber-verbose output script executed when git commit --amend

javascript - Angular data binding after ajax -

i have route like: /items/item/123/edit , controller (one controller view , edit): ... if ($routeparams.id) { $scope.itemid = $routeparams.id; $scope.editmode = true; item.getboxes({id: $routeparams.id}).$promise.then(function (data) { $scope.data.boxid = []; angular.foreach(data, function (obj) { $scope.data.boxid.push(obj.id); $scope.boxcache[obj.id] = {id: obj.id, name: {id: obj.id, name: obj.name}}; }); $scope.items= data; }); } ... 7 8 cases worked correctly doesn't bind data view. can't coll $scope.$apply() or $scope.$digest() because in progress you can use $scope.$apply when if not in progress. you can check if $digest in progress checking $scope.$$phase. if(!$scope.$$phase) { //$digest or $apply } use safe apply, this: $rootscope.$$phase || $rootscope.$apply(); or method use service. $timeout(function(),millise...

android - How to replace fragment properly using navigation drawer -

i using navigation drawer , simple use. not providing complete code providing detail easy understand problem. using fragments these 8 in numbers , replacing them 1 other. here comes problem replacing them on click event of navigation drawer. there 2 main problems after replacement , can see previous fragment in background. replace method call new fragment on ? if yes should old fragment not visible in background of new fragment. when click navigation drawer item , loads specific fragment successfully. keeping in fragment when click specific item again loads fragment again , again. example if drawer item num 3 opens fragment mybook , clicking item num 3 2 or many times open fragment time. so please 1 answer me how cure app such kind of actions described above. i tried this. working fine me fragmentmanager frgmanager = getfragmentmanager(); frgmanager.popbackstack(null, fragmentmanager.pop_back_stack_inclusive); fragmenttransaction frgtransaction = frg...

eclipse javascript plugins to detect inheritance -

Image
my project implemets inheritance via following code pattern: scantemplate1.prototype = object.create(scantemplatebase.prototype); scantemplate1.prototype.contructor = scantemplate1; here, scantemplate1 inherits scantemplatebase class. now in .js file, content assist suggests member functions defined in scantemplate1.js file. doesn't suggest member functions inherited scantemplatebase. i using eclipse luna latest jsdt version. is there way enable content assist suggest inherited member functions? example: scantemplatebase class has function scantemplatebase.prototype.getinstruction = function(){ return this.instruction; }; scantemplate1 has function scantemplate1.prototype.gettextbox = function() { return this.textbox; }; now, in file main.js , have statement var packagescanbox = new scantemplate1( ..... constructor args ....); on typing packagescanbox. , pressing ctrl + space , suggests gettextbox() not getinstruction() thanks in advance! ...

c# - Unable to send email in web form -

i trying send email website has fields name,email,category,subject , message using c# asp.net.my requirement when user clicks on send button email send given mail address.i explaining code below. contact.aspx: <form id="form1" class="contactformdetils" runat="server" > <fieldset> <div class="clearfix"> <div class="input"> <label>your name:</label> <asp:textbox id="txtname" name="name" runat="server" ></asp:textbox> </div> <div class="input"> <label>your email:</label> <asp:textbox id="txtemail" runat="server" name="email"></asp:textbox> </div> </div> <div class="clearfix"> <div class="input...

.net - RavenDB Migration: update property from string to array of strings -

Image
i have collection of documents named actions. action in db looks this: { "name": "name1", "actiontype": "typea" } i need migrate actions actiontype property contain array of strings: { "name": "name1", "actiontype": ["typea"] } i don't want create converters in project mentioned here . should simple utility can run separately. the idea load documents, made necessary changes , save them (like here ). current code looks doesn't work correctly: using system.collections; using system.collections.generic; using system.linq; using raven.client; using raven.client.document; using raven.client.linq; using raven.json.linq; namespace ravendbmigration { public class simplemigrator { private readonly idocumentstore _documentstore; public simplemigrator(idocumentstore documentstore) { _documentstore = documentstore; } ...

laravel - Joining table created_at and updated_at values not being set -

i have 2 models, product , attribute. there 'product_attributes' joining table between 'products' , 'attributes'. relationship defined in both models using belongstomany(), , key of table compound 1 of product_id , attribute_id. i can retrieve , store records in joining table - so, such functioning expected, exception created_at , updated_at in product_attributes not being set. is above design, , there can rectify this? you should use belongstomany function timestamps declaration this: $this->belongstomany(<entity>)->withtimestamps();

vba - Excel 2010 - Macro Copy range of cells instead of entire row -

i've tried using feedback similar threats - can't seem implement of them in code. apoligize i'm brand new macros! i have spreadsheet pivot table, wish copy a2:j2 if k2="create". macro working copying entire row, can please me? sub create() dim rngcolf range dim range dim dest range sheets("data").select set rngcolf = range("k1", range("k" & rows.count).end(xlup)) sheets("open quotes") set dest = .range("a" & rows.count).end(xlup).offset(1, 0) end each in rngcolf if i.value = "create" i.entirerow.copy dest set dest = dest.offset(1) sheets("open quotes").select end if next end sub try sub create() dim rngcolf range dim range dim dest range sheets("data").select set rngcolf = range("k1", range("k" & rows.count).end(xlup)) sheets("open quotes") set dest = .range("a" & ...

objective c - GCD wait until all task in queue are finished -

in app got photo upload function , want main queue wait until photo upload done. here's code : dispatch_group_t groupe = dispatch_group_create(); dispatch_queue_t queue = dispatch_queue_create("com.freesale.chlebta.photouplaod", 0); dispatch_group_async(groupe, queue, ^{ //upload photo in same array annonce //++++++++++++++++++++++++++++++++++++++ if(!_annonce) [kvnprogress updatestatus:@"جاري رفع الصور"]; __block nsinteger numberphototoupload = _photoarray.count - 1; (int = 1; < _photoarray.count; i++) { //check if image asset upload else decrement photo numver because it's uploaded if ( [[_photoarray objectatindex:i] iskindofclass:[alasset class]]){ alasset *asset = [_photoarray objectatindex:i]; nsdata *imagedata = uiimagejpegrepresentation([uiimage imagewithcgimage:[[asset defaultrepresentation] fullresolutionimage]], 0.6); pffile *imagefile = [pffile filew...

codeigniter - is it neccessary to have a controller for every model while using mvc -

i new mvc. please tell me necessary have controller every model, or can use single controller more 1 models. answers highly appreciated. in advance. you can load number of model in 1 controller or model can loaded in multiple controller. codeigniter not following convention , hence can use want.

ios - Objective C " * " syntax and usage -

i re-writing particle filter library of ios in swift objective c available on bitbucket , have question regarding syntax of objective c cannot understand. the code goes follows: - (void)setrssi:(nsinteger)rssi { _rssi = rssi; // ignore zeros in average, stddev -- clear value before setting // prevent old values hanging around if there's no reading if (rssi == 0) { self.meters = 0; return; } self.meters = [self metersfromrssi:rssi]; nsinteger* pidx = self.rssibuffer; *(pidx+self.bufferindex++) = rssi; if (self.bufferindex >= rssibuffersize) { self.bufferindex %= rssibuffersize; self.bufferfull = yes; } if (self.bufferfull) { // calculate trailing mean , std dev when have enough data double accumulator = 0; (nsinteger = 0; < rssibuffersize; i++) { accumulator += *(pidx+i); } self.meanrssi = accumulator / rssibuffersize; self.meanmeters = [self metersfromrssi:self.meanrssi]; accumulator = 0; (nsinteger...

PHP - Call a function with no return that does actually change values -

this question has answer here: changing global variable inside function php 4 answers i want call function in php, changes existing variables without returning specific one. here example: <?php $number1 = 5; $number2 = 3; echo $number1; echo $number2; //shows unmodified numbers modifynumbers($number1, $number2); // modifies numbers echo $number1; echo $number2; //shows modified numbers ?> <!-- stuff --> <?php function modifynumbers($number1, $number2) { /* doing math stuff numbers */ /* no return because many numbers changed / overwritten } ?> basically, want make function overwriting variables instead of giving specific value specific variable function called. thanks in advance! pass reference & <?php $number1 = 5; $number2 = 3; echo $number1; echo $number2; //shows unmodified numbers ...

scorm1.2 - Does aggregation/reporting of scoring across distinct but related SCORM packages usually fall under the remit of the containing LMS? -

i designing scormv1.2 based elearning solution client manage existing training courses via saba lms. considering providing each section of course separate sco own score tracking. wondering whether function of lms aggregate tracking scores across distinct sco's user, or whether should creating multi-package sco aggregates scores each of child sco's. i'd there's mix of lmss aggregation scores , don't. it's common practice content vendors deliver complete block of content single package , single sco can control , feel of navigation. means present aggregated score lms. it possible more complex things scorm 2004 including multi-sco packages include own navigation menus, not commonly done. here's statistics on features of scorm commonly used .

javascript - .setZoom() function on Google Map -

i create map using: var mapoptions = { zoom : 15 }; //create map. map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); i add slider bar on html file : <div class="sliderbar" id="sliderbar"> <input type="range" min="1" max="100" value="1" step="1" onchange="showvalue(this.value)" /> <span id="range">1</span> </div> so when value of slider bar changed, evoke showvalue(this.value) function with function have changed map zoom's, works first time. so, when change value works, if change value again doesn't work. this function: function showvalue(newvalue) { document.getelementbyid("range").innerhtml = newvalue; //var value=1; value = newvalue; if(50<value<=100){ map.setzoom(11); }else if(25<value<=50){ ...

c# - Selenium WebDriver with Firefox error -

i have problem: win 8.1 (fresh, installed), firefox 34 (downgraded, tested on 38 , 39), selenium 2.46.0... receive: an unhandled exception of type 'openqa.selenium.webdriverexception' occurred in webdriver.dll additional information: failed start socket within 45000 ms. attempted connect following addresses: 127.0.0.1:7055 any idea how make run? on virtual server win7 - same project working well... you have download latest references " http://docs.seleniumhq.org/download/ "; add reference latest net40 dll's; build , run.

php - How to set Consumer started once and goes on forever uninterruptedly. -

i new rabbitmq , using rabbitmq 3.5.3, erlang r14b04, , library alvaro videla( https://github.com/videlalvaro/php-amqplib ) queuing in rabbitmq. need keep consumers conection alive time not producer. the simple logic behind is, running producer through cron. after queue getting generated there no need keep producer connection alive. worker or consumer initiated once. , connection should never die. if done cron end long list of consumer connections @ end of day, annoying, , not desirable. so punchline here is: 1. produce queue , close connection cron every time. 2. consumer started once , goes on forever. queued consumed instantly. can architecture built in system. necessary changes need make here. reading description hard more or don't understand problem well. built app checking rabbit every 1 second or 3 seconds if arrive consumer createconnectiontorabbit while (true) { checkconnectionstillalive fetchdatafromqueue doprocessdata sleep(3) } clos...

php - Override translator Symfony2 -

i trying override symfony translator have translations database. first checking if translation not in catalogue , if not load database <?php namespace competitive\translationbundle\translation; use competitive\translationbundle\entity\translationmanager; use symfony\component\translation\messageselector; use symfony\component\translation\translator basetranslator; class translator extends basetranslator { /** * @var translationmanager */ private $translationmanager; public function __construct($locale, translationmanager $translationmanager, messageselector $selector = null, $cachedir = null, $debug = false) { parent::__construct($locale, $selector, $cachedir, $debug); $this->translationmanager = $translationmanager; } /** * {@inheritdoc} */ public function trans($id, array $parameters = array(), $domain = null, $locale = null) { $cataloguedomain = $domain; if (null === $cataloguedomain...

scheme - Matching wildcards in Guile -

i using guile , trying akin regular expressions. the problem this: have me simple list this: ((ma.+) (mb.+) (mc.-)) . now, list this: ((*.+) (mb.+) (mc.-)) the list * character means can match string long next character + . means both lists can matched , similar each other. so how go matching this? elaborate, these list: ((ma.+) (*.+) (mc.-)) , ((ma.+) (mb.+) (*.-)) equivalent original list. how code this?

How to use a class from another package in java? -

i wondering how use class package here's file inside package project1 package project1; class student{ void print(){ system.out.println("s"); } } class teacher{ void print(){ system.out.println("t"); } } public class project1 { /** * @param args command line arguments */ public static void main(string[] args) { // todo code application logic here } } here's file inside package project2 package project2; import project1.student; public class project2 { /** * @param args command line arguments */ public static void main(string[] args) { student x = new student(); } } but getting error student not in public, am importing student class in wrong way can't use student class , or it's impossible this? first of all, can't have 2 main methods. try making classes static can access them class.etc; or try creating new object of ...

python - Django ORM magic. Bug or a feature? -

data = self.get_queryset()\ .annotate(total=func(sum('money_field'), value('char'), function="convert"))\ .filter(date__lt=end, date__gte=start) if execute data.query - works fine, data.all() raise mysql error. reason of magic django func(), when try pass constant param (without brackets) -- threre 1 way it: using django value(). it works fine, when query throught data.query, when execute -- mysql add additional quotes, working wariant is: data = self.get_queryset()\ .annotate(total=func(sum('money_field'), value('char'), function="convert"))\ .filter(date__lt=end, date__gte=start) cursor = connection.cursor() cursor.execute(str(data.query).replace('%', '%%'), []) data_list = cursor.fetchall() anyone can wtf ? upd 2: printing query of queryset looks like: select `blankapp_modela`.`id`, `blankapp_modela`.`decimal_field`, convert(sum(`blankapp...

java - Adding an element to a DOM document with batik -

good evening, my problem when adding element (rectangle) dom document. the addition done follows: creating element rect light blue / fluo node node = doc.createelement("rect"); element elem = (element)node; elem.setattribute("fill", obj.getcolor()); contained in group of elements g node newzone = doc.createelement("g"); element elemzone = (element)newzone; elemzone.setattribute("id", zone); adding element rect element g elemzone.appendchild(elem); adding document doc.getelementbyid(iduse).appendchild(elemzone); updating document jsvgcanvas (which allows display svg) svg.setdocument(doc); so weird may seem, change taken account, because when save document , displays file, see change. but nothing in application updated. also, added element (symbol + use) following same process. jsvgcanvas , update document considered , visible. thank in advance ... remarks: - repaint tested np times. - launching application doc...

ruby - how to coding nest tags in language slim -

i write below in language slim. <li class="active"><a href="#">link <span class="sr-only">(current)</span></a></li> and <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">dropdown <span class="caret"></span></a> i can embed inline html, interesting. html: <li class="active"><a href="#">link <span class="sr-only">(current)</span></a></li> slim: li.active href="#" | link span.sr-only (current) and html code: <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">dropdown <span class="caret"></span>...

c++ - codeblocks doesn't work on windows 8 or 8.1 -

i need help. purchased new laptop, has windwos 8 operating system, , trying practice c++ code, gives me error , doesn't output. please help... here when run simple "hello world" program. ||=== build: debug in codeblocks_testing (compiler: gnu gcc compiler) ===| ld.exe||cannot find -lsndfile| ld.exe||cannot find -lglew| ||=== build failed: 2 error(s), 0 warning(s) (0 minute(s), 2 second(s)) ===| thanks in advance,

osx - weird css-issue in Firefox, goes away when inspecting element -

on site built have strange issue. until specific menu working expected. today saw there goes wrong on firefox mac now. checked site safari , chrome mac, no problem there. weird thing happens links in menu drop out of sight, except 1 page has childpages (which not shown in menubar). think: use 'inspect element' see if can find problem. second inspect element menubar looks should. close inspector , trouble again. any tips or insights helpful! site http://www.wij30.nl okay, fixed it, found work-around. point not link shown 1 had child-pages. 1 link consisted of more 1 word. , obscure reason broke 2 lines in firefox38 mac. ("over wij" in first line , "3.0" in second line). moving items contained 1 word down line. adding none-breaking spaces in menu label fixed problem now. said: work-around not problem-solver. if can tell me why firefox38 mac made happen: please tell. thanks!

php - Undefined Offset while looping -

i have problem in code, when im trying give value array variable location. code working, there many notification said "undefined offset " looping when im tryng loop variable.` $query_jur="select * t_jurusan order id_jurusan"; $sql_jur=mysql_query($query_jur); if (mysql_num_rows($sql_jur)==0) { echo "kosong"; $jml_jur=mysql_num_rows($sql_jur); } else { $jml_jur=mysql_num_rows($sql_jur); echo "jumlah jurusan yang diinputkan pada tabel jurusan adalah : ",$jml_jur; echo "<br>"; } $query_ins="select * t_ins_akreditasi_jur order id_kriteria"; $sql_ins=mysql_query($query_ins); if (mysql_num_rows($sql_ins)==0) { $jml_ins=mysql_num_rows($sql_ins); echo "k...

How can I find out how a commit landed in a Git branch? -

Image
a feature supposed in side branch, appeared in our production branch in git. expect have happened, pushed wrong local branch remote production branch, local branch ahead of remote production branch. however, there isn't way tell whether happened, merge on remote would've been fast-forward merge. there way find out how happened? you can display full log history or use gui. git has build in tool named gitk can run git log form command lien view full tree git log --oneline --decorate --graph the above command out put example:

node.js - Mongoose returns default value when excluded in find -

my user schema is, { _id: string, name: string, status: {type: string, "default": "notverified" } } in mongoose query, need exclude status field result. my model query like, user.find({}, {status: false}, function(err, users) { // process error if (err) console.error(err); // process result console.log(users); }); in above query, excluded status , in result documents default value defined in schema. i.e status: "notverified" even though issue mongoose, quick fix, tried approaches mentioned here how exclude fields document . but doesn't , work, because queries returns single document, toobject() work, want exclude array of documents, doesn't have toobject() method. any other possible working solution(before marking duplicate)? you misused mongoose's projection: user.find({}, {status: 0}, function(err, users) { // process error if (err) console.error(err); // process result console.log(...

php - Split field values using specific character -

please me this. it possible split field values using specific character? here sample table value 10uf 2k 1.0uf 200uf i want split this: value capacitance/resistance 10 uf 2 k 1.0 uf 200 uf ps: using oracle , numbers should separated letters use split array split ( string $pattern , string $string [, int $limit = -1 ] ) <?php // delimiters may slash, dot, or hyphen $date = "04/30/1973"; list($month, $day, $year) = split('[/.-]', $date); echo "month: $month; day: $day; year: $year<br />\n"; ?>

OneDrive Upload API, resumeable uploading does not work on web -

i have developed web apps. http://onedrive.booogle.net/ the resumeable uploading onedrive api not work on web. simple item uploading works (100m limit). "request header field content-range not allowed access-control-allow-headers." error occurs on chrome, firefox... bugs? how fix it? function _upload_send(uploadurl){ var cfiledata='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; var body=btoa(cfiledata); var start=0; var end=cfiledata.length; var len=cfiledata.length; xhr.open('put', uploadurl); xhr.setrequestheader('authorization', 'bearer ' + md_access_token); xhr.setrequestheader('content-range', 'bytes '+start+'-'+(end-1)+'/'+len); xhr.setrequestheader('content-encoding', 'base64'); xhr.onload = function(){ //request header field content-range not allowed access-control-allow-headers. }; xhr.onerror = function(e){ /...

mysql - SQL - can i add word every column? -

i trying add temporary word every column loop or else on mysql ? when im try select full_name players . can example : +--------------+ | full_name | +--------------+ | ahmed sayed | +----+------+--+ | **any word** | +--------------+ | kareem gaber | +------+-------+ | **any word** | +------+-------+ | omar galal | +--------------+ | **any word** | +------+-------+ | mohamed gad | +------+-------+ | **any word** | +--------------+ you can joining table itself. i've made example you: (you can use test table if want try code , reuse in tables). create table test (`id` int, `productname` varchar(7), `description` varchar(55)) ; insert test (`id`, `productname`, `description`) values (1, 'openidm', 'platform building enterprise provisioning solutions'), (2, 'openam', 'full-featured access management'), (3, 'opendj', 'robust ldap server java') ; and query: select case when q...

import - What is the compression algorithm used in FBX file? -

i write imorter fbx-files, guided specification located on link https://code.blender.org/2013/08/fbx-binary-file-format-specification/ . says data sets can compressed (for example, array of vertices). ok. when exporting blender, compressed set of vertices, can not unpack them, because did not fit 1 library (dotnetzip, sharpziplib). what's wrong? example: note: vertex double type u ncompressed vertices in ascii fbx file: -12.500000,-12.500000,0.000000,12.500000,-12.500000,0.000000,-12.500000,12.500000,0.000000,12.500000,12.500000,0.000000,-12.500000,-12.500000,25.000000,12.500000,-12.500000,25.000000,-12.500000,12.500000,25.000000,12.500000,12.500000,25.000000 compressed binary data: [0] 120 byte [1] 1 byte [2] 99 byte [3] 96 byte [4] 0 byte [5] 1 byte [6] 205 byte [7] 3 byte [8] 96 byte [9] 10 byte [10] 78 byte [11] 67 byte [12] 120 byte [13] 64 byte [14] 113 byte [15] ...

javascript - How to use AngularJS to make these two sections repeat? -

Image
i trying make 2 sections in html repeat itself. first section supposed repeat twice , second section supposed repeat 4 times. here second section in particular looks like(i want repeat 4 times) here current progress - fiddle ( wo angular js applied second) , fiddle 2 (w angularjs). got first section repeat twice when apply repeat directive second section, second section disappears.... to accomplish both tasks, used angularjs ng-repeat directive. made sure bootstrap or initialize angular app once in outer div contains both sections. followed syntax objects group data in javascript. haven't read says can't have more 1 ng-init(i used 2 initialize data 2 sections) <div id="rest_contents" data-ng-app=""> ..... does see issue syntax or did wrong? check console log, there syntax error sections list definition. have pictorial= should pictorial: <div data-ng-init="sections=[{title: 'campaign', pictorial:'campaign...

javascript - Twitter typeahead different value to display -

//javascript var customer = new bloodhound({ datumtokenizer: bloodhound.tokenizers.obj.whitespace('name'), querytokenizer: bloodhound.tokenizers.whitespace, prefetch: 'include/customer.json' }); $('.typeahead').typeahead(null, { name: 'customer', display: 'name', source: customer }); //json [ {"identity":"1","name":"uzumaki naruto"}, {"identity":"2","name":"monkey d. luffy"}, {"identity":"3","name":"ichigo kurosaki"} ] //html <input class="typeahead" type="text" name="customer"/> is possible in typeahead plugin search , display ' name ' , when submit form give me value of ' identity '. btw i`m using 0.11.1v of typeahead. tia to accomplish want, have use 2 input fields. // html <in...

Powershell datagridview cell click event -

i have powershell script in script using datagridview. script working fine. looks ok me. my issue want first column value of selected row. fulfill need add event (cell click/cell content click/cell mouse click). not able figure out. how add event. can please advise me on this? $datagridview1_cellmouseclick = [system.windows.forms.datagridviewcelleventhandler]{ write-host $_.rowindex # displays row number selected write-host $_.columnindex # displays column number selected write-host $datagridview1.rows[$_.rowindex].cells[0].value # display value of first cell in selected row write-host $datagridview1.rows[$_.rowindex].cells[$_.columnindex].value # display value of cell selected } there plenty of example availble c# not found powershell. not stupid question @ all, little confusing. want first column value of selected row, based on output looking seems more interested in selected cell. answering assumption selection of cell looking for. there many possible event...

module - Use of __exit token in linux kernel -

what use of __exit token in loadable linux kernel modules , kernel in general? see explation __init in /include/linux/init.h couldn't find general or particular (for case loadable modules) anywhere. very simple - __exit marks code used in module destruction. if compiled feature built-in kernel , not module or under configuration forbids kernel module unload (yes, there one), code doesn't need loaded ram.

c# - Send relational data using Json to wcf services -

roles , privileges have relationship 1 many. while retrieving roles getting null value "[]" privileges. using json send data wcf services using ef6 having code first approach. code : system.web.script.serialization.javascriptserializer objjsserializer = new system.web.script.serialization.javascriptserializer(); string strjson1 = objjsserializer.serialize(( role in context.roles select role) .tolist()); output: [{"privileges":[],"users":[],"id":1,"rolename":"admin","isactive":1}, {"privileges":[],"users":[],"id":2,"rolename":"apprisal minister","isactive":0}] i tried context.configuration.proxycreationenabled = false; still not able privileges. basically, problem, getting when try serialize roles object. doesn't serialize relational data. mean privileges not there. which right way relational data in enti...

database - SQL - field involving multiple rows from another table -

what i'm trying figure out surely answered before, can't find here (since i'm not sure should search for), bare me. i have created/am creating 3 tables: slaves , citizens , incidents . how should go incident involving multiple citizens , slaves ? i'm thinking making 2 fields in incidents containing list of citizenid's , slaveid's (slaveid1, slaveid2...,slaveidn), seems plain dumb. actually idea doesn't sound dumb @ all. can design incidents table this: +------------+-----------+---------+ | incidentid | citizenid | slaveid | +------------+-----------+---------+ | 1 | | | <-- incident #1 involved 2 citizens , 1 slave | 1 | b | | | 2 | | | <-- incident #2 involved 2 citizens , 2 slaves | 2 | b | | | 2 | | b | | 2 | | b | +------------+-----------+---------+ now when query incident ...

mpi - How to write in chunks by multiple ranks using parallel HDF5 -

Image
i have dataset of 20x20. want write in chunks of 2x2 4 ranks in parallel. using parallel hdf5. each rank has 25 chunks write. not understanding how code when use plain chunking, ranks write entire 20x20 dataset. when use hyperslab, not know how set multiple chunks written each rank. has pointers me? stuck. i'm not sure understand asking. here's how interpret question. global domain 20x20 4 mpi ranks chunking 2x2 you don't have set chunking, in fact don't. here's how it. domain decomposition in mpi . generate local matrix. create memory hyperslab (based off local matrix). create file hyperslab (based off global matrix). create dataset chunking property. write dataset. here's looks like. ! program use mpi_cart , parallel hdf5 ! program hdf_pwrite use mpi use hdf5 use kinds, : r_dp implicit none ! local array size halo integer, parameter :: g_n = 20 integer, parame...