Posts

Showing posts from February, 2012

ios - Subview's sublayers overlapping higher subviews -

Image
i have issue: i'm creating uiview returned method, , part fine, i've noticed when add sublayers 1 of subviews, layers overlap subviews higher in hierarchy (textview , imageview) sublayers added testviewcopy appearing on top of these subviews, , aren't supposed to. have no idea what's going on here cause this. code: - (void)makeshareimages { uiview *shareview = [self shareview]; uiview *testviewcopy = [shareview viewwithtag:0]; nsuinteger currentindex = 1; (nsdictionary *sub in self.array) { nsarray *lastarray = [sub objectforkey:@"lastarray"]; (nsdictionary *dict in lastarray) { @autoreleasepool { currentindex ++; circlelayer *layer = [[circlelayer alloc]init]; layer.portrait = [[dict objectforkey:@"portrait"]boolvalue]; layer.frame = testviewcopy.bounds; [testviewcopy.layer addsublayer:l

gmail - Gamil logged me in when i give my email address without dot or with dot? -

i don't know whether ask question in stack overflow appropriate or not. sorry if question not fulfilling rules. my google mail account shakil.cph@gmail.com my question before login when entering mail address without dot mean shakilcph@gmail.com logged me in shakil.cph@gmail.com. reason. https://support.google.com/mail/answer/10313?hl=en gmail doesn't recognize dots characters within usernames, can add or remove dots gmail address without changing actual destination address; they'll go inbox, , yours. ... you can see if try sign in username, adding or removing dot it. you'll still go account. a note using google apps: one last thing: google apps does recognize dots. if you'd have dot in username, please ask domain administrator add preferred username nickname.

jquery - display different item from a list on click of a button in MVC Mobile -

i have list of customers in customers list. list<customer> customers= getcustomer("new york"); i want display each customer item in mvc view on click of left , right buttons , save customer @ end. my mvc view below | leftbutton | 1 of 5 |rightbutton| customer: michael address: 123 park ave, new york rating: 4 phone: 123456 |buttonsave| |buttonremove| i hope explained properly, should approach thing done in mvc partial page updates. here 1 possible solution: create partial view show single customer record. model: public static customer getcustomerinfo(int customerid) { using (var db = new dbcontext()) { return db.customers .where(c => c.customerid == customerid) .firstordefault(); } } view: <label><b>customer:</b> @viewbag.customer.name</label><br> <label><b>address:</b>

python - What is the relationship between virtualenv and pyenv? -

i learned how use virtualenv , virtualenvwrapper in workflow i've seen pyenv mentioned in few guides can't seem understanding of pyenv , how different/similar virtualenv. pyenv better/newer replacement virtualenv or complimentary tool? if latter differently , how 2 (and virtualenvwrapper if applicable) work together? pyenv , virtualenv different tools work in different ways different things: pyenv bash extension - not work on windows - intercepts calls python, pip, etc., direct them 1 of several of system python tool-chains. have libraries have installed in selected python version available - such users have switch between different versions of python. virtualenv , pure python works everywhere, makes copy of, optionally specific version of, python , pip local activate environment may or may not include links current system tool-chain, if not can install known subset of libraries environment. such better testing , deployment know exactly libraries, @ vers

html - How does css checkbox hack work? -

i came across switch toggle button created using css. known checkbox hack. for doesn't know checkbox css hack is, please read here https://css-tricks.com/the-checkbox-hack/ i tried out , working fine. didn't understand how working because not clicking on checkbox. so have 2 questions how working ? instead of absolute positioning tried display: none; still worked. method have drawbacks? the way works using <label> element. input element can (and should) have label. can tell browser label belongs label using for attribute, referring input's name : <input name="myname" /> <label for="myname">label</label> whenever click label, focuses input (or in case of checkboxes, toggles it). the label , checkbox don't have near each other. add few hidden checkboxes @ start or end of document , place labels anywhere on page, , they'd still focus input. hiding checkbox through display: none cause bug

html - Border-radius and IOS select fields -

Image
i experiencing problem height , border-radius of select fields in ios. first, border-radius. specified border-radius select fields image below demonstrates: for reason, border-radius settings ignored on iphone. i'm not sure if ipad produces same result don't have 1 test. according few posts " remove border radius select tag in bootstrap 3 " solution found set border-radius 0, want border-radius. shall do? second, height. height of selects not matching height when viewing site desktop browser. set min-height helped it's still under required height. what can missing? note, following css rules applied select fields: -webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-appearance: none; -moz-appearance: none; appearance: none;

sql - Join same table twice for count in different columns -

i have 2 tables a +----+-------+ | id | user | +----+-------+ | 1 | user1 | | 2 | user2 | | 3 | user3 | +----+-------+ b +----+--------+------+ | id | userid | type | +----+--------+------+ | 1 | 1 | | | 2 | 1 | b | | 3 | 1 | c | | 4 | 2 | | | 5 | 2 | b | | 6 | 2 | c | | 7 | 3 | | | 8 | 3 | c | +----+--------+------+ userid fk table a.id i'm trying count of each type , type permutations below single sql query. (e.g count a^b means number of users has type , b) +---------+---------+---------+-----------+-----------+-----------+-------------+ | count | count b | count c | count a^b | count a^c | count b^c | count a^b^c | +---------+---------+---------+-----------+-----------+-----------+-------------+ | 3 | 2 | 3 | 2 | 3 | 2 | 2 | +---------+---------+---------+-----------+-----------+-----------+-------------+ or separate query each permutatio

Issue with Full-Text (FTS) master merge on SQL Server 2012 SP2 -

Image
on current project have annoying issue master merge process occurs after full population of fts index. let me describe our process: have continuous build setup environment , run unit tests after each commit in our source control. each run create new db (on same sql server) fill test data , run unit tests. unit tests failed because fts index population cannot finish in time. we have seeing in [sysprocesses] table lots of sessions wait type ft_master_merge block our tests: in fts log have following error: the master merge started @ end of full crawl of table or indexed view [tablename] failed hresult = '0x80000049'. database id '45', table id 706101556, catalog id: 5. here example of how create fts catalog , add table (as can see it's created auto change tracking index update in background ): -- create fts catalog exec sp_fulltext_catalog 'wilcoftscatalog', 'create' exec sp_fulltext_table 'users', 'create',

jssor carousel Having an Issue -

i need simple horizontal no-autoplay carousel images of various width same height ( 117px ). need see continuous multiple images (depending on width ) in container separated by, say, 5px . oriental lady example on jssor.com . what (see below code) working carousel, displaying single image per slide. need do/set multiple images per slide please? <script src="../js/jquery-1.9.1.min.js"></script> <script src="../js/jssor.slider.min.js"></script> <script> jquery(document).ready(function (\$) { var options = { \$autoplay: false, \$loop: 0, }; var jssor_slider2 = new \$jssorslider\$('slider2_container', options); }); </script> <div id="slider2_container" style="position: relative; top: 0px; left: 0px; width: 300; height: 117;"> <!-- slides container --> <div u="slides" style="cursor: move; position: relative; overflow: hidden; left: 0px; to

How to log which is the Pretty print like pprint by clojure.tools.logging? -

i using org.clojure/tools.logging . want function can pretty print log, can't find it. example, content want print is {:status 401, :headers {"content-type" "application/octet-stream"}, :body {:error "you don't login."}} but call function name info ,i this {:status 401, :headers {content-type application/octet-stream}, :body {:error don't login.}} how this: (require '[clojure.pprint :as pprint]) (defn pformat [& args] (with-out-str (apply pprint/pprint args))) then: (require '[clojure.tools.logging :as log]) (log/info (pformat {:status 401, :headers {"content-type" "application/octet-stream"}, :body {:error "you don't login."}})) which outputs this: apr 29, 2015 9:43:40 user invoke info: {:headers {"content-type" "application/octet-stream"}, :status 401, :body {:error "you don't

Cordova Splashscreen for android not showing when delay value too small -

i use cordova 5.0.0 splashscreen support integrated. used code documentation : <platform name="android"> <splash src="res/splash/android/splash-land-hdpi.png" density="land-hdpi" /> <splash src="res/splash/android/splash-land-ldpi.png" density="land-ldpi" /> <splash src="res/splash/android/splash-land-mdpi.png" density="land-mdpi" /> <splash src="res/splash/android/splash-land-xhdpi.png" density="land-xhdpi" /> <splash src="res/splash/android/splash-port-hdpi.png" density="port-hdpi" /> <splash src="res/splash/android/splash-port-ldpi.png" density="port-ldpi" /> <splash src="res/splash/android/splash-port-mdpi.png" density="port-mdpi" /> <splash src="res/splash/android/splash-port-xhdpi.png" density="port-xhdpi" /> </platfor

hadoop - hive - Regex in Split function not giving output -

input : [a,b], [c,d], [e,f] select split(col,'\\,') table_1; with above query, able split on every comma. (inside , outside braces) i need split on commas outside braces. changed query below. select split(col,',(?=\[)') table_1; regex used correct knowledge not able output. output required: "[a,b]","[c,d]","[e,f]" it looks there space in between data, try regex instead: ,\\s(?=\\[) edit: so, not sure if have spaces or not in column, here both: case 1 : without spaces in column hive> describe a; ok t string hive> select * a; ok [a,b],[c,d],[e,f] time taken: 0.089 seconds, fetched: 1 row(s) hive> select split(t, ',(?=\\[)') a; ok ["[a,b]","[c,d]","[e,f]"] time taken: 0.081 seconds, fetched: 1 row(s) case 2 : spaces in column hive> describe b; ok t string hive> select * b; ok [a,b], [c

Parsing an input file to create a directed graph C++ -

so i'm starting project on directed graphs , topological sorting. i'm looking efficient way parse input file of courses in form: course_1 course_2 where course_1 prerequisite course_2 none course_3 where course_3 has no prerequisites. all vertex labels strings, obviously. have created graph class data members store vertices, edges, , vertex labels. later, adding methods topologically sort , find shortest path 1 vertex another. given these future plans, questions here better use adjacency list? or matrix? efficient way populate graph input files? initial thought using adjacency list. since size of graph isn't known @ compile time idea std::vector<std::list<std::string>> adjacencylist; also, thought of creating helper function parse input file. along lines of void populategraph(std::string filename, graph* graph) am totally going in wrong direction here? you're on right track lot of things. if can assume inputs encou

Why my javascript variable referencing a function stay unchanged even after I overload the referenced function? -

i have problem of understanding how javascript works, , can't find correct explanation, perhaps me. assuming following code : // afunction references console.error var afunction = console.error; // assign new property afunction // afunction references console.error have property afunction.callcount = 0; afunction.hasownproperty("callcount"); //true console.error.hasownproperty("callcount"); //true // overload console.error (why not purpose) console.error = function() {} console.dir(afunction); //vm807:2 function log() { [native code] } console.dir(console.error); //vm808:2 function () {} why afunction still references original console.error ? thanks in advance help. when set variable reference object (a function, in case), gets copy of reference value. subsequent changes other variables or object properties share reference value won't have effect on copy made. it should clear what's going on here, right? var =

uiview - How to add line at the top of keyboard in ios? -

Image
i have view in show numeric keyboard. problem keyboard missing top line. white background unpleasant effect appears: how can add 1pt view @ top simulate top line? quick , dirty: - (bool)textfieldshouldbeginediting:(uitextfield *)textfield { uiview *separatorview = [[uiview alloc] initwithframe:cgrectmake(0, 0, cgrectgetwidth([uiscreen mainscreen].bounds), 1.0 / [uiscreen mainscreen].scale)]; separatorview.backgroundcolor = [uicolor lightgraycolor]; textfield.inputaccessoryview = separatorview; return yes; }

excel - Sheet to sheet multiple cell comparison -

i'm trying create code compare first column (dates) on sheet8 first column (dates) on sheet7. in addition, have compare 2nd columns on each sheet (shift). once program hits correct shift , date, need copy , paste data located on sheet7 sheet8. i've searched quite bit on , can't seem find correct answer. (note: new vba , self taught forgive me mistakes in code). enter code here option explicit sub grabkpi() dim integer, j integer dim date1 date, date2 date dim shift1 integer, shift2 integer date1 = sheets("sheet8").range("a" & i) date2 = sheets("sheet7").range("a" & j) shift1 = sheets("sheet8").range("b" & i) shift2 = sheets("sheet7").range("b" & j) = 2 1697 if date1 = date2 if shift1 = shift2 sheets("sheet7").activate range("c" & j, "f" & j).select selection.copy sheets("sheet8").activate

Delphi - Adding BCC & CC Recipients to OLE Outlook object -

the answer post " how working outlook in delphi different other email clients? works great. see below. using example how go adding cc , bcc recipients? uses olectrls, comobj; procedure tform1.button1click(sender: tobject); const olmailitem = 0; var outlook: olevariant; mailitem: variant; mailinspector : variant; stringlist : tstringlist; begin try outlook:=getactiveoleobject('outlook.application') ; except outlook:=createoleobject('outlook.application') ; end; try stringlist := tstringlist.create; mailitem := outlook.createitem(olmailitem) ; mailitem.subject := 'subject here'; mailitem.recipients.add('someone@yahoo.com'); mailitem.attachments.add('c:\boot.ini'); stringlist := tstringlist.create; stringlist.add('body here'); mailitem.body := stringlist.text; mailinspector := mailitem.getinspector; mailinspector.display(true); //true means modal outlook := u

ajax - p:selectOneRadio does not work the first time -

i have problem selectoneradio id="idesito" of code. in fact first time click on it, java method specified listener attribute not called, instead successive times called correctly <h:form id="switchform"> <pf:panelgrid id="srinfopanel" styleclass="gridnoborder centered" style="width:100%;" rendered="#{switchufficioservice.selectedsub != null}"> <pf:row> <pf:column colspan="10" styleclass="fondogreendark"> <pf:outputlabel id="titoloriepilogo" styleclass="captionmaschera" value="riepilogo dati switch" /> </pf:column> </pf:row> <pf:row> <pf:column> <pf:panelgrid id="infocedpanel" styleclass="gridnoborder centered" style="width:100%;"> <pf:row>

python - Flask sqlalchemy update limit -

i try execute update query limit in flask, using flask-sqlalchemy (not sqlalchemy!). db.session.query(itemobject).filter_by(owner_type=0,item_id=item_id.decode('hex')).update({'owner_type': '1'}) when try ".limit(1)" or "update({'owner_type': '1'}, mysql_limit=1)" geting error attributeerror: 'long' object has no attribute 'limit' or typeerror: update() got unexpected keyword argument 'mysql_limit' how can make query without using execute()? for first error, sounds you're trying call limit() after calling update(). db.session.query(itemobject).filter_by(owner_type=0,item_id=item_id.decode('hex')).update({'owner_type': '1'}) this line returns long because update() returns number of rows matched (not modified!). can't chain limit after update. you also can't call limit on query update , wouldn't work anyways. that's mysql thing

google maps - Inconsistent administrative_area_level_1 geocode for same city (accented) -

my simple app has been working quite until client reported bug mentioned in title. google return sometime accent-removed result : { "long_name" : "hanoi", "short_name" : "hanoi", "types" : [ "administrative_area_level_1", "political" ] } and accented one: { "long_name" : "hà nội", "short_name" : "hà nội", "types" : [ "administrative_area_level_1", "political" ] } i have tried applying api key (with language = french) no luck. as result, logic group address city , district failed! btw, guys have hints automatically group address district, city, country using data google geocode or other provider thank you if want french language of resulting data have mention in language parameter of request. however, group addresses district city , count

c# - Deserializing Settings Stored As JSON In CRM Web Resource -

i've added configuration data json in web resource in crm. when attempt deserialize in c# plugin have first decode base 64 string, , have encode utf bytes. i've done before outside of crm , haven't had issue, crm threw me loop when json wasn't deserializing due argument exception "invalid json primitive: ." i figured out crm includes utf preamble , isn't valid json have remove it. below current solution, have thought there standard way encode (or decode) bytes check see preamble was, , correctly apply correct encoding , return result without preamble. private static settings deserialize(webresource value) { if (value == null) { throw new argumentnullexception("value"); } // default, content stored in base64string utf preamble. var content = encoding.utf8.getstring(convert.frombase64string(value.content)); var preamble = encoding.utf8.getstring(encoding.utf8.getpreamble()); if (content.startswith(p

ios - Set a button as an image in SpriteKit -

i have uibutton restart button game within spritekit , i'd make image. have declared button as: var ratebtn: uibutton! here's current code button: restartbtn = uibutton(frame: cgrect(x: 0, y: 0, width: view!.frame.size.width / 3, height: view!.frame.size.height / 3)) restartbtn.center = cgpointmake(view!.frame.size.width / 2, view!.frame.size.height) restartbtn.settitle("restart", forstate: uicontrolstate.normal) restartbtn.settitlecolor(uicolor.whitecolor(), forstate: uicontrolstate.normal) restartbtn.addtarget(self, action: selector("restart"), forcontrolevents: uicontrolevents.touchupinside) self.view?.addsubview(restartbtn) uiview.animatewithduration(1.0, delay: 0, usingspringwithdamping: 1.0, initialspringvelocity: 1.0, options: nil, animations: ({ self.restartbtn.center.y = self.view!.frame.size.height / 1.4 }), completion: nil) so have set out spring effect want image instead of font. how do this? make button skspritenode.

c# - How to send html in email with image(base 64 string ) to Outlook, gmail etc -

i have create html image(base 64 string ) sending mail. on outlook doesnt show image , not support html. what do, please me. thanks kamlesh this may answer you're looking - how create email embedded images compatible mail clients note images embedded using <img src="cid:....">

jQuery click event handler not firing -

i had more robust page, jquery not firing , have no idea why! in both firefox , chrome, there's nothing showing in console. please me see fried brain cannot see: <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <script language="text/javascript"> $(document).ready(function() { console.log("ready!"); $("#launch_windows").click(function(){ console.log('launching'); }); }); </script> </head> <body> <input type="button" id="launch_windows" value="launch" /> </body> </html> the language attribute deprecated based on mdn doc . language  type attribute, attribute identifies scripting language in use. u

php - transferring a variable through different web pages in wordpress -

currently i'm building plug-in wordpress, have couple of webpages tables, filled data database. right i'm working on part click on number (memberid) should redirect page, having information table regarding number. i've tried transfering data through url, both ?memberid=".$item->memberid." and /memberid="$item->memberid." , everytime try alter url, webpages can't seem find anymore. i'm sure has whith part of code: add_submenu_page( null , 'manage memberdetails' , 'memberdetails' , 'manage_options', 'memberdetails' , 'memberdetails_list' ); where fifth value sets url page be http://localhost/wordpress/wp-admin/admin.php?page=memberdetails so whenever try add behind url, doesn't acknowledge existance of said page anymore, resulting in redirection error. is there way transfer variable without using url, or there way give more of dynamic url?

java - TomCat server configuration not appearing in Intelliji -

Image
im trying set remote debugging in tom cat server have running. problem have when try edit run configuration tomcat server not option in intelliji. here images demo issue: update: after creating debug configuration im getting following error: i checked first line of running servers log statment , showed running on 8081: listening transport dt_socket @ address: 8081 here intelliji debug configuration: add usual remote debug configuration shown below (you should specify port). , suppose run tomcat in jpda mode. edit: for enable jpda debugger run tomcat command below: catalina.sh jpda run or catalina.sh jpda start you can check port number in catalina.sh, example tomcat 7.0.27 if [ "$1" = "jpda" ] ; if [ -z "$jpda_transport" ]; jpda_transport="dt_socket" fi if [ -z "$jpda_address" ]; jpda_address="8000" fi if [ -z "$jpda_suspend" ]; jpda_suspend="n"

Connect via Bluetooth with Delphi XE7 using portable printer -

i'm trying communicate sewoo lk-p32 printer via bluetooth. using delphi xe7 . made few examples come delphi , not having success. put paired printer in tablet , not able print continuously. when print have restart application, can print again. below sources. could me? support on issue? time short try other technologies. method initiates communication printer procedure tform2.buttonclickstart(sender: tobject); var msg, texto: string; i, b: integer; bluetoothadapter: tbluetoothadapter; listadeaparelhospareados: tbluetoothdevicelist; lservices: tbluetoothservicelist; begin try memo1.lines.add('ponto 1'); fbluetoothmanager := tbluetoothmanager.current; if fbluetoothmanager = nil memo1.lines.add('fbluetoothmanager esta nulo'); memo1.lines.add('ponto 2'); bluetoothadapter := fbluetoothmanager.currentadapter; if bluetoothadapter = nil memo1.lines.add('bluetoothadapter esta nulo'); listadeapare

java - JBoss AS 7.1 ERROR: JBREM000200: Remote connection failed: -

i have 2 projects, 1 si running on server (jboss 7.1) , other 1 should client, can communicate server. both on same machine. picture of eclipse workspace here code class main.java in client project. import javax.naming.context; import javax.naming.initialcontext; import javax.naming.namingexception; public class main { public static void main(string[] args) { calculetteservice calculette = null; try { context context = new initialcontext(); calculette = (calculetteservice) context.lookup("ejb:/analyzator-server//calculetteserviceimpl!calculetteservice"); system.out.println("vysledok je: " + calculette.add(10, 10)); } catch (namingexception e) { e.printstacktrace(); } } public main() { super(); } } after trying run error: apr 29, 2015 4:26:12 pm org.xnio.xnio <clinit> info: xnio version 3.0.3.ga apr 29, 2015 4:26:12 pm org.xnio.nio.nioxni

sorting - How to sort ArrayList alphabetically in Java without using collections? -

this question exact duplicate of: how can sort arraylist without using collections.sort()? [duplicate] 1 answer i have following code takes names , stores them in arraylist. class main{ public static void main(string[] args) { arraylist<string> names = new arraylist<string>(); scanner scan = new scanner(system.in); string name; do{ system.out.println("enter next name: "); name = scan.nextline(); string touppercase = titlecase(name); if(!touppercase.equals("stop")){ names.add(touppercase); } } while(!name.equalsignorecase("stop")); system.out.println(names); } public static string titlecase(string s){ string output = s.substring(0, 1).touppercase() + s.substring(1).tolowercase(); return output; } } i need sort arraylist alphabetically na

java - JAXB Marshall XML Profile Filter -

i have need marshall object xml using jaxb. the marshall / unmarshall code works fine, want filter resulting xml based on annotation. xmlprofile.java @retention (runtime) @target({type, method, field}) public @interface xmlprofile { string[] value(); } foopojo.java @xmlrootelement @xmlaccessortype(xmlaccesstype.field) public class foopojo { @xmlelement @xmlprofile("config") public string bar; @xmlelement @xmlprofile("operational") public string bartender; @xmlelement @xmlprofile({"config", "operational"}) public string spy; } i read jaxb documentation, have not found examples / topics on how inject code marshall process, different adapter or eventhandlers. in particular read event handlers, found support of before marshal / after marshal events. i expected found beforefieldmarshal event not possible, figured write piece of code scans current entity , set null properties not matching

How to save a BOOL in iOS app -

i used following code save bool it's not working. [[nsuserdefaults standarduserdefaults] setbool:yes forkey:@"save"]; strongman = [[nsuserdefaults standarduserdefaults] boolforkey:@"save"]; are there other ways save bool ? you should add following code [[nsuserdefaults standarduserdefaults] synchronize];

angularjs - Show Post with its comments using ng-repeat not working -

i facing issue in building below format in mvc using angularjs showing posts facebook using api ng-repeat consists of image. now problem facing show comments each of posts using nested ng-repeat. dont have idea how proceed it. ng-repeat nested sample http://plnkr.co/edit/ngwoz4?p=info i think need that? <body ng-controller="programcontroller"> <div class="panel-group" ng-repeat="row in osk.programs"> <div>{{row.day}}</div> <div> <h4>{{row.head}}</h4> <p>{{row.content}}</p> <aside class="warning" ng-repeat="row in row.extra"> <strong>ekstra gezi:</strong> {{row.exhead}} &nbsp; <span>{{row.price}}</span> <p>{{row.excontent}}</p> </aside> </div> </div> </body> var myapp = angular.module('myapp', []); myapp.controller('pr

C++ reading binary data to struct -

i reading binary file know structure of , trying place struct when come read off binary file finding when prints out struc individually seems come out right on fourth read seems add onto last member last read. here code make's more sense how explaining it: struc #pragma pack(push, r1, 1) struct header { char headers[13]; unsigned int number; char date[19]; char fws[16]; char collectversion[12]; unsigned int seiral; char gain[12]; char padding[16]; }; main header head; int index = 0; fstream data; data.open(argv[1], ios::in | ios::binary); if(data.fail()) { cout << "unable open data file!!!" << endl; cout << "it looks has deleted file!"<<endl<<endl<<endl; return 0; } //check size of head cout << "size:" << endl; cout << sizeof(head) << endl; data.seekg(0,std::ios::beg); data.read( (char*)(&

jasper reports - Subreports dependancy -

is there way show 1 subreport if other subreport doesn't have rows (doesn't return rows). what have tried: in first subreport returned number of processed rows "report_count" master report variable "subreport_var". variable "subreport_var" works should. added additional text field master report , output variable it. set evaluation time of text field band , without doesn't work correctly. further set option "print when expression" of second subreport to: $v{subbreport_var} < 1 i use jasper studio 5.5.0 final. if there no row count wouldn't result null. if you use in print when expression in second subreport: $v{subbreport_var}==null another option run query in main report , use subreport expression : if($f{some_var_from_your_query}==null,subreport2.jasper,subreport1.jasper this prints subreport2 when some_var_from_your_query returns null if not prints subreport1.

Need suggesstion for IOS app review guideline for Paypal IOS SDK -

do need give credential of paypal account while submitting application apple store? if yes, kind of information , information? is there documentation apple side? i dealing physical goods means buy them using paypal ios sdk. any great. in advance.

javascript - Jquery: draggable item not bringing to front -

i have html markup: <body> ... <div id="maincontainer"> <div id="somediv">...</div> <div id="content">...</div> </div> ... </body> and have partial html page markup this: @foreach(var item in model.items) { } this partial page loading main page div id="content". using jquery: ajax.partial( url.action("action", "controller"), {}, function (data) { $('#content').html(data); makedraggable(); }, function () { alert('error!'); } ); i using asp.net mvc, , controller has action returns needed data in model. method makedraggable() makes "a" items have class "m-item" draggable: makedraggable() {

Raw pdf color conversion (with known conversion formula) from RGB to CMYK -

this question related to script (or other means) convert rgb cmyk in pdf? however way more specific. consider not expert in print production ;) situation: printing allowed use 2 colors, cyan , black. printery requests final pdf in devicecmyk channels c , k used. pdflatex automatically (with xcolor package) fonts , drawn objects, have more 100 sketches/figures in pdf format embedded in manuscript. due admittedly badly designed workflow (late realization inkscape cannot export cmyk pdfs), these figures created in inkscape, , rgb pdfs. however, used colors within inkscape rgb complements of cmy(k), e.g. 100% cyan (0,255,255) rgb , 50% k (127,127,127) etc. problem: need convert these pdf figures rgb devicecmyk (or alternatively whole pdf of final manuscript) specific conversion formula. i did lot of google research , tried suggested ways of using e.g. ghostscript or various print production tools in adobe acrobat, of conversion techniques found far wanted use icc co

hadoop - Charset, Accents, Special Characters in Apache Hive -

the problem i’m having quite problems hive tables contain special characters (in french) in of row values. basically, special character (like accent on letter or other diacritics) gets transformed in pure gibberish (various weird symbols) when querying data (via hive cli or other methods). problem not column names, actual row values , content. for exemple, instead of printing "variat°" or other special character or accent mark, result (when using select statement): variat� cancel infos & conf the hive table external, csv file in hdfs encoded in charset iso-8859-1. changing original file encoding charset doesn’t produce better result. i'm using hortonworks distribution 2.2 on redhat enterprise 6. original csv displays correctly in linux. the question i've looked on web similar problems seem no 1 encountered it. or @ least uses english when using hive :) jiras have addressed issues special characters in hive table column names - problem actual

java - Connecting to remote HIVE server -

i trying connect remote hive server. have following maven java code : private static string drivername = "org.apache.hadoop.hive.jdbc.hivedriver"; public static void main(string[] args) throws sqlexception { try { // register driver , create driver instance class.forname(drivername); } catch (classnotfoundexception ex) { logger.getlogger(forhive.class.getname()).log(level.severe, null, ex); } // connection system.out.println("before trying connect"); connection con = drivermanager.getconnection("jdbc:hive://<hostip>:10000/", "hive", ""); system.out.println("connected"); // create statement statement stmt = con.createstatement(); // execute statement stmt.executequery("create table if not exists " +" consultant ( eid int, name string, " +" salary string, destignation string)" +" comment ‘employ

SQL, How to loop for a date list using each as parameter for an Procedure? -

i have procedure receives specific date parameter ie exec procdb '20150428' frequently need run procedure many dates , retype exec procdb 'date1' go exec procdb 'date2'go ..... think it's not smart, so i can valid list of dates using select distinct [dates] table1 order [dates] . so want create new procedure receives start_dt , end_dt , loops dates select distinct returns between including start_dt , end_dt. ie like: create procdblist start_dt date, end_dt date each date in: select distinct [date] [table1] [date] >= @start_dt , [date] <= @end_dt do: exec procdb 'date n' end updated: final solution: create procedure [dbo].[processdbrange] (@start_dt varchar(15) =null, @end_dt varchar(15) =null) begin declare @date varchar(15) declare cursor_processdb cursor select distinct convert(varchar(15), [date], 112) [date] [prices] [date] >= @start_dt , [date] <= @end_dt order [date] open cursor_processdb fet

android - Unit testing using Eclipse - JUNIT -

i wrote android application uses gps mainly, using eclipse. i want junit test application. what best way specifying multiple values unit tests? in each test should use 1 of many available asserts http://junit.org/apidocs/org/junit/assert.html check whether value returned tested method correct one. while testing method can pass parameters need it. for instance assertequals("ok",myobj.methodundertest(param1,param2,param3));

statistics - What is causing my R script to return longer object length is not a multiple of shorter object length? -

here code: production<-function(alpha1,alpha2,beta1,beta2,d1,d2){ alpha3=1-alpha1-alpha2 beta3=1-beta1-beta2 observation.1 <- c(p.path1=alpha1, p.path2=alpha1*alpha2, p.path3=alpha2, p.path4=alpha3,p.path5=alpha1, p.path6=alpha1*alpha2) revenue.1 <- c(c.path1=d1+d2,c.path2=d2,c.path3=d1,c.path4=d2+d1+d1,c.path5=d1+d2,c.path6=0) observation.2 <-c(p.path7=beta2,p.path8=beta1, p.path9=beta1*beta2,p.path10=beta3*beta1,p.path11=beta2,p.path12=beta1) revenue.2<- c(c.path7=d1+d1,c.path8=d2,c.path9=d2*2,c.path10=d1+d2,c.path11=d1+d1,c.path12=0) production1=sum(revenue.1*observation.1) production2=sum(revenue.2*observation.2) outcomes<-c(meancostproduction1 = production1, meancostproduction2=production2) } results<-production(alpha1=0.1,alpha2=0.9,beta1=0.33,beta2=0.67,d1=0.4,d2=0.6) print(results) #new values sample of parameters alpha1<-rbeta(12,1.5 , 0.5+ 80-42) alpha2<-rbeta(12,21.5 , 0.5+ 80-21) beta1<-rbeta(12, 33.5 , 0.5+ 92-33) beta2<-