Posts

Showing posts from July, 2015

linux - Concatenate and change extension -

i'm trying concatenate files 1.txt , 2.txt, , several html files. i'm trying save them .php after concatenation after. i've tried follows, doesn't work. step 1: sudo find . -name "*.html" -type f -exec ./code.sh {} \; code.sh cat 1.txt $1 2.txt > mv $1 `echo $1 | sed 's/\.html/.php/'`; any ideas how solve this? your problem you're trying write file called mv along other parameters. i think mean code.sh is: cat 1.txt $1 2.txt > $(echo $1 | sed 's/\.html/.php/')

How to display Django SelectDateWidget on one line using crispy forms -

i trying display 3 select fields rendered out using django selectdatewidget on 1 line. when use crispy forms, on separate rows. there way use layout helper achieve this? thank you! class wineaddform(forms.modelform): hold_until = forms.datefield(widget=selectdatewidget(years=range(1950, datetime.date.today().year+50)), required=false) drink_before = forms.datefield(widget=selectdatewidget(years=range(1950, datetime.date.today().year+50)), required=false) helper = formhelper() helper.form_method = 'post' helper.form_class = 'form-horizontal' helper.label_class = 'col-lg-2' helper.field_class = 'col-lg-8' helper.add_input(submit('submit', 'submit', css_class='btn-wine')) helper.layout = layout( 'name', 'year', 'description', 'country', 'region', 'sub_region', 'appellation', 'wine_type', 'producer', 'varietal...

javascript - node-ffi : Dynamic Linking Error -

i have c++ method (which role killing processes), in library risk.dll. on other hand, developing web-application (using nodejs , angularjs), running on google chrome. when click on button through browser, able call c++ function, through app.js file. i have decided use node-ffi, have error : error: dynamic linking error: "risk.dll": here code on javascript : var ffi = require('ffi') //kill server socket.on('killserver', function(date){ var ctest = ffi.library("risk", { "datemodified":["long", ["string"] ] }); var res = ctest.datemodified(date); console.log(res) }); in c++, have done extern c{ } and want add file risk.dll in same file file server.js run node when want use app. any clue ? try 64-bit compiler found in c:\program files (x86)\microsoft visual studio xx\vc\bin\amd64\cl.exe

Perl wont recognize my if statement -

my code: #!/usr/bin/perl $line = <stdin>; if ($line eq "/n") { print "that blank line!"; } else { print "that line of input was: $line"; } it wont recognize when $line in empty or /n. output "that line of input was:" , nothing, empty. print text if $line something. it's "\n" create newline.

Cannot connect from c# to sql locally but can remotely -

i have c# application want connect sql server , server , application used on same machine , application cannot connect sql if installed application on machine , keeping server in first server connected ! server installed on windows 8. thanks please following - make sure local database server has both windows authentication , sql server authentication mode enabled. but if using windows authentication change connection string - connectionstring="data source=lenovo;initial catalog=app;integrated security=true;" if using sql server authentication mode, seems since providing username connectionstring="data source=lenovo;initial catalog=app;integrated security=false;user id=sa;password=111" also, app reserve keyword in systems. better avoid such name name of db. if using default server instance can use . or (local) instead of lenovo

c# - Using custom JsonConverter to customize list reading -

i'm using json.net , want deserialize json list : [ { "name":"blabla", "price":"50" }, { "name":"blabla", "price":"50" }, ... ] so i've done list<priceitem> list = jsonconvert.deserializeobject<list<priceitem>>(json, new dictionnaryjsonconverter()); but want deserialize items names in line, basicly have function isnamevalid(string name) if return true put item in list , if false rid of it. i computation in second read need have perf on function. i've tried custom jsonconverter don't know how write list readjson function public class customjsonconverter : jsonconverter { public override bool canconvert(type objecttype) { if (objecttype == typeof(priceitem)) { return true; } else if (objecttype == typeof(list<priceitem>)) { return true; } throw new notimplementedex...

database - What is dirty read? And How does it hinder the performance issues? -

i have heard term dirty read many times in beginning career of development. somehow understand want expert's light on it. does diminish performance issues ? or making wrong assumptions. please provide characteristic also. thanks in advance. quite in database processing, come across situation wherein 1 transaction can change value, , second transaction can read value before original change has been committed or rolled back. known dirty read scenario because there possibility first transaction may rollback change, resulting in second transaction having read invalid value. while can command database disallow dirty reads, degrades performance of application due increased locking overhead. disallowing dirty reads leads decreased system concurrency.

java - Best Method to Initialise Complex Static Values -

i have class may need large, unchanging, data-structure based on contents of enum class. what i'm interested know whether better me initialise in static block, or should initialise within method accesses data (in case it's never used)? here's example: public enum myenum { foo ("foo"), bar ("bar"), foobar ("foo_bar"); private final string othername; private myenum (string othername) { this.othername = othername; } private static final map<string, myenum> othernames = new hashmap<string, myenum>(); } now, have 2 options initialising othernames map, first being use static block so: static { (myenum entry : myenum.values()) othernames.put(entry.othername, entry); } public static myenum valuebyothername (string othername) { return othernamesstatic.get(othername); } or alternatively can initialise map first time lookup requested like-so: public static myenum valu...

multithreading - Mutexs with pipes in C -

i sorry if sounds repeating question, have couple additions hoping can explain me. i trying implement 'packet queueing system' pipes. have 1 thread has packet of data needs pass second thread (lets call threads , b respectively). did queueing structure implemented using linked lists. lock mutex, write queue, , unlock mutex. on read side, same thing, lock, read, unlock. decided change implementation , make use of pipes (so can make use of blocking when data not available). question: do need use mutexs lock file descriptors of pipe read , write operations? here thinking. i have standard message gets written pipe on writes, , expected read on read side. struct pipe_message { int stuff; short more_stuff; char * data; int length; }; // read pipe num_bytes_read = read(read_descriptor, &buffer, sizeof(struct pipe_message)); if(num_bytes_read != sizeof(struct pipe_message)) // if message isn't full { printe("error: read did not r...

google app engine - First connection to userEndpoint takes long time in Android with appEngine -

in android app, after sometime (hour or so.. not determined) connection , response google-appengine takes long, 10 seconds or more. after first connection other enpoint requests done pretty , why believe sw issue , not internet connection issue. should establish 'dummy' connection app loaded ? here sample code of asynctask tried user entity appengine endpoint : private class getuser extends asynctask<void, void, boolean> { long mtaskuserid = constants.user_id_no_id_infdicator; string midinplatform = constants.user_id_no_id_infdicator.tostring(); long mserverscore; context mcontext; string musername; getuser(string idinplatform, string username, context c) { midinplatform = idinplatform; musername = username; mcontext = c; } @override protected boolean doinbackground(void... params) { userendpoint.builder builder = new userendpoint.builder( androidhttp.newcompatibletransp...

javascript - how to download a file on Chrome without auto renaming file to "download"? -

i use javascript generate file , download it. seems, depending on version of chrome, download file names can auto renamed 'download'. there way avoid it? this code: var link = document.createelement("a"); link.setattribute("href", 'data:application/octet-stream,' + 'file content here'); link.setattribute("download", 'file1.txt'); link.click(); this not duplicated question, because i'm using latest chrome , suggested hyperlink i'm using. think, chrome v34 works fine, once chrome auto updated v35, went 'download' file name. use html5 download attribute. attribute tell browser virtual link created aimed download only. download file link's href file name specified download attribute's value. great feature works in chrome. window.downloadfile = function(surl) { //if in chrome or safari - download via virtual link click if (window.downloadfile.ischrome || window.downloadfile....

perl - How can I get hold of all the arguments passed to a method with MooseX::Method::Signatures? -

if use moosex::method::signatures , , want pass arguments onto second method, have explicitly list them again: method foo (str :$bar!, int: :$baz!) { ... return $self->_foo2(bar => $bar, baz => $baz); } it nice if like: method foo (str :$bar!, int: :$baz!) { ... return $self->_foo2(%args); } this documentation method::signatures suggests can use @_ drops named parameter keys. having done little testing, seems moosex::method::signatures "odd 1 out" of major implementations of method signatures. others allow use @_ expected; mxms not. use strict; use warnings; use test::more 0.96; { package mybase; sub new { bless {}, shift } sub _foo { \@_ } } { package usekavorka; use kavorka; use parent -norequire => qw(mybase); method foo (str :$bar!, int :$baz!) { $self->_foo(@_); } } { package usems; use method::signatures; use parent -norequire => qw(mybase); method foo (str :$bar!, int :$baz...

c++ - Mouse stops working after changing function -

i'm making console board game on c++, , i've been able make mouse work in first function, menu one, however, when getmove function , need click on house, doesn't work.. can help? class mouse. #include <cstdlib> #include <iostream> #include <process.h> #include <windows.h> #include <time.h> #include <stdio.h> using namespace std; void game(); int chu(); int rato(int &row, int &col) { handle hin; hin = getstdhandle(std_input_handle); bool continue = true; input_record inrec; dword numread; hwnd window = getconsolewindow(); point cursorpos; rect wpos; int x = 0; int y = 0; //cout << hin << endl; flushconsoleinputbuffer(hin); while (continue) { readconsoleinput(hin, &inrec, 1, &numread); switch (inrec.eventtype) { case mouse_event: if (getasynckeystate(vk_lbutton)) { cout << "r...

gcc - Debugging optimization problems -

i've written code (fortran, fwiw), , compiled gfortran without optimisation. runs, , produces expected output. if recompile -o2 or -o3, runs , exits normally, produces no output. presumably, output-producing section of code somehow being optimized away. bug in gfortran - or silly in code. so: start debugging this? there tools can use understand optimizer doing, , why?

C# Visual Studio 2012 Speech to textBox1 -

i got problem speech api. i'm working commands, thats working fine, when want speech seen in textbox1 wont show it. this code need with. im working switch case. tried several if statement, none works. case "listen": ai.speak("i listening"); textbox1.text = textbox1.text + " " + e.result.text.tostring(); break; each time listen, 'listen' comes visible in textbox here full code: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.threading; using system.windows.forms; using system.speech.recognition; using system.speech.synthesis; using system.io; using system.xml; using system.web; using windowsmicrophonemutelibrary; using tweetsharp; /* * * ...

c++ - I accidentally created a virus. Just how is this a virus? -

so doing experimenting strings, see whether store string in variable , display contents of variable onto screen. apparently, antivirus wasn't happy that. here code: #include <iostream> #include <string> using namespace std; int main() { string boy = "hello"; cout << boy << endl; system("pause"); return 0; } active software may cause harm computer or data has been detected. detected: trojan.win32.shutdowner.aadw just how on earth did manage that? first year in computer science , enumerations far we've gotten. is virus or antivirus being ' paranoid '? or in other words mistaking virus due loophole or another? p.s. i'm using devc++ it antivirus being paranoid. antivirus programs largely based on byte signatures known virus code (some rely on heuristic analysis of runtime behavior). program compiled binary code happened contain random byte signature antivirus recognized known ...

Windows 7 64 Bit/Save mode: Rename msi.dll not possible -

due problems windows installer 5 must rename msi.dll reinstallation. that's not possible in save mode/as administrator (access denied). of course service stopped. hints? edit: problem can't install msi files anymore. everytime after dialogs error message corresponding msi file can't read. have tried infos found in www universe , lost lot of time already. e. g. replaced registry settings, used sfc /scannow without success. in windows 7 there no dllcache, don't know preventing renaming. my problem can't install msi files anymore. everytime after dialogs error message corresponding msi file can't read this sounds little bit strange. if see msi dialogs , install fails when kick off there must else wrong. assume have, have verified problem exists multiple msi files? try fresh msi file, preferably 1 downloaded fresh internet. try run local disk , network disk. have enabled logging install? try flush log enabled (the ! character enables c...

Pressing arrow keys do not work correctly in Clojure console -

i downloaded clojure jar. version 1.6.0. when run clojure in console press arrow keys don't move cursor produce these characters "[[d^[[c . i start clojure using command: java -cp clojure-1.6.0.jar clojure.main using java 1.7.0_55 64 bit on ubuntu 14.04 lts 64 bit. how can normal arrow keys behaviour ? the repl bundled clojure pretty terrible. that's okay, because want install leiningen anyway , , repl better, including various readline stuff you're used to. but in general, if there's app terrible job of being repl, can always use rlwrap wrap app in readline .

python - Django REST framework: Update gives error with nested serializer -

i have 2 models auth user model , userprofile useprofile is: class userprofile(models.model): user = models.onetoonefield(user, related_name='profile') name = models.charfield(_lazy(u'name'), max_length=255) for using these serializers: from rest_framework import serializers django.contrib.auth.models import user oneanddone.users.models import userprofile class userprofileserializer(serializers.modelserializer): class meta: model = userprofile fields = ('name',) class userserializer(serializers.modelserializer): profile = serializers.relatedfield() class meta: model = user fields = ('id', 'username', 'email', 'groups', 'profile') the views both serializers are: class userlistapi(generics.listcreateapiview): """ api endpoint used complete list of users , create new user. ""...

histogram - R hist right/left clump binning -

Image
i have data set of length 15,000 real values 0 100. data set heavily skewed left. i'm trying accomplish following bins: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, >10. have done far created following: breakvector = c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100) and have run: hist(datavector, breaks=breakvector, xlim=(0, 13)) however, seems results in histogram data greater 13 aren't included. have idea on how r bin rest of data in last bin. in advance. how this datavector<-c(sample(1:9, 40, replace=t), sample(10:100, 20, replace=t)) breakvector <- c(0:11) hist(ifelse(datavector>10,11,datavector), breaks=breakvector, xlim=c(0, 13), xaxt="n") axis(1, at=1:11-.5, labels=c(1:10, ">10")) rather adjusting breaks, throw values >10 bin 11. update axis accordingly.

javascript - Cancel incoming jQuery click event if mouse is moved after mousedown -

i'm trying prevent click event firing if mouse moved after 'mousedown' event. i'm doing manually via conditionals , booleans. still don't have working how want, , feel it's poor approach accomplishing this. var mousemove = false; var mousedown = false; var cancelclick = false; $('.example').click( function() { if (!cancelclick) { if ( $(this).attr('id') === 'example-green') { $(this).attr('id', 'example-blue'); } else { $(this).attr('id', 'example-green'); } } cancelclick = false; }); $('.example').mousedown( function() { mousedown = true; }); $('.example').mouseup( function() { if (mousemove) { cancelclick = true; } mousedown = false; mousemove = false; }); $('.example').mousemove( function() { if (mousedown) { mousemove = true; } }); http://jsfiddle.net/agf6g/4/ i...

java - Playframework: a value is not a member of models -

i trying access loaddiameterdata() method of dataloader class template view pipeindex.scala.html. i following error when add nextline javascript section of template: @diameterlengtharray = @dloader.loaddiameterdata(); error: value loaddiameterdata not member of models.dataloader i include dataloader template in following way template: @(dloader: models.dataloader, diameterlengtharray: list[double]) and parts of dataloader class package models; ... public class dataloader { public static list<double> loaddiameterdata() { list<double> diameterlengtharray = new arraylist<double>(); diameterlengtharray.add(component.getpipelenghtsaccordingtodiameter(0, 101)); return diameterlengtharray; } do know, why error? stuck error cheers, alp

logout.php is not working second time -

i have 1 problem logout.php . problem second time logout. example, user has 2 accounts on website. user loged in first account , click loged out ok. when logged in second account click loged out logout.php not work. can me here please.. here session.php <?php $session_uid=$_session['uid']; // session private if(!empty($session_uid)) { $uid=$session_uid; $login='1'; } else if($_get['username'] || $_get['msgid']) { $uid=$wall->user_id($username); $login='0'; } else { $url=$base_url.'index.php'; header("location:$url"); } ?> and here login.php code: <?php ob_start(""); error_reporting(0); include_once 'includes/db.php'; include_once 'includes/user.php'; session_start(); $session_uid=$_session['uid']; if(!empty($session_uid)) { header("location:main.php"); } $user = new user(); //login $login_error=''; if($_post['user'] && $_post[...

c# - DataBinding between two custom listbox -

Image
what want i have 2 custom listbox inside usercontrol . my custom listbox1 has private list<element> sublist sub-list of elements. custom control implements propertychanged of inotifypropertychanged etc etc. my listbox2 has display sub-list. both of them using datatemplate not think problem here not take care of part here. if wrong, let me know , update example. what tried <usercontrol> <local:listbox1 x:name="listbox1" datacontext="{binding myfulllist}"/> <local:listbox2 x:name="listbox2" datacontext="{binding elementname=listbox1}" content="{binding path=sublist}"/> </usercontrol> it's giving me inside listbox2: (collection) i tried using 1 element instead of list of elements , working. tried this: <usercontrol> <local:listbox1 x:name="listbox1" ...

mysql - FIND_IN_SET() alternative? -

i have query looks like: select [column a], [column b], [column c], [column d] [table] find_in_set(2, column d) order [column a] desc where [column d] of type varchar , , holds set of numbers (ex, 3, 2, 4, 6, 1, 9 ). trying return records 2 in set of numbers. however, when execute explain on above query, output: id select_type table type possible_keys key key_len ref rows 1 simple [table] null null null null 500000 using where; using filesort this query not seem using indices during execution of query. [column a] primary key, there index on column already. there way utilize index query run faster? or there way me improve performance of query? alternative: normalize schema. find_in_set not sargable , index cannot used.

css - Second Text Line Above The First Line -

Image
i'm having issue displaying long title in recent post widget of wordpress site, because when link long, breakes line new line, messing first one, because second line above. tried add css line line-height: 1.6em; in .widgettitle li didn't work , tried couple of more classes possible related name. 0 success on it, doing wrong? i can see class applying box expecting element, here's url http://experiencias.freeserver.me/ . not see class name on of index page nor head code. .widgettitle { color:#fff; background-color:#cc3234; border: 1px #d9d9d9 solid; font-size:20px; padding-left:5px; box-shadow: rgba(0,0,0, 0.1) 0px 0px 5px; -moz-box-shadow: rgba(0,0,0, 0.1) 0px 0px 5px; -webkit-box-shadow: rgba(0,0,0, 0.1) 0px 0px 5px; } .textwidget { list-style-type: none; font: 14px/16px helvetica, arial, sans-serif; padding:5px; line-height: 1.6em; } .widget { overflow:hidden; padding: 0 0 10px 10px; margin: 0 0 10...

Why does this program hang? Google App Engine and Python -

this program supposed compute numeric palindrome, when data input via web form. did run on localhost environment using python , web.py framework. since then, ported google app engine, using webapp2 framework, can launch on public server. when refactored code new framework, got off in lines of code dealing computation. hoping can solve this. below class handles getting input browser. i've tested , seems input fine. sends compute_palintip , supposed solve palindrome (final amount). hanging here. class result(webapp2.requesthandler): def post(self): form = self.request.get_all('entries', default_value = none) if form[0]: if form[1]: orig_dollar_amount = cgi.escape(form[0]) tip_percent = cgi.escape(form[1]) final_amount = compute_palintip(float(orig_dollar_amount), float(tip_percent)) actual_tip_percent = final_amount - orig_do...

jquery - Fixed position background on iPad -

i have div background-size:cover , background-attachment:fixed. works fine except on ios. #featured { background:url(img/mountains.jpg) center bottom no-repeat fixed; background-size:cover; padding-bottom:65px; } the problem similar these questions: using background-attachment:fixed in safari on ipad fixed position background on ios but not quite. every solution i've found fixed background on body tag. need fixed background within div in middle of dynamic page. setting fake div position:fixed isn't going work me. is there way make fixed position background work on ios? need jquery?

javascript - Chrome Extension Capture Tab Audio -

i'm trying create chrome extension captures audio active tab , either sends server or makes accessible via url. i'm using chrome.tabcapture.capture api , can mediastream of tab's audio, don't know after that. the chrome docs have nothing mediastreams i've looked through documentation here , played js debugger see methods available, can't find way send mediastream somewhere. it's possible record stream locally in js using mediarecorder . there demo here , w3c spec here the method startrecording in demo requires window.stream set mediastream instance. // nested try blocks simplified when chrome 47 moves stable var mediarecorder; var recordedblobs; window.stream = mymediastreaminstance; function startrecording() { var options = {mimetype: 'video/webm', bitspersecond: 100000}; recordedblobs = []; try { mediarecorder = new mediarecorder(window.stream, options); } catch (e0) { console.log('unable create medi...

sql server - Crystal Reports or T-SQL: Comparing multiple records values based on values in another table -

i attempting compare , perform calculations on sets of values have multiple entries in crystal reports or t-sql (ms sql server) , calculation. example data: table (millions of rows) entry id 1, vendor, product id, inventory count, inventory value entry id 2, vendor, product id, inventory count, inventory value ... entry id 99, vendor, product id, inventory count, inventory value table b: (millions of rows) entry id 1, datetime, entrytype entry id 2, datetime, entrytype ... entry id 99, datetime, entrytype an entry created in both tables every transaction instance , both tables 5 million plus rows, entry several batch operations occur on schedules , maintenance activities. i need compare 2 values in table , calculate difference in values of inventory count & inventory value, between recent date time or entry id update in table b (max) regardless of table b entry type , last table b value of type "10" vendor & product id in table a. so if entr...

css - Fix gap from border-bottom none -

i have <a> tag border: 1px solid #ccc; border-bottom:none; style , it's leaves tiny gap, please @ codepen result see mean. gap appears left login tab if login tab active or right register tab if register tab active. html: <div id="w-login"> <div id="login"> <menu id="tabs"> <a id="tab-signin" class="tab-active"><i class="fa fa-unlock-alt"></i>login</a><a id="tab-signup"><i class="fa fa-lock"></i>register</a> </menu> <div id="signin"> <form class="form-horizontal"> <div class="form-group"> <label for="username" class="control-label col-1">username:</label> <input type="text" name="username" class="form-control col-2...

asynchronous - Async run for javascript by using listeners -

i have 2 functions, names function3, function4, function3 send request server side jsondata using ajax, which, however, take 3 seconds complete. function4 common function wait function3's result , action. code puts below: function ajaxrequest(container) { $.ajax({ url: "home/getresult", type: "post", success: function (data) { container.append(data.message); } }); } var eventable = { on: function (event, cb) { $(this).on(event, cb); }, trigger: function (event) { $(this).trigger(event); } } var function3 = { run: function () { var self = this; settimeout(function () { ajaxrequest($(".container1")); self.trigger('done'); }, 500); } } var function4 = { run: function () { var self = this; settimeout(function () { $(".container1").append("function4...

twitter bootstrap - Composite component with h:form weird rendering -

composite components h:form render in weird way. jsf markup i'm using: <div id="modals"> <div id="modal1"> <custom:mycomp /> </div> <div id="modal2"> <custom:mycomp /> </div> <div id="modal3"> <custom:mycomp /> </div> </div> for reason, instead of rendering each composite component inside respective div , source of rendered html looks this: <div id="modals"> <div id="modal1"> <div class="modal-dialog"><!-- rendered component --></div> <div id="modal2"> <div class="modal-dialog"><!-- rendered component --></div> <div id="modal3"> <div class="modal-dialog"><!-- rendered component --></div> </div> </div> </div> </div> they b...

css - What am I missing to make the <li> stay clicked? -

html: <ul> <li data-target="#front-info" data-slide-to="0" class="col-md-4 col-width-fix front-info-button"> <h1>heading one</h1> </li> <li data-target="#front-info" data-slide-to="1" class="col-md-4 col-width-fix front-info-button"> <h1>heading two</h1> </li> <li data-target="#front-info" data-slide-to="2" class="col-md-4 col-width-fix front-info-button"> <h1>heading three</h1> </li> </ul> css: .front-info-button:hover, .front-info-button:active { background-color:#666; } it reacts hover won't maintain color after i've clicked , moved mouse away. missing? you add behaviour inside javascript. example below uses jquery accomplish this: css .selected { background-color:#666; } js $('ul li').click(function() { $(...

javascript - AJAX POST REQUEST -

i'm trying save data database javascript using ajax. part of code create request , send json formatted data save/save1.php: urlpath = "save/save1.php"; var request = new xmlhttprequest(); request.addeventlistener('load',function() { console.log(this.responsetext); }); idgame = "1"; data = json.stringify({'iduser': iduser, 'idgame': idgame, 'score': score}); request.addeventlistener('error', function () { document.write('there error ajax request!'); }); request.addeventlistener('load', this.onsuccess); request.onreadystatechange = function(){ if(request.readystate == 4){ alert(request.responsetext); } }; request.open("post", urlpath); request.setrequestheader('content-type','application/json'); request.send(data); and save1.php file: <?php include '../database_connection.php'; var_dump($_p...

ext4 - What file system does Android use? -

which file system android use? have read both ext4 , yaffs2. android used yaffs2 file system. after android 2.3, file system became ext4 . yaffs2 used nand flash in embedded systems such mobile phones. includes wear-leveling , gc mechanism nand flash, single-threaded. according ars technica article , reason android switched ext4 yaffs2 file system because yaffs2 single-threaded, , "would have been bottleneck on dual-core systems." android, in 2010 looking forward when many cores used in smartphones. looking back, obvious right decision. smartphones went dual core around time of galaxy s2 . more smart phones released in quad-core configuration, 6 , 8 core configurations on horizon.

linux - Php curl with digest -

curl --digest -u username:pass "http://api.moodstocks.com/v2/search" --form image_file=@"" when execute statement on terminal image_file parameter locally stored works fine. how can pass remote url in image_file parameter using following statement?

Meteor.startup(func) - when is the DOM "ready" in Meteor? -

http://docs.meteor.com/#meteor_startup concerning meteor.startup(func) on client, function run dom ready. at point "dom ready"? the reason why ask because can have meteor template uses many other templates (ie. other dom elements) inside of , have many other things loading @ different times depending on how long things take load (ie. more dom elements). in past i've loaded javascript files on meteor.startup still loaded because entire dom had not been loaded yet. meteor.startup( function() { //load js files }); so mean "dom ready?" not mean "when dom loaded in entirety." meteor.startup runs when files have downloaded server (javascript files). if place code run @ startup without putting in meteor.startup may not run because run js/html has not been downloaded yet this when 'dom ready', not when html rendered, because (the html) renders when dom ready too. if you're looking runs after both dom ready , a...

image - Memory usage of Windows Phone app keeps building up when going back and forth between pages -

i writing sample windows phone 8.1 app album maker. app, can choose photos gallery , make them album. features :- if albums have been created me, first picture of each album displayed when start app.(lets call page 'allalbumsview' ) if click on picture in allalbumsview , taken specific album(lets call page 'editpage' ) , can view pictures of album. if click button editpage , again taken allalbumsview. now, problem facing is: if have 1 album having 3 pictures, , if go allalbumsview editpage , allalbumsview clicking on button , again , again , memory used app keeps on building. i investigated through memory diagnostic tool of visual studio , found when went editpage allalbumsview , memory usage didn't go down(i.e. images of album being viewed still in memory). when opened editpage again clicking on album, memory usage increased images again loaded.(so, have multiple copies of images in memory) what want is : when go editpage images should lo...

wpf controls - Accessing Canvas properties inside DataTemplate, WPF -

i have datatemplate text , use itemcontrol place text inside canvas. how access canvas properties inside data template? in case if difficult want access individual textbox properties inside itemcontrol. reason need textcontrol alignment. both of datatemplate , itemcontrol code below <datatemplate datatype="{x:type local:text}"> <textblock text="{binding description}" fontsize= "{binding thickness}" rendertransformorigin="0.5,0.5" foreground="#fff63aff" fontweight="bold" > <textblock.rendertransform> <transformgroup> <translatetransform x= "{binding startpoint.x}" y= "{binding startpoint.y}" /> <rotatetransform angle= "{binding angle}" /> </transformgroup> </textblock.rendertransform> </textbl...

javascript - keep google maps centered when window resize -

i trying center google maps when window resized. looked around many examples on stackoverflow nothing of seems working me. here's sample code: google.maps.event.adddomlistener(window, 'resize', function() { //window resize , position map center center = map.getcenter(); google.maps.event.trigger(map, 'resize'); map.setcenter(center); }); i have markers on map should fit accordingly when map center positioned. missing here ? when resize window(and map), center of map changes too(also when didn't trigger resize-event). when call map.setcenter(center) value of center has been updated regarding new size of map. you must store center of map each time when changes(except when map has been resized), , when map has been resized restore stored value. possible solution: google.maps.event.addlistener(map, 'center_changed', function() { //a value determine whether map has been resized var size=[this.getdiv().offsetwidth,...

CKEditor's focus manager focusing on the wrong editor -

i building ckeditor plugin, not using ckeditor's dialog. instead, using dialog widget. dialog contains text input , few checkboxes. this in doing: var dialogue = y.one('#blah'); //get dialog node using yui ckeditor.plugins.add('myplugin', { init: function(editor){ editor.focusmanager.add(new ckeditor.dom.element(dialogue.getdomnode()), true); } } i have 2 ckeditor instances on page created using ckeditor.inline() . the problem when interact or focus on text inputs or checkboxes in dialogue, focuses on second editor though supposed focused on first editor. what causing problem?

asp.net mvc - Pass model to controller -

im tryin ceate simple blog. in view got this: @using (html.beginform("addblogpost", "home")) <--probably missing here { foreach (var item in model.blogpost) { @html.labelfor(x=>item.title) @html.textboxfor(x=>item.title) @html.labelfor(x=>item.text) @html.textboxfor(x=>item.text) } <input type="submit" value="create post" /> } with submit-button, im hoping pass 2 values controller: public actionresult addblogpost(blogpost model) { blogpost post = new blogpost() { title = model.title, text = model.text, }; ravensession.store(post); ravensession.savechanges(); return redirecttoaction("index"); } creating new blogpost , saving db. problem method receives null. guess im missing somehting silly? edit: im not longer passing list ...