Posts

Showing posts from June, 2015

java - Client Server Communication in REST: Using RestTemplate: Unable to send data to Server side -

i trying setup client-server communication in rest, spring. in client side have code: rresult = resttemplate.getforobject("http://localhost:8081/springmvcmerchant/movietheater.htm", responsetext.class, variable); the variable above hashmap. want value variable transferred server side code. server side code is: @responsebody @requestmapping(value="/movietheater", method=requestmethod.get) public responsetext getcustomerinput(map<string, double> input) { transaction transaction = new transaction(); responsetext result = new responsetext(); if(transactionservice.addtransaction(input)) result.setmessage(responsestatus.success.getstatus()); else result.setmessage(responsestatus.failed.getstatus()); return result; } in side expecting map input receive value of map variable. but, not happening. don't want send value url parameter. can please tell me how can fix this? thanks in advance! instead of http r...

Sharing one huge HTML text in more containers (jQuery) -

i have specific issue: i have couple of divs on html page, each different fixed sizes , set overflow:hidden, each of containers powered jqueryte wisiwig editor (jqueryte.com) user can change content of divs interactively. the point ensure more comfortable work huge texts (like books etc.). user insert 1 big content (also html marks) in div editor, oveflowed part of text (not visible in current div) send next div (assume user select joined divs before). for familiar adobe indesign there same functionality, question if it's applicable on html/css/jquery environment. some perfect solution user edit content in each separate div editor , content interactively continue next joined div, if u understand mean. i have found couple of tips needs either same width divs or non-html content (plain text). please guys, there posibility prepare such concept of working huge html-like content? thank help, regards, honza. if understand correctly scenario following: supporse...

web scraping - Scrapy run from Python -

i trying run scrapy python. i'm looking @ code ( source ): from twisted.internet import reactor scrapy.crawler import crawler scrapy.settings import settings scrapy import log testspiders.spiders.followall import followallspider spider = followallspider(domain='scrapinghub.com') crawler = crawler(settings()) crawler.configure() crawler.crawl(spider) crawler.start() log.start() reactor.run() # script block here my issue i'm confused on how adjust code run own spider. have called spider project "spider_a" specifies domain crawl within spider itself. what asking is, if run spider following code: scrapy crawl spider_a how adjust example python code above same? just import , pass crawler.crawl() , like: from testspiders.spiders.spider_a import myspider spider = myspider() crawler.crawl(spider)

WebDAV ACL: Setting read permission on folder for principal -

i attempting give principal read-permission webdav-folder own. according rfc3744 should possible using proppatch, examples of propfind listed. the example find example of how not set owner (read-only property): <propertyupdate xmlns="dav:"> <set> <prop> <owner> <href>principal_uri</href> </owner> </prop> </set> </propertyupdate> from i've deduced (failing) proppatch: <propertyupdate xmlns="dav:"> <set> <prop> <acl> <ace> <principal> <href>principal_uri</href> </principal> <grant> <privilege> <read/> </privilege> </grant> </ace> </acl> </prop> </set> </propertyupdate> i doing against bedework 3.8 calendar server. answ...

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

i'm in trouble add prebuilt apk system.img based taiwan mtk android phone platform, when push apk onto device,after reboot phone,the apk can installed succecessfully,but if add apk alps/out/target/product/$prj/system/app or vendor/mediatek/$prj/artifacts/out/target/product/$prj/system/app ,and produce system.img,the apk can't installed normally,the logcat say: a.lang.runtimeexception: unable instantiate activity componentinfo{com.sec.android.widgetapp.ap.hero.accuweather.widget/com.sec.android.widgetapp.ap.hero.accuweather.widget.weatherclock}: java.lang.classnotfoundexception: com.sec.android.widgetapp.ap.hero.accuweather.widget.weatherclock. can tell me what's problem ? when package manager installs apps part of system partition different installing apps on data partition. looks app using libraries somewhere else. when install on data lib directory created in apps data directory , symlinked /data/app-lib/. when apps installed on system it's expecte...

javascript - y-axes of Highcharts line chart -

Image
if create line chart highcharts , set minimum value of y-axes smallest value in data series (0 in example below), points along y-axes (circled below) not connected. there way connect them. this known highcharts bug: https://github.com/highslide-software/highcharts.com/issues/1687 as suggested, can set linewidth: 0 xaxis.

c# - How do i wait until a String returns a value? -

i have program uses keypress event add new character new label , sort of console application. need add input method program when press enter instead of executing function, returns string. have tried making keypress event return string doesn't work obvious reasons, how make work? note: "return string" mean; if ask console wait input still using keypress event return string/input user. i hope understand code have written, note extends other my keypress event handler: private void form1_keypress(object sender, keypresseventargs e) { if (e.keychar == '\b') // backspace { if (ll.text != "_" && actualtext != "") // there characters remove? { actualtext = ll.text.substring(0, actualtext.length - 1); ll.text = actualtext + "_"; } } else if (e.keychar == (char)13) { if (!in...

jquery - How to select all specific elements with all siblings of a specific element -

