Posts

Showing posts from January, 2014

asp.net mvc - Model Binding to view in MVC -

asp.net mvc - Model Binding to view in MVC - i beginner mvc , know how can set binded model vaule viewing. here example. public class datatypes { public guid itemid { get; set; } [required()] public string name { get; set; } [required()] public string status { get; set; } [required()] public datamodel datamodel { get; set; } // binding } public class datamodel { public string activity { get; set; } public datetime ?datetime { get; set; } } with above model class, sucessfully able bind info ui backend problem how can retrun same info ui using above. tried below code when comes setting vaules binded class (datamodel) this.datatype.itemid = // guid stored vaule in database this.datatype.name = // name stored vaule in database this.datatype.status = // status stored vaule in database // set activity ui - error.....!!!!!! // error nullreferenceexception unha...

java - ImageIcon in JButton -

java - ImageIcon in JButton - i creating snake game in java , seemed work fine. when tried add together snake head image in jbutton, image not displayed. imageicon img = new imageicon("shead.jpg"); (int = 0; < 3; i++) { if (i == 0){ lb[i] = new jbutton("lb" + i, img); } else { lb[i] = new jbutton("lb" + i); } lb[i].setenabled(false); p1.add(lb[i]); lb[i].setbounds(lbx[i], lby[i], 10, 10); lbx[i + 1] = lbx[i] - 10; lby[i + 1] = lby[i]; } set whole path image, "c:\user\folder\folder\file...". also, think needs png file work. can't jpg. java swing jbutton imageicon

Node.js - Issues with request.client._peername.address when getting Client IP -

Node.js - Issues with request.client._peername.address when getting Client IP - i'm looking @ ways client's ip adress when making connection using http module. found 2 ways this, there may more: request.connection.remoteaddress request.client._peername.address (1) seems work fine, see unusual behavior when using (2). take @ next examples: var http = require('http'); var server = http.createserver(function(request, response) { response.writehead(200, {"content-type": "text/plain"}); var clientip1 = request.connection.remoteaddress; var clientip2 = request.client._peername.address; response.write("you (1): " + clientip1 + "\n" + "you (2): " + clientip2 + "\n"); response.end(); }).listen(8080); code above works fine. let's create changes it. var server = http.createserver(function(request, response) { response.writehead(200, {"content-ty...

Python format output in concise manner -

Python format output in concise manner - is there conciser way express: '{:f};{:f};{:f};{:f};{:f}'.format(3.14, 1.14, 2.14, 5.61, 9.80) such 1 not need write{:f} multiple times? you utilize nice way can think of generate string, illustration using join : ';'.join(['{:f}' _ in range(5)]).format(3.14, 1.14, 2.14, 5.61, 9.80) here's variation format within list comprehension. nice because doesn't require typing length of list. nums = [3.14, 1.14, 2.14, 5.61, 9.80] ';'.join(['{:f}'.format(n) n in nums]) python

rust - Is there a way to implement a custom enumerate method? -

rust - Is there a way to implement a custom enumerate method? - i creating simple matrix implementation in rust. need next result: class="lang-rs prettyprint-override"> for (i, j, elem) in matrix.iter().enumerate() { ... } but can see, enumerate() method in iterator trait pre-defined, , cannot override custom implementation, able homecoming (usize, usize, &t) . there way implement custom enumerate() method? using rustc 1.0.0-dev (built 2015-04-06) rust-nightly . it right cannot specialize implementation of iterator::enumerate . however, can create enumerate method straight on matrix want: class="lang-rust prettyprint-override"> struct matrix { value: u8, size: usize, } impl matrix { fn enumerate(&self) -> matrixenumerate { matrixenumerate { matrix: self, pos: 0 } } } struct matrixenumerate<'a> { matrix: &'a matrix, pos: usize, } impl<'a> iterator mat...

symfony2 - swiftmail symfony duplicate check for error log / email before sending -

