Posts

Showing posts from January, 2014

java - Using OpenCSV to convert CSV file to XML using byte array in input -

java - Using OpenCSV to convert CSV file to XML using byte array in input - i have question: i'm trying convert csv file xml file , i'm seeing response of post: java lib or app convert csv xml file? i see need utilize opencsv library , in particular, must utilize code: csvreader reader = new csvreader(new filereader(startfile)); where string startfile = "./startdata.csv"; now, don't string startfile, have byte[] because, other question, have convert file in byte[]. how can utilize code byte[]? are there alternatives? thanks since csvreader's constructor takes reader parameter, can pretty much pass that's readable it. so in case, may seek using bytes stream reader, in: csvreader reader = new csvreader( new inputstreamreader( new bytearrayinputstream(yourbytearray))); java xml parsing converter opencsv

php - mysql: How can list 2 different condition, ordering, and limit requirements from one table? -

php - mysql: How can list 2 different condition, ordering, and limit requirements from one table? - there table of men , women. table has field, sex has values, men or women. tabel-a id sex grade-a grade=b 1 men 2 4 2 women 4 5 3 women 6 1 4 men 1 3 5 men 3 6 6 men 5 2 i want sort table below; first, list 2 men ordering grade-a desc. second, list rest both men , woman ordering grade-b desc expected output; id sex grade-a grade=b 6 men 5 2 5 men 3 6 2 women 4 5 1 men 2 4 4 men 1 3 3 women 6 1 because these 2 conditions have different ordering requirement not utilize union. union slow. here failed query, part 1 select distinct t.* ( ( select * table-a a.sex = 'men' order a.grade-a desc limit 2 ) union ( select * table-a order a.grade-b desc ) ) t also tr

java - ExceptionInInitializerError - service and library -

java - ExceptionInInitializerError - service and library - i have unexpectedly encountered exceptioninintiialize error while trying run application. believe error prompted when users click on quick chat button. 10-09 18:27:08.450: e/androidruntime(999): fatal exception: main 10-09 18:27:08.450: e/androidruntime(999): java.lang.exceptionininitializererror 10-09 18:27:08.450: e/androidruntime(999): @ com.sinch.android.rtc.internal.client.servicefactory.createuseragent(servicefactory.java:44) 10-09 18:27:08.450: e/androidruntime(999): @ com.sinch.android.rtc.internal.client.defaultsinchclient.<init>(defaultsinchclient.java:157) 10-09 18:27:08.450: e/androidruntime(999): @ com.sinch.android.rtc.internal.client.internalsinchclientfactory.createsinchclient(internalsinchclientfactory.java:14) 10-09 18:27:08.450: e/androidruntime(999): @ com.sinch.android.rtc.defaultsinchclientbuilder.build(defaultsinchclientbuilder.java:95) 10-09 18:27:08.450: e/androidruntime(999): @ com.d

c++ - Can I access boost::interprocess::managed_shared_memory multiple times without opening it again-and-again? -

c++ - Can I access boost::interprocess::managed_shared_memory multiple times without opening it again-and-again? - i using boost::interprocess::managed_shared_memory create memory shared across processes. following steps taken: step a) create memory. step a) open memory. b) write memory step a) open memory. b) read memory. c) open memory. d) read memory. e) open memory. f) read memory. g) ...... , on , forth! now, question is, in step number 3, opening memory again-and-again before reading it! think redundant behavior. how can read multiple number of times opening once? actually open command quite expensive in terms of performance, , proving bottleneck in application. many of samples have managed_shared_memory in main function brevity. you should, however, create fellow member of relevant class (with responsibility manage lifetime of shared memory mapping). you of course, maintain local variable in main, you'd forced maintain passing

How to recognize a custom method from an iOS built-in method -

How to recognize a custom method from an iOS built-in method - lets define class uiviewcontroller @interface myviewcontroller : uiviewcontroller so myviewcontroller used of uiviewcontroller class built-in methods loading view controller’s views such as viewwillappear: viewdidappear: and of custom methods defined such elementstoadd: pressthis is there way recognize custom method names built-in methods? there list of ios reserved built-in method names different classes? ios methods

javascript - squeeze a webpage to show ad -