trying select h2's, works fine. however, h2's can have siblings of h3's want select. for example, have: <h2> <h3> <h3> <h3> <h2> <h2> <h2> <h3> <h3> http://jsfiddle.net/v9upc/1/ current code, , here example of i'm trying achieve is: -<h2> --<h3> --<h3> --<h3> -<h2> -<h2> -<h2> --<h3> --<h3> how select h2's , if siblings h3's include them children in unordered list? try var $h2s = $('h2'), $div = $h2s.parent(); var totop = '<span class="top">back top</span>'; var $ct = $('<div />', { class: 'indexholder' }).append('<h2>on page</h2>'); var $ul = $('<ul />', { class: 'index' }).appendto($ct); $h2s.each(function(idx, el){ var $li = $('<li />', { id: 'index' + idx, te...

c# - How do i send a data from one form to function of another class -

i know how pass data 1 form form, how can pass data 1 form class. data want pass form1 class question: string grpid = "somevalue"; string durationid = "somevalue";` i searched didn't got exact answer this. class question { string groupid="here want value of groupid,how can this"; string duraid="and here value of durationid"; // can use them here public ienumerable<question> getquestions(string topicid, int marks) { string sql = "select qid,question,opt1,opt2,opt3,opt4,ansop,marks questions topicid in(" + topicid + ") , marks=" + marks.tostring(); var cmd = new oledbcommand(sql, new oledbconnection(@"provider=microsoft.jet.oledb.4.0;data source=db1.mdb")); var rs = cmd.executereader(); if (rs != null) { while (rs.read()) { yield return new question ...

image - To measure the distance from a blob to the iris centre? -

i obtained blood vessel patterns in eye blobs. how calculate distance each blob iris center (c(1),c(2)). also, guess need center point of blob. logically correct consider testfeaturevector = [blobmeasurements.centroid]; equivalent of center of blob ? or should take majoraxislength /2 ?

Perform an ajax call from AngularJS to a Django server that allows CORS -

Image
i developing webapp using angularjs , rest api based on django-tastypie data. to able perform ajax requests, enabled cross origin resource sharing on django using django-cors-header framework ( https://github.com/ottoyiu/django-cors-headers ), noticed in chrome inspector preflighted request (an options request) sent before main request cancelled , saw in django server logs : "options /api/airport/19643 http/1.1" 301 i found posts suggesting delete 'x-requested-with' parameter header ( $http.get not allowed access-control-allow-origin $.ajax is ) resolves problem requests. if try send put or post request, preflighted request sent , gets cancelled ! here see on inspector when enable cors don't delete previous parameter header: i same error put requests well. i can't see problem is, hope if point me right direction. thanks lot i suggest,can try below command line options chrome allowing cors in local testing : chrome.exe --allow-file-...

.net - c# cache not persisting between users -

i'm experiencing problems use of system.web.caching.cache . basically i'm using cache.insert(tablename, newlist, null, system.web.caching.cache.noabsoluteexpiration, system.web.caching.cache.noslidingexpiration); to insert objects cache, , cache[tablename] retrieve them on webform. what i'm experiencing if refresh browser calls these methods, data there, , cache.count reflects this. however, if close browser , start again, or start different browser on test machine or another, cached data not there. ie cache working if using session store. i've tried using application store too, same results. i've had through application pool settings , web.config, , can't see obvious. any appreciated, requerying databases information put in cache slow down webform great deal. i'm not sure i'm being clear enough. reproduce. browser 1 opens webpage, no cached data browser 1 refreshes webpage, cached data browser 2 opens webpage, no cached...

asp.net - Eliminate explicit scrolling in a listbox -

i have list box populated via migrating items list box. have 2 asp.net buttons namely , down scroll , down through list box. maximum number of items visible @ time in list box 9, while maximum number of items 21. hence scrollbar comes eventually. pretty evident , ok. if select 21st item , click on button, 21st item moves 1 place above, list shows items first. mean list rearranged, , client has explicitly scroll down list box view 21st item has been moved above. i want if select item , click button, view of list box should there itself, shouldn't show list box first item. any appreciated. below code: protected void btnthird_click(object sender, eventargs e) { if (lstboxselectedcolumns.selectedindex == 0) { page.clientscript.registerstartupscript(this.gettype(), "alertscrollup", "alertmessage('please select other item scroll or click down navigation button');", true); } else if (lstboxselect...

sql server - Ambiguous column name error getting while executing stored procedure -

i have stored procedure this: alter procedure [dbo].[parkingdeatailsreportcheck] @locid integer , @startdate nvarchar(100) , @enddate nvarchar(100) begin declare @cols nvarchar(max) , @query nvarchar(max) select @cols = stuff((select distinct ',' + quotename(vtype) vtype_tbl xml path('') , type ).value('.', 'nvarchar(max)'), 1, 1, '') set @query = 'select locname,date, ' + @cols + ' ( select l.locname, v.vtype, convert(date, dtime) date transaction_tbl t inner join vtype_tbl v on t.vtid = v.vtid join location_tbl l on t.locid=l.locid locid=' + cast(@locid varchar(max)) + ' , dtime between ''' + @startdate + ''' , ''' + @enddate + ''' ) d p...

asp.net - Sorting an array of dates -

i have created array csv of date values , need able sort them can latest date array. i have tried: array.sort() but doesn't sort correctly, suppose because array values strings, body got ideas?? thanks help. code used create array 'array string exampel: "19/07/2012,23/07/2012,23/07/2012,19/07/2012,25/07/2012" dim arrdates array = arrdates .split(",") solution dim arragentsreportcheck array = agentsreportcheck.split(",") dim arrdates new list(of date) integer = 0 arragentsreportcheck.length - 1 arrdates.add(arragentsreportcheck(i)) next arrdates.sort() dim latestdate date = arrdates.max() as astander said, complicated sort array having datetime values. instead convert array list or arraylist , make life easy. for arraylist can use following syntax: list<datetime> dates = ... // init , fill dates.sort(); dates.reverse();

How to remove heroku ssh keys that don't have a name -

the heroku docs mention how remove ssh keys have name associated them using heroku keys:remove : https://devcenter.heroku.com/articles/keys but have managed upload keys don't have name , can't find way delete them. heroku keys:remove command expects name specified. is there other way clear ssh keys associated account? you can delete keys in web interface on heroku. or use heroku keys:remove full public key (or first part of public key) $ heroku keys === my@email.com keys ssh-rsa aaaab3nzac...gegfp2jw== ssh-rsa aaaab3nzac...wzp2pjuw== two keys without names , want delete second ending in 'juw=='. full key, use -l flag. $ heroku keys -l === my@email.com keys ssh-rsa aaaab3nzac1yc2eaaaabiwaaaqeash1gfnghrmfsq+dkg71vtyjkrjzladimxj9m7elhczom6a3e/9gefzvxosirtqicbxnpabxo/nx4zhh/ft5l+yhmohj0fqdghhcz3g3elng5+ve+aj3ade3xy3fidm9znkmth5ymgl+aboig7cjybwvll5wrmmaytpdunvehw0airrs4bego+lzvz+eo+ip+jj3pxwz4kunnw82oy1+twfvswwudyavfbrksyptj50kbtgi8qesjtvinwh8x76am...

android - Google Play - Package File is Invalid -

i've developed app while ago , uploaded google play few months ago. has 2000 downloads @ moment , seems work fine everyone. but today sent me email, i'm quoting him: i wanted app. when started downloading got error message "package file invalid". thought fault went , downloaded other stuff downloaded fine. hoping nay able fix it! have sg3, version 4.1.2 , if need more information, assist in way! i've (2 days ago) release update app, it's been 2 days , statistics no 1 downloaded update yet. i did research , says problem caused user, not developer. tell me if can fixed me? or should tell him clear cache etc.? this app, if take time , download see if works :) thank you! keystore not expired: certificate expires on wed oct 14 22:17:12 cest 3012 also, asked friend, has samsung galaxy s3 try downloading , says works good. i'm pretty sure problem isn't in app, in user's phone. suggestions should tell him try fixing? t...

Multiple selection of ListBox is not working in asp.net mvc4 -

i have bound listbox data entity framework. have selected multiple values in listbox. but, values not fired. count of property 0 only. using code below: public class sample1 { [key] public int sampleid{ get; set; } public string sampledesc{ get; set; } } public class expmodel { public list<sample1> sample{ get; set; } } public actionresult index() { viewdata["samplelist"] = new list<sample1>(entity.samp); return view(); } @html.listboxfor(model => model.sample, new selectlist(((list<details.models.sample1>)viewdata["samplelist"]), "sampleid", "sampledesc")) what have do? please me... you should bind listboxfor helper property collection of simple/scalar values such strings or integers: public class sample1 { [key] public int sampleid { get; set; } public string sampledesc { get; set; } } public class expmodel { public list<int> select...

java - Lazy evaluation not working as it should -

i had evaluate boolean expression frecuently, converted in private method in it's class. here code it's causing me trouble: //"x", "y" , "team" defined return (map.iswalkable(x,y) && (!map.isoccupied(x,y) || map.getoccupant(x, y).getteam() == team) ); methods should preety self-explanatory purpose of question. now, iswalkable , isoccupied both return boolean, , getoccupant method returning object reference. problem i'm getting nullpointerexception when executing piece of code, , shouldn't happening because isoccupied returns true if , if map.getoccupant != null (that's method returns). language supporting lazy boolean evaluation left right (as assume java is, or @ least that's able read) getoccupant method should never executed whenever return null right? is more compiler-dependent thought was? should safer if used if statements, or there obvious i'm missing here, maybe operations resolved other way round....

Changing String Resources in C#.net -

i added strings string resource file in c#.net project (using ms visual c# express 2010). properties of resource file set follows copy output directory: copy , build action: embedded resource when compile application under bin/release creates folder resources , copies stringliterals.designer.cs , stringliterals.resx. my requirement: need edit string resources application pro-grammatically. using resxresourcewriter able change resource file stringliterals.resx. please let me know if there way use changed string resources in main exe without recompiling. i don't believe can change embedded resource file without recompiling. should consider using configurable xml file or writing registry. how application settings stored. if you're worried text being stored in readable format, might consider encrypting text before writing file , decrypting when need text.

javascript - Passing a href value inside a php function on same page -

$disply_storage variable has list of value, want call storage_facility_id in php myfunction() cant understand how storage_facility_id values in myfunction() <?php function myfunction(){ $x=$_post['storage_facility_id']; } ?> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <?php include('include/admin-header.php'); $disply_storage=edit_storage_facility(); ?> <script language="javascript" type="text/javascript"> function ilovephp() { b = "<?=myfunction();?>"; alert(b); } </script> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <t...

ruby on rails - CanCan: set abilities based on controller data or helpers -

so have following setup: class user < ar has_many :memberships has_many :user_groups, through: :memberships has_many :organizations, through: :memberships end class membership < ar belongs_to :user belongs_to :user_group belongs_to :organization end class usergroup < ar has_many :memberships has_many :users, through: :memberships has_many user_groups, through: :memberships end so 1 user can e member of several user groups throughout different organizations, i.e. he/she can product manager in organization , article manager , comment manager in organization b. so in order able ask can? :manage, an_article_instance somehow need have abilities set so: class ability if user.is_content_manager_for(currently_selected_organization) can :manage, article elsif user.is_admin_for(currently_selected_organization) can :manage, user, memberships: { organization_id: currently_selected_organization } end end the web interface of backend suppose...

php - SimpleXML with decoded entities -

how can make simplexml replace html/xml entities respective characters, in php? assume having xml document, in string: $data = '<?xml version="1.0" encoding="iso-8859-1"?><example>tom &amp; jerry</example>' obviously, want simplexml decode &amp; & . not default. have tried these 2 ways, neither of worked: $xml = new simplexmlelement($data); $xml = new simplexmlelement($data, libxml_noent); what's best way xml entities decoded? guess xml parser should it, avoid running html_entity_decode before parsing (actually, won't work either). may problem encoding of string? if so, how track , fix it? i don't know if going work in cases maybe... $xml = new simplexmlelement(html_entity_decode($data)); http://www.php.net/manual/en/function.html-entity-decode.php

Convert PDF to binary in Ruby -

is there ruby function convert pdf binary data.i need binary data soap api. found lot of reference converting binary file , other formats , need reverse. this shorter type: text = io.read(fname, mode: 'rb') but soap isn't easy deal with. check out savon gem.

sublimetext3 - How to install SFTP plugin in Sublime Text 3 on Windows 7 64bit -

i cannot install st3's sftp plugin on windows 7 64bit. installed menus greyed out, not active. i read support. says: to fix this, please perform following: open preferences > browse packages… navigate sftp/ folder and open sftp.py in sublime. i open browse packages... written there no sftp/ folder in sublime text 3\packages folder thet opened. neither in sublime text 3\packages nor in sublime text 3\packages\user . have 2 folders there: \sublime text 3\packages\package control \sublime text 3\packages\user what do wrong? how may install or set plugin correctly? on computer mentioned directory located here c:\users\user\appdata\roaming\sublime text 3\packages\ . may st3 install plugin other directories? sftp doesn't work in sublime text 3. @ least on windows 7 64 bit. works fine in sublime text 2. uninstalled st3, installed st2 , installed sftp plugin. , quite happy.

Publish Blackberry app for BB10 and BBOS -

i want publish app blackberry 10 have version on app world bbos. version if targeted bb10 overwrite old version targeted bbos? how upload bb10 version keep both versions? when upload application, have choose os target specific release. won't overwrite current version if select qnx targets (bb10 and/or playbook). can select custom set of devices/os version each release.

sql - Select another attribute if the original attribute is NULL (Conditional select) -

how can achieve if want select attribute , if attribute null. i know long way of this: select val1 test_table val1 not null or select val2 test_table val1 null the bad solution if have long , complicated select need write twice... eg: select val1 test_table condition1 , condition2 , condition3 , val1 not null or select val2 test_table condition1 , condition2 , condition3 , val1 null so hope, maybe there shorter form this. anyway if or case in programming languages (i think). any idea appreciated. first ide: inside select can shorten second select select coalesce(val1, val2) test_table

c# - Why is Ajax.BeginForm not working? -

i looked @ several similar questions, can't working. i have radio buttons in form. instead of selecting option , clicking submit button, want submit form when user clicks radio button. so hid submit button , placed javascript function emulates click of button (i tried working button click, doesn't seem problem). in view have: <script type="text/javascript" src="/scripts/jquery-1.9.1/jquery-1.9.1.min.js" ></script> <script type="text/javascript" src="/scripts/jquery-1.9.1/jquery.unobtrusive-ajax.min.js"></script> <script type="text/javascript"> function change() { $('#buttonradio').click(); } </script> <h2>dashboard</h2> <div class="dashboard" id="itemsdshbrd" style="overflow:auto;height:97%;"> <div id="dshbrdradiogroup" style="float:right;font-size:small"> <% usi...

c# - Windows 8 phone application runs out of memory -

i have windows phone(lumia 920) app deals lot of images(10 or full resolution) being captured camera. it being sent asynchronously service(wcf) , discarded phone. when wifi little slow photos in memory of phone gets bottle , out of memory exception occurs. this not app on store want increase available usage on phone. i have tried set <requirements> <requirement name="id_req_memory_300" /> </requirements> yet having same issue. have tried saving images isolatedstorage, disposing of in-memory objects, recovering each image in turn form isolatedstorage memory, uploading it, then, when sure has been uploaded, disposing of isolatedstorage version?

ios - Passing compiler flags through xcodebuild -

i'm using xcodebuild automate testing ios. right now, i'm stuck on trying pass compiler flags through xcode directly compiler. these flags are: -fprofile-arcs -ftest-coverage . i don't have liberty of modifying xcodeproj, that's why want inject these flags via xcodebuild command. it like: xcodebuild -project path/to/my.xcodeproj -scheme myapp -fprofile-arcs -ftest-coverage is feasible? how? apparently compiler flags can expressed constants, , these can passed compiler via xcodebuild easily. to them, select option in xcode build settings view, , hit command-c (copy). in case, gcc_generate_test_coverage_files , gcc_instrument_program_flow_arcs . my command looks this: xcodebuild gcc_generate_test_coverage_files=yes gcc_instrument_program_flow_arcs=yes ...

view not refreshing after zend redirect -

so trying do, after user submit information, make call action call saveronda, save information on database, after saving want redirect page, according firebug html correct, view isnt refreshing. here code in /rondas/chooseronda ive got this <span class="st-labeltext">tags da ronda:</span> <table id="toolbar2"></table> <div id="ptoolbar2"></div> <div class="clear" style="z-index: 670;"></div> </div> <div class="st-form-line" style="z-index: 680;"> <span class="st-labeltext">nome da ronda:</span> <input type="text" name="nomeronda" id="nomeronda"> <div class="clear" style="z-index: 670;"></div> </div> <div class="st-form-line" style="z-index: 680;"> <span class="st-labeltext">tag inicial:...

javascript - Radio button value regardless of selected input -

i have code: <input type="radio" name="pay" id="payid" value="banktransfer"> bank transfer <br/> <input type="radio" name="pay" id="payid" value="paypal"> paypal <br/> <br/> i try: var sample = $('#payid').val() alert(sample); why have still banktransfer ? (regardless of selected input)? the id must unique. radios need same name on-off functionality work, each must have unique id. could, instance, have "payid1" , "payid2"

emacs - Replacing yasnippet fields by entries from a list -

recently stumbled across question "a quick way repeatedly enter variable name in emacs?" asks way create , expand snippets "on-the-fly". found package auto-yasnippet created author of question , result of question. package much, expanded functionality. package allows following: you write following snippet: convert img$1.jpg -monochrome -resize 50% -rotate 180 img$1_mono.pdf call aya-create , enter new line , call aya-expand : above code pasted , can replace placeholders ( $1 , $2 , ...) ordinary yasnippet. this great feature, however, if have create many copies of snippet , enter expansion string becomes not fun. nice pass list (or list of lists if have multiple placeholders) used expand placeholders. lets have call above thing files img_1.jpg img_9.jpg , results should called img_a_mono.jpg img_k_mono.jpg , 1 create list: (setq foo-list '( '( 1 2 3 4 5 6 7 8 9 ) '( b c d e f g h j k ) ) write snippet convert img$1.jpg -monoch...

jquery - Javascript on carousel breaking -

i made update page: http://www.thesanfordcenter.net/sanford-center , carousel broke on me. should have 4 items able slide right , left, showing of items. pretty new javascript , jquery, apologize in advance if seem bit slow. thank why broken.

javascript - How to check if value is not `blank` in this code using Java Script or jQuery? -

how check if value not blank in code using java script or jquery? <select name="producttype" class="selectoption"> <option class="selectoption" value="blank">select something</option> <option class="selectoption" value="test1">test1</option> <option class="selectoption" value="test2">test2</option> <option class="selectoption" value="test3">test3</option> </select> using jquery: $(".selectoption").on("change", function() { if ($(this).val() != "blank") // });

sql - MAXDOP is set to 0, however, all transactions run in serial -

the server setting maxdop set 0 , threshold default of 5. all transactions run against server run in serial , not against multiple cores/cpus (virtual machine , has 8 cpus). server windows server 2008 r2 enterprise x64 , sql server 2008 r2 enterprise x64. there "default" , "internal" workload group on machine both resource governors not enabled , disabled, have maxdop setting of 0. i've confirmed sql server has cpu affinity across cores/cpus. i'm kind of lost why server refuses run transactions in parallel opposed other machines @ location. came in noticing many of servers here had long cxpacket wait times , many processes causing wasted cpu overhead. dba said after reading evaluation there nothing wrong maxdop 0 , threshold of 5 because xxxx server never runs in parallel say. i believe evaluation of site still correct, darn server debunking evaluation. i open suggestions why server not configured , should run in parallel doesn't. ...

user interface - Domain Entity and UI Entity -

we creating project using mvc c# in application having following layers: presentation (mvc) controller view domain domain entity repository interface interface unit of works infrastructure (dataaccess) repository unit of works edmx data entity our domain entity , data entity same. poco class. have bound our views domain entity tightly coupled. question: 1. correct or create viewmodel entity our views? 2. pass our data entity our view save on mapping? i dont think rigth... talking mvc, our layers meens model, view,controller, maybe

xamarin.ios - Error rebuilding ATMHud.DLL for Monotouch -

after updating latest versions of xamarin studio morning zbar , atmhud references in our project started throwing bunch of errors, of were: the type 'monotouch.uikit.uiviewcontroller' defined in assembly not referenced. consider adding reference assembly 'monotouch, version=0.0.0.0, culture=neutral, publickeytoken=null' (cs0012)' i did reading , found out needed rebuild both of libraries because of "assembly strong names" in xamarin. able muddle way through rebuilding zbar library, atmhud rebuild has given me trouble , i'm not familiar enough i'm doing fix problem. i downloaded atmhud project github , followed instructions in readme state "run 'make' in binding directory build atmhud.dll", when errors. teds-mac:binding ted$ make /developer/monotouch/usr/bin/btouch -e atmhud.cs enums.cs assemblyinfo.cs --out=atmhud.dll --link-with=libatmhudsdk.a,libatmhudsdk.a /var/folders/75/vl_6zkyx03sc4tymnp41lsgw0000gn/t/09x9yx...

ios - Saving Photos to Core Data -

i want save photo core data. in internet , find many resources core data cannot find 1 want accomplish. want use core data save images user has taken , want user select category wants save it. sorting pictures categories example meat or vegetables or etc. have made 1 entity called photo , put 6 attributes name of categories example meat vegetables. did not select type yet. thinking user chooses category , save attribute. here's question. want cannot find resources meet want do. doing correct thinking of using multiple attributes? scroll down storing uiimage data in core data, firstly bit core data attributes: shouldn't use multiple attributes different categories, should have single attribute called 'category'. integer or string, depending on implementation. recommend using integer , defining enum follows: typedef ns_enum(nsuinteger, myfoodcategory){ myfoodcategoryvegetable = 0, myfoodcategorymeat = 1, myfoodcategoryfish = 2, myfoo...

linux - GPIO output value not changing -

i trying setup output gpio pin on nitrogen6x board, can't change file value . navigated /sys/class/gpio/ , exported pin (gpio18) echo 18 > export . able change direction command echo out > direction , seems should able change value file same way, echo 1 > value , doesn't seem working. logged in root , permissions on both direction file , value file same: -rw-r--r-- 1 root root . does have idea why not writing file? thanks of help! the commands have listed should work, if gpio number correct. while have not worked nitrogen6x in particular, have found out linux gpio pin numbers not match labels on board. advice trying find out proper mapping experimentally watching possible gpios: cd /sys/class/gpio x in `seq 1 128`; echo $x > export; done ground pin in question via 10k resistor, run: grep . gpio*/value > /tmp/values0 connect pin in question vcc via 10k resistor, run: grep . gpio*/value > /tmp/values1 diff files, , pay a...

java - Saving large short array android -

i'm looking way save , reload few large arrays (about 5 million short ) in fastish way on android. app needs save them in way them later, can't hold them in memory... so far, i've tried converting them byte[] array , seem save successfully, can't data back, how saving code works (it's separate functions, simplified here): bytearrayoutputstream baos = new bytearrayoutputstream(); objectouputstream oos = new objectoutputstream(baos); oos.writeobject(data); oos.close(); baos.close(); fileoutputstream fos = new fileoutputstream(filename); // valid absolute path fos.write(baos.tobytearray()); fos.close(); and loading part stuck, how short[] byte[] ? read database might work too, quick enough? i've looked around stackoverflow , google , can't seem find similar problem, or @ least solution it, beginner might have missed obvious... if data short[] , want write whole thing file, don't use buffer in memory, write directly. objectoutputst...

How to limit the product quantity for specific items in magento -

i'm setting magento site client sells fabric , other related materials. there minimum of .5 yard 1 fabric product, after that, can go amount, minimum .5. i'm able type in .25, .125, etc. , add shopping cart. i want apply fabric products (there around 2000 different fabric products) not other types sells on site, rulers, needles, buttons, etc... don't want people able purchase .5 buttons. thanks you might need observer monitors checkout_cart_product_add_after event. event passes following parameter: array('quote_item' => $result, 'product' => $product) here, check quantity via quote_item , product's category (if it's fabric or not) via product . imagine here remove specific quote item cart if decimal value , not member of 'fabric' category. good luck.

jquery - SPServices applications on SharePoint 2010. Will it work on SharePoint 2013? -

i'm using spservices develop on sharepoint 2010. organization upgrading sharepoint 2013 sometime in future. need (if anything) when new sharepoint server installed keep using spservices library? i'm using getlistitems, updatelistitems, createlistitems , query operations. per article linked in response question - depend on number of factors , deprecated between 2010 , 2013...but can tell able port company news site/portal made extensive use of getlistitem ajax calls , search queries no issues. keep in mind lot of stuff still works in 2013 deprecated , removed entirely in future releases. here's list starters: http://www.c-sharpcorner.com/uploadfile/roji.joy/deprecated-features-in-sharepoint-2013-from-sharepoint-2010/

jdbc - Java SQL Resultset retrieval order is not correct -

hi have following 3 row in table tb1 key time id rowid x 11:40 1 1 y 4:50 1 2 z 6:48 1 2 now using jdbc records , iterating on resultset shown below: rs = statement.executequery("select * tb1") resultsetmetadata md = rs.getmetadata(); int cols = md.getcolumncount(); while(rs.next()) { for(int = 1; <= cols ; i++) { system.out.println("col name " + md.getcolumnname(i)); system.out.println("col name " + rs.getobject(i)); } } when execute above code strangely prints second row first , first row , third row. in short resultset data retrieval not in order. dont understand why? please guide. in advance. you have not specified "order by" clause. in general, databases not required return rows in order unless "order by" clause specified. add order clause select statement.

Loop playback with ffmpeg + ffserver -

i have ffserver multicast stream other devices , ffmpeg send input video ffserver using following command: ffmpeg -re -y -i ~/videofile.mp4 http://192.168.2.38:8090/f.ffm is possible loop video playback, mean after videofile.mp4 ends, ffmpeg or ffserver restarts playback beggining of file? i couldn't find key ffmpeg loop playback, can done using shell script: #!/bin/sh while [ 1 ] ; ffmpeg -re -y -i /path_to_videofile http://url:8090/f.ffm done

MySQL error at line 1 when I try to insert values -

php script: <?php include('connect.php'); if (isset($_post['project_name'])){ $name = $_post['project_name']; $date = $_post['date']; $amount = $_post['amount']; $curr = $_post['curr']; $spec = $_post['spec']; $sql = "insert projects (name, date, currency, amount, specifications) values '$name','$date','$amount','$curr','$spec'" or die(mysql_error()."update failed"); $insert = mysql_query($sql); if($insert){ echo "successful"; echo "<br>"; echo "<a href='insert.php'>back main page</a>"; } else { ?> html form here <?php } ?> note: connect.php file working ok since i've used before on other scripts on same server. every time try submit form ( method = post ), error: you have error in sql syntax; check manual corresponds mysql server version right syntax use...

Weird behavior of XCode4.6 base localization: Works on simulator but only PARTLY on device -

i tried use base localization project using xcode4.6. weird thing works on simulator , on ad-hoc testing device loaded archive itunes, on development iphone connected xcode, language setting german, localizable.strings shown in german, none of mainstoryboard_iphone.strings - shown in english. have cleaned product, deleted app development iphone, changed language settings english , forth german, restarted xcode etc. result same: development iphone not translate storyboard files, although translated on simulator , on ad-hoc testing device. configuration: have base localization storyboard, , localization of in 2 languages (english , german), i.e. in project folder there folder base.lproj containing mainstoryboard_iphone.storyboard , en.lproj folder containing infoplist.strings , localizable.strings , , mainstoryboard_iphone.strings (apart mainstoryboard_ipad.storyboard , don't use right now), , de.lproj folder containing files same name. base localization english. english...

Testing an externally hosted app on HTTPS using Karma -

i have angularjs/flask app (serverside) redirects https version of if you're not on https. i'd use karma test app using https, btu can't locally without running https server on own computer (which hassle), pushed app heroku site (say @ mine.herokuapp.com ) has ssl. now, i'm trying run karma tests against external site config file like var proxypath = 'mine.herokuapp.com'; files = [ ... ]; urlroot = '/_karma_/'; singlerun = true; browsers = ['chrome']; proxies = { '/': proxypath }; but when try run tests, error sandbox error: application document not accessible upon navigating app. i'm positive nothing wrong on heroku side; can navigate there fine. there way test https in karma or on wild goose chase? i had problem running dev site in iis redirect http requests https i still haven't go working, can @ least load site inside iframe in karma runner i had specify hostname , allow invalid ssl certificat...

jquery - How can I render a grails model to javascript using a post method from a controller action? -

at jquery event want call upon controller action , use data. way did until was: $('#my-button').click(function(){ $.post("${createlink(controller: 'myview', action: 'myaction')}", {param1: x, param2: y}, function(data){ //in here want use both elements of model see fit. }) }); my controller method looks this: def myaction(param1, param2){ //some data manipulation goes here render model: [returnvalue1: variable1, returnvalue2: variable2]; } my question how can access variable1 , variable2 $.post method? if don't use model , return 1 of variables, data equal variable, in case won't. can tell me how access variables in model please? calling ${returnvalue1} not work in function. you can render json object representing model. here's render documentation render(contenttype: "text/json") { [returnvalue1: variable1, returnvalue2: variable2] } or render([returnvalue1: variable1, returnvalue2: variable...

format - EDI, 852 Product Transfer: N1 loop out of order? -

i have build edi report i'm working on. i'm using edi notepad validate output. while edi readable edi notepad, keep getting errors have few n1 loops out of order. gives? i've been reading through spec afternoon trying figure out, , see no mention of n1 order anywhere. doing wrong? here's edi in question: isa*00* *00* *12*abccom *01*999999999 *110127*1719*u*00400*000005438*0*p*>~ gs*pd*4405197800*999999999*20110127*1719*1421*x*004010vics~ st*852*000008315~ xq*g*20130807*20130807~ n1*st**11*ad6448446~ lin**ua*53233*pi*76189053560~ za*qa*0*ea~ za*qs*0*ea~ lin**ua*53234*pi*76189053430~ za*qa*0*ea~ za*qs*0*ea~ n1*st**11*bd9628542~ lin**ua*53234*pi*76189053430~ za*qa*30*ea~ za*qs*0*ea~ lin**ua*53233*pi*76189053560~ za*qa*0*ea~ za*qs*60*ea~ n1*st**11*fd0286244~ lin**ua*53233*pi*76189053560~ za*qa*180*ea~ za*qs*930*ea~ lin**ua*53234*pi*76189053430~ za*qa*390*ea~ za*qs*585*ea~ n1*st**11*bd9076008~ lin**ua*53234*pi*76189053430~ za*qa...

powershell - I am not able to find my webparts after deploying them to sharepoint site -

i have add .wsp package sharepoint site , deployed through sharepoint central management web app. it says deployed not see in gallery. did miss step ? thanks, won't let me answer own question :p able solve it: ok after additional clicking around central management web app found disconnect. here steps worked first published package of solution right click on project select publish select folder save .wsp file open sharepoint powershell , execute add-spsolution [path wsp file] open sharepoint central management web application select system settings on left side menu find solution , click deploy missing part go on sharepoint home site under site actions go site settings page look web parts in gallery section on library tools strip select documents click on new document , pop list of new webparts appear scroll , find web parts check out web parts solution click populate gallery should find web part under misc. folder this assumes sp admin. hope ...

ios - When is it appropriate to release CGImageRef? -

when xcode analyzes code, finds potential memory leaks. use arc , learned arc doesn't handle c types. since use cgimageref in order create uiimage , assign uiimageview.image property, when appropriate release cgimageref ? can release right after create new uiimage it? if release cgimageref , make uiimage instance invalid? uiimageview retains image property (if needs it) or copies - whatever. once have set property, can release cgimageref.

c++ - Does a win32 application have one message loop? Or is it one message loop per window? -

i'm little bit confused how message loops work in win32 programming. in winmain put following: while ( getmessage ( &msg, null, 0, 0 ) > 0 ) { translatemessage ( &msg ); dispatchmessage ( &msg ); } this while loop pretty runs until application stops. mean have 1 message loop per application rather per window? from about messages , message queues : applications multiple threads can include message loop in each thread creates window. note messsage queue can support multiple windows... second parameter of getmessage handle of window want watch messages for. if null windows of thread. as second note, possible create message queue without windows (at least windows 2000 onward). described in documentation postthreadmessage : in thread message posted, call peekmessage shown here force system create message queue. peekmessage(&msg, null, wm_user, wm_user, pm_noremove)

java - How can I write a function boolean succeeds(char a, char b, String s)? using s.equals(""), s.charAt(0), s.substring(1) -

i trying write function takes string s , returns true if every occurrence of character b succeeded character a, , false otherwise. have tried: boolean succeeds(char a, char b, string s) { boolean to_return = true; boolean seen_a = false; while(true) { if (s.equals("")) return to_return; char c2 = s.charat(0); if (c2 == a) seen_a = true; if (c2 == b) { if (!seen_a) return false; } s = s.substring(1); } } } i think have right idea. don't know how put together. given guidelines, can along lines of while (!s.equals("")) { char c = s.charat(0); // record first char s = s.substring(1); // cut off first char // if "first char 'b' , next // not 'a'", can return false if (c == b && (s.equals("") || s.charat(0) != a)) return false; } return true; by ...

javascript - Remove the latest URL parameter after "/" -

i need remove text (or parameters) after latest "/" in url , did this: var current_url = $(location).attr('href'); var clean_url = current_url.substring(current_url.lastindexof('/') + 1); but it's not working because text (or parameters) after latest "/" , don't want that. how? what's wrong in code? substring returns string starting @ index specified first parameter, , going until index specified second parameter, or end if there isn't second parameter. try this: var current_url = location.href; var clean_url = current_url.substring(0, current_url.lastindexof('/') + 1);

javascript - Is there any way to change the CSS of the Facebook Like Box? -

so i'm trying, through whatever way possible, modify facebook box's css. i've found offending value , want change it. inside of iframe. the css this: .pluginlikeboxstream { overflow-x: hidden; overflow-y: auto; } this causing there scrollbar on box stream, really, don't want. i'm not seeing anyway modify - not javascript sdk (which best hope, think), not through using javascript or jquery on (as creates iframe, impossible, far can tell - though firebug lets me change this). obviously best solution able set style using css, seems impossible. is there way fix this? i've tried load iframe no scrollbars, that's on outside of iframe - internal. all want class set overflow: hidden; it not possible change css of official facebook box because external iframe. read more in this duplicate.

css - How to modify wrapper div error class when using CakePHP with Bootstrap -

i'm using bootstrap 3.0rc1 cakephp 2.3.6 . trying take advantage of beautiful looking classes has-error , has-warning validation states , need change default element class formhelper adds wrapping div. so far i'm using code: echo $this->form->create('user', array( 'inputdefaults' => array( 'class' => 'form-control', 'div' => array('class' => 'form-group'), 'label' => array('class' => 'control-label'), 'error' => array('attributes' => array('wrap' => 'span', 'class' => 'help-block')) ) )); echo $this->form->input('email')); which output on error: <div class="form-group error"> <label for="useremail" class="control-label">email</label> <input name="data[user][email]" class="f...

javascript - angular-ui and datepicker directive error -

i trying following example/demo , keep getting error in chrome console: error: non-assignable model expression: undefined (directive: datepicker) i dont 404s during execution. the code used based on: http://angular-ui.github.io/bootstrap/#/modal or http://plnkr.co/edit/?p=preview the code in modal template: <pre>selected date is: <em>{{dt | date:'fulldate' }}</em></pre> <div class="well well-small pull-left" ng-model="dt"> <datepicker min="mindate" show-weeks="showweeks"></datepicker> </div> the code in modal controller: $scope.today = function () { $scope.dt = new date(); }; $scope.today(); $scope.showweeks = true; $scope.toggleweeks = function () { $scope.showweeks = !$scope.showweeks; }; $scope.togglemin = function () { $scope.mindate = ($scope.mindate) ? null : new date(); }; $scope....

mysql - Database full of duplicate entries -

i have huge database full of duplicate entry errors. fastest way remove of errors? error: 1062 - duplicate entry 'x' key 'primary' thanks in advance. if no matter left in table that: dump datebase truncate tables add pk whatever need (empty db) in console replace dump insert insert ignore recover dump profit i did once, not @ production/not big db - 200mb per dump - anoing relation issue @ localhost. know it's not pretty... me worked. edit: if thinks it's bad solution, please leave comment - know how better...

python - For Loop with Bool -

i have simple loop gets stuck on division 0 error. running bool filter out zero-value denominators, reason bool used isn't working. can please help? using python 2.6.5 here sample code: for in range(0,len(lines)): line = lines[i] line = line.split(";") leansz = line[9] fw = line[34] fs = line[35] print "fs: %s %s"%(fs,type(fs)) #troubleshooting denominator , type if fs == "0": #i have tried fs == 0 , fs == "0" no avail print 'fs == "0"' #checking if bool working continue #return top of loop if denominator 0 lnszra = float(leansz)/(float(fs)/2) #division 0 error here sample of returned , error: fs: 184 <type 'str'> fs: 1241 <type 'str'> fs: 2763 <type 'str'> fs: 1073 <type 'str'> fs: 971 <type 'str'> fs: 0 <type 'str'> traceback (most recent call last): file...

java - Tapestry - Writing a file to webapp directory -

i'm trying write out xml file within subdirectory of webapp. let's case directory is: c:\tapestry\xyz\src\main\webapp\directory1\ how can part of file path c:\tapestry\xyz\src\main\webapp\ within 1 of java classes? don't want hard code because won't portable. thanks,

Variables in Python: Add and change variables -

i making game in python, , want add store. i want variable. know how add variables, , how change them, not how increase or decrease variable. i have never used variables before. have read it, don't remember it. def level1(): os.system('cls') gold = 500 print print 'you have currently', print (gold), print 'gold' time.sleep(3) level2() def level2(): print print 'congratulation! completed quest! received 200 gold.' time.sleep(2) gold =+ 200 print 'you have now', print (gold), print 'gold.' time.sleep(5) and result is: you have 500 gold congratulation! completed quest! received 200 gold. have 200 gold. i tried gold + 200, gold += 200, , gold =+ 200, last 1 worked. i tried print 'you have now' + gold + 'gold' but didn't work reason. tried print 'you have now' + (gold) + 'gold' i not quite sure what's wrong here, , appreciate can get! thank much. edit: i forgot add ...