symfony2 - swiftmail symfony duplicate check for error log / email before sending - i run duplicate content check before firing off email whcih uses swiftmailer within symph2 app send me dev error log entries. this functionality sits right next error log database function, has duplicate check, although 1 much easier, uses sql. for one, want maintain lastly mail service sent body atleast next 10 emails sent, if error log goes out of control, wont maintain firing me duplicate emails of same error. should collect body onto object holds lastly 10 email bodies, , attach swift mailer class? or there easier way, using embedded in swift mailer kind of post sending use? or maybe session.. edit, phone call swift mailer backend helper class, think can pretty much there long atleast semi-elegant. edit refined version of method calls both persist , firing of email <?php class somewierdclass { public function addlogaction(request $request, $persist = true, $addemai...

ruby on rails - In Carrierwave how to create a version only when needed? Not when uploading -

ruby on rails - In Carrierwave how to create a version only when needed? Not when uploading - i have setup uploader upload bunch of photos album. allow user select 4 images album cover. after select it, need generate smaller version of photos. selected 4. how can this? basically need way generate image versions after main upload. can utilize refile. problem is, need create versions while uploading! building off @karlingen's answer: i'm going assume there 'selected' boolean value on table image records. # picture.rb belongs_to :my_model scope :chosen, -> { where(selected: true) } set version want display user select in carrierwave uploader, along versions want after album selected include carrierwave::minimagick # original version version :thumb process resize_to_fill: [50, 50] end # processed later versions :large_album, if: :is_selected? process resize_to_fill: [500, 500] end versions :medium_album, if: :is_selected? process resize...

c# - How to replace a string in this case? -

c# - How to replace a string in this case? - i'm implementing filter. i store filter criteria in list of string. e.g. list filters a filter logic string e.g. string filterlogic = "(1 , 2) or 3"; now want replace numbers filter criteria, e.g. (filters[1] , filters[2]) or filters[3]) //stores filter criterias list<string> filters = new list<string>(); (int = 1; <= controlgroupid;i++ ) { stringbuilder sb = new stringbuilder(); string fieldsdropdownid="dlfields"+i; dropdownlist dlfields = (dropdownlist)this.findcontrol(fieldsdropdownid); sb.append(dlfields.selectedvalue); string operatordropdownid = "dloperator" + i; dropdownlist dloperator = (dropdownlist)this.findcontrol(operatordropdownid); string operatorvalue = dloperator.selectedvalue; string valuetxbid = "txb" + ...

jquery - show/hide divs on hover -

jquery - show/hide divs on hover - i cannot div show/hide upon hovering on element. apply image map, made simple fiddle functionality. doing wrong? <script> $('#a1').hover(function () { $('#t1').toggleclass("hidden"); }); </script> <style> .hidden {display:none;} </style> <div id="a1">test a1</div> <div id="t1" class="hidden">timeline 1</div> http://jsfiddle.net/4p7vlogd/ html <div id="a1">test a1</div> <div id="t1" class="hidden">timeline 1</div> jquery $(document).ready(function(){ $('#a1').hover(function () { $('#t1').toggleclass("hidden"); }); }); css .hidden { display:none; } make sure include jquery. here's forked fiddle: http://jsfiddle.net/2eyzce7h/ if you're having issues functionality, consider using mouseenter() , mouseleave...

javascript - How to add products to the stores located on mapbox? -

javascript - How to add products to the stores located on mapbox? - i have set of locations in json format successful in mapping mapbox. have created custom map. store owners should able update/upload inventory. want users using application can browse through stores near them , located in database. can straight purchase product listed in particular store. how can accomplish using mapbox.js? should approach towards be? source code available on https://github.com/tinker20/martbell-mapbox and live version running @ http://martcee.herokuapp.com/ thanks in advance. javascript geocoding mapbox dashboard

javascript - Wordpress - Loading JS files after footer -

javascript - Wordpress - Loading JS files after footer - thanks reading, how load js files after footer instead of beingness in header example: <head> <script type="text/javascript"></script> <script type="text/javascript"></script> <script type="text/javascript"></script> </head> changed </footer> <script type="text/javascript"></script> <script type="text/javascript"></script> <script type="text/javascript"></script> </body> </html> i've tried wp_register_script( 'cycle', 'http://malsup.github.com/jquery.cycle2.js', '', '', true); wp_enqueue_script( 'cycle' ); wp_register_script( 'site', get_template_directory_uri().'/js/site.js', '', '', true); wp_enqueue_script( 'site' ); the lastly paramet...

python - How to retain column headers of data frame after Pre-processing in scikit-learn -

python - How to retain column headers of data frame after Pre-processing in scikit-learn - i have pandas info frame has rows , columns. each column has header. long maintain doing info manipulation operations in pandas, variable headers retained. if seek info pre-processing feature of sci-kit-learn lib, end losing headers , frame gets converted matrix of numbers. i understand why happens because scikit-learn gives numpy ndarray output. , numpy ndarray beingness matrix not have column names. but here thing. if building model on dataset, after initial info pre-processing , trying model, might have more info manipulation tasks run other model improve fit. without beingness able access column header makes hard info manipulation might not know index of particular variable, it's easier remember variable name or doing df.columns. how overcome that? edit1: editing sample info snapshot. pclass sex age sibsp parch fare embarked 0 3 0 22 ...

xml - Need to read test names from teamcity daily build results and compare those names -

xml - Need to read test names from teamcity daily build results and compare those names - we have daily test run , failed test cases displayed under teamcity "overview" tab. what want accomplish build list of failed test on daily basis , compare yesterday's list today's, way, able plot number of repetitive failed tests on time. is possible accomplish using xml? thanks xml teamcity-8.0

ruby - WebSockets, how to implement ping? -

ruby - WebSockets, how to implement ping? - i have created websockets server in sinatra/faye websocket. has built in capabilities of pinging client, not work. ping client manually using thread sleeps n seconds , sends through sockets. when not implement ping, connection closed client after 60 seconds of inactivity. how properly? i re-think if have utilize ping option... it's hardly utilized , think faye have implemented workflow if best solution. i create javascript timer send actual info on websocket, calling empty event. if server-side app ignores data, have effective ping javascript based , allow measure of command might missing simple ping (such recording user's lastly active time, facebook does, , other options). ruby web websocket sinatra

coldfusion - How to run a cfquery within the onRequestStart() function? -

coldfusion - How to run a cfquery within the onRequestStart() function? - i want run query on every page user requests. query needed preferences set user's organisation application. have tried: <cffunction name="onrequeststart" access="public" returntype="boolean"> <cfargument type="string" name="targetpage" required="true"/> <cfquery name="rssettings"> select * dbo.settings </cfquery> <cfreturn true> </cffunction> </component> however each pages looks rssettings recordset says not defined. if set same query within each page needs works fine. does onrequeststart() not handle cfquery? <cfquery name="request.rssettings"> select * dbo.settings </cfquery> then in page use: request.rssettings.columname coldfusion coldfusion-10 coldfusion-11

android - Dynamic Loadfrom file image is giving Access vailation on Firemonkey Mobile -

android - Dynamic Loadfrom file image is giving Access vailation on Firemonkey Mobile - i creating demo application having list box , image. when running application on phone giving me (using image1.loadfromfile('path of image')) segmentation 11 exception. not able display image adding @ run time on phone. using below code dynamic loading image. procedure tform1.button1click(sender: tobject); var item : tlistboxitem; img : timage; begin item := tlistboxitem.create(listbox1); img := timage.create(item); item begin text := 'vikas'; height := 49; selectable := false; stylelookup := 'listboxitemnodetail'; img.align := talignlayout.left; end; img.multiresbitmap.items[0].bitmap.loadfromfile('path image in .png format'); item.addobject(img); listbox1.addobject(item); end; how load image dynamically? you need phone call img.multiresbitmap.add() method before can access img.multiresbitmap.items[0]...

c# - How to get System.IO.Stream from a String Object -

c# - How to get System.IO.Stream from a String Object - i have string object. need pass info object of type xyz. object of type xyz taking system.io.stream. how convert string info stream object of xyz type can utilize string data? you'll have pick text encoding utilize translate string byte array, utilize memorystream phone call function. example: using(system.io.memorystream ms = new system.io.memorystream( system.text.encoding.utf16.getbytes(yourstring))) { xyz(ms); } you can alter utf16 whatever encoding you'd utilize pass string. c# string

Queue processing one by one using RabbitMQ -

Queue processing one by one using RabbitMQ - i have limited number of workers , unlimited number of queues named mask "q.*" (e.g. q.1 , q.2 ). need process them in turn. 1 task per 1 worker. when worker finished task, receive new 1 next existing queue. e.g. have queues: q.1: task11, task12, task13 q.2: task21, task22, task23 and 3 workers. expect next order of executing: worker1: task11 worker2: task21 worker3: task12 worker1: task22 worker2: task13 worker3: task23 i tried utilize topic , subscribed mask q.* leads fact each worker receives tasks queues. right decision? think of each queue it's own bucket of work. q.1 has no relation q.2 @ , in fact doesn't know exists. may process things @ different rates q.2 , should have different consumers. worker on q.1 should concerned q.1, shouldn't bounce , forth between q.1 , q.2. are trying chain 2 queues together? if have this: message gets set q.1 message processed worker (call ...

naming conventions - What is the purpose of starting variable's and function's names with underscores? -

naming conventions - What is the purpose of starting variable's and function's names with underscores? - this mutual practice in c, c++, c#, java, javascript, python, visual basic, , load of other programming languages. purpose of names of variables , underscores? source of practice? why not not utilize underscores? naming-conventions

javascript - IE Zoom Issue - Child div does not expand to parent div width on zoom in/out -

javascript - IE Zoom Issue - Child div does not expand to parent div width on zoom in/out - scenario: kid div not expanding parent width on zoom. works on chrome. not work in ie. wanted behavior: expand kid div on zoom in / out parent. achievable css (preferred)? js? my approach: see here: http://jsfiddle.net/y6oqfljt/3/ html <div id="content_report" style="width:100%;position:relative;height:500px;background:#cccccc;overflow:hidden;"> <div id="wrapper_report" style="width:100%;position:relative;"> <table id="header_report" style="width:5000px;position:relative;background:#eb5f3a;display:block;border:solid;"> <tr> <th style="border-right: solid">header</th> <th style="border-right: solid">header</th> <th style="border-right: solid">header</th> <th style="border-right: solid...

javascript - To check when knockout binding is complete -

javascript - To check when knockout binding is complete - i using knockout bind controls on page , after binding finish utilize window.print() print page. these functions called in $(document).ready(function (){//} so flow this: page loads , due window.print(); goes print wizard. problem page goes print wizard , bindings incomplete although have used ko.applybindings(object bound); before window.print(); there method or way in knockout can check if bindings finish or not because writing in document.ready() not helping. hmmm... applybindings should synchronous should go after it's called. are doing ajax phone call after load data? if so, that's can add together logic maintain kind of 'ready' boolean. you set boolean false, true after phone call applybindings, suspect there's else going on if you're print screen coming empty. javascript knockout.js

clojure - How to substitute path to home for "~"? -

clojure - How to substitute path to home for "~"? - if pass in path command line, "~" expands home directory: (defn -main "i don't whole lot ... yet." [& args] (doseq [arg args] (println arg))) britannia:uberjar srseverance$ java -jar args-0.1.0-snapshot-standalone.jar ~/158.clj /volumes/macintosh hd/users/srseverance/158.clj but if seek utilize path-file containing ~, can't find file. user> (with-open [r (clojure.java.io/reader "~/158.clj")] (doall (line-seq r))) filenotfoundexception ~/158.clj (no such file or directory) java.io.fileinputstream.open0 (fileinputstream.java:-2) how take string like, "~/158.clj" , clojure.java.io/reader can use, such "/volumes/macintosh hd/users/srseverance/158.clj"? you can define (defn expand-home [s] (if (.startswith s "~") (clojure.string/replace-first s "~" (system/getproperty "user.home")...

python - AttributeError: 'module' object has no attribute 'choice' -

python - AttributeError: 'module' object has no attribute 'choice' - i using python3. first utilize random.choice in terminal, , works. python 3.2.3 (default, feb 27 2014, 21:31:18) [gcc 4.6.3] on linux2 type "help", "copyright", "credits" or "license" more information. >>> import random >>> x = [1, 2, 3] >>> random.choice(x) 3 but when run in script, message: attributeerror: 'module' object has no attribute 'choice' here code import random scipy import * numpy import linalg la import pickle import operator def new_pagerank_step(current_page, n, d, links): print(links[current_page]) if random.rand() > 1 - d: next_page = random.choice(links[current_page]) else: next_page = random.randint(0, n) homecoming next_page def pagerank_wikipedia_demo(): open("wikilinks.pickle", "rb") f: titles, links = p...

encryption - How do I generate an encrypted password string, as it is in /etc/shadow? -

encryption - How do I generate an encrypted password string, as it is in /etc/shadow? - i'm trying mimic creation of password strings appear in /etc/shadow. this i've got far, encrypted passwords don't match, when utilize same password , same salt. 5000 rounds standard crypt, used well, don't see exacly made mistake: i'm doing in perl, relevant porion: ($pass, $salt) = @argv; unless(defined($salt)) { $salt = mime::base64::encode(random_bytes(12), ''); } $i (1 .. 4999) { $pass = digest::sha::sha512($salt, $pass); } ""; print '$6$', $salt, '$', digest::sha::sha512_base64($salt, $pass), "\$\n"; the crypt algorithm involves a lot more re-hashing 5,000 times: unix crypt using sha-256 , sha-512 encryption passwd sha512

android - Droid X is large screen? -

android - Droid X is large screen? - reading documentation: http://developer.android.com/guide/practices/screens_support.html. judged droid x big screen phone, since it's physical dimension 4.3". reading/exploring farther i'm realizing large modifier has little screen size. as there's quoted in documentation: note density , screen size independent parameters , interpreted scheme individually. example, wvga high density considered normal screen because physical size same 1 of t-mobile g1. on other hand, wvga medium density screen considered big screen — offers same resolution @ lower pixel density, meaning both physically larger baseline screen , can display more info normal screen size. i'm confused, can clarify. thanks. it's size, actually, though method makes seem more complicated. droid x wvga high-density (200-250 pixels/inch), though it's larger screen 3.7" droid 2 same number of pixels. 5"+ wvga or higher device ...

javascript - How can you click on links with Mocha in Meteor? -

javascript - How can you click on links with Mocha in Meteor? - i want go page page in meteor app in order test onboarding process. @ moment have this: $('#signup').click(); template.signupwithemail.onrendered(function() { chai.assert.equal($('#cool').text(), 'cool'); }) however, unsure if best practice. when not phone call onrendered , doesn't seem check page correctly. in addition, tests not seem refresh immediately. javascript testing meteor mocha

css - How to make an element not extend the parent div's scrollable area? -

css - How to make an element not extend the parent div's scrollable area? - i have tooltips elements might big - big can't position them on side of cursor without going outside of page. there way prevent scrollbars appearing in case (besides setting body overflow:hidden )? i think should possible create fullscreen div contain tooltips, , set have overflow hidden, i'm hoping there improve solution. update: okay pretty simple. append next div body , place tooltips within it. .tooltip-body { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; } css

ios - View shows up in Debug View Hierarchy, but NOT on device/sim -

ios - View shows up in Debug View Hierarchy, but NOT on device/sim - this issue perplexing me. have little uiview i'm using show button selected. however, it's not showing in app — it should under "local activities," doesn't show up: that's fine, thought, i'll debug view hierarchy , see is! , looks it's should be: does know might going on here? help! i'm stupid — fixed it. i'm not sure why shows on top in view debugger, behind uiview. ios iphone xcode view uiview

node.js - Can't save object pushed to array -

node.js - Can't save object pushed to array - hi have unusual issue mongoose. group.findbyid(req.params.group_id, function(err, group){ user.findone(req.body, function(err, user){ group.users.push(user); user.groups.push(group); group.save(); user.save(); res.json({group: group, user: user}); homecoming true; }); }); i seek create double way relation between user , group. user pushed group.users array , saved perfectly. issue appear when seek save grouping in user.groups array. there no action on mongo side until seek run action again. old element saved properly, , new 1 still don't saved. on express side seems fine, , objects returned front end end valid. here have visualization of problem > grouping user group.users in database user.groups in database > group1 user1 [user1] [] > group2 user2 [user1, us...

regex - Regexp to find all subnet blocks in config file -

regex - Regexp to find all subnet blocks in config file - i have such config file: #dhcp server configuration file. deny unknown-clients; subnet 10.8.140.2 netmask 255.255.255.255 { host example{ optian:param; } host example2{ option2:param2; } } subnet 20.8.110.1 netmask 255.255.255.255 { } and need find subnet blocks. problem subnet block can contain host blocks (with curly brackets). , cant build regexp match those. so result should be: 1. subnet 10.8.140.2 netmask 255.255.255.255 { ... host {...} host{...}} 2. subnet 20.8.110.1 netmask 255.255.255.255 { ... } you didn't named programming language. here comes illustration using recursive pattern in php (pcre): class="lang-php prettyprint-override"> <?php $conf = file_get_contents('/path/to/dhcp.conf'); # utilize recursive pattern, check link posted above $pattern = '/(subnet.*?)?\{((?>[^{}]+)|(?r))*\}/'; preg_match_...

asp.net - I get aspxGVPagerOnClick is not defined on my ASPxGridview when it's loaded on AJAX -

asp.net - I get aspxGVPagerOnClick is not defined on my ASPxGridview when it's loaded on AJAX - function showdailysalesadjustment(txt) { console.log(txt); var xmlhttp; if(window.xmlhttprequest){ // code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else{ // code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function(){ if(xmlhttp.readystate==4 && xmlhttp.status==200){ document.getelementbyid("divtable").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get", "getdailysalesadjustmenttable.aspx?q=" + txt, true); xmlhttp.send(); } above ajax code , calls...

ruby - How to split a string behind a particular marker -

ruby - How to split a string behind a particular marker - i split string array. i'm looking first word isn't exclusively capitalised, , want split behind that. "word word cccc cccc cccc cccc ccccc cccc....." or "word cccc cccc cccc cccc ccccc cccc....." should result in ["word word", "cccc cccc cccc cccc ccccc cccc....."] or "word", "cccc cccc cccc cccc ccccc cccc....." what best way this? you can utilize next regex: (?=\p{zs}(\p{lu}\p{ll}+.*))\p{zs} explanation: i assume have input string starts allcaps word(s) , rest of string not. so, (?=\p{zs}(\p{lu}\p{ll}+.*)) - positive look-ahead checking if have space ( \p{zs} ) followed capital letter, non-capitalized letter, , characters newline, number of repetitions \p{zs} - consume space not include array element upon split. ruby string

ruby - undefined function error in rspec -

ruby - undefined function error in rspec - i having problem running rspec file, provided part of exercise, , not sure going on. here code in silly_blocks.rb: def reverser(num = 1) result = [] if yield == integer yield + num else yield.split.each{|word| result << word.reverse} result.join(' ') end end here rspec file: require "05_silly_blocks" describe "some silly block functions" describe "reverser" "reverses string returned default block" result = reverser "hello" end result.should == "olleh" end "reverses each word in string returned default block" result = reverser "hello dolly" end result.should == "olleh yllod" end end describe "adder" "adds 1 value returned default block" adder 5 end.should == 6 end "adds ...

Does Dust.js provide a way to reference an object key/value by keywords "key" and "value"? -

Does Dust.js provide a way to reference an object key/value by keywords "key" and "value"? - i want utilize dust.js client template engine. have info json this: var info = { "foo": [{ "somekey": "somevalue", "otherkey": "othervalue" }, { "somekey": "somevalue", "otherkey": "othervalue" }], "bar": [{ "somekey": "somevalue", "otherkey": "othervalue" }, { "somekey": "somevalue", "otherkey": "othervalue" }] } i not know in advance uppermost object keys - not know foo , bar keys, can value. so, need iterate through json keywords key , value . in pseudo-code: {% for(key, value) in info %} {key}: {value} {% /for %} i know dust.js has {#section/} loop through object. again, have...

pentaho - Grouping by Quarters with Mondrian / MDX: Behavior of Sum and Count vs Avg -

pentaho - Grouping by Quarters with Mondrian / MDX: Behavior of Sum and Count vs Avg - i'm trying aggregate (sum , average) on groups of quarters, i'm getting different results depending on method use. i'd understand why. the next basic query illustrates info (pentaho steelwheels sample): select {measures.sales, measures.quantity} on columns , order( time.quarters.members, time.currentmember.caption, basc ) on rows steelwheelssales the result: time | sales |quantity -----+------------+--------- qtr1 | 445094.69 | 4561 qtr1 | 877418.97 | 8694 qtr1 | 1111260.1 | 10995 qtr2 | 564842.02 | 5695 qtr2 | 847713.97 | 8443 qtr2 | 869565.24 | 8480 qtr3 | 687268.87 | 6629 qtr3 | 1145308.08 | 11311 qtr4 | 1980178.42 | 19554 qtr4 | 2117298.82 | 20969 so row headers captions quarters , different occurrences of qtr1, qtr2, qtr3 , qtr4 each belong particular year (so 1st qtr1 [2003].[qtr1], 2nd [2004].[q...

json - How to delete row in SAPUI5 table with delete button embedded in the row -

json - How to delete row in SAPUI5 table with delete button embedded in the row - i have xml sapui5 table delete button embedded in each rows. table bound json.. <table id="iduploadtable" mode="none" delete="handledeletelistitem" width="100%" items="{uiformmodel>/attachmentlist}"> <columns> <column id="idfilenamecol" valign="middle"> <header> <label text="file name" /> </header> </column> <column id="iduploadedobycol" halign="left" valign="middle"> <header> <label text="uploaded by" /> </header> </column> <column id="iduploadedoncol" halign="left" valign="middle"> <header> <label text="...

qr code - Use of unresolved identifier QR Reader -

qr code - Use of unresolved identifier QR Reader - i have barcode reader code working xcode 6.2 when upgraded xcode 6.3 got error message use error message of unresolved identifier 'qrcodeframeview' this code func captureoutput(captureoutput: avcaptureoutput!, didoutputmetadataobjects metadataobjects: [anyobject]!, fromconnection connection: avcaptureconnection!) { // check if metadataobjects array not nil , contains @ to the lowest degree 1 object. if metadataobjects == nil || metadataobjects.count == 0 { qrcodeframeview?.frame = cgrectzero homecoming } // metadata object. allow metadataobj = metadataobjects[0] as! avmetadatamachinereadablecodeobject // here utilize filter method check if type of metadataobj supported // instead of hardcoding avmetadataobjecttypeqrcode, check if type // can found in array of supported bar codes. if supportedbarcodes.filter({ $0 =...

java - How to design user Authorisation -

java - How to design user Authorisation - i have database based user authorization roles. user have services can access , in each service user can see , actions. this, user==> services ==> roles. best design pattern can utilize in scenario. design roles , services stored in user context. every time user determines can see. if roles stored in service service can decide user authorized to. can tell improve approach , why?. java design-patterns

objective c - How to make a UITextView not take the focus when initializing? -

objective c - How to make a UITextView not take the focus when initializing? - i'm using code create detailed view pushed when press row of uitableview, theres problem. the detailed view contain uitextview , when detailedview called (only first time) create uitableview row pressed lose pressed state. shouldn't ! should lose pressed state when returning detailed view list view. as remove uitextview code, no problem ! i think it's uitextview taking focus? is there way avoid ? subclassing or such? hmmm not seeing in sandbox wrote. created simple navigation-based project. added view controller project xib; added uitextfield xib. made next code changes root view controller: - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { homecoming 1; } in cellforrowatindexpath: cell.text = @"push me"; in didselectrowatindexpath: simpleviewcontroller *detailviewcontroller = [[simpleviewcontrol...

iphone - MPMoviePlayerController view disappearing when next/previous button is pressed -

iphone - MPMoviePlayerController view disappearing when next/previous button is pressed - i have unusual problem. create mpmovieplayercontroller in view controller next code: player = [[mpmovieplayercontroller alloc] initwithcontenturl:[nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"vid96" oftype:@"mov"]]]; player.fullscreen = yes; player.controlstyle = mpmoviecontrolstylefullscreen; player.view.frame = cgrectmake(0, 0, 320, 480); [self.view addsubview:player.view]; now if user taps on next/previous buttons, mpmovieplayercontroller 's view disappears. normal behavior of mpmovieplayercontroller ? there way stop this? don't need next/previous buttons, if there's way disable or hide them ok too. thanks. try [player setcontrolstyle:mpmoviecontrolmodehidden]; iphone mpmovieplayercontroller fullscreen player movie

php - Using getElementsByTagName in Wordpress -

php - Using getElementsByTagName in Wordpress - i have simple script read xml file: <?php $xml_data=wp_remote_get("http://example.com/connectioncounts"); //$doc = new domdocument(); //$doc->load($xml_data); $wms = $xml_data->getelementsbytagname('tag'); $currentlistener = $wms->item(0)->getelementsbytagname("connectionscurrent")->item(0)->nodevalue; $listenerhits = $wms->item(0)->getelementsbytagname("connectionstotal")->item(0)->nodevalue; echo "current listener: $currentlistener<br> total hits: $listenerhits"; ?> i using wp_remote_get wordpress doesn't seem file_get_contents referred this previous question. the problem when run code error: fatal error: phone call undefined method wp_error::getelementsbytagname() in /home/user/public_html/test/wp-content/themes/headway/library/common/functions.php(405) : eval()'d code on line 10 i figured sim...

php - Create PDF file with BIG html CODE -

php - Create PDF file with BIG html CODE - i have generate pdf document big html code (created 1000 or more pages). standard method limited me - memory. standard method: $html = generatepdf($data_to_pdf); $dompdf = new dompdf(); $dompdf->load_html($html); $dompdf->set_paper('a4', 'landscape'); $dompdf->render(); $pdf = $dompdf->output(); file_put_contents('pdf/' . $tmp_name . '.pdf', $pdf); the memory little need save info in part. how generate pdf page page? or that? how prepare memory problem? try taking @ this: https://pdfmerger.codeplex.com/ then, split html, render each part separate file, , merge them afterwards.. php memory pdf-generation dompdf memory-limit

Facebook url does not work -

Facebook url does not work - i'm trying facebook application when access url app: https://apps.facebook.com/420842188090395 don't show application , when access direct url give me token , works fine. how can prepare this? facebook

c - Applying fork() and pipe() (or fifo()) on counting words code -

c - Applying fork() and pipe() (or fifo()) on counting words code - i've completed writing of counting words code finally. counts total number of words in files. (i.e. txt). now, want utilize multiple fork() access , read every file. studied in lastly week. besides, utilize global variable hold number of counted words. far know, if apply fork(), used global variables assigned 0. avoid it, tried utilize mmap() , similar functions okey. but, want utilize pipe() (fifo() if possible) communicate (hold values of numbers). i utilize nftw() function go in folders , files. logic on below picture. how can utilize fork() , pipe() (fifo()) on code ? fork() complicated me because of inexperience. i'm new using of pipe() , fork(). according thought logic of code if can utilize fork() , pipe(), there fork() every file(i.e. txt) , access them using fork. if there folder , there files, 1 time again creates fork() 1 of created forks , access file. seek explain drawing below. ...

asp.net mvc 4 - Multiple HTML-documents inside other HTML-document -

asp.net mvc 4 - Multiple HTML-documents inside other HTML-document - i have kind of reports (varying in content , layout) can generated users. study can consist of x pages. user can setup study , on next , study previewed. if user fine preview able export pfd , xls or whatever else. what i'm trying accomplish is, each study has template finish html-document <html> , <body> , on, defining own styles . my preview looks like: @foreach (var page in model.pages) { html.renderpartial("partial/_reportpage", page); } the foreach -loop within preview page user can slide through pages check if , ready e.g. printed. the problem is, styles in outer html apply single report-page not want because later on, when user wants generate pdf -document, same html -code should used previewing report. i thought using iframes , ended problem, have pass page object iframe -src, post info not possible. antoher seek unsetting styles style="...

jquery - Send dynamic HTML list with PHP to server -

jquery - Send dynamic HTML list with PHP to server - i have 2 simple html lists. first 1 contains bunch of entries, sec 1 empty. mutual list construction following: <ul id="project-offer-list" class="connectedsortable"> <li class="ui-state-default"> <div> <!-- formatting --> </div> </li> <li class="ui-state-default"> <div> <!-- formatting --> </div> the user can select entries first list dragging them sec one. doing can give preference sorting elements within sec list. the drag-drop-mechanism realized jquery: <script> $(function() { $("#project-offer-list, #project-selection-list").sortable({ connectwith: ".connectedsortable" }).disableselection(); }); </script> i want send both selected elements (those in sec list) , order remot...

c - Streaming H.264 over RTP (Raspberry Pi) -

c - Streaming H.264 over RTP (Raspberry Pi) - i need help using rtp protocol streaming h.264 video. have raspberry pi(b+) , photographic camera module. raspberry pi has hardware encoder h.264. however, player can't play rtp streams: video have delay , image bad : i can't understand problem. there stream h.264 : [sps] [pps] [i-frame] [p-frame] [p-frame] [p-frame] .... [sps] [pps] [i-frame] .... this stream place in separate rtp packets. log of vlc while playing: [h264 @ 0x90bba80] error while decoding mb 19 14, bytestream (-3) [h264 @ 0x90bba80] concealing 50 dc, 50 ac, 50 mv errors [h264 @ 0x90bb680] error while decoding mb 19 14, bytestream (-3) [h264 @ 0x90bb680] concealing 50 dc, 50 ac, 50 mv errors [h264 @ 0x90bb680] error while decoding mb 19 14, bytestream (-3) [h264 @ 0x90bb680] concealing 50 dc, 50 ac, 50 mv errors for access hardware encoder utilize openmax. part of code encoder: omx_init_structure(ep->encoder_portdef); ep->encoder_p...

.net - What's the Oracle equivalent of System.Data.Linq.DataContext? -

.net - What's the Oracle equivalent of System.Data.Linq.DataContext? - i implementing irepository interface against oracle database. public interface idinnerrepository { iqueryable<dinner> findalldinners(); iqueryable<dinner> findbylocation(float latitude, float longitude); iqueryable<dinner> findupcomingdinners(); dinner getdinner(int id); void add(dinner dinner); void delete(dinner dinner); void save(); } how should implement save method? if working linq2sql create database context , phone call submitchanges on database context. how can implement same functionality oracle end? /// <summary> /// database context /// </summary> private dbdatacontext db = new dbdatacontext(); public void save() { this.db.submitchanges(); } thanks! if want utilize linqtosql equivalent oracle, there linqtooracle project on codeplex. provides oracledatacontext , else ...

java - Socket called on wrong port -

java - Socket called on wrong port - i having web server running glass fish 4 on port 8080 in local. having standalone java socket server running in local on port 9010. when seek access webservice objective c on glass fish server using nsurlconnection on port 8080, socket gets called though runs on different port. nsurl connection code provided below, nsmutableurlrequest* request = [[nsmutableurlrequest alloc] initwithurl:[nsurl urlwithstring:”http://localhost:8080/testapp/customer/authenticate”]]; [request setvalue:@"application/json" forhttpheaderfield:@"content-type"]; [request setvalue:@"application/json" forhttpheaderfield:@"accept"]; [request sethttpmethod:@“post”]; [request sethttpbody:myjsonrequestdata]; [nsurlconnection connectionwithrequest:request delegate:self]; i have searched not find leads. please help sorry coding bug in server code , other tied issues in client code. interpretation wrong. have solved now. ...

Using Android Volley to post an array to PHP -

Using Android Volley to post an array to PHP - this how post values volley: @override protected map<string, string> getparams() { jsonobject jsonobjectmembers=new jsonobject(); (int i=0; i<arr_added_userids.size(); i++) { seek { jsonobjectmembers.put("params_"+i,arr_added_userids.get(i)); } grab (jsonexception e) { e.printstacktrace(); } } map<string, string> params = new hashmap<string, string>(); params.put("host", session_userid); params.put("params",jsonobjectmembers.tostring()); homecoming params; } this tried: foreach($_post['params'] $key => $value) { seek { $stmt = $conn->prepare("insert crewmembers (crewid, member) values (:crewid, :member)"); $query_params = array( ':crewid' => $crewid, ':member' => $value ); ...

c# - Unity3d 2d Help transforming code to drag touch -

c# - Unity3d 2d Help transforming code to drag touch - i want transform game android , it's pong. want able drag paddle on phone. ahead of time help. here's oldest code: using unityengine; using system.collections; public class moveracket : monobehaviour { public float speed = 30; public string axis = "vertical"; void fixedupdate () { float v = input.getaxisraw (axis); getcomponent<rigidbody2d> ().velocity = new vector2 (0, v) * speed; } } heres old code it's still not working. using unityengine; using system.collections; public class moveracket : monobehaviour { public float speed = 30; public string axis = "vertical"; public object racket = "racket"; public bool touchinput = true; public vector2 touchpos; void fixedupdate () { //used not have in parentheses float v = input.getaxisraw (axis); //getcomponent<rigi...