Posts

Showing posts from March, 2010

How to create expand css3 animation like it's on HTC ONE M8 design slide -

i want regarding css3 animation mobile parts expand view on htc 1 m8 website in second "design" slide. http://www.htc.com/us/smartphones/htc-one-m8/ many anticipation. do have code? try sort of horizontal transition each element has 3d skew on it. css3 animation whereas transition merely css transition.

multithreading - Android making thread in service -

i'm making mediaplayer service , don't want use application resource service. read must create new thread in service,but i'm beginner , can't understand how this. know how start new thread don't know how process startplay , stopall method in thread package com.filsoft.mouse; import android.app.service; import android.content.intent; import android.media.mediaplayer; import android.media.mediaplayer.oncompletionlistener; import android.os.binder; import android.os.ibinder; public class sound extends service implements oncompletionlistener { mediaplayer[] mediaplayer=new mediaplayer[3]; private final ibinder mbinder = new localbinder(); @override public ibinder onbind(intent intent) { return mbinder; } @override public void oncreate() { mediaplayer[0] = mediaplayer.create(this, r.raw.sound1); mediaplayer[0].setoncompletionlistener(this); mediaplayer[0].setlooping(true); mediap

javascript - Jquery removing issue divs still remains -

yesterday coded commentbox in php, html , ajax. ajax part gives me opportunity delete comment without refreshing page. way this, give each , every comment (div) unique id via database. let example in mysql database how comment looks like: username: blabla<br> comment: haha funny<br> id: 52 this printed out in html page likes example: <div class="commentstyle" id="<?php echo $commentid; ?>"> comment have id of 52 <div class="deletecomment">delete comment here!</div> </div> and then! comes ajax part coded this: $(document).ready(function(){ $(".deletecomment").click(function(){ //getting id of comment id = $(".deletecomment").attr("id"); $.ajax{ type: 'get', url: 'deletecomment.php', data: "id=" + id, success: function(){ $("#" + id).hide(); } } }); }); this works fine when deleting first comment. wont let me delete o

post - Wordpress nextpage display Previous 2 of 10 Next -

Image
i'm using wp_link_pages() split post multiple pages. want achieve shown in image below. instead of showing page numbers links, want show format (current page of total page). please me exact codes. thank in advance. ps: don't want use plugins. there simple solution problem. i've got inspiration source file function wp_link_pages defined. function page_pagination( $echo = 1 ) { global $page, $numpages, $multipage, $more; if( $multipage ) { //probably should add && $more condition. $next_text = "next"; $prev_text = "prev"; if( $page < $numpages ) { $next = _wp_link_page( $i = $page + 1 ); $next_link = $next . $next_text . "</a>"; } if( $i = ( $page - 1 ) ) { $prev = _wp_link_page( $i ); $prev_link = $prev . $prev_text . "</a>"; } $output = "<div class=\"prev

Qt qUncompress giving "could not allocate enough memory to uncompress data" -

i have following code failing when called error: quncompress: not allocate enough memory uncompress data code: qstring decstage3 ( qbytearray s ) { printf ( "3a: length in %d\n", s.length()); qbytearray bdata = qbytearray::fromhex(s ); printf ( "3b: length ba %d\n", bdata.length()); printf ( "3c: ba [%s]\n", qprintable(bdata.tohex())); printf ( "3d: mem [%d]\n", bdata.capacity() ); qbytearray ds = quncompress( bdata ); // qbytearray::fromhex(s.tolatin1()); return (ds.data()); } example input "789c0b492d2e5170492c490400101e033b" ( == "test data" ). update: following chernobyl's suggestion, decided add direct test follows: void tst ( qbytearray b0 ) { qbytearray b1 = qcompress (b0); printf ( "[%s] %d = [%s] %d\n", qprintable(b0), b0.length(), qprintable(b1.tohex()), b1.length()); qbytearray b2 = quncompress (b1); printf ( "uncomp = [%s]\n", q

c# - Strange behaviour when toggling RIDEV_CAPTUREMOUSE | RIDEV_NOLEGACY -

i'm writing mouse object in c# uses raw input. device registers , gets data , stuff, it's working in regard. however, on object have property called "exclusive" meant mimic exclusive mode in direct input. when toggle property true, call registerrawinputdevices dwflags member of rawinputdevice set to: ridev_capturemouse | ridev_nolegacy. , when set property false, set 0. now problem when mouse button down/up event. on mouse object assign mouse button down event set exclusive true , on mouse set false. when run application events fire , exclusive mode set , reset. weird stuff begins happen: after mouse event , exclusive mode disabled, window doesn't respond mouse on events in window decorations (e.g. close button won't highlight , can't click on it). can't exit application hitting alt+f4. however, when click on window once or twice regular window behaviour comes back. after application closed, windows explorer , other application wi

c - handling sigusr1 and sigusr2, works for only sigusr2 -

this (almost) homework question. have sender , receiver program. sender takes pid of receiver , int t command line parameters. has string consists of , bs(e.g. "aabbba") , sends string receiver via signals. every in string sends sigusr1 , every b sends sigusr2. , waits t milliseconds between every letter. receiver, should print every sigusr1 , b every sigusr2 arrived. can't understand why receiver prints bs. that's first problem. in code above, use 2 signal handlers, 1 each. want know if it's possibile use single handler handle both of them. read it's not ok. i'm not sure if got true. tried both of them anyway prints bs. ok use handler this?: void handler(int signum) { if (signum == sigusr1) // arrived . { write(1,"a\n", 2); } else if(signum == sigusr2) //arrived _: { write(1,"b\n", 2); } } //in main function... sa.sa_handler = handler_sg1; ec_neg1(sigaction(sigusr1, &sa, null),

c++ - How to call CreateProcess() in C# passing lpEnvironment -

i imported native createprocess c# project icordebug purposes http://msdn.microsoft.com/en-us/library/vstudio/ms232508(v=vs.100).aspx [methodimpl(methodimploptions.internalcall, methodcodetype = methodcodetype.runtime)] void createprocess([in, marshalas(unmanagedtype.lpwstr)] string lpapplicationname, [in, marshalas(unmanagedtype.lpwstr)] string lpcommandline, [in] security_attributes lpprocessattributes, [in] security_attributes lpthreadattributes, [in] int binherithandles, [in] uint dwcreationflags, [in] intptr lpenvironment, [in, marshalas(unmanagedtype.lpwstr)] string lpcurrentdirectory, [in] startupinfo pstartupinfo, [in] process_information pprocessinformation, [in] cordebugcreateprocessflags debuggingflags, [marshalas(unmanagedtype.interface)] out icordebugprocess ppprocess); i call trying pass lpenvironment way intptr intptrenv; if (variables != string.empty) intptrenv = marshal.stringtohglobaluni(variables);

command line - Run an file after X seconds when running the .bat file -

i wonder if there way can run file after x seconds when run .bat file i have search example didn't help @echo off sleep 10 start "c:\file.txt" exit thanks! from bat file use regularly: rem - wait 10 seconds choice /c:ab /t:10 /d:a > nul i don't recall got it, superuser. i've been using years, though.

php - SimpleXML create feed - loop gives wrong output -

having problem creating datafeed simplexml. using loop put products inside data feed data of products inserted inside first product. giving me following output: <products> <product> <product_id>36440</product_id> <product_name>snoerloze ramenwasser</product_name> <brand/> <description> <h1>droge schone ramen in een handomdraai... streeploos!</h1> <h3>dankzij de nieuwe, inventieve draadloze ramenreiniger</h3> <ol> <li> licht in gewicht, compact en extreem krachtig</li> <li>bespaart u tijd</li> <li> een snelle en effectieve manier om zowel binnen als buiten al uw ramen streeploos schoon en droog te maken. </li> <li>laat geen watersporen, strepen of druppels achter</li> </ol> <h3><br />bent u die strepen op het raam ook zo beu? dit de nieuwe - tijdbesparende - leuke manier om uw ramen streeploos schoon te krijgen in een handomdraai. al het

java - When using GregorianCalendar and adding 4 years, why does it appear further in date? -

i've completed assignment , output appears work except fact results projgraddate or graduation date should 4 years greater enrollment date. why appear if it's more 4 years or 5 years? my results after running program follows enrollment date: 10/14/2013 graduation date: 07/17/2018 this seems 5 years or overlooking something? here code (first collegestudent class testcollegestudent application): this.fname = fname; this.lname = lname; this.enteredenrollmentdate = enteredenrollmentdate; projgraddate = new gregoriancalendar( enteredenrollmentdate.getinstance().get(enteredenrollmentdate.year), enteredenrollmentdate.getinstance().get(enteredenrollmentdate.month), enteredenrollmentdate.getinstance().get(enteredenrollmentdate.day_of_month)); projgraddate.set(projgraddate.year, projgraddate.get(projgraddate.year) + 4 ); your code should start working when remove .getinstance() . tried this: import java.text.dateformat; import java.text.

C++ Error: "member Engine::x is not a type name" -

i'm bulding standard 4 func calculator, , i'm trying pass 2 numbers off parameters user has entered. within engine.h class have declared float num1, num2; and have function float add(num1, num2); in these params, num1 , num2 both have error stated in title: "error: member engine::num1 not type name." i'm confused why these bringing errors, isn't how parameters work? simply declare member function as float add() const; as function deal data members num1 , num2 needs no parameters. example defined as float engine::add() const { return num1 + num2; } as error forgot write type specifiers of parameters. instead of float add(num1, num2); there shall @ least float add( float num1, float num2);

Android - send fake SMS to local phone on KitKat -

i have nexus 5 running kitkat no sim card (work phone etc). i'm trying create app send fake sms locally device can demonstrate sms receiver behavior can't work. i've implemented code phone in this topic, others have said work fine them, when run generic "no matching service error": unable start service intent act=android.provider.telephony.sms_received cmp=com.android.mms/.transaction.smsreceiverservice at first thought issue might have been fact phone using hangouts switching default app textra didn't help. did more digging , found "getting sms apps ready kitkat" blog post talked new intents , behavior , looks on kitkat want use default sms provider, there way use send sms local phone? didn't see examples , api makes no mention of capability.

Javascript get values inside an object and add them together? -

i'm wondering if it's possible loop through set objects in angular , perform maths on retrieved values. i have object ( $scope.basketitems ) , i'd know if it's possible (and if how) loop through each item inside $scope.basketitems , extract each price , add price 's create total figure? i use lodash or underscore, this: $scope.basketitems = [ {name: 'bob', price: 50}, {name: 'tim', price: 25}, {name: 'sarah', price: 25} ]; $scope.sum = 0; _.foreach( $scope.basketitems, function(item) { $scope.sum += item.price; }); sum = 100;

java - Eclipse 4.4 suddenly stopped printing stack traces to console -

Image
ever since i've begun using eclipse, whenever exception occured i'd message , stack trace in console, no matter if caught exception or not. now however, of sudden thing printed console class of exception , message if there one. haven't changed settings manually did install grep console eclipse. can stack traces somehow without having reinstall eclipse? i've looked around preferences compiler , debugger haven't found remotely seems manipulates console stack traces. here's how exceptions presented now. it's difficult sort of debugging without stack trace now: i know post old, have add -xx:-omitstacktraceinfastthrow as jvm-option

php - InvalidArgumentException: The service definition "my.markdown.parser" does not exist -

i try instal bundle:knplabs/knpmarkdownbundle have error : invalidargumentexception: service definition "my.markdown.parser" not exist. this section of requires : "php": ">=5.3.3", "symfony/symfony": "~2.4", "doctrine/orm": "~2.2,>=2.2.3", "doctrine/doctrine-bundle": "1.3.*@dev", "twig/extensions": "~1.0", "symfony/assetic-bundle": "~2.3", "symfony/swiftmailer-bundle": "~2.3", "symfony/monolog-bundle": "~2.4", "sensio/distribution-bundle": "~2.3", "sensio/framework-extra-bundle": "~3.0", "sensio/generator-bundle": "~2.3", "incenteev/composer-parameter-handler": "~2.0", "jms/di-extra-bundle": "dev-master",

javascript - Add additional link to responsive navigation -

i created little responsive navigation works fine. want add link on right side of navigation "account". my idea insert div ul think not w3c conform. <div class="navigation"> <ul> <li><a href="#">welcome</a></li> <li><a href="#">me</a></li> <li><a href="#">service</a></li> <li><a href="#">contact</a></li> <div class="account">account</div> </ul> <a href="#" class="pull">navigation</a> here js fiddle demo important want "account" on right side, not side side other navigation items. under 700px screen size should under contact li. should this: http://www.directupload.net/file/d/3718/xneivu5d_png.htm sorry bad english. hope can understand problem , maybe have idea solve this. your .navigation li{ float: left;

javascript - google maps api conflicting with a div with background-attachment:fixed which overlaps it -

i have div background-attachment: fixed , div further down page position:fixed. working fine in ie11 , firefox 31.0 in in chrome div background-attachment: fixed scrolling image div , has large black blocks across image's full width, covering half image, in thick bars (like zebra if will) if don't run google map js, or have background-attachment: scroll, or have position: static, works expect. am doing wrong, bug in chrome? either way need find way make behave intended (fixed background image , fixed google maps div window) - either correction of code, or workaround 'bug' helpful. (aside: have fixed div @ top nav bar isn't affecting issue. believe because not stack google map) code in full: http://jsfiddle.net/chowie/rodx0v02/3/ html: <div id="hobbiescontainer" class="sectioncontainer"> <section id="hobbiessection"> <a id="hobbies"><h4>hobbies</h4><

html - Stretch UL list as horizontal navigation bar evenly spaced... with spaces on outer margins as well -

i spent chunk of evening trying horizontal navigation bar , managed set , centered, this tip . however, code gives items evenly spaced , pressed against edges of page (or region, or div, or whatever they're inside). what i'd them evenly spaced across inside , spaces of same size appear on outer margins, i.e. before first , after last items, well. for reference, here's html: <ul id = "nav"> <li>accueil</li> <li>recherche</li> <li>contact</li> </ul> and here css: #nav { width: 100%; text-align: justify; margin: 0 0 3em 0; padding: 8px; list-style: none; border-bottom: 1px solid #ccc; border-top: 1px solid #ccc; } #nav:after { content: ''; display: inline-block; width: 100%; } #nav li { width: 15%; display: inline-block; padding: 4px 15px; text-align: center; text-decoration: none; background-color: #f2f2f2; border:

ios - UITableView won't present -

i have strange situation in app , can't explain or locate bug. have uiviewcontroller tableview in it. in table view have 3 prototype cells, have 2 section divided so: first section: row 0 (cell id: episodescrollerscell) second section: row 0 (cell id: addcommentscell) : row 1+ (cell id: commentcell) the required methods in protocol listed below. - (nsinteger)numberofsectionsintableview:(uitableview *)tableview { return 2; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { nsinteger rownum; if(section == 0){ rownum = 1; }else{ rownum = 1; // here problem. if change number of row above 1 } return rownum; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier; if(indexpath.section == 0){ cellidentifier = episodescrollerscell; }else if (indexpath.section == 1 && indexpa

c# - How can I use the Live SDK on the client to login to my own Web API? -

fellow programmers, it hard me wrap head around whole token based oauth authorization flow please forgive me eventual stupidity , broken english (i'm poland). i'm developing web service using .net's web api 2 technology , 2 native clients: windows store (8.1) & windows phone 8.1. controllers on api side of course need authorization. want users not forced create new account in system seperate login data i've decided use microsoft authentication. i've created application on live.com developers , got client id & secret. i've enabled microsoft authentication in app_start\startup.auth.cs correct id & secret. now, i've made native client (win store app) using live sdk 5.6 (newest available) , associated store. managed sign in account in client using sdk , basic data me testing purposes. but that's managed do. question is: how can use live sdk on client login own web api? what's flow? i've found this: http://leastprivilege.

class - In Python, Return “None” instead of creating new instance if wrong parameters are given -

when creating instance of class, if wrong parameters given. how i not create new instance , return reference, instead return "none" here application: because allowed sometime. application build trees list of integers. want use none in list represent leaf. want return none instead of empty tree node. see this answer python __init__ return failure create . basically, can use __new__ accomplish want, really, pythonic way of doing throw exception. arguably, pythonic way have simpler __init__ method initialization , not can fail @ all.

know where clicked gridview android -

i new android, , i'm developing game memorized. using gridview display images. have arraylist pictures (animals) , arraylist images (incognita). able when click on image display animal, , if backs equal, if not match can hide clickeo last picture. achievement esconnder not first image clicked. how can know elements of gridview pushed ?. greetings , thanks. public class juego3libre extends activity implements android.widget.adapterview.onitemclicklistener { private arraylist<integer> animaleslist = new arraylist<integer>(); private arraylist<integer> signolist = new arraylist<integer>(); int[] comparar = new int[2]; int[] temporal = new int[2]; int contador=0,contador2=0; imageview imgv1; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.juego3libre); //acá seteo el nombre del layout this.settitle("juego memorice"); gridview gridview = (gridv

android - Playstore GoogleMaps not working -

i have app using googlemaps android api 2. maps work fine on device test device when app exported eclipse not when app installed playstore. additionally series of warnings , errors in log shown below: 08-18 10:44:18.952: i/google maps android api(7756): google play services client version: 4323000 08-18 10:44:18.952: i/dalvikvm(7756): not find method gui.a, referenced method gqh.a 08-18 10:44:18.952: w/dalvikvm(7756): vfy: unable resolve static method 24934: lgui;.a (landroid/content/context;)lgrh; 08-18 10:44:18.952: d/dalvikvm(7756): vfy: replacing opcode 0x71 @ 0x0003 08-18 10:44:18.952: e/dalvikvm(7756): not find class 'gpq', referenced method gpr.a 08-18 10:44:18.952: w/dalvikvm(7756): vfy: unable resolve new-instance 4090 (lgpq;) in lgpr; 08-18 10:44:18.952: d/dalvikvm(7756): vfy: replacing opcode 0x22 @ 0x0000 08-18 10:44:18.952: e/dalvikvm(7756): not find class 'gpq', referenced method gpr.a 08-18 10:44:18.952: w/dalvikvm(7756): vfy: unable resolve

workflow foundation 4 - WF 4.5 State Machine: Jump to a state -

i have wpf based ui has navigation bar. ui uses wcf service state machine workflow. wpf application data capture wizard sort of application. user goes through different states navigation bar shows states(user journey or breadcrumb). @ point user can click on of visited states navigate state. using wf4, possible jump state without having transition? scenario not want use persistence , store "last state name". later when user wants resume workflow, want instantiate new instance of workflow , jump state using stored "last state name" , resume workflow. thanks. i found after since posted in 2011, wondering if there new released same. http://code.msdn.microsoft.com/windows-workflow-233b5e3c#content

jsf - primeface default selection on radio buttons -

i have field 1 radio button: xhtml: <div class="col-md-4"> <p:selectoneradio id="gender" value="#{onegobean.gender}" required="true" requiredmessage="gender required"> <f:selectitems value="#{onegobean.gender}" /> </p:selectoneradio> </div> bean: import javax.faces.model.selectitem; private arraylist<selectitem> gender; public final arraylist<selectitem> getgender() { return gender; } public final void setgender(final arraylist<selectitem> gender) { this.gender = gender; } public final void loadgender() { gender = new arraylist<selectitem>(); gender.add(new selectitem("m", "male")); gender.add(new selectitem("f", "female")); } during loadup arraylist being populated 2 genders. problem is, there no defualt value on web page. both radio buttons not selected. anyne kn

asp.net mvc - ServiceStack AutoQuery MVC controller -

i'm experimenting servicestack in mvc, using standard server side controllers creating view models. there no jquery calls (or direct calls) of services registered @ /api. since ss lets resolve services directly using: using (var dr = hostcontext.resolveservice<datareportservice>(base.httpcontext)) i haven't been calling services using jsonserviceclient. instead i've been resolving services , calling methods directly. var datareport = new datareport { isarchived = false, reportdate = datetime.now, reporttype = model.reporttype }; var drid = dr.post(datareport); however, have not been able find way new autoquery feature. know creates service automatically class descends querybase have had no luck resolving it. if try resolve name used @ run time won't compile (obviously). if try this using (var dr = hostcontext.resolveservice<autoqueryservicebase>(base.httpcontext)) then won't work either, because base class , not actual registered

wpf - DispatchHelper open new window -

i using dispatchhelper mvvm light open new window while calculation being performed. window contains simple label , button. when use show() method window appear when calculation starts , close when calculation ends label , button not in window. i have tried using showdialog() method before calculation starts , show label , button on window. however, showdialog doesn't return until window gets closed. therefore, window stay open , calculation not performed. would have advise on how work through issue? public relaycommand showpopupcontrol { { return _showpopupcontrol ?? (_showpopupcontrol = new relaycommand( () => { dispatcherhelper.checkbegininvokeonui(() => { var ww = new workingwindow(); ww.showdialog(); var loop = new loopdata(); loop.dosomeloops();

PHP to check file exist on external server using file_get_contents() -

checking file exists on external server using file_get_contents() method, method work properly? $url_file = "http://website.com/dir/filename.php"; $contents = file_get_contents($url_file); if($contents){ echo "file exists!"; } else { echo "file doesn't exists!"; } i think best method me using script: $file = "http://website.com/dir/filename.php"; $file_headers = get_headers($file); if file not exists output $file_headers[0] is: http/1.0 404 not found or http/1.1 404 not found use strpos method check 404 string if file doesn't exists: if(strpos($file_headers[0], '404') !== false){ echo "file doesn't exists!"; } else { echo "file exists!"; } thanks :)

Getting all dihedral angles in Pymol -

i want dihedral angles of protein in pymol (phi, psi, chi1, chi2, chi3, chi4) manage find function can shows me phi , psi. for instance: pymol>phi_psi 1a11 ser-2: ( 67.5, 172.8 ) glu-3: ( -59.6, -19.4 ) lys-4: ( -66.4, -61.7 ) met-5: ( -64.1, -17.9 ) ser-6: ( -78.3, -33.7 ) thr-7: ( -84.0, -18.1 ) ala-8: ( -85.7, -40.8 ) ile-9: ( -75.1, -30.8 ) ser-10: ( -77.6, -47.0 ) val-11: ( -61.3, -27.4 ) leu-12: ( -60.7, -47.5 ) leu-13: ( -71.1, -38.6 ) ala-14: ( -46.2, -50.7 ) gln-15: ( -69.1, -47.4 ) ala-16: ( -41.9, -52.6 ) val-17: ( -82.6, -23.7 ) phe-18: ( -53.4, -63.4 ) leu-19: ( -61.2, -30.4 ) leu-20: ( -61.1, -32.3 ) leu-21: ( -80.6, -60.1 ) thr-22: ( -45.9, -34.4 ) ser-23: ( -74.5, -47.8 ) gln-24: ( -83.5, 11.0 ) it's missing chiral angles. know how dihedral angles? many thanks! you can arbitrary dihedral angles get_dihedral. create 4 s

ios - radio streaming without MPMoviePlayerController -

i doing small radio shoutcast android , ios kony. fine android ios, creating library play shoutcast. unfortunatly, seems player of mpmovieplayercontroller need set subview work , unable that. does know other solution play shoutcast on ios? i don't know shoutcast imagine similar soundcloud in use api parse stream url? if i'm right in thinking need put url nsurl , make sure tell mpmovieplayercontroller source, so... radioplayer = [[mpmovieplayercontroller alloc] initwithcontenturl:[nsurl urlwithstring:your_shoutcast_stream_url]]; radioplayer.moviesourcetype = mpmoviesourcetypestreaming; then play [radioplayer preparetoplay]; hope helps :)

php - Cakephp 3.0 alpha2 How to compare new password to old passwords? -

okay, testing out cakephp 3.0 alpha2 transferring application(2.5) 3.x. current application has set when reset password cannot change of previous 6 passwords(stored in passwords table connects user_id) security purposes. @ changes in cake 3.0, noticed if create new entity password hashes differently if same password. way compare new password old ones? go using password hasher built in function called check? cakephp 3 uses bcrypt. in brief: bcrypt uses different salt each password, , stores salt part of password hash. why, you've found, bcrypt generate different hash each time same plain-text password encrypted. however, if it's of use authentication system, have able check if plain-text password 'fits' given hashed version of password - though there's not 1 single 'correct' hashed version, right? right. you password_verify method - http://au2.php.net/password_verify so, rather hashing plain-text version , seeing if hashed version of new p

jquery - How to set $jQval.unobtrusive.options ErrorPlacement function correclty -

what proper way override errorplacement function in jquery.validate.unobtrusive? looking @ jquery.validate.unobtrusive.js script appears developers intention allow apply own errorplacement function setting $jqval.unobtrusive.options. in validationinfo(form) function defines errorplacement function see call execincontext("errorplacement", arguments). it seem if create errorplacement function under $.validator.unobtrusive.options called. $.validator.unobtrusive.options = { errorplacement: function () { console.log("hello"); } }; the issue must configured after jquery.validate.js , before jquery.validate.unobtrusive.js referenced. otherwise $jqval.unobtrusive.options null , $form.data(data_validation, result) not set again. function validationinfo(form) { var $form = $(form), result = $form.data(data_validation), onresetproxy = $.proxy(onreset, form), defaultoptions = $jqval.unobtrusive.

c# - Date conversion issue with Excel Interop and CSV file -

i have csv file contains dates formatted m/dd/yyyy follows 1/06/2013,15,1,1/06/2013 0:15,1,6.44 when open file in excel, dates correctly converted - 1/06/2013 has numeric value 41,426.00 , month() function returns 6. when use microsoft.office.interop.excel open same file using either open() or opentext() method date gets converted 41,280.00 (6/01/2013). can open csv file using microsoft.office.interop.excel opens same if user opened file windows shell? regards dave found answer myself buried in bottom of question - excel vba date formats/values change when file opened programatically workbook = workbooks.open(filename, local: true) open() has local property, when false assumes mdy order ambiguous dates, when true uses local machine setting in australia dmy

search - How can i fix "Googlebot can't access your site" issue? -

Image
i keep getting message "over last 24 hours, googlebot encountered 1 errors while attempting access robots.txt. ensure didn't crawl pages listed in file, postponed our crawl. site's overall robots.txt error rate 100.0%. can see more details these errors in webmaster tools. " i searched , told me add robots.txt on site and when test robots.txt on google webmaster tools ,the robots.txt cannot fetched. i thought maybe robots.txt blocked site ,but when test says allowed gwt. ' http://momentcamofficial.com/robots.txt ' , here content of robots.txt : user-agent: * disallow: so why robots.txt cannot fetched google?what did miss .... can me ??? before googlebot crawls site, accesses robots.txt file determine if site blocking google crawling pages or urls. if robots.txt file exists unreachable (in other words, if doesn’t return 200 or 404 http status code), we’ll postpone our crawl rather risk crawling urls not want crawled. whe

mysql - Dilemma about the number of columns on a table -

scenario: creating website checklist, can done/accessed multiple users in same time needs fields editable, saveable , retrievable. dilemma: checklist has 212 entries, means 212 rows. have 5 columns needs entries thus, 212x5. means, have create 1060 columns able me code website want do. 1060 columns on table seems wrong , tiring use. sample solution: divide 5 columns 5 tables, making date checklist created primary key. use 5 tables corresponding columns reducing number of columns per table 212. is there anyway reduce this? sorry long post, appreciated. **edit: reason, can't comment on answers, says error on page. nevertheless, appreciate everybody's answer; yet have 1 info may change answers. have thought of making 5 columns instead of obnoxious 1060, doing that, need/the system need create 1 table per 1 worksheet , of course, on time, cause massive problems database. although still pretty huge, ah_hau's answer seems smallest , easiest handle. using it, system

php - SugarCRM, displaying data as HTML in DetailView -

Image
in sugarcrm, have tried use rich text editor fields using tinymce , stores , renders in editview in listview , detailview output displaying tags instead of formatting. in database storing html tags expected. looking solution how render formatting in detailview section. in detail view i found solution decode html characters in smarty in customcoce in detailviewdefs.php file. 'name' => 'editor_c', 'studio' => 'visible', 'customcode' => '{$fields.editor_c.value|escape:\'htmlentitydecode\' |escape:\'html\'|strip_tags|url2html|nl2br}',

Compiler gives "excess element in array initializer" warning in objective C with 2D C-array -

i'm learning objective c , writing program aid people in learning play guitar. wanted create 2d array containing (almost) notes on guitar neck. since there 6 strings on guitar , twelve notes in octave, created 6 x 12 array. edit: solution @ bottom the intention here array read as (string),(fret number) . int strings[6][12] = { { {0, 8},{0, 9},{0, 10},{0, 11} ,{0, 12} ,{0, 1}, {0, 2},{0, 3},{0, 4},{0, 5},{0, 6},{0, 7} }, { {1, 3},{1, 4},{1, 5},{1, 6},{1, 7},{1, 8,},{1, 9},{1, 10},{1, 11} ,{1, 12},{1, 1},{1, 2} }, { {2, 12},{2, 1},{2, 2},{2, 3},{2, 4},{2, 5},{2, 6},{2, 7},{2, 8},{2, 9},{2, 10},{2, 11} }, { {3, 6}, {3, 7} , {3, 8} , {3, 9} ,{3, 10} ,{3, 11} ,{3, 12} ,{3, 1} ,{3, 2} ,{3, 3} ,{3, 4} ,{3, 5} }, { {4, 1} ,{4, 2} ,{4, 3} ,{4, 4} ,{4, 5} ,{4, 6} ,{4, 7} ,{4, 8} ,{4, 9} , {4, 10} ,{4, 11} ,{4, 12} }, { {5, 9},{5, 10},{5, 11} , {5, 12} ,{5, 1},{5, 2},{5, 3},{5, 4},{5, 5},{5, 6},{5, 7},{5, 8} } }; the problem is, xcode throws warning: "e

python - Need to dump entire DOM tree with element id from selenium server -

i have been using python selenium web automation testing. key part of automation find right element user-visible object in html page. following api work of time, not time. find_element_by_xxx, xxx can id, name, xpath, tag_name etc. when html page complicated, search dom tree. wonder if it's possible ask selenium server serialize entire dom (with element id can used perform action on through webdriver server). client side (python script) can own search algorithm find right element. note python selenium can entire html page drv.page_source however, parsing doesn't give internal element id selenium server's point of view, hence not useful. edit1: paraphrase make more clear (thanks @alecxe): what's needed here serialized representation of dom elements (with dom structure preserved) in selenium server, serialized representation can sent client side (a python selenium test app) can own search. try: find_elements_by_xpath("//*"

sql server - How to generate sql output as piped -

this question has answer here: how use group concatenate strings in sql server? 16 answers concat groups in sql server [duplicate] 5 answers i using ms sql server. i have table of students this: studentid,teacher 123,adams 124,adams 125,johnson 126,johnson 127,adams 128,marks i need have output looks this: teacher,students adams,123|124|127 johnson,125|126 marks,128 i appreciate help. thank you. declare @table_var table( student_id int, teacher varchar(50) ) insert @table_var select 123, 'adams' union select 124, 'adams' union select 125, 'johnson' union select 126, 'johnson' union select 127, 'adams' union select 128, 'marks' select * @table_var select teacher, students = stuff((select '|

c++ - Typecasting processed float value to int reduces the actual value -

this question has answer here: floating point arithmetic not producing exact results [duplicate] 7 answers in c++, floor(9099.96 *100.0) giving me answer 909995 . expecting 909996. i not able think of explanations here. appreciated.thanks. this proper result: according ieee754 calculator , value of 9099.96 represented 9099.9599609375 in double . after multiplication 100 909995.99609375 . taking floor gives 909995 .

maven - Starting of the Apache tomcat server before integration test -

i've been looking solution last 4 days , raised question bounty still not getting answer. where i've succeeded pf pom.xml file:- a) starting tomcat server manually using command i.e mvn tomcat7:run. command me deploying of war file tomcat server , starting server. b) running integration tests using testng.xml file configuration on eclipse. where i'm failed pf pom.xml file:- a) automatically starting of tomcat server. b) running integration tests. c) stopping of tomcat server. this question posted me couldn't find answer starting apache server before integration testing not working please i'm wrong. it looks have tomcat start , stop bound pre-integration-test , post-integration-test phases, testng stuff being run during test phase, comes before integration-test phases. other responder said - should running: mvn clean verify -x ... you're catching phases through post-integration-test (and catching debug information tr

jquery - Remove row between table header and row -

see fiddle this jquery : function searchrecords() { $('#searchme').tableutils({ filter: { type: ['nofilter', 'nofilter', 'text'] }, fixheader: { width: 1000, height: 200 }, columns: [{ label: 'first name' }, { label: 'last name' }, { label: 'concept' }, { label: 'rating' }, { label: 'aka' }] }); $('#searchrecords').hide(); } searchrecords(); $('#filter_searchme_2').css('width', '100px').detach().appendto("#outside"); how can remove row between table header , first table row? basically,the area filtering every column not want filter every column remove 1 textbox filtering , put outside table. appreciated.thanks in advance. you can see mean on

c# - Out of memory exception when loading tif file in a picture box -

i need load tiff file in picture box , use following code this: picbox.image = image.fromfile(files[current].fullname); this code works great on computer, when deploy on pc, throws outofmemoryexception . tiff files generated fax service. i want know how load file in exception safe manner. i have same problem , confused solving. save time 3 days. but test code , found image lost transparency @ end. i need png image , edit code , problem solved. thanx

java - Netbeans FrameView CenterScreen,ChangeSize -

i modifying java desktop application made using netbeans 6.9.1 . no matter unable change size of main application neither can centralise it. netbeans uses called frameview extends jframe . no jframe object directly available what have tried already this.getframe().setlocationrelative(null); this.getframe().setsize(whatever,whatever); above 2 dont work neither can find option in gui builder i have feeling question may have been asked have failed find correct answer alright @madprogrammers hint have come worst possible solution netbeans view file has class (our application) extends frameview(netbeans native class) . class instantiated in {}app.java file .. class has constructor calls initcomponent() method . on rides properties after constructor has finished (madprogrammers) .. able fix issue writing following code before constructor ended solution works every time have feeling stackoverflow going kill me :) final jframe f=this.getframe(); runnable r1 = new r

JavaScript code to include Maximum and minimum limit for a number Z -

function add(id,value) { var x = document. element id(id). value ; x = x.replace('$',''); x = x.replace(',',''); var y = value; var z = +x + +y; document.get element id(id). value =z; } to set minimum value z 0 , maximium value 999999999 if question how make sure z never less 0 or greater 999999999 , there 2 common ways: using if : if (z < 0) { z = 0; } else if (z > 999999999) { z = 999999999; } using math : z = math.max(0, math.min(z, 999999999)); math.min(z, 999999999) pick smallest of values give it, , won't return value greater 999999999 . similarly, math.max(0, ...) return largest of 2 values give it, , won't return value less 0 .