Posts

Showing posts from June, 2011

cocoa - NSScrollView redraw after setting magnification -

i setting magnification property on nsscrollview perform zoom (mountain lion only) works fine except after setting magnification, whole view repainted during scrolling - makes jumpy. if set magnification 1.0 repaint/scroll issue persists. seen before - or know workaround? thanks craig ok, spent 1 of apple support incidents on this. apparently it's known issue (which not fixed in mavericks either.) no work around available - other use layer backed views - introduces other issues :-(

php - Passing multi-Array from Model to a Controller -

i have controller array $added_tabs. pass array function model. in model if print results works fine, if return $row controller again, show 1 record. any ideas? in controller have this: $this->load->model('check_info/check_post_day'); $admin_post_day = $this->check_post_day->check_post($added_tabs); echo "<pre>"; print_r($admin_post_day); echo "</pre>"; in model have this: class check_post_day extends ci_model { function check_post($data) { foreach ($data $info) { $row = array(); $query = $this->db->query(" select admin_post_day.page_id, admin_post_day.admin_id, admin_post_day.hour_post, admin_post_day.discount, admin_post_day.url, admin_post_day.message_post, admin_post_day.voucher, admin_post_day.date_saved, fb_pages.page_id, fb_pages.id_fb_pages,

c# - How did I solve this memory leak-ish issue? -

i have .net 2.0 app heavy processing, uses lots of memory, , more. takes tasks web service, it's job, returns results, , repeats infinity. main code structure can simplified , illustrated this while (true) { task t=serviceaccess.gettask(); if (t.tasktype == 1) { brutalmemoryconsumerprocessor b=new brutalmemoryconsumerprocessor(); b.dotask(t); } else if (t.tasktype == 2) { heavycpuconsumerprocessor h=new heavycpuconsumerprocessor(); h.dotask(t); } } fortunatelly me, died after few cycles outofmemoryexception somewhere in inner code. due fact both objects have been calibrated use of ram there (for x86 app), , having old object instance while new 1 being created sure way process snuff out. ok, tried few tricks first. namely: gc.collect(); at beginning of loop, after while (true) . no luck. next, remembered old vb6 com based days, , tried b = null; , h = null; inside scope of if stat

similarity - TF-IDF in python and not desired results -

i found python tutorial on web calculating tf-idf , cosine similarity. trying play , change bit. the problem have weird results , without sense. for example using 3 documents. [doc1,doc2,doc3] doc1 , doc2 similars , doc3 totaly different. the results here: [[ 0.00000000e+00 2.20351188e-01 9.04357868e-01] [ 2.20351188e-01 -2.22044605e-16 8.82546765e-01] [ 9.04357868e-01 8.82546765e-01 -2.22044605e-16]] first, thought numbers on main diagonal should 1 , not 0. after that, similarity score doc1 , doc2 around 0.22 , doc1 doc3 around 0.90. expected opposite results. please check code , maybe me understand why have results? doc1, doc2 , doc3 tokkenized texts. articles = [doc1,doc2,doc3] corpus = [] article in articles: word in article: corpus.append(word) def freq(word, article): return article.count(word) def wordcount(article): return len(article) def numdocscontaining(word,articles): count = 0 article in articles: if word

Hiding the browser link in HTML emails (when viewing in browser) -

i using gold lasso send emails customers , there built in functionality add link view email in browser. when user clicks link , viewing email in default browser, "view in browser" link disappear. what best way hide link in browser, still have show when viewing in email client? add javascript function makes disappear. can't recommend hiding things though. if make unobtrusive (put under signature @ end of mails)

c++ - Override c library file functions? -

i working on game, , 1 of requirements per licence agreement of sound assets using distributed in way makes them inaccessible end user. so, thinking aggregating them flat file, encrypting them, or such. problem sound library using (hekkus sound system) accepts 'char*' file path , handles file reading internally. so, if continue use it, have override c stdio file functions handle encryption or whatever decide do. seems doable, worries me. looking on web seeing people running strange frustrating problems doing on platforms concerned with(win32, android , ios). does there happen cross-platform library out there takes care of this? there better approach entirely recommend? do have option of using named pipe instead of ordinary file? if so, can present pipe sound library file read from, , can decrypt data , write pipe, no problem. (see beej's guide explanation of named pipes.)

php - PHPMailer doesn't send mail to gmail -

i trying send mail through phpmailer. seems work fine, mails sent email not show on gmail (when using google apps) shows in outlook or mobile email. think i'm going wrong headers somewhere. please me. tried question first got no answer. phpmailer file : <?php require('phpmailer/class.phpmailer.php'); if(isset($_post['email'])) { // edit 2 lines below required //$email_to = "info@rsadvisories.com"; //$email_subject = "request portfolio check ".$first_name." ".$last_name; $title = array('title', 'mr.', 'ms.', 'mrs.'); $selected_val = $_post['title']; $first_name = $_post['first_name']; // required $last_name = $_post['last_name']; // required $email_from = $_post['email']; // required $telephone = $_post['telephone']; // not required $comments = $_post['comments']; // required function clean_string

sinatra - ruby, Plivo and Heroku getting status "404" or no xml response error -

i attempting make outbound call softphone using plivo. the answer url (on plivo account) http://frozen-lake-7349.herokuapp.com/outbound if go url, on heroku, see: <response><hangup/></response> which correct. the ruby code is: get '/outbound' to_number = params[:to] from_number = params[:clid] ? params[:clid] : params[:from] ? params[:from] : '' caller_name = params[:callername] ? params[:callername] : '' resp = plivo::response.new() if not to_number resp.addhangup() else if to_number[0, 4] == "sip:" d = resp.adddial({'callername' => caller_name}) d.adduser(to_number) else d = resp.adddial({'callerid' => from_number}) d.addnumber(to_number) end end content_type 'text/xml' resp.to_xml() end yet when try make call softphone never works. plivo debug logs tells me http response failure , xml : no response tag present and heroku

jaxb - how to define XSD for a XML with optional element -

i have xml likethis <datapoint> <fieldname>somestring</fieldname> <value>some string</value> </datapoint> <datapoint> <fieldname>somestring</fieldname> <value>some string</value> </datapoint> <datapoint> <fieldname>somestring</fieldname> <value> <filename>some string</filename> </value> </datapoint> i need define xsd xml. used value complex type . when use value complex type not able parse string value value in jaxb. getting object only. if declare value simple type(string) not able read filename.what should do..please help. you mark xml element optional including minoccurs="0" in definition. i used value complex type . when use value complex type not able parse string value value in jaxb if define complex type need pass corresponding class unmarshal method: datapoint datapoint = unmarshaller.unmars

swing - Strange behavior of java game loop -

i have simple game loop in java: public void run(){ while(running){ start = system.nanotime(); gamepanel.update(); gamepanel.repaint(); elapsed = system.nanotime() - start; wait = (target_time - elapsed) / 1000000; if(wait < 0){wait = target_time;} try {thread.sleep(wait);}catch(exception e) {e.printstacktrace();} } } now problem: when add sysout in update() outing "updating" , 1 in paintcomponent() outing "repainting", following result: updating updating updating updating updating (x1000 , more) repainting so when repaint 1 time, game updating 1000 , more times. normal? think abit strange, isnt it? example can 1000 steps player until game painting it... means, update() method doesnt wait repaint finishing? why? thank you! edit: here update code: public void update(){ if(moveup){ changemapy(map, -map.getspeed()); } if(movedown){ changemapy(map, map.getsp

jquery - Change background-color while scrolling -

i background-color of header change background-color of div scrolls past. so, when scrolled div #about (green), background-color of header change green. have far, it's not working. appreciated. var t = $('#about').offset().top - 100; $(document).scroll(function(){ if($(this).scrolltop() > t) { $('header').css({"background-color":"green"}); } }); check out fiddle . your code works fine in fiddle after add jquery it. (i used 1.9.1).

html5 - href links not working when nested in data section -

so i'm designing site utilizes parallax scrolling , html5 data attribute. problem nested in 1 of data sections (data-slide), have link, , doesn't seem work unless place outside of data-slide. url: http://ericbrockmanwebsites.com/dev3/ (at bottom of page, in "projects") here's markup: <div class="slide" id="slide4" data-slide="4" data-stellar-background-ratio="0"> <div class="container clearfix"> <div class="row"> <div class="span10 offset1"> <div class="row"> <div class="span3"> <div class="slideno"> projects </div> <!-- slideno --> </div> <!-- span3 --> <div class="span7"> <div class="gridcontainer"> <?php $the_q

css - Floated divs don't like up vertically as desired -

this question has answer here: css floating divs @ variable heights [duplicate] 10 answers i've got divs, floated left, first of 3 times wider , bit shorter rest. when smaller divs wrap , break onto next "line", i'd first 3 of smaller divs lie flush against bottom of larger one. (a bit tricky describe in text, fiddle give idea.) how make happen? markup: <div class="bigger"></div> <div class="smaller"></div> <div class="smaller"></div> <div class="smaller"></div> <div class="smaller"></div> <div class="smaller"></div> <div class="smaller"></div> <div class="smaller"></div> <div class="smaller"></div> <div class="smaller"></div>

android - Changing layout through user input -

im new app development. i want add button on screen when clicked give user textedit in can enter data. can give brief description how done? i'm not going write code scratch can give few pointers should help. can create new edittext like public void onclick(view v) { edittext et = new edittext(v.getcontext()); // add layout params, text, etc... } then need add viewgroup such linearlayout in inflated layout viewgroupname.addview(et) ; however, simpler way, if works you, have edittext defined in xml , set visibility either invisible or gone set visibility in onclick() visible . hopefully enough started. if have questions feel free ask.

mozilla blue highlight color in clickeable javascript elements -

i have problem mozilla , classic blue highlight color. there's no problem highlighted text, mean, i've been searching , tried ::-moz-selection css property, , works fine, real deal comes clickeable javascript events have on page, example... css figure:nth-of-type(1) { -o-transform: translate(60%,-25%) rotate(-10deg) scale(0.60); -webkit-transform: translate(60%,-25%) rotate(-10deg) scale(0.60); -moz-transform: translate(60%,-25%) rotate(-10deg) scale(0.60); transform: translate(60%,-25%) rotate(-10deg) scale(0.60); } figure.active:nth-of-type(1) { z-index:10; box-shadow:0px 0px 50px black; -o-transform: translate(-6.5%,-13.5%) rotate(0deg) scale(0.70); -webkit-transform: translate(-6.5%,-13.5%) rotate(0deg) scale(0.70); -moz-transform: translate(-6.5%,-13.5%) rotate(0deg) scale(0.70); transform: translate(-6.5%,-13.5%) rotate(0deg) scale(0.70); } javascript <script type="text/javascript" > <!--

ios - Clip/Control scrolling of table view -

sorry: problem little lengthy , may complicated: i have uitableview row section header view , cell. there background image (blurred) on whole uitableview . image visible section header well. , achieved making background color of section header , cell clearcolor . there text on cell. when scroll cell, text on cell gets section header (because section view clearcolor ). what want cell text should not seen when entering header section (it same if section header has non-clear color alpha 1) if cannot see original background image section header view want see. how can achieve effect? there way apply kind of transparent mask on section header view image below visible text cell not seen on when scrolling? i'm not clear on how uitableview set up, try maskstobounds property of calayer . make sure add quartzcore framework import header: #import "quartzcore/quartzcore.h" then setting maskstobounds property this: yourview.layer.maskstobounds = yes;

c# - Impossible? How to deserialize this using DataContractSerializer? -

so have xml looks this: <a> <b c="1" ></b> <b c="2" ></b> <b c="3" ></b> <b c="4" ></b> </a> i want deserialize on wp7 using datacontractserializerdo that. i run across opinions impossible without tricks enclosing xml in additional tags push < > down root level. true? on request i'm adding code classes: [knowntype(typeof(b))] [datacontract(namespace = "")] public class a:list<b> { [datamember] public list<b> b { list<b> _b = new list<b>(); { return _b; } set { _b = value; } } } [datacontract(namespace = "")] public class b { [datamember] public string c = "foo"; } deserialisation: var serializer = new datacontractserializer(typeof(a)); var o = serializer.readobject(someresponsestream); and many, many other variations of this . way -

wordpress - Remove href link from images with overlay -

i need turn products listed in http://srougi.biz/gb/portfolio_listing/ non-clickable items, without loose overlay effect. , since wordpress site, can't change code, option css. i've tried put pointer-events:none , cursor:default in image, lost overlay effect. appreciate help. to deactivate links in case, need add javascript code. js: add before </body> in theme file: footer.php <script> var thumbnails = document.getelementsbyclassname('thumbnail'); for(i = 0; < thumbnails.length; i++){ thumbnails[i].getelementsbytagname("a")[0].setattribute("onclick", "return false;"); } </script> css: style remove pointer link. .thumbnail { cursor: default !important; }

c - Calling functions from mongoose begin_request_handler callback -

currently i'm working on application embeds mongoose webserver. in cases, have call additional functions inside begin_request_handler create desired http header. during this, realized theses functions called after request handler done. example: void test() { printf("hello"); } static int begin_request_handler(struct mg_connection *conn) { test(); const struct mg_request_info *request_info = mg_get_request_info(conn); ... return 1; } here hello getting printed right after browser closes tcp connection. there way call functions inside callbacks? or missing something? if want create desired http header. function mentioned above (begin_request_handler) may not correct approach. structure mg_request_info field in structure mg_connection . here name , value of headers set. think these structures populated @ start after connection establishment. @ pull() , read() . these ground-level function data set. and yes there way call functi

linux - Home/End keys do not work in tmux -

i'm using tmux xterm-256color $term variable. when in bash under tmux, pressing home/end insert tilde characters (~). outside of tmux home/end keys work fine. using cat , tput, see there mismatch between generated , expected sequences: $ cat -v # pressing home, end ^[[1~^[[4~ $ tput khome | cat -v; echo ^[oh $ tput kend | cat -v; echo ^[of to fix this, decided add following .bashrc: if [[ -n "$tmux" ]]; bind '"\e[1~":"\eoh"' bind '"\e[4~":"\eof"' fi that fixed problem bash, in other readline programs, such within repl such ipython, still inserts tilde home/end. why problem in first place? why generated sequence different when i'm inside tmux vs outside it? how can fix it's not issue in programs? it appears main problem using xterm-256color $term. switched $term screen-256color , problem went away.

Some methods can't be resolved - android -

i new android. have activity fragmenttabsactivity extends fragmentactivity , , implements tabs using tabhost (i know deprecated, better understand). when tab active, want display list item content. this list defined class tabfragment extends listfragment . now, have public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { mprogressbar = (progressbar) findviewbyid(r.id.progressbar); .... } .... private boolean isnetworkavailable(){ connectivitymanager manager = (connectivitymanager) getsystemservice(context.connectivity_service); the problem neither findviewbyid , nor getsystemservice recognized. why ? converting comments answer findviewbyid method of activity inflated there couple ways can here simplest change mprogressbar = (progressbar) findviewbyid(r.id.progressbar) to mprogressbar = (progressbar) getview().findviewbyid(r.id.progressbar) by calling method on inflated

Excel: Search for a cell address, then use that address in a function -

i'm having trouble rather convoluted excel issue, think have problem figured out. lets use successful pets example. have 3 pets, cat, dog, , bird. cat , bird both successful @ jumping through hoop, dog wasn't. have results listed in 1 table: sheet1: http://imgur.com/ltrmwqy i have table lists pets: sheet2: http://imgur.com/prq12md in sheet2 b2, have formula return word "success." can't seem function work this. the logical progression see first identify cell holds word "cat" in sheet1. need set if statement searching word success in cell. i have second part down: =if(isnumber(find("successful",sheet1!a1)), "success", "fail") what need write search out , populate "sheet1!a1" portion of above function searching sheet1 column value in sheet2 cell a2. can or me pointed in right direction? thank in advance. i wrote down bit quickly, there might shorter ^^; =if(isnumber(search("succes

javascript - Cannot connect to dlib webserver remotely, localhost does work -

i developing html/javascript frontend c++ backend doing calculations. both connected via integrated small dlib webserver handles requests. frontend requests data this: pop=$.ajax({ //load population array of 90 type:"post", url: "pop90", async:false }); eval(pop.responsetext); the webserver returns large array (length around 4 000 000) in single string. works if connect via localhost, cannot access server remotely on computer. browser loads while , times out, can see requests on server. server throws error: dlib.server_http: http field client long. http request client should not big, actual post server is. thx lot in advance! elaborate bit more. tested page in firefox, doesn't work via localhost. error console sais array initializer, respinse string of webserver , goes this, 4 million entries: "ar=[-99999, -99999, ...]" the webserver class handles request looks this: class web_server : public serve

vim - Repeating last function call with dot -

i wrote small function , added map jump next line not match 2 first chars in current line: function! jumptonextnonmatching() let curr_line = getline('.') let spattern = '^[^' . curr_line[0] . '][^' . curr_line[1] . ']' call search(spattern) endfunction nnoremap ,n :<c-u>call jumptonextnonmatching()<cr><c-l> so if hit ,n jump next line doesn't match criteria. use repeat.vim plugin use . repeat operation, i.e., jump next line doesn't match criteria. how can plugin mentioned or there better alternatives can use? you should have told you're struggling with. using repeat.vim doesn't require many changes: you need introduce intermediate <plug> mapping repeat invoke. you need register mapping plugin @ end of command's execution. here are: function! jumptonextnonmatching() let curr_line = getline('.') let spattern = '^[^' . curr_line[0] . '][^' . curr

serialization - What is the fastest / memory / size efficient Java Serialisation framework based on Benchmarks? -

what fastest / memory / size efficient java serialisation framework based on benchmarks? there claims kryo fastest. jackson smile , nfs-rpc. there solid comparisons backed numbers , perhaps other lesser know frameworks give better performance. found nice comparison . have @ , decide yourselves.

how can I partially fade out an image out with jQuery -

this question has answer here: how fade in *partially* in jquery? 4 answers i have background image. want fade out part-way when page loads, meaning want effect of fadeout -- instead of making image invisible want stop part-way semi-visible. is there way of doing fadeout? there method use? did tried .animate(properties, duration) function? $("#image").animate({ opacity: 0.5}, 200); or use .fadeto(duration, opacity) function: $("#image").fadeto(2000, 0.5); demo

c# - Is there a way to get a list of all the places where a variable is touched in a project? -

i trying figure out variable being assigned for-it nosensical value. know can select "find usages" context menu, , list of places referenced within own unit, such as: string name; . . . name = "bla"; ...but in cases referenced outside class, such as: workfiles wrkfile = new workfiles(); wrkfile.name = bla; ...find usages not out. there way see places variable touched within project? update the place var being assigned in class of member this: name = aname.remove(0, 3); ...all other places "find usages" found "name" parameters sql statements; @ 1 point has value such full value entered in unrelated text box. has being assigned elsewhere. or name "name" causing untoward occur... selecting "go reference" context menu takes me line of code shown above. update 2 this looks promising: http://visualstudiogallery.msdn.microsoft.com/fb5badda-4ea3-4314-a723-a1975cbdabb4

tastypie - Post request to create new custom users in Django -

i have model extend user model: class readeruser(models.model): user = models.onetoonefield(user) email = models.emailfield() def __unicode__(self): return self.user.first_name + ',' + str(self.email) i create resources tastypie api: class createreaderuserresource(modelresource): user = fields.onetoonefield('userresource', 'user', full=false) class meta: allowed_methods = ['post'] always_return_data = true authentication = authentication() authorization = authorization() queryset = readeruser.objects.all()

Grails create-controller fails (inside Eclipse) -

first off: sorry if question should not belong here. new grails , wanted set eclipse (spring tool suite + grails/groovy plugin). creation of helloword controller fails huge exeptions. did set java_home , grails_home in environment variables in windows. i keep short uploaded pastebin: http://pastebin.com/aesgcyp7 as can see fails with: \helloworldcontroller.groovy: 1: unexpected token: package @ line 1, column 1. package 7daystobuild background info: tried newer grails versions (2.2.4, since plugin uses 2.2.3) , both jdk 1.7 , 1.6) thanks i don't think package name valid. i've never officially looked groovy, believe groovy follows java naming conventions packages, states can't have package names start digit.

Looking for best way to Incorporate C++ dll with Python -

i have python gui application needs incorporate complex c++ dll. have looked boost.python having difficulties program contains 5 separate c++ files , have no prior c++ coding experience. able test 'hello world' c++ dll working python c++ code simple compared dll need. i have gotten dll work visual basic project looking best possible solution same application in python. would best attempt rewrite c++ code in python or try boost.python wrappers coded correctly? if time required rewrite code in python comparable time take code wrappers preferred rewrite code completely? would converting dll code compiled language interpreted 1 show more negative affects positive? thank in advance, garrett i started using boost.python year ago novice/mid level c++ programmer, , happy decision go forward it. learning curve steep, gradually eases once learn how navigate online documentation. have trouble every , then, best assistance found on how use boost.python asked question

mysql - Matching id reference between two tables and exclude result with connection user id -

i have 2 tables - simplified this: //table player_img_id || player_img_category_id //table b user_play_uid || user_play_img_id (reference table a: player_img_id) how show results table a exclude rows based on reference entries table b result_should_exclude_reference_with instance user_play_uid = 1 , user_play_img_id == player_img_id . basically want show results table dont have referenced user entry in table b. note: start of with, there no user entries in table b any suggestions? as suggested in comment found solution reading bit on joins here: http://www.codinghorror.com/blog/2007/10/a-visual-explanation-of-sql-joins.html the query needed following: select * player_img left outer join user_play on user_play.user_play_entry_player_img_id = player_img.player_img_id , user_play.user_play_uid != $this->user_uid user_play.user_play_entry_player_img_id null

css3 - Setting box-shadow to a group of HTML elements -

i have 2 elements positioned sides touch. have different dimension/size on touching side. both of them need have shadow underneath. the problem 1 of shadows overlaying sibling element. can play z-index means select of 2 overlaid sibling's shadow. it great if 1 add shadow group of elements in case shadow rendered behind group without element interference , regardless of z-index vertical ordering. is possible achieve similar effect in ccs3 without resorting shadow images? maybe use div:after { pseudo element http://jsfiddle.net/2p964/ bit of mug method works :)

iphone - Framework not found -

i know similar questions have been asked many time, unfortunately none of answers able solve problem. the problem got new imac , when add 3rd party framework (for eg: comscore) drag/drop or using "add framework" method, gives me compile error ld: framework not found comscore clang: error: linker command failed exit code 1 (use -v see invocation) i created test application, , has no other functionality. in throwing same error. on previous machine, , other machines, works fine. problem specific new mac. framework search paths target , project has following values $(inherited) "$(srcroot)" "$(srcroot)"/cstest/ the structure of folder in project files this: cgtest (outermost folder name) --> cgtest --> cgtest.xcodeproj comscore.framework there inside cgtest folder.

javascript - Hide or remove next button after 3 clicks and show again if click on previous button -

i have done basic jquery code when clicking 3 time on next button hides , when click on previous button shows doesn't run 3 click loop. need make after clicking 3 time on next button when click on previous button should run first loop 3 click. var $i = 1; $('body').on('click','#next',function(){ if ($i < 3) { /*functions executed*/ $i++; } else { $(this).prop('disabled', 1); $(this).hide(); } }); $('#prev').click(function() { $('#next').show(); }); var $n = 1; $('body').on('click','#prev',function(){ if ($n < 3) { /*functions executed*/ $n++; } else { $(this).prop('disabled', 1); $(this).hide();

ruby - "Internal error" when pushing to Heroku -

whenever try push repo heroku, absurdly unhelpful error: counting objects: 214, done. delta compression using 8 threads. compressing objects: 100% (204/204), done. writing objects: 100% (214/214), 196.99 kib | 306 kib/s, done. total 214 (delta 98), reused 0 (delta 0) -----> removing .ds_store files -----> ruby/rack app detected -----> using ruby version: ruby-2.0.0 -----> installing dependencies using bundler version 1.3.2 running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment source :rubygems deprecated because http requests insecure. please change source 'https://rubygems.org' if possible, or 'http://rubygems.org' if not. fetching gem metadata http://rubygems.org/......... fetching gem metadata http://rubygems.org/.. fetching git://github.com/datamapper/dm-core.git fetching git://github.com/datamapper/dm-aggregates.git fetching git://g

jquery - $ajax() call works in Firefox not Webkit/Chrome -

the following $ajax() call works fine firefox returns "error" status text , '0' status in webkit. url cakephp specific controller action returns html. id passed ajax call comes option select , functioning in both browsers. $.ajax({ type : "post", url : "http://mysite.com/controller/controllername/action/", datatype: 'html', data: {'itemid':id}, success: ajaxsuccess, error: ajaxerror, complete: ajaxcomplete }); function ajaxcomplete(jqxhr, textstatus){ console.log("complete: " + textstatus); console.log("complete: " + jqxhr); } function ajaxerror(jqxhr, textstatus, errorthrown){ console.log(errorthrown); console.log(textstatus); console.log(jqxhr); } function ajaxsuccess(result, status, jqxhr){ console.log(result); } does have ideas why work in firefox , not in webkit/chrome? i'm out of ideas.

How does a for loop over a file work in Python? -

i have piece of code f = open('textfile.txt', 'r') line in f: print line lets textfile.txt this 1 2 3 4 5 how work? how know in file? understand printing on , on why doesn't print whole file on , over. don't see how f range. assume knows stop @ eof? calling open() returns file object - i.e. f file object. file objects own iterators, implementing next() method, allowing them used in for loops per example. , yes, iterator implementation knows stop @ eof. have @ description here, under file.next() method details: http://docs.python.org/2/library/stdtypes.html#bltin-file-objects

java - Newrelic Install for WebSphere - ClassNotFoundException -

we've installed newrelic java agent on our websphere application / websphere commerce system , in newrelic logs seeing this: sep 3, 2013 22:47:53 -0400 newrelic 14 info: data collector temporarily unavailable. can happen periodically. in event availability of our servers not restored after period of time, please report new relic. java.net.socketexception: java.lang.classnotfoundexception: cannot find specified class com.ibm.websphere.ssl.protocol.sslsocketfactory @ javax.net.ssl.defaultsslsocketfactory.a(sslsocketfactory.java:11) @ javax.net.ssl.defaultsslsocketfactory.createsocket(sslsocketfactory.java:6) @ com.ibm.net.ssl.www2.protocol.https.c.afterconnect(c.java:161) @ com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:36) @ sun.net.www.protocol.http.httpurlconnection.getinputstream(httpurlconnection.java:1184) @ java.net.httpurlconnection.getresponsecode(httpurlconnection.java:390) @ com.ibm.net.ssl.www2.protocol.https.b.getresponsecode(b.jav

asp.net web api - rest api that allows update to collection -

what best practice allowing webapi odata based webservice update entire collection? for example, have admin page allows users maintain list of payment terms. have created controller based on paymentterm entity, allows standard get, key, put, post, , delete, working single instances of paymentterm entity. however, our ui team retrieve collection of payment terms (easily done standard collection), manipulate locally, , put or post entire collection server, rather having make series of put, post, , delete calls server. i have tried creating action method this, , while have managed work, seems kludgy, requires id, odata parameters (which contain collection), , id meaningless because @ point not working instance of payment term, entire collection of them. i create new controller solely working collection of payment terms, i'm not sure better, end having have base class declaration of entitysetcontroller<paymenttermcollection, int> or like, not make sense collecti

tycho - Unknown packaging: eclipse-target-definition -

i'm trying build application based on eclipse 4 rcp platform , built tycho. followed article http://blog.vogella.com/2013/01/03/tycho-advanced/ use pde target definition, , following error occurs when building project: [error] unknown packaging: eclipse-target-definition my project's modules architecture adapted the eclipsecon 2013 tycho demo , plus target module: - mybundle.myproject.bundle - mybundle.myproject.bundle.tests - mybundle.myproject.feature - mybundle.myproject.parent - mybundle.myproject.target i'm using tycho 0.18.1, , pom.xml mybundle.myproject.target module generates error is: <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <artifactid>mybundle.myproject.repository</artifactid

java - Why are iterators private? -

iterators nested classes exported clients. why declared private instead of public ? eg: private abstract class hashiterator<e> implements iterator<e> { private final class entryiterator extends hashiterator<map.entry<k,v>> { public map.entry<k,v> next() { return nextentry(); } } in general case, don't have private; i.e. if designing data structure, there nothing stopping declaring iterator class public . however, private iterators "good design" if data structure intended string abstraction; i.e. 1 internal representation hidden client code. one reason making iterator class private prevents undesirable coupling; i.e. stops external class depending on actual iterator code in way make future code changes harder. another reason in cases extensible public iterator class couldn't instantiated anyway. or @ least, not without relaxing abstraction boundary of data structure. another way

python - How do I correctly install pyinstaller? (what am I doing wrong?) -

i trying install pyinstaller (on ubuntu). used pip install pyinstaller , think worked fine. outputted downloading/unpacking pyinstaller running setup.py egg_info package pyinstaller setup.py not yet supposed work. please use pyinstaller without installation. complete output command python setup.py egg_info: setup.py not yet supposed work. please use pyinstaller without installation. ---------------------------------------- command python setup.py egg_info failed error code 1 in /home/alex/venv/base/build/pyinstaller storing complete log in /home/alex/.pip/pip.log i ran "pip install --upgrade pyinstaller" outputted downloading/unpacking pyinstaller running setup.py egg_info package pyinstaller setup.py not yet supposed work. please use pyinstaller without installation. complete output command python setup.py egg_info: setup.py not yet supposed work. please use pyinstaller without installation. ---------------------------------------

cakephp 2.0 - SEO pages not generating dynamic in sitemap.xml -

i generating sitemap.xml, generated 17 files has links on site means pages either in header or footer or interlinking have 50 seo pages not generating. don't have links on site means (header, footer , interlinking) in view/pages folder , method in pagescontroller. want dynamic generate 50 seo pages in sitemap.xml. how work please body asap. doing throgh generator.zip folder. try public function seo_sitemap() { $this->autorender=false; $data = $this->page->find('all'); if(!empty($data)) { $writer = new xmlwriter(); $writer->openuri(www_root.'/seo_pages_sitemap.xml'); $writer->startdocument('1.0', 'utf-8'); $writer->setindent(4); $writer->startelement('urlset'); $writer->writeattribute('xmlns:xsi', 'http://www.w3.org/2001/xmlschema-instance'); $writer->writeattribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.

twitter bootstrap - if statement combined with jQuery .hover -

i working bootstrap , make drop down menu fade in when in full screen, when window size smaller dose not want turn off , rely on basic bootstrap. here code. cant seem if statement work. if ($(window).width() > 766){ $('.navbar .dropdown').hover(function() { $(this).find('.dropdown-menu').first().stop(true, true).fadein(500)}, function() { $(this).find('.dropdown-menu').first().stop(true, true).fadeout(500) }); }; keep in mind jquery's find() select descendants of .dropdown elements you're searching also, way jquery selector hover written (with spaces) cause binding apply .dropdown children of .navbar , relationship must this: <div class="navbar"> <div class="dropdown"> hovering here shows menu <div class="dropdown-menu"> menu fades </div> </div> </div>

Get Outlook email address through c# -

i need able logged in user's email address c# code. i need full address , not assumed email account (eg user@localdomain.com.au), although work clients. any appreciated. try this, http://msdn.microsoft.com/en-us/library/ff462091.aspx : using system; using system.text; using outlook = microsoft.office.interop.outlook; namespace outlookaddin1 { class sample { public static void displayaccountinformation(outlook.application application) { // namespace object (session) has collection of accounts. outlook.accounts accounts = application.session.accounts; // concatenate message information accounts. stringbuilder builder = new stringbuilder(); // loop on accounts , print detail account information. // properties of account object read-only. foreach (outlook.account account in accounts) { // displayname property represents friendly

iphone - Set frame to UIview which is child view of UIScrollview -

i have created 1 uiview inside uiscrollview storyboard, above uiview more views present label, imageview etc inside uiscrollview . i want set frame uiview programatically. have tried set frame using setframe function programatically, not working uiview inside uiscrollview . i have seen similar questions this, everywhere create uiview programmatically, want use uiview created in storyboard , want set frame that. can please suggest me, how can this? thanks. edit1: added code [myownview setframe:cgrectmake(0, 50, 320, 110)]; myownview uiview added inside uiscrollview, write above code inside viewdidload method. edit2: nsstring usertext = @"some long text multiple lines"; cgsize constraint = cgsizemake(200, 90000.0f); // size of text given cgsize made constraint cgsize size = [usertext sizewithfont:[uifont fontwithname:@"helveticaneue" size:13] constrainedtosize:constraint linebreakmode:nslinebreakbywordwrapping]; uilabel *mylabel = [

local storage - push() not working in javascript -

problem : uncaught typeerror: object #<object> has no method 'push' in console. code in http://jsfiddle.net change storage item id(cart) , try again, looks stored item under "cart" id not json array @dc5 suggested in comment section upd: try http://jsfiddle.net/vjkbq/4/ html <div id='cart'></div> <input type="button" id="add" value="add cart item 1" /> <input type="button" id="add2" value="add cart item 2" /> javascript //todo: move globals var storagename = 'mycart'; $(document).ready(function () { var item = { departmentid :333, categoryid:117, brandid:19, brandimage:"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", brandname:"general", id:711 }; var item2 = { departmentid :123, categoryid:321,

c# - DataAccess Plugin in NopCommerce 3.1 -

i trying create plugin data access based on tutorial . when install method called in turn calls createdatabaseinstallationscript . scripts generated plugin in tutorial generate sql custom tables. but when function called in plugin, generates sql 30 tables. following dbcontext class: public class myproductobjectcontext : dbcontext, idbcontext { public myproductobjectcontext(string connectionstring) : base(connectionstring){} protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.entity<rewardpointshistory>() .hasrequired(p => p.usedwithorder).withoptional(); modelbuilder.configurations.add(new myproductmap()); modelbuilder.configurations.add(new myproductnotemap()); base.onmodelcreating(modelbuilder); } public string createdatabaseinstallationscript() { return ((iobjectcontextadapter)this).objectcontext .createdatab