javascript - squeeze a webpage to show ad - i have next jsfiddle link where trying squeeze webpage show advertisement towards right http://jsfiddle.net/5o6ghf9d/1/ works fine on dekstop browsers but not getting squeezed on ipad safari/chrome browsers below functions used squeeze/unsqueeze web page function squeeze_page(){ d.body.style.paddingright='160px'; d.body.style.paddingleft='160px'; d.body.style.marginleft='-160px'; d.body.style.overflowx='hidden !important'; is_page_squeezed=true; } function unsqueeze_page(){ d.body.style.paddingright=''; d.body.style.paddingleft=''; d.body.style.marginleft=''; is_page_squeezed=false; } let me know if other way there can squeeze webpage perhaps you're looking for: jsfiddle if want have advertisement slide right when showing, it's improve utilize css transition in example. first, need have container content,

c# - Rich Text Box Select First Character -

c# - Rich Text Box Select First Character - is there way in c# select first character of text in paragraph in rich text box? want this: richtextbox.selection.select(0, 1); 0 beingness start position , 1 beingness selection end position. you utilize textrange object that. should homecoming first character in richtextbox textrange justthefirst = new textrange(richtextbox.document.contentstart, richtextbox.document.contentstart.getpositionatoffset(1)); string text = justthefirst.text; c# wpf

mysql - How to SUM from another table in SQL in one view? -

mysql - How to SUM from another table in SQL in one view? - i have 2 tables maintable , secondtable in sec table column maintable_id , price. i have bulided view in workbench this: create view test select maintable.id id, maintable.name name, maintable.date date, secondtable.price price, maintable left bring together secondtable on maintable.id=secondtable.maintable_id i have thought create like: sum(price) gprice secondtable maintable.id=secondtable.maintable_id how can find out total cost items in secondtable secondtable.maintable_id= maintable.id thank help. try this.. create view test select maintable.id id, maintable.name name, maintable.date date, sum (secondtable.price) gprice, maintable left bring together secondtable on maintable.id=secondtable.maintable_id grouping maintable.id id, maintable.name name, maintable.date date mysql sql sql-server mysql-workbench

multiple if statements(nested 3) not working in android -

