Posts

Showing posts from June, 2012

vb.net - Reparent controls from a .NET form to VB6 -

good morning. i've got interop .net form can create , show inside vb6 project. now, open form in "mdi mode". i've got control allows me achieve result. unfortunatly seems work standard vb6 forms. so, test try copy content of .net form inside vb6 one... have suggestion on how deal situation? thank you! the way doing asking trouble - it's bit hacky. better use supported mechanisms far possible. you better off if create .net usercontrol gui want display, , make com visible. can instantiate control in vb6 form, support way mdi supported in vb6.

entity framework - ASP.NET MVC - user authorize in controller -

i have table in database names of users (with domains, example: domain1\user1). project has windows authentication. have 2 controllers - 1 logged in users , second specific user. table has 3 columns: (id, name, extra), "extra" fill user, admin (it has varchar: "admin"). want create such authorization, admin have access site second controller. how write it? for suggestions appreciate. in advance help. ;) monic ====edit==== example: asp.net mvc 4 custom authorize attribute permission codes (without roles) in main controller: [authorizeuser(accesslevel = "extra")] public class securecontroller : controller { (...) } public class authorizeuserattribute : authorizeattribute { public string accesslevel { get; set; } private report_dbent ren = new report_dbent(); protected override bool authorizecore(httpcontextbase httpcontext) { var isauthorized = base.authorizecore(httpcontext); if (!isauthorize...

c# - Are interfaces data types? -

i viewing tuts+ video titled design patterns in c# . in it, instructor says: "interfaces contracts. they data types define properties , methods have implement within class." my question: correct, is, interfaces data types in c#? from the c# programming guide : c# strongly-typed language. every variable , constant has type, every expression evaluates value. every method signature specifies type each input parameter , return value. (...) you use struct, class, interface, , enum constructs create own custom types. so yes, interfaces considered first class types in .net world. anyway find term "data type" confusing in context, think saying "type" more correct.

.htaccess file is not getting post method in php -

i using simple .htaccess file rest service implementation options +followsymlinks rewriteengine on rewriterule ^([a-za-z_-]*)$ get_price.php?name=$1 [nc,qsa] currently working fine $_get method , returning { status: 200 status_message: "record found" data: "kashif@gmail.com" } but pass parameter using $_post returns { status: 200 status_message: "record found" data: "" } any idea doing mistake. not expert in .htaccess files. below simple testing class get_price.php. <?php header("content-type:application/json"); include 'header.php'; $name = $_request['name']; $friendresult = mysqli_query($con,"select id user name='$name'"); $row = mysqli_fetch_array($friendresult); $data = $row['id']; deliver_response(200,"record found",$data); function deliver_response($status,$status_message,$data){ header("http/1.1 $status $stat...

Can I read XML Attributes dynamically in WPF C# -

hi have 1 big concern reading xml attributes like <xmlnode attribute1="somevalue1" attribute2="somevalue2" attribute3="somevalue3"> can read attribiute1, attribute2 or attribute3 dynamically? know can read attribute values nd.attributes["attribiute1"].value . how read "attribute1" dynamically? var xml = xelement.parse(@"your xml"); foreach (var attr in xml.attributes()) { } this not specific wpf, works wherever have access linq xml provider

Configuration parameters in web application (Java+Spring+Hibernate+Tapestry) -

i'm developing web application , need save 100 configuration parameters. best solution?: make xml file , parse read configuration. make table in database, , consult read configuration. another better solution? thanks. what done in case configuration parameters stored in properties files loaded spring. in event have parameters can changed during execution of application, simple way approach problem save them in database

python - How to generate group based columns faster? -

i'd create column dataframe based on anther column. example, have dataframe this: content date id bob birthday 2010.03.01 bob school 2010.04.01 tom shopping 2010.02.01 tom work 2010.09.01 tom holiday 2010.10.01 i want generate column equals size of id , resulting dataframe looks this: content date size id bob birthday 2010.03.01 2 bob school 2010.04.01 2 tom shopping 2010.02.01 3 tom work 2010.09.01 3 tom holiday 2010.10.01 3 the standard way seems use groupby , transform . code work: df['size'] = df['date'].groupby(df.index).transform(np.size) the problem is, transform works slow. in dataframe 40k rows, above code takes more 10 sec on pc. regularly work on datasets larger 1 million rows , generating group-based variables frequent practice. the problem lies transform . example, if generate cumcount on same dataframe u...

Android: Broadcastreceiver with Achartengine ,don't display updates -

i'm trying display information got wifi scan broadcast receiver ,into bar chart using achartengine. want have real time chart ,every time receive data onreceive() method ,i update chart. achaeive ,i create chart objects in onreceive() method .but chart first result ,there no update ,although can see changes on wifi scan. know problem. this code i'm using: public class wifichartsrealtime extends activity { linearlayout layout; list<int[]> values = new arraylist<int[]>(); //list<scanresult> classobject = new arraylist<scanresult>(); int [ ] [ ] center_frequency_2 = { { 1,2,3,4,5,6,7,8,9,10,11,12,13,14 }, { 2412, 2417, 2422, 2427, 2432,2437,2442,2447,2452 ,2457,2462,2467,2472,2484}, }; wifimanager wifi; button enab; string resultsstring ; string[] mystringarray; int aa = 10; public class receiver extends broadcastreceiver{ @override public void onreceive(context context, intent intent) { int length ; ...

xamarin.ios - Failed to create view from XIB UI using Xamarin and MvvmCross -

Image
i'm have xamarin.ios app. written time ago , used xib define user interface. want add new view (and controller it) every time i'm adding new page , launching app following error: failed marshal objective-c object 0x17a37a70 (type: loginview). not find existing managed instance object, nor possible create new managed instance (because type 'touch.loginview' not have constructor takes 1 intptr argument). additional information: selector: viewdidload method: touch.loginview:viewdidload () what more interesting if i'm creating new view copying existing 1 , renaming - works fine. tried figure out difference thing found following: if noticed level of hierarchy added. level , why app continue fail newly created view (i have copy existing 1 if want new view). this kind of error message can real pain normally. in case, you're pretty lucky there simple fix this. when working xib or storyboard files, want have following in controllers: public...

amazon ec2 - Continuous deployment & AWS autoscaling using Ansible (+Docker ?) -

my organization's website django app running on front end webservers + few background processing servers in aws. we're using ansible both : system configuration (from bare os image) frequent manually-triggered code deployments. the same ansible playbook able provision either local vagrant dev vm, or production ec2 instance scratch. we want implement autoscaling in ec2, , requires changes towards "treat servers cattle, not pets" philosophy. the first prerequisite move statically managed ansible inventory dynamic, ec2 api-based one, done. the next big question how deploy in new world throwaway instances come & down in middle of night. options can think of : bake new fully-deployed ami each deploy , create new launch config , update group that. sounds very, cumbersome, reliable because of clean slate approach, , ensure system changes code requires here. also, no additional steps needed on instance bootup, & running more quickly. use base a...

scala - Dynamic ElasticSearch mapping using Elastic4s -

i have document want index on elasticsearch, document contains dynamic keys can not know in advance, "spanish" or "french" in following example "contents": { "title": { "spanish": "hola amigos", "french" : "bonjour les amis" } } i'm using elastic4s dsl in order make mapping ( via createindex dsl ), can not find how create, library, dynamic mapping based on "match" option ( suggested here ), in order specify different analyzer each language stored under path contents.title. any track please ? :-) you can't want in elastic4s scala api @ moment. can create dynamic template in java api , use scala api rest of calls. the dynamic template can set use regex , apply mapping. since know countries in advance (there's ~200) why not spend time , make mapping?

JSON support in wso2 Web Services Framework for C++ -

i looking open source c++ restful web services framework , came across wso2 c++ framework. product features( http://wso2.com/products/web-services-framework/cpp/ ) shows support json, unable find sample example on this. does 1 able consume or deploy web services using wso2 c++ ws framework json? let me know if know open source c++ restful web services framework json support. thanks in advance. maybe link can solve problems http://www.mikesknowledgebase.com/pages/services/webservices.htm

push notification - No device yet in pushbots -

i new pushbots , have done push notification given in tutorial, when click on dashboard , push display alert box messaged "no devices yet" not getting how add device while have installed apps in android mobile. please me out... i had same problem, , made sure more once right tried uninstall app , install again taking instance myapplication in mainactivity public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); new myapplication(); } } and worked me, when tried again delete instance , delete uninstall app still registered on pushbots website!!

java - JDialog - Add and arrange buttons -

i have code add 9 buttons, want them appear in 3 different lanes (3 buttons each row) not know how to, suggestions? ... jpanel buttonpane = new jpanel(); //jbutton1 jbutton jbutton1 = new jbutton("ok"); jbutton1.settext("package 1"); jbutton1.addactionlistener(new java.awt.event.actionlistener() { @override public void actionperformed(java.awt.event.actionevent evt) { jbutton1actionperformed(evt); } }); buttonpane.add(jbutton1); //jbutton2 jbutton jbutton2 = new jbutton("ok"); jbutton2.settext("package 2"); jbutton2.addactionlistener(new java.awt.event.actionlistener() { @override public void actionperformed(java.awt.event.actionevent evt) { jbutton2actionperformed(evt); } }); buttonpane.add(jbutton2); //jbutton3 ... you need use gridlayout layout manager. for example: buttonpane.setlayout(new gridlayout(rows, cols)); read more bout gridlayout .

c# - Dynamic Routing in asp.net webforms -

can add dynamically routes global.asax file suppose if have multiple routes same page example http://website.com/about http://website.com/en/about http://website.com/en/about-us while actual url page http://website.com/en/about-us . my question is: there way can dynamically define these routes in global.asax file in such way reads url entered users http://website.com/about , compares database table , redirects correct page http://website.com/en/about-us ? taking consideration following table structure: id url_name url actual_url page_handler 1 home http://website.com/ http://website.com/ default.aspx 2 http://website.com/about http://website.com/en/about-us about.aspx 3 http://website.com/about-us http://website.com/en/about-us about.aspx 4 http://website.com/en/about http://website.com/en/about...

javascript - jQuery - Can not select first option on last optgroup -

i have small problem. need select option <select> a, triggered action , select first <option> in <select> b value selected <option> a. works fine, can't select last optgroup , option. try @ jsfiddle this bug seems on firefox (linux, win7). google chrome ok. ideas? code (html): <select id="charset" name="charset"> <option value=""></option> <option value="armscii8">armscii-8 armenian</option> <option value="ascii">us ascii</option> <option selected="selected" value="utf8">utf-8 unicode</option> </select> <select id="collation" name="collation"> <optgroup label="armscii8"> <option value="armscii8_bin">armscii8_bin</option> <option value="armscii8_general_ci">armscii8_general_ci</option> <...

jquery - Does XmlHTTPRequest/AJAX request on Asp.net MVC controller update session timeout -

scenario we have auto logout feature activates timeout window after 4 minutes or so. timeout value retrieved formsauthentication element of authentication configuration in web.config file. e.g.: <authentication mode="forms"> <forms loginurl="~/account/login" timeout="5" /> </authentication> the javascript code has timer fires every second checking see if: there's been no activity user (mouse clicks or mouse move) and, if there hasn't, checks see if 5 minutes (or rather 4 minutes 30 seconds) has elapsed. if has then, it shows popup counting down 30 seconds lets user either click continue stop auto logout or if left untouched automatically logs user out , redirects them login page. here's example of code runs on client side extend session: $.ajax({ type: "get", url: alchemy.rootpath + "account/timeoutextend" }); the controller action being called nothing: public actionresul...

hibernate - connecting to PostgreSQL from OSGi application deployed in Karaf container -

i'm using hibernate connect postgresql karaf 2.3.4 container, when deploy bundle there exception saying javax.naming.namenotfoundexception osgi:service/javax.sql.datasource/"(osgi.jndi.service.name=jdbc/postgresds). here persistance.xml file <?xml version="1.0" encoding="utf-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" version="1.0"> <persistence-unit name="hibernateosgi_containermanaged" transaction-type="jta"> <jta-data-source>osgi:service/javax.sql.datasource/(osgi.jndi.service.name=jdbc/postgresds)</jta-data-source> <class>org.hibernate.osgitest.entity.datapoint</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> <properties> <property name="hibernate.dialect" value="org.hib...

mysql - Is it best idea to have a table with all column type as "Text" -

i new web application developing.i using php+mysql . wanted check best , safe way create db schema. having table 15 column 1st column unique id , remaining type of "text" , planning put approx 1-20kb data in each column. so or bad or should not that. please me on same. i using engine type myisam . the best idea depends on you're using for. varchar faster when size reasonable , dependent on hardware , data using. should aways try store text format messages text whereas string attributes varchar. text columns not stored in memory , have read disk, slower. check reference also check blob storage in innodb

objective c - Show items cells vertically in collection view iOS -

it's first time using collectionview. cells presented c1,c2,c3. want c1 c2 c3 instead. there property position of cell or something. looks silly 1 couldn't figure out. pls help. you can change layout uicollectionviewflowlayout *layout; layout = [[uicollectionviewflowlayout alloc] init]; layout.minimuminteritemspacing = 10; layout.minimumlinespacing = 10; layout.itemsize = cgsizemake(cgrectgetwidth(self.collectionview.frame), 60); layout.sectioninset = uiedgeinsetsmake(30, 0, 10, 10); [collectionview setcollectionviewlayout:layout animated:no];`

mysql - how to sort varchar numeric columns? -

this question has answer here: natural sort in mysql 19 answers i write ... order by column asc column varchar , sorts wrong i want sorting numeric value datatype varchar how value this 1.2.840.113619.2.55.3.163578213.42.1355218116.691.1 1.2.840.113619.2.55.3.163578213.42.1355218116.691.10 1.2.840.113619.2.55.3.163578213.42.1355218116.691.100 1.2.840.113619.2.55.3.163578213.42.1355218116.691.101 1.2.840.113619.2.55.3.163578213.42.1355218116.691.2 1.2.840.113619.2.55.3.163578213.42.1355218116.691.20 but want in sequence last 1.2.840.113619.2.55.3.163578213.42.1355218116.691.1 1.2.840.113619.2.55.3.163578213.42.1355218116.691.2 1.2.840.113619.2.55.3.163578213.42.1355218116.691.10 1.2.840.113619.2.55.3.163578213.42.1355218116.691.20 1.2.840.113619.2.55.3.163578213.42.1355218116.691.100 1.2.840.113619.2.55.3.163578213.42.1355218116.691.101 and have string th...

android - Unable to execute dex: Multiple dex files define Landroid/support/v4/accessibilityservice -

i getting error in sherlock while executing. have tried many things, removed bin folder, build project again, clean project , many more. none of them working. please me this. console : unable execute dex: multiple dex files define landroid/support/v4/accessibilityservice/accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl; [2014-04-14 16:26:12 - navigation-drawer-page-sliding-tab-strip] conversion dalvik format failed: unable execute dex: multiple dex files define landroid/support/v4/accessibilityservice/accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl; error log : null error mon apr 14 16:26:12 ist 2014 unable execute dex: multiple dex files define landroid/support/v4/accessibilityservice/accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl; com.android.dex.dexexception: multiple dex files define landroid/support/v4/accessibilityservice/accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl; @ com.android...

jquery - How to position a div relative to img without a parent div wrapping the img -

i writing little jqueryplugin preloading images statusbar each image. the statusbar should centered horizontally , vertically above each image. as should plugin don't want user need wrap each image relative positioned div in order position div relative img. using cms user might not able change way image being output. so don't want this: <div style="position: relative"> <img src="" /> <div style="position: absolute, ...">100% loaded</div> </div> what want is: <img src="" /> <div style="position: absolute, ...">100% loaded</div> i tried place div right behind image jquery, setting position relative , place div right inside div positioned absolute. might work cases, depends on css of img... floated or not etc. does css- or jquery-guru got suggestions me? :-) cheers this wrap img s , remove wrapper when images loaded. $('img').each(funct...

android - sherlockactionbar 4.4.0 error -

good day! connect sherlockactionbar 4.4.0 in eclipse. according instructions, , error: [2014-04-14 15:10:40 - example] c: \ workspace \ appcompat_v7 \ res \ values ​​\ attrs.xml: 32: error: attribute "windowactionbar" has been defined [2014-04-14 15:10:40 - example] c: \ workspace \ appcompat_v7 \ res \ values ​​\ attrs.xml: 33: error: attribute "windowactionbaroverlay" has been defined [2014-04-14 15:10:40 - example] c: \ workspace \ appcompat_v7 \ res \ values ​​\ attrs.xml: 34: error: attribute "windowsplitactionbar" has been defined [2014-04-14 15:10:40 - example] c: \ workspace \ appcompat_v7 \ res \ values ​​\ attrs.xml: 45: error: attribute "actionbartabstyle" has been defined ... http://i.stack.imgur.com/hp4tu.jpg please help! first of : c: \ workspace \ appcompat_v7 \ res \ values ​​\ attrs.xml: 32: error: attribute "windowactionbar" has been defined means resource has been defined . given path in err...

Ruby each do loop 'n' number of times -

hi i'm having trouble below loop in .erb view <% my_list.each | list | %> .. loop stuff..... <% end %. this works fine looping through list, want loop through first 4 items in 'my_list' , not whole list. tried things like: <% my_list.each | product | 3.times %> but didn't seem work think ruby knowledge limited least! take first 4 element my_list array#first : <% my_list.first(4).each | product | %> use array#each_slice slice array <% my_list.each_slice(4) | products | %> <% products.each | product | %>

php - Showing current user in log -

i'm trying create custom monolog processor attach current user error mailer. when declaring service so: monolog.processor.mail: class: myvendor\monolog\processor\mailprocessor arguments: - @mailer - @security.context tags: - { name: monolog.processor, method: processrecord } i circular reference: [symfony\component\dependencyinjection\exception\servicecircularreferenceexception] circular reference detected service "monolog.processor.mail", path: "router -> monolog.logger.router -> monolog.processor.mail -> security.context -> security.authentication.manager -> fos_user.user_provider.username_email-> fos_user.user_manager -> doctrine.orm.default_entity_manager -> doctrine.dbal.default_connection -> doctrine.dbal.logger -> monolog.logger.doctrine". what best practice solution here? a related forum thread: http://forum.symfony-project.org/viewtopic.php?t=40306...

javascript - Is there a way to declare functions in constructor? -

first of all, recognize there 100+ threads on method.this vs var method, etc. not asking. know differences. confused of function expressions vs function declarations in context of creating objects using constructor. what wanted know this: how come function declarations never appear in constructors, function expressions do? whenever declare function rather use expression not accessible in object once initiated; why this? i think because either local (aka private) , inaccessible, or when creating objects, if constructor not see function prefixed 'this', 'var', or 'constructor.prototype', skips it. how come function declarations never appear in constructors, function expressions do? they do whenever declare function rather use expression not accessible in object once initiated; why this? you must doing wrong. function thing() { function go() { alert('hello'); } this.foo = 1; this.bar = function () { ...

python - How to merge item in list -

i have problem list in python. when print "list" have results: [1,2,3] [4,5,6] so have 2 lists in 1 variable guess. how can merge items 1 variable ? try , >>> [[1, 2, 3], [4, 5, 6]] >>> result=[] >>> in a: result+=i >>> result [1, 2, 3, 4, 5, 6] >>> or >>> [[1, 2, 3], [4, 5, 6]] >>> sum(a, []) output: [1, 2, 3, 4, 5, 6] or >>> a1 [1, 2, 3] >>> a2 [4, 5, 6] >>> [item item in itertools.chain(a1, a2)] output: [1, 2, 3, 4, 5, 6]

Storing huge number of records in hibernate -

i have list more 50k entities attached it. have store each entity row in db . to store them i'm traversing list , calling below function each node public serializable create(t entity) throws mycustomexc{ serializable serializable = null; try{ session session = gethibernatesession(); session.save(entity); }catch(hibernateexception e){ throw new mycustomexc("error...."+entity,e); } return serializable; } the issue i'm getting error this jdbcexception e org.hibernate.util.jdbcexceptionreporter logexceptions db2 sql error: sqlcode=-964, sqlstate=57011, sqlerrmc=null, driver=3.62.56 which means "running out of space in transaction log." now, can't change of transaction log properties. in hibernate autocommit property false. what issue here?? should change "session.save(entity)" "session.persist(entity)". let me know if other info needed.

openoffice.org - dealing with .doc file in python and getting a limited list of character -

i know .doc files not directly read in python. thus, when read in python using os.open() , os.read() following result no matter how long actual document is, want know these characters are? b'\xd0\xcf\x11\xe0\xa1\xb1' it signature of olecf file: http://www.forensicswiki.org/wiki/ole_compound_file#file_signature the olecf used store: microsoft office 97-2003 documents: word document (doc) excel spreadsheet (xls) powerpoint presentation (ppt) msn (toolbar) (c:\documents , settings\%username%\local settings\application - data\microsoft\msne\msninfo.dat) jump lists stickynotes.snt thumbs.db windows installer (.msi) , patch file (.msp) windows search (srchadm.msc) for more information, see compound binary file specification that being said, reading .doc files not easy way extract text ms word files. may try python-docx library if files dealing .docx files.

ruby - How to dynamically transmit params in link_to ? -

i need use part of application in iframe on page. need remove layout on these pages. i added applicationcontroller layout :current_layout def current_layout if params[:layout] == false.to_s false else 'main' end end this works until user click on link in navigation. need add every link_to in part of application like: link_to 'store', store_path(params.merge({layout: params[:layout]}) i wondering maybe can refactor , maybe remove params.merge every link? you try this: def my_path_helper(string, path_type, params) link_to(string, polymorphic_path([path_type], params.merge({layout: params[:layout]}))) end see the docs polymorphic path here , answer provides example . is looking for?

html - HTML5 'Required' tag not working in Safari -

my html5 input types' required tags not working in safari. when try submit without filling in required fields, goes through. :( supposed have warning or reminder telling fill in fields. please me. thank you! safari doesn't (yet) support feature of html 5 candidate recommendation. either implement javascript shim, or depend on server side validation in safari.

ios - How do I change the primary Accessibility element in a new ViewController which helps blind people? -

i implementing voiceover accessibility in ios app pikspeak helps blind people locate ios different buttons on screen. so, when open new viewcontroller first button siri announces 1 on top left corner. though, not primary button want users hear when open new vc button. rather want page heading button so, how change primary accessibility uilabel ??

android - Adding setOnTouchListener makes OnClickListener no longer working -

i have activity implements both ontouchlistener , onclicklistener. if add both listeners buttons, onclicklistener doesn't work, mean onclick() method, implemented in activity, doesn't anything. i assign listeners in way. button1.setonclicklistener(this); button1.setontouchlistener(this); if remove button1.setontouchlistener(this) then onclick() method starts working. the 2 listeners setting view: onclick() from view.onclicklistener. called when user either touches item (when in touch mode), or focuses upon item navigation-keys or trackball , presses suitable "enter" key or presses down on trackball. and ontouch() from view.ontouchlistener. called when user performs action qualified touch event, including press, release, or movement gesture on screen (within bounds of item). for ontouch() , ontouch() - returns boolean indicate whether listener consumes event. important thing event can have multiple acti...

c# - Asp.Net button has no ID in javascript? -

i have problems identifying asp.net control in javascript. here's simple variant of code, maybe can see error. this function creates set of button + label, can called multiple times: private void addrow(panel pnl) { var mybutton = new button(); mybutton.text = "+"; mybutton.attributes.add("onclick", "return myjavascript();"); mybutton.attributes.add("somevariable", "foobar!"); var lblanzahl = new label(); pnl.controls.add(mybutton); pnl.controls.add(lblanzahl); } this js function button calls: function myjavascript(e) { var sender = event.target || event.srcelement; var somevar = sender.getattribute("somevariable"); alert('somevar: ' + somevar); alert('id: ' + sender.id); } the output is: somevar: foobar! id: so guess correc...

java - How change formate date from jDateChooser? -

Image
i want enter start date , deadline task in database. format saves database this: tue apr 15 13:46:38 bst 2014 want in yyyy-mm-dd format. this code use write data in database: public void addtask() { try { taskt1 = new task(); t1.setidtask(jtidtask.gettext()); t1.setdesctask(jtdesctask.gettext()); t1.setdate(jdatechooserdare.getdate().tostring()); t1.setdeadline(jdatechooserdeadline.getdate().tostring()); taskdao dao = new taskdao(); dao.task(t1); } catch (sqlexception ex) { logger.getlogger(jttask.class.getname()).log(level.severe, null, ex); } } --------------form----------- thank help, hope explain best possible greetings i hope , can use simpledateformat accomplishing this. code: simpledateformat sdf = new simpledateformat("yyyy-mm-dd"); string date = sdf.format(jdatechooserdeadline.getdate()); t1.setdate(date);

Tricky function for a VBA newbie -

here's problem. need compare 2 sets of cells on 2 different worksheet. on sheet 1, cells a1 , a2. on sheet 2, cells a1 , a2. on sheet 1, each cells populated single digit number, 1 being greater other, eg: 1-2, 2-1, 3-1, etc. , never equal another. on sheet 2, 1 of cell populated single digit number. other cell empty. i need determine if non empty cell on sheet 2 same cell cell on sheet 1 containing greater number. unfortunatly have next 0 knowledge of vba, trying learn tutorial can't seem figure out how write one. me please? thank much. sub doit() dim sh1 worksheet, sh2 worksheet set sh1 = worksheets("first") set sh2 = worksheets("second") dim ivalue1 long if sh1.cells(2, 1) > sh1.cells(1, 1) ivalue1 = sh1.cells(2, 1) else ivalue1 = sh1.cells(1, 1) end if dim ivalue2 long if len(sh2.cells(2, 1)) = 0 ivalue2 = sh2.cells(1, 1) else ivalue2 = sh2.cells(2, 1) ...

python - pdf2htmlEX is not recognized in the py script -

in cmd type following run test script provided in pdf2htmlex : python test.py it giving me following error: 'pdf2htmlex' not recognised internal or external command, operable program or batch file. the test.py script follows: #!/usr/bin/env python dir = 'test_data' import os import sys open('out2.html','w') outf: outf.write('<!doctype html>\n<html><head><meta charset=\"utf-8\"></head><body><div style="position:absolute;top:0;left:0;width:80%;height:100%;"><iframe width="100%" height="100%" name="pdf"></iframe></div><div style="position:absolute;top:0;right:0;width:20%;height:100%;overflow:auto;text-align:right;">') f in os.listdir(dir): if not f.lower().endswith('.pdf'): continue print f if os.system('pdf2htmlex -l 10 --no-drm 1 --fit-width 1024 ...

oop - Java Inheritance constructor issue -

i try send parent's parameters through child constructor. parent: public class animal { protected string name; protected int age; protected int weight; protected int height; public animal(string name,int age,int weight,int height) { name = name; age = age; weight = weight; height = height; } } child: public class mammals extends animal { protected string haircolor; public mammals(string haircolor,int age,int weight,int height) { super(age,weight,height); haircolor = haircolor; } public string walk() { return "walking..."; } } from reason keep getting error. the error comes from super(age,weight,height); because super-constructor has 4 parameters , you're passing three. since don't have name child , can pass null . super(null, age, weight, height); also, consider following code-conventions .

In PHP when using ternary operator (?:) what are benefits/damage of evaluating multiple conditions at a time? -

having hard time finding words phrase every example using ternary uses single condition $x = ($x > 1) ? 1 : 0; $x = (any single evaluation) ? if true : if false; above, how example found structured. my question though structure below, using here && $x = (($x > 1) && ($z === 0)) ? 1 : 0; so question whether using format of last example above frowned upon or causes issues since have never seen used or benefits/damage explained. the possible issue more complex condition, harder read. there comes point it's easier read if( ... ) {$x = 1;} else {$x = 0;} ternary operator alternative.

c - How to make flexible array that based on the input -

#include<stdio.h> #include<ctype.h> int main() { int i=0; char in[100],mychar; fgets(in,sizeof(in),stdin); while (in[i]) { mychar=in[i]; putchar (toupper(mychar)); i++; } return 0; } simple program used change string of characters uppercase letters. question declare array in[100], how can make array number follow input? mean if type 1201 characters , program make have array follows input in[1201]. you can see c++ vector does: can malloc length of l @ fist, every time getch(), should decide if expand l 2*l (or l + 100 saving spaces)

c# - Authorization to DB2 database using ADO.NET in Visual Studio 2010 -

Image
im using code connect db2 database - testing purposes : private void ctss_connect(object sender, routedeventargs e) { idb2connection nc = new idb2connection(); nc.connectionstring = "datasource=as400machine; defaultcollection=mydatabase;"; nc.open(); nc.close(); } the problem program ask me once userid , password. when debug program next time, login machines without prompt userid , password. should add connectionstring or there hidden in visualstudio settings? i'm using ibm iaccess windows , personal communicator access as400 machine when run program popup windows personal communicator have enter userid , password my guess credentials cached somehow. .net-db2-ado.net-library. this setting in personal communicator might help: i use following connectionstring db2 databases, contains both username , password program not have ask user: datasource=xxx;userid=xxx;password=xxx;checkconnectiononopen=true;datacompression=true; replace...

Difference between ' and " in tcpdf or php -

i m little bit confuse in ' , ". im trying create pdf. code txt='<input type="checkbox" name="product[]" value="product fault/failure"'.if(in_array("product fault/failure",$myarray)) { .' checked="checked" '.} .'>product fault/failure' when executing this,getting syntax error.i dnt know why write in "" or '' quote , why cant write <?php ?> '.....'.if(in_array("product fault/failure",$myarray)) { .' checked="checked" '.} .'...' this wrong. can't concatenate if statement that. '.....'.(in_array("product fault/failure",$myarray) ? ' checked' : '').'...'

java - How can I use project resources in my code? -

say working on project involves using resources imported project in eclipse. in src folder, have res folder, contains kinds of resources: image files, wav files. now need access these files in code. should trivial i'm not sure how this. what should do? somehow store resource in file object? use kind of stream? what best way this? common 'conventional' and/or simplest way know use resources in code. i use packages import functionality managing media resources javax.media.format; javax.media.manager; javax.media.medialocator; javax.media.player; javax.media.pluginmanager; javax.media.format.audioformat ; player player = manager.createplayer(new medialocator(newfile("/res/file.wav").touri().tourl()));

Does a sidebar/navbar count towards columns in Bootstrap 3? -

i'm working on bootstrap 3 site , have stupid question. code have (didn't write, cleaning up) has sidebar navigation bar, nested under container, not live within col-div or row. incorrect? layout currently: <body> <section id="container"> (no class) <header/> <aside> <div id="sidebar" class="nav-collapse"> <ul class="sidebar-menu" id="nav-accordion"> <li class="sub-menu"> ... </aside> <section id="main-content"> <section class="wrapper site-min-height"> <div> <div class="row-fluid"> <div class="col-sm-6 pull-right"> ...content... well, condense this, see there no class container anywhere in hierarchy... awesome! original question remains, though: should navigation sidebar exi...

ios - Objective-c : Unable to handle request without a valid action parameter. please supply a valid soap action -

Image
i'm trying consume asmx web service objective-c using wsdl2objc tool. now, i'm trying consume temperature conversion web service . using tool, client classes got generated consuming service (i have used link reference write code). however, i'm continuously getting soap fault message "unable handle request without valid action parameter. please supply valid soap action". while error message states need add "soapaction" header request headers, don't know how in case when using wsdl2objc tool generate client classes consuming web service. i have searched long time in links referred, there no mention of situation occurring in objective-c. please check code below: - (ibaction)submitclicked:(id)sender { tempconvertsoap *binding = [tempconvertsvc tempconvertsoap]; tempconvertsoapresponse* response; tempconvertsvc_celsiustofahrenheit* request = [[tempconvertsvc_celsiustofahrenheit alloc] init]; request.celsius = self.txtce...