multiple if statements(nested 3) not working in android - i have create media players based on 3 if conditions. in service class creating media players. code in onstartcommand of service class below. in debug mode, found when day == "day1" , servicename == "startservice1" command not going within if statement , local1 == "betty" not executed. so, mplayer , mplayer2 equal null. not created. myservice.java if (day == "day1" && servicename == "startservice1") { if (local1 == "betty") mplayer = mediaplayer.create(this, r.raw.betty); else if (local1 == "betty2") mplayer = mediaplayer.create(this, r.raw.betty2); else if (local1 == "thorne1") mplayer = mediaplayer.create(this, r.raw.thorne1); else if (local1 == "kick") mplayer = mediaplayer.create(this, r.raw.kick); if (local2 == "bet

nlp - Using pre-defined topics in Mallet -

nlp - Using pre-defined topics in Mallet - i'm looking utilize mallet classify different documents topics have defined. know mallet first determine topics, classify documents want skip first step because have list of topics words associated them. there way utilize pre-defined topic lists have created classify documents mallet? any guidance appreciated. thanks! if you're doing unsupervised learning (without training examples, i.e. docs each topic), cannot trivially set topics. point training algorithm not know docs in advance. tries separate/distribute them, based on features provide. if you're doing supervised learning, topics classes , have documents each class. algorithm tries larn features important each class. in mallet should utilize classification module. there fancy topic modelling ideas, incorporate / skew topic distributions according specific keywords, don't think that's possible mallet. nlp topic-modeling mallet

android - ADB connection not working because of a double port -

android - ADB connection not working because of a double port - i'm trying connect vmware invitee android emulator runs on host. emulator connected port 5554. tried both nat , bridged network. , anytime: root@dev-virtual-machine:~# adb connect 10.100.102.8:5554 unable connect 10.100.102.8:5554:5554 tried forwards port , changing tcpip: root@dev-virtual-machine:~# adb forwards tcp:5555 tcp:5554 root@dev-virtual-machine:~# adb tcpip 5554 restarting in tcp mode port: 5554 root@dev-virtual-machine:~# adb connect 10.100.102.8 unable connect 10.100.102.8:5555 but still same error double port problem. from host when run this: adb connect localhost:5554 it work. ok, after tried lot of options figured out problem android emulator listens on traffic comes 127.0.0.1(localhost) there couple of solutions: 1. think there alternative in emulator config allows outside traffic. 2. ssh forwarding. 3. set kind of proxy outside host inside android port virtua

ios - Instruments viewcontroller segue not released? -

ios - Instruments viewcontroller segue not released? - i have question storyboard, segues , memory management. if read on forums people working wondering following, made little video illustrate: https://www.youtube.com/watch?v=ixs1fiv5m9s i grabbed source github explaining segues , unwinding them i tested in debugging , indeed see functions including dealloc working i run instruments , check how many times 2de view controller created (every time #persistent increasing) i check changes in memory between 2 states, , lot still in memory? view controller gone? i looking wrong info in instruments? guess looking memory leaks using modal , dismissing view controller not right way this? can explain me how memory leaks? need much bigger app using lot of segues, , app crashes because of memory warnings... ios memory-leaks swift storyboard segue

php - Waterline in SailsJS doesn't seem to catch unique constraint -

php - Waterline in SailsJS doesn't seem to catch unique constraint - in sailsjs, when have attribute on model like: email: { type: 'email', unique: true} for reason, waterline doesn't grab duplicates, of course of study mongo does. throws mongo error, waterline never catches wlvalidationerror. anyone having error? can't seem wlvalidationerror work. thanks i've had problem too, overcome added user model. not implementation, worked me when nil else did. beforecreate: function(values, cb) { user.findone({email : values.email}, function(err, user){ if(user){ homecoming cb('e-mail address existis'); } else { cb(); } }); } docs here: https://github.com/balderdashy/waterline#lifecycle-callbacks php mongodb validation sails.js waterline

r - How to access (index) a name/column by its name? -

r - How to access (index) a name/column by its name? - let's assume have x <- 1:3 names(x) <- c("has", "some", "names") and want rename 1 of these names, some good . if know index, can this: names(x)[2] <- "good" what i'm trying find out how access name "some" name. intuitively: names(x)["some"] <- "good" but not work, since names(x) not have "names" (i.e. left hand side null ). tried set "names" of names(x) : names(names(x)) <- names(x) which gives no error, names(x) still not have "names" => still no access text possible... question is: how can set "names of names"? note: i'm asking educational purposes improve understand how indexing strings works. there ways accomplish without setting "names of names", maybe this: x <- ifelse(names(x) == "some", "good", names(x)) r

ios - Constraint "width equals height" in interface builder, for the same view: how to create such a constraint? -

ios - Constraint "width equals height" in interface builder, for the same view: how to create such a constraint? - i want create constraint "width equals height" for same view (so, view square shaped). method given in this answer not work since not constraint between 2 different views. is possible? control + drag view itself, set aspect ratio 1:1. ios osx interface-builder nslayoutconstraint

c++ - Template Alias failing when I try to use it in a function -

c++ - Template Alias failing when I try to use it in a function - i trying utilize template type aliasing, when utilize in function thought fails, in illustration below: #include <iostream> #include <vector> template <typename t> using vec_t = std::vector<t>; template <typename t> t sum_vector(vec_t vec) // t sum_vector(std::vector<t> vec) { t sum = 0; typename vec_t::iterator it; // typename std::vector<t>::iterator it; (it = vec.begin(); != vec.end(); ++it) { sum += *it; } homecoming sum; } compiling above code fails next error: error: template declaration of ‘t sum_vector’ t sum_vector(vec_t vec) error: missing template arguments before ‘vec’ t sum_vector(vec_t vec) if used commented lines instead code works fine. don't understand missing here, understanding after using x = y , compiler place y have x , error coming from? how should go fixing this? the differenc

Opposite of isnull in mysql -

Opposite of isnull in mysql - to whether field null can do: select id, isnull(sd_vod_retail_price) main_territorypricing title_id=904534727 how check see whether field not null? like: select id, isnotnull(sd_vod_retail_price) ? you can utilize ! operator: select id, !isnull(sd_vod_retail_price) main_territorypricing title_id=904534727 mysql

unity3d - Why my C# code is causing a -

unity3d - Why my C# code is causing a - this code giving stack overflow happens half time , have no thought why it's doing it. seen happens coms(topcom, etc) in mass of numbers around 5+ stack overflows. public bool getconnected(int d) { if (topcom.connection != null) { if (d != topcom.connection.id) { if (topcom.connection.id == 0) { homecoming true; } else if (topcom.connection.connected == true) { if (development.instance.currentdos.buttons[topcom.connection.id].getconnected(id)) { homecoming true; } } } } if (leftcom.connection != null) { if (d != leftcom.connection.id) { if (leftcom.connection.id == 0) { homecoming true; } else if (leftcom.connection.connected == true) { if (development.instance.currentdos.buttons[leftcom.connection.id].getconnected(id)) {

oracle - SQL query to change file extension in a record containing a file-path? -

oracle - SQL query to change file extension in a record containing a file-path? - given sql table table column path , how can modify values /dir/subdir/file.aaa => /dir/subdir/file.bbb e.g. modify file-extension without having hard-code specific file/path query? seems perfect fit regexp_replace : with t (select '/dir/subdir/file.aaa' path dual union select '/dir/subdir.aaa/file.aaa' dual) select regexp_replace(path, '[.][^.]*$', '.bbb') path -- ^^^^ ^^^^^^^^^ ^^^^ -- replace lastly dot-whatever "right" extension t path '%.aaa' -- ^^^^^ -- path ending "wrong" extension see http://sqlfiddle.com/#!4/d41d8/37017 tests sql oracle

Adding and Deleting from objects in javascript -

Adding and Deleting from objects in javascript - i pretty sure have right, trying add together , delete using 2 separate method in javascript code. the first one, trying add together classstr html element object el , property of classname . if contains classstr , left alone. var addclass = function addclass(el, classstr) { if(el.classname !== classstr) { el.classname = classstr; } }; this one, trying delete classstr classname without leaving white spaces. el element object. thing unsure about, if leaving white spaces. var removeclasfunction = function removeclass(el, classstr) { delete el.classname; }; the main disadvantage of functions don't handle multiple class names on object. in addition, don't want removing property name, setting empty string when there no class names. here's set of utility functions managing class names works when there more 1 class name on object should plan (which yours not). these don't ac

ios8 - External display shows black borders on iOS 8 -

ios8 - External display shows black borders on iOS 8 - problem: external screen connected through hdmi cable shows black borders on sides. have tried setting overscancompensation property no luck. problem occurs if app run on ios 8, on ios 7 external (tv) screen shows no borders. i can't find overscan configuration on samsung tv though. any suggestions seek additionally? until can't find solution black border... old tricks set overscancompensation '3' not work now. workaround apple tv: if can utilize apple tv, able disable overscaling on apple tv: settings > sound & video > adjust airplay overscan. set off (default on). i hope apple create alternative user able disable on his/her idevice... ios ios8 screen border hdmi

java - Unmarshall with JAXB doesn't work -

java - Unmarshall with JAXB doesn't work - i have simpe xml want unmarshall model class. have annotated class jaxb annotations defining access type (field): class="lang-java prettyprint-override"> import javax.xml.bind.annotation.xmlaccesstype; import javax.xml.bind.annotation.xmlaccessortype; @xmlaccessortype(xmlaccesstype.field) public class dtotest { private string name; public dtotest() {} public dtotest(string name) { super(); this.name = name; } public string getname() { homecoming name; } public void setname(string name) { this.name = name; } @override public string tostring() { homecoming "dtotest [name=" + name + "]"; } } this main class run unmarshal method against simple xml saved in string variable: class="lang-java prettyprint-override"> public class test { public static void main(string[] args) throws exception

c# 3.0 - Sorting Generic List in C# -

c# 3.0 - Sorting Generic List in C# - i have generic list shown in below. list<usrprofile> lst = getusers(); lst.sort(); ddluser1.datasource = lst; ddluser1.databind(); now dropdown has both value , text. sort text using generic list. please help. cannot utilize linq if understand question correctly (and may not...it's not clear), want sort list specific fellow member of usrprofile class. specifically, text property. this easy do: lst.sort((u1, u2) => u1.text.compareto(u2.text)); should want. this passes comparison<usrprofile> delegate instance list<usrprofile>.sort() method, allowing customize comparing logic used sort. in case, rather comparing whole usrprofile objects against each other, compares text property between objects. c#-3.0 asp.net-3.5

Track and redirect an offsite link using Google Analytics without javascript? -

Track and redirect an offsite link using Google Analytics without javascript? - i have text file link needs tracked geo profile of users, possible have url redirect users right file , record stats in google analytics without using javascript. clarity need http://www.google-analytics.com/__utm.gif?utmwv=5.1.7&utms=1&utmn=1894752493&utmhn=www.mylink.com&utmcs=utf-8&utmsr=1280×1024&utmsc=24-bit redirect destination page. i cannot utilize server-side script file contains version info software , beingness accessed thousands of times per second. switch universal analytics. write script pipes server log file (the lines relevant you) analytics via measurement protocol. include queue time parameter (which allows to record right time of time if send 4 hours after nail occured). run script every few hours. alternatively @ to the lowest degree apache webserver allows reroute writes log file through external processes (via customlog directive), pipe

Scala type inference: can't infer IndexedSeq[T] from Array[T] -

Scala type inference: can't infer IndexedSeq[T] from Array[T] - in scala 2.11.2, next minimal illustration compiles when using type ascription on array[string] : object foo { def fromlist(list: list[string]): foo = new foo(list.toarray : array[string]) } class foo(source: indexedseq[string]) if remove type ascription in fromlist , fail compile next error: error:(48, 56) polymorphic look cannot instantiated expected type; found : [b >: string]array[b] required: indexedseq[string] def fromlist(list: list[string]): foo = new foo(list.toarray) ^ why can't compiler infer array[string] here? or issue have implicit conversion array 's indexedseq 's? the issue .toarray method returns array of type b superclass of t in list[t] . allows utilize list.toarray on list[bar] array[foo] required if bar extends foo . yes, real reason doesn't work out of box compiler

java - How do I find out , what exception occurred in spring integration? -

java - How do I find out , what exception occurred in spring integration? - how find out , exception occurred in spring integration, when send message server via tcp client. , there <int-ip:tcp-connection-factory> ( client ! ), , has error channel. when connection created between client , server , after few seconds server closes connection there exception.it's ok, , able grab it, exception : "read timed out". when connection dosn't create , because server doesn't hear specified port, don't cache exception via error channel. therefore, i'am trying cache exceptions in way : try{ success = gateway.send(adaptor); } grab ( messagingexception exc){ system.out.println("exception occurred : timed out waiting response"); } but - @ point - cache timed out waiting response exception reason. ( example, when server close connection, or the connection doesn't occurre ) can't take difference between exceptions. henc

php - Is there a better way to get arguments for controller in laravel? -

php - Is there a better way to get arguments for controller in laravel? - in cakephp, there default way pass arguments controller. example, if controller method: public function index($arg1 = "asia", $arg2 = "hk") { // controller code } in cakephp, default url method parameter is: http://link.to.my.host/public/testcontroller/method/arg1/arg2/ however, in laravel, pass arguments, need add together line route.php route::any("test/{arg1}/{arg2}", "testcontroller@index"); the problem have more 10 controllers few methods in each of them, receiving same argument.(the parameter language settings) annoying write 30+ lines handle these cases , not mention adding arguments/methods/controllers project grows. there way utilize few lines tell laravel arg1 , arg2 set methods of controllers? (or @ to the lowest degree methods in particular controller?) i know can handle things parameter, don't want makes url looks ugly. user ab

java - Apache Camel send message JMS Consumer receives message -

java - Apache Camel send message JMS Consumer receives message - have apache camel simple message route folder activemq topic: //create context create endpoint, routes, processor within context scope camelcontext context = new defaultcamelcontext(); //create endpoint route context.addroutes(new routebuilder() { @override public void configure() throws exception { from("file:data/outbox").to("activemq:topic:vadim_topic"); //from("activemq:topic:test").to.to("file:data/outbox"); } }); context.start(); thread.sleep(5000); context.stop(); } and jms implementation if topic consumer: connectionfactory connectionfactory = new activemqconnectionfactory(); seek { connection connection = connectionfactory.createconnection(); session session = connection.createse

Android Intent Filter for Non-registered File Extension -

Android Intent Filter for Non-registered File Extension - i trying set intent filter downloads app (in kit kat) open application when file appropriate extension selected. the file extension not have associated mime type in android world. i can app trigger on http download based on scheme , mime type offered web server. , can utilize file manager fine based off of extension. not downloads app. file manager list app handling file type , allows me take open file. downloads app toasts "can't open file". what required create work? android android-intent

javascript - chrome.runtime.setUninstallUrl doesn't seem to be working -

javascript - chrome.runtime.setUninstallUrl doesn't seem to be working - i'm trying create chrome extension visit url when uninstalled. apparently chrome.runtime.setuninstallurl best (and only?) option, doesn't seem work me. it's not firing @ all. this code use: chrome.runtime.setuninstallurl('www.google.com'); it's located in extension's background javascript file couple of other event listeners. tried loading unpacked extension chrome , removing it, uninstall url not budge. any help appreciated. the documentation displays warning: dev channel only. this means api function still considered experimental , not enabled in stable/beta builds of chrome. here's corresponding issue in chrome bug tracker. seems feature should nail stable (ready since july) got bit lost on way. consider starring issue raise priority. until fixed, won't work in normal chrome versions. should have seen error function undefined if loo

ios - Xcode 6.1 crash on "Edit scheme" -

ios - Xcode 6.1 crash on "Edit scheme" - xcode 6.1 crashed when tried screen: edit scheme -> run -> options tab sample screenshot: http://meandmark.com/blog/wp-content/uploads/2013/12/xcode-5-current-working-directory.png now crashes every time go "edit scheme..." i'v tried rebooting , reinstalling xcode. when reinstalled xcode able open "edit scheme" window, options tab crashed again. crash report: process: xcode [404] path: /applications/xcode.app/contents/macos/xcode identifier: com.apple.dt.xcode version: 6.1 (6604) build info: ideframeworks-6604000000000000~2e) parent process: ??? [1] responsible: xcode [404] date/time: 2014-11-05 15:54:10.508 +0100 os version: mac os x 10.10 (14a389) study version: 11 time awake since boot: 710 seconds crashed thread: 0 dispatch queue: com.apple.main-thread exception

c++ - MPI_gatherv returns wrong receivecounts for mpi_doubles -

c++ - MPI_gatherv returns wrong receivecounts for mpi_doubles - i trying collect double values via mpi_gatherv. have array double values , different lenghts each rank. master should collect them , print them all. here code sample: #include "mpi.h" #include <iostream> #include <cmath> /* * * * silly demo * */ int main(){ int rank, wsize; // setup communication: mpi_init(null, null); mpi_comm_rank(mpi_comm_world,&rank); mpi_comm_size (mpi_comm_world, &wsize); if(rank ==0){ // master: int tasks = rank +1; double res[tasks]; for(int i=0; < tasks; i++){ // job: res[i] = std::sqrt(tasks+i); //std::cout << res[i] << " "; } double recvbuffer[wsize*wsize]; int rd[wsize]; int rc[wsize]; mpi_gatherv(res, tasks, mpi_double, recvbuffer, rc, rd, mpi_double, 0, mpi_comm_world);

go - How to check non standard object equivalence in golang template -

go - How to check non standard object equivalence in golang template - i outputting dropdown list using html template, follows: {{range .organisations}} <option value="{{.uuid}}">{{.name}}</option> {{end}} i want indicate 1 of items should selected doing eq comparator. potential complication aware of .uuid *gocql.uuid , trying this: {{range .organisations}} <option value="{{.uuid}}"{{if eq $.contact.organisation .uuid}} selected="selected"{{end}}>{{.name}}</option> {{end}} but results in next error message: page:32:36: executing "submit_scholarship" @ : error calling eq: invalid type comparison any pointers in right direction much appreciated. eq works on basic types. can add together custom function this. http://play.golang.org/p/rkynlqmela package main import ( "html/template" "os" ) type s struct { name []byte uuid []byte } func main() {

c - Why is my function representation not reverse-copying data? -

c - Why is my function representation not reverse-copying data? - i have function representation of fwrite write bytes backwards. however.. doesn't re-create them backwards appears strange. size_t fwrite_backward ( const void * ptr, size_t size, size_t count, file * stream ) { int i, chr; for(i = count * size; != 0; i--) { if( fputc(*(unsigned char*)ptr + (count * size) - i, stream) != eof ) chr++; } homecoming chr; } it supposed behave fwrite 2 differences: it copies info backwards it doesn't set ferror what might doing wrong? the implementation below seems work. corrects minor design flaws of version: your code writes out bytes backwards, should write items backwards bytes in items in original order. (after all, what's distinction between size , count for?) code below works items of size. yor code returns number of bytes written. fwrite returns number of items written. the loop ends on unsuccessful

ios - NSNotification not working on Swift translation (from Objective-C) -

ios - NSNotification not working on Swift translation (from Objective-C) - after converting objective-c code swift, cannot nsnotifications work. after hr of searching in web, gave up. consider next example: func gettourl(url:string, timeoutinterval:float) -> bool { println("starting http to: \(url)") // fire notification nsnotificationcenter.defaultcenter().postnotificationname("startnotification", object: self) [...] } func getjsonfromserver() { // add together observer should fire method test when desired nsnotificationcenter.defaultcenter().addobserver(self, selector: "test:", name: "startnotification", object: self) // calls function gettourl("http://www.stackoverflow.com", timeoutinterval: 10) } func test(sender: anyobject) { println("i here!") } i cannot find error, appreciate if else could! the code runs, test method never called. change in this, se

ios8 - iCalendar: Recurring events are not correctly displayed in IOS -

ios8 - iCalendar: Recurring events are not correctly displayed in IOS - brief introduction recurring events in php-generated icalendar file not recur correctly ios applications. recur correctly in outlook 2010 , google calendar, not in ios 8.1 (iphone 5s , ipad 2). details the next file generates calendar file fit subscription applications ms outlook , google calendar. file contains vtimezone , single vevent, meant recur every fri 7 - 28. nov 2014, 4 recurrences in total. icalendar file: http://www.elitesystemer.no/mycal_stack_example.php (full code below) on both idevices (ios 8.1) event occurs once; 7. nov 2014. odd behaviour goes native calendar app week calendar app (site: http://weekcal.com). the file works ms outlook 2010 , google calendar, not ios. unfortunately, have not been able find equivalent issue @ apple forums. neither able test idevice former os version, nor smart phone @ time. i have tested file @ online icalendar validators http://icalvalid.clouda

c# - WPF Telerik ScatterPointSeries RenderMode deprecated -

c# - WPF Telerik ScatterPointSeries RenderMode deprecated - a telerik radchartview beingness assigned analysischartscatterpointseries , rendermode property of formerly beingness set seriesrendermode.light . this property has been marked obsolete and, upon removing assignment code, performance chart has become poor larger info sets. the property marked (in metadata) "this property obsolete , removed. use renderoptions property instead." but on examining property, has type chartrenderoptions , empty, abstract class. what should instantiate, assign renderoptions, such performance issue can reverted? i assigned renderoptions property follows: renderoptions = new xamlrenderoptions() { defaultvisualsrendermode = defaultvisualsrendermode.batch } the documentation here: xaml rendering helped me. c# wpf telerik radchart

jquery - mvc bootstrap datepicker with editor template not working -

jquery - mvc bootstrap datepicker with editor template not working - i seek utilize implement bootstrap v3 datetimepicker in mvc project not working. below editor templates. @model datetime? @html.textbox("", model.hasvalue ? model.value.tostring("d") : string.empty) $(function() { // target input in editor template $('#datepicker').datetimepicker(); }); </script> i had inculded bootstrap datetimepicker script on _layout.chtml seem cant function <script src="~/scripts/bootstrap-datetimepicker.js"></script> <script src="~/scripts/bootstrap-datetimepicker.min.js"></script> this view @html.labelfor(model => model.enddate, new { @class = "control-label col-md-2" }) @html.editorfor(model => model.enddate) @html.validationmessagefor(mod

ruby on rails - Figaro Gem and Missing `secret_key_base` for 'development' environment -

ruby on rails - Figaro Gem and Missing `secret_key_base` for 'development' environment - i'm having difficulty getting figaro gem configured in app - here's have: the error i'm getting internal server error missing secret_key_base 'development' environment, set value in config/secrets.yml webrick/1.3.1 (ruby/2.1.2/2014-05-08) @ localhost:3000 gemfile gem 'sdoc', '~> 0.4.0', group: :doc # spring speeds development keeping application running in background. read more: https://github.com/rails/spring gem 'spring', group: :development gem 'figaro' gem 'flickraw' application.yml flickraw.api_key: 00000000000etc flickraw.shared_secret: 0000000000etc development: secret_key_base: 0000000000etc test: secret_key_base: 0000000000etc secrets.yml (i added env variable see if prepare .. doesn't create difference) development: secret_key_base: <%= env[&

javascript - How can I get express js to read forms -

javascript - How can I get express js to read forms - i trying nodejs/expressjs form info sent using jquery $.ajax function. know $http there plus not practice have angular jquery stuck in requires new form element , jquery, have written test it. i doing test because not find way or info on how form info (including files) without using body-parser doesn't back upwards multipart/form-data have read on web. here code in in front end end $scope.sendmsg = function () { var formdata = new formdata($('#form')); $.ajax({ url: '/test', type: 'post', data: formdata, cache: false, contenttype: false, processdata: false, success: function (data, status,something) { $scope.$apply(function () { console.log('data: ' + data); console.log('status: ' + status); console.log('something: ' + something);

Yasnippet installing with cask in Emacs error -

Yasnippet installing with cask in Emacs error - i've been trying install yasnippet using cask, can't work. i've installed other packages using cask , seem work, yasnippet won't load. error when opened emacs , have added (yas-global-mode 1) init.el file. warning (initialization): error occurred while loading `/home/adam/.emacs.d/init.el': error: don't know how create localized variable alias ensure normal operation, should investigate , remove cause of error in initialization file. start emacs `--debug-init' alternative view finish error backtrace. cask has been erased , reinstalled in home folder. yasnippet map in /home/adam/.emacs.d/.cask/24.3.1/elpa/ has been erased , reinstalled cask. thanks in advance help! edit: emacs --debug-init debugger entered--lisp error: (error "don't know how create localized variable alias") defvaralias(yas/fallback-behavior yas-fallback-behavior) byte-code("\304\211\203? em

javascript - ColdFusion and AJAX - Updating Database -

javascript - ColdFusion and AJAX - Updating Database - i'm wanting have scheme set users can go page there's list of items can rate (say, 1 through 5) drop-down. list going quite long much more convenient if go through , rank each item without ever having nail "save." i'm very much novice when comes ajax figure can't that difficult. found an reply in different discussion think quite relevant doesn't provide plenty info me know it. in short, how utilize ajax, in congruence jquery , coldfusion, update database without need save/submit button? clarification: should have clarified user can rate items - not rank. meaning there's no #1, #2, #3, etc. instead, each item can rated on scale 1-5. currently i'm basing off of ".change()" when user makes selection in drop-down. @ point have 2 jquery variables set "id" of item changed new "rating." need find way utilize these 2 variables update table in database.

r - Most efficient way to loop through each observation in a data frame -

r - Most efficient way to loop through each observation in a data frame - i'm trying find efficient way loop through info frame , cluster observations groups of 5. example, if have: group <- c(1,2,3,4,5,6,7,8,9,10) people <- c(1,2,3,4,4,3,2,1,2,3) avg_age <- c(5,10,15,20,25,30,35,40,45,50) info <- data.frame(group,people,age) this should generate grouping people avg_age 1 1 1 5 2 2 2 10 3 3 3 15 4 4 4 20 5 5 4 25 6 6 3 30 7 7 2 35 8 8 1 40 9 9 1 45 10 10 2 50 i'd create "cluster" of groups @ to the lowest degree 5 people in weighted average age "cluster." i'd in efficient way going through info set , sequentially adding groups until "cluster" made @ to the lowest degree 5 people. our info should like: grouping people age cluster tot_ppl avg_age 1 1 1 5 1 6 1

scala - Polymorphic functions with constant return type in Shapeless -

scala - Polymorphic functions with constant return type in Shapeless - long story short, i'm trying figure out how define function generic input single-typed output. the background: continuation of mapping on shapeless record. after travis's first-class answer, have following: import shapeless._ import poly._ import syntax.singleton._ import record._ type queryparams = map[string, seq[string]] trait requestparam[t] { def value: t /** convert value query parameter representation */ def toqueryparams: seq[(string, string)] /** mark parameter auto-propagation in new urls */ def propagate: boolean protected def querystringpresent(qs: string, allparams: queryparams): boolean = allparams.get(qs).nonempty } type requestparambuilder[t] = queryparams => requestparam[t] def booleanrequestparam(paramname: string, willpropagate: boolean): requestparambuilder[boolean] = { params => new requestparam[boolean] { def propagate: boolean = willpropagate

c# - Modifiy JSON Date time object format -

c# - Modifiy JSON Date time object format - hi writing json webservice returns datetime. it returning date time in epoch format. possible modify json date format returns. code snippet [servicecontract] public interface itmappservices { [operationcontract] [webget(uritemplate = "/test", requestformat = webmessageformat.json, responseformat = webmessageformat.json)] datetime getdata(); } actual implementaiton public class tmappservices : itmappservices { public datetime getdata() { homecoming datetime.now; } } i returning datetime.now in c# output in epoch format : "/date(1413399311687+0300)/" i want output in same format returned c# or if datetime sql it looks you're writing wcf service. default, wcf uses datacontractjsonserializer json serialization - uses format. you should consider either replacing json.net - or preferably, writing

How to auto-reload css in Chrome after editing SASS files -

How to auto-reload css in Chrome after editing SASS files - i trying set mapping feature in chrome canary. followed screenshots in this answer. the main feature works, when inspect element, points me local sass file , when edit it, local file safes, , `sass --watch' triggered. however, browser not refresh, though on "general" tab in devtools have checked "auto-reload css upon sass save". should browser reload? there way reload? ps - have compass can not utilize not back upwards mapping, compiling sass through terminal thanks it sass-file still compiling when chrome tries reload css. setting 'auto-reload css upon sass save' timeout 5000 ms fixed me. when chrome triggers reload, can prevent sass recompiling css. sass google-chrome-devtools

javascript - Create an effect to make element fadeIn and fadeOut without using fadeToggle() -

javascript - Create an effect to make element fadeIn and fadeOut without using fadeToggle() - you see, utilize if else accomplish goal, not works. think might create mistakes. these codes w3schools, , changed look. class="snippet-code-js lang-js prettyprint-override"> $(document).ready(function() { if ($("button").text() == "click fade in boxes") $("button").click(function() { $("#div1").fadein(); $("#div2").fadein(); $("#div3").fadein(); $("button").text("click fade out boxes"); }); else $("button").click(function() { $("#div1").fadeout(); $("#div2").fadeout(); $("#div3").fadeout(); $("button").text("click fade in boxes"); }); }); class="snippet-code-html lang-html prettyprint-override"> <script src="https://aj