Posts

Showing posts from February, 2012

c# - How can i send email one after one in a row? -

in form1 in backgroundworkerdowork event did: se.sendphotos(photofilesdir + "\\" + "photofiles.zip"); se.sendphotos(photofilesdir1 + "\\" + "photofiles.zip"); se.sendphotos(photofilesdir2 + "\\" + "photofiles.zip"); se.sendphotos(photofilesdir3 + "\\" + "photofiles.zip"); in se class sendemail did: public void sendphotos(string filenametosend) { try { mailaddress = new mailaddress("test@gmail.com", "user " + (char)0xd8 + " name", system.text.encoding.utf8); mailaddress = new mailaddress("test@test"); photosmessage = new mailmessage(from, to); photosmessage.body = "please check log file attachment have bugs."; string somearrows = new string(new char[] { '\u2190', '\u2191', '\u2192', '\u2193'

html - How to make change in this post title table with css? -

this html code- <table style='min-width:60%;height:25px;'> <tr> <td> <data:post.title> </td> <td id='date-and-author' style='position: relative;bottom: -2px;white-space:nowrap;'> <data:post.author><data:post.dateheader> </td> </tr> </table> this gives following result- how make html table      admin on 8/1/13 can see title, admin , date in 1 line. problem is, when device has maximum width of 480px 'by admin on 8/1/13' run out of 100% window size. if make white space= normal in id #date-and-author displayed like: by admin on 8/1/13 not good. want, when device has maximum width of 480px 'by admin on 8/1/13' displayed in new row. css should place in @media screen , (max-width:480px){..} that, id #date-and-author displayed in new row as: how make html table admin on 8/1/13 don't want use div element. please me. you can tell

google chrome - How to convert ISO 8601 date/time into milliseconds in XSLT 1.0? -

how can convert iso 8601 2013-08-13t17:57:55z date/time text "milliseconds since epoch" using xslt 1.0? more specifically, google chrome's version of xslt. extending algorithm julian dates taught me old manager (hi, george!), got in turn collected algorithms of acm (although not appear included in online version of calgo , have not been able find algorithm number, date of publication, or author [but see postscript below]), following template calculates, given iso 8601 timestamp in time zone z, number of milliseconds since beginning of julian day 0, excluding leap seconds. julian day 0 begins @ noon on 1 january 4713 bc in julian calendar; that's noon on 24 november 4714 bce in gregorian calendar. checking input sanity, adjustment use different epoch, extension handle time zones other z, , extension handle leap seconds , dates before common era left exercise reader. (or call out javascript, where's fun in that?) <xsl:template name="ts2

.net - Setting Tab XPosition/YPosition correctly for form fields using Aspose.Net PDF Kit -

my pdf forms may contain signature/initial/date fields @ various locations within pages throughout pdf document. having issues dynamically setting each of tab's xposition/yposition various form signature/initial/date fields. using aspose.net pdf api x/y position of form field within pdf/page, yields corresponding form field's rectangle properties of lower left x,y , upper right x,y. these supposed give position of rectangle of form field within pdf page. when use either of these values aspose.net pdf api (lower left x,y or upper right x,y), result in docusign signing process tab/sign here positioned higher in particular page expected. does have experience using aspose.net pdf form field rectangle x,y positions , setting tab x/y positions correctly? thinking dpi issue between pdf , docusign expecting perhaps. appreciated. the lower left / upper right values relative bottom left corner of page. possible docusign expects values relative top left corner of page. t

c++ - Handling windows socket error -

i retrieving data socket using following code iresult = recv(socket,data_array,sizeof(data_array),0); now documentation states if recv succefull return no. of bytes retrieved otherwise return error code. how check error code. mean if data retrieved same amount value of error code. check this link more detail. basically, when error occurs, socket_error (-1) gets returned, , have call wsagetlasterror() , or read errno or other platform-specific equivalent, specific error code.

javascript - Putting two divs on the same row via relative positioning -

i'm trying create animation on site when user clicks link, site shifts main content div off page left, , new content (which corresponds clicked link) flies open spot right. original content block gets deleted after animation completes. i have down, , i've done far use relative positioning , jquery animate movement of divs. specifically, if block a original div, , block b replacement div, create b , position off right side of screen setting left:100% use jquery animate right:100% on a send a off left side of screen use jquery fly in b right animating left:0% the problem after these new styles set, there still empty area a was, , b below empty space. how push b space? short answer: believe missing position:absolute on a , b . long answer: if define container position:relative , newly created elements position:absolute positioned within bounding box of container. @ point can stick 2 elements 1 next each other said: a on left:0 , b on left

Jquery hiding images with parent class -

consider html: <span class="leaguetogglehome"> <img src="/images/formleagueall.png" id="up" class="homeleagueswitch" /> <img src="/images/formleague.png" id="down" class="homeleagueswitch" /> </span> i want hide 1 of 2 buttons using jquery: $('span.leaguetogglehome img#up').hide(); $('span.leaguetogglehome img#down').hide(); what happens 2 other images 'up' , 'down' id's hidden instead. in container of different class, why hidden , not 2 intend hide. have included class of parent contain button si want hide. this makes no sense it? the 'other' img tag: <span class="toggle" id="home"> <img src="/images/formhomeup.png" id="up" class="hometoggleresults"/> <img src="/images/formhomeoverallup.png" id="down" class="hometoggleresults"/> &l

configuration - Typesafe config: Load additional config from path external to packaged scala application -

my scala application packaged jar. when run app, needs read additional config file stored externally app jar. looking functionality similar typesafe config library other solutions welcome ! there way below: val hdfsconfig = configfactory.load("my_path/hdfs.conf") i think want is: val mycfg = configfactory.parsefile(new file("my_path/hdfs.conf"))

c# - Right Approach to Insert in Table then copy it to another table -

in application user insert book. example somebook insert 3 copies. table1.bookid = 1, table1.copy = 3, in table 3 books have primary key table2.accessionid = 1,2,3 table2.bookid = 1, 1, 1. this current doing bad practice aaron bertrand said. int booktitlesid; public void addbooktitle() { int copy = int.parse(textbox2.text); try { using (sqlconnection mydatabaseconnection = new sqlconnection(myconnectionstring.connectionstring)) { mydatabaseconnection.open(); using (sqlcommand mysqlcommand1 = new sqlcommand("insert booktitles(booktitle, copies) values(@booktitle, @copies)", mydatabaseconnection)) { mysqlcommand1.parameters.addwithvalue("@booktitle", booktitletextbox.text); mysqlcommand1.parameters.addwithvalue("@copies", copy); mysqlcommand1.executenonquery(); } } } catch (exception ex) { messagebox.show(ex.message, "exception"); } } public void addbook() {

rhomobile - Xcode keeps alternating two errors -

when trying run app on local iphone, me , coworker keep getting 2 errors seem alternating every other build. first "a signed resource has been added, modified, or deleted", , second "a valid provisioning profile executable not found". we've tried lot of common fixes, deleting weird db files ~/library/developer/xcode folder. input @ welcome, both dumbfounded going wrong. thank in advance! if need more information, please let me know. this issue provisioning profile ios device, not related db files. your device not recognized provisioning profile using application. you can have @ these posts, if interest you, a valid provisioning profile executable not found debug mode a valid provisioning profile executable not found... (again)

java - Scrolling issues having a ViewPager as the header in a ListView -

i'm trying stick viewpager (horizontal scroll) in tableview (vertical scroll). appears works unless kind of vertical scroll in viewpager happens when trying swipe. ideas on how can work properly? you can use code (the trick disallow vertical scrolls in parent horizontal scroll detected): viewpager.setonpagechangelistener(new onpagechangelistener() { @override public void onpageselected(int position) { } @override public void onpagescrolled(int position, float positionoffset, int positionoffsetpixels) { } @override public void onpagescrollstatechanged(int state) { if (state == viewpager.scroll_state_dragging) { viewpager.getparent().requestdisallowintercepttouchevent( true); } } });

php - Q&A site template like stackoverflow -

i'm looking template q&a site stackoverflow preferably written in php. knows open-source template that? searched github, didn't find anything. thanks in advance. i think both of these open-source , php. http://www.question2answer.org/qa/ http://support.lampcms.com/

android - CWAC Camera - Overriding saveImage() -

i'm trying use own custom implementation of cwac camera . trying override saveimage function on own extension of simplecamerahost. code: you welcome override saveimage(byte[]) , else byte[], such send on internet. saveimage(byte[]) called on background thread, not have own asynchronous work. @override public void saveimage(byte[] bytearray) { intent myintent = new intent(); retdata.putextra("data", bytearray); getactivity().setresult(activity.result_ok, myintent); getactivity().finish(); } i'm testing on samsung galaxy s3, , works perfectly, when try use front facing camera, application freezes , crashes. i'm not doing onactivityresult, originating camerafragment. don't know wrong because documentation says has been tested s3. edit #2: @override public size getpicturesize(parameters parameters) { //return camerautils.getlargestpicturesize(parameters); // todo auto-generated method stub list<ca

jsf 2 - How to invoke a JSF composite within composite:implementation? -

how invoke jsf2 composite (widget) within anothers composite's implementation tag? when so, following error: /resources/widgets/tilecontainer.xhtml @25,45 <mywidgets:tilecontainer> tag library supports namespace: http://java.sun.com/jsf/composite/widgets, no tag defined name: tilecontainer the code snippet is: <composite:interface name="tilecontainer"> <composite:attribute name="pubcategoryid" type="java.lang.long" required="true" /> </composite:interface> <composite:implementation> <div class="tilecontainer"> <ui:repeat value="#{pubcontroller.getpubsbycategory(cc.attrs.pubcategoryid)}" var="pub"> #{pub.title} <mywidgets:tilecontainer title="private"> <mywidgets:tilesmallpicturetitle title="bulk dispatch lapse stressed application protoco

linux - Capturing a traffic Chrome sends -

for debugging purporses need find out (packets , headers, data, etc) chrome sends on network. not html page, chrome itself. how do that? if need use wireshark, how set this? wireshark use. if you're in windows can use fiddler apparently. i've never tried it, assume says. http://hak5.org/episodes/haktip-64 https://confluence.atlassian.com/display/confkb/capturing+http+traffic+using+wireshark+or+fiddler there's 1 called http debugger. worth google. enjoy

sql server 2008 - Updating table values in a trigger depending on data subset -

ok, title mouthful. basically, means when dealing rows inserted table, depending on value in specific column, splits rows 1 of 2 subsets, data dealt in 1 of 2 manners. have been iterated on cursor, cte too, there way, following (pseudo) code looks ugly , doesn't work, gives idea of i'm looking for: trigger alter trigger [dbo].[tcda_combined_activeunitshiftexpiredstatus_updateshift] on [dbo].[cd_units] after update begin set nocount on if update(shift_start) begin if(inserted.ag_id <> 'fire') begin update cd_units set shift_expired_status = 0 inserted inserted.unid = cd_units.unid , inserted.shift_start <= dbo.get_dts() end else begin update cd_units set shift_expired_status = 0 inserted inserted.unid = cd_units.unid , inserted.shift_start >= dbo.get_dts() end update cd_units set sask911_shift_end = (select substring(shift_st

c# - Will the result of a LINQ query always be guaranteed to be in the correct order? -

question: result of linq query guaranteed in correct order? example: int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 }; var lownums = n in numbers n < 5 select n; now, when walk through entries of query result, in same order input data numbers ordered? foreach (var x in lownums) { console.writeline(x); } if can provide note on ordering in documentation, perfect. for linq objects : yep. for parallel linq : nope. for linq expression trees (ef, l2s, etc): nope.

MySQL time difference between rows matching criteria -

hello need query on mysql database. i have table looks this: id trackid date name action 38 2013-08-12-36 2013-08-12 14:54:50 john smith 0 37 2013-08-12-39 2013-08-12 14:54:28 john smith 3 36 2013-08-12-39 2013-08-12 14:53:24 john smith 4 35 2013-06-12-91 2013-08-12 14:30:01 john smith 3 34 2013-06-12-91 2013-08-12 14:29:44 john smith 4 31 2013-06-12-91 2013-08-12 14:28:39 john smith 0 i want list time difference between action=0 , action=3 each unique trackid between specified date. select distinct timediff ( (select `date` hesk_history `action` = 0), (select `date` hesk_history `action` = 3 ) ) diff hesk_history `date` between '2013-08-12 00:00:00' , '2013-08-12 23:59:59' the solution should list each distinct trackid , timediff between action 0 , action 3 when these action exist each trackid. trackid diff 2013-06-12-91 -00:01:22 try

php - Convert a start and end ip range to a net mask -

good morning, i trying subnet mask start , end ip in php. eg; 14.1.32.0 , 14.1.64.0 255.255.224.0 but there doesn't seem built in function this? have searched refers cdir , trying ips etc seems trying go other way. anyone have ideas? this should want: $ip = "14.1.32.0"; $ip2 = "14.1.64.0"; echo long2ip(ip2long($ip) - ip2long($ip2));

How to parse the JSON Date format from the below given json data using jquery? -

{ "2013\/02\/05":[ {"id":"84eb13cfed01764d9c401219faa56d53","colour":"#000000","category":"custom"} ], } i have used jquery code given below.i trying access date '2013/02/05' , array elements id ,colour , category of date. $(document).ready(function(){ var output = $("#changebtn"); $("#data").click(function(){ $.getjson("json_data.json",function(jd){ var dates = jd.date; alert(dates); }); }); the object returned associative array can access property follows: $.getjson("json_data.json",function(jd){ var dates = jd["2013\/02\/05"][0].colour; alert(dates); }); js fiddle: http://jsfiddle.net/dlkfk/ on side note, pretty nasty object. i'm not sure why needs assign array date property. if have control on

php - Pass symbols in GET variable -

when pass long string along # 's , + 's seem disappear in $_get variable, how can make them not disappear? have tried escaping string yet doesn't help. you want utilize urlencode function.

PHP - Getting an XML file that is echoed in another PHP file, then saving the echoed XML output to the server -

i have php file - called xml_generate.php - creates dom object , echoes @ end. lets looks this: header("content-type: text/xml"); $dom = new domdocument('1.0'); $node = $dom->createelement('foo'); $root = $dom->appendchild($node); $node = $dom->createelement('bar'); $new_node = $root->appendchild($node); echo $dom->savexml(); i'm accessing file jquery , displaying content on client-side. actual xml_generate.php creates dom dynamically database. however, want have php file create backup of xml generated generate_xml.php , save server. so, need somehow access xml document (the 1 dynamically created in xml_generate.php). i've tried a few different functions xml xml_generate.php, instance: $xml = http_get('xml_generate.php'); , $xml = file_get_contents('xml_generate.php'); as including first file ( include('xml_generate.php') , trying access $dom variable in file). but can't s

c++ - std::vect sorting with member variable -

i'm stuck piece of code: class myobject { public: int value; } class myclass { private: btalignedobjectarray<myobject*> m_objects; public: int comp (myobject *a, myobject *b) { return calculatethenewvalue(a->value) < calculatethenewvalue(b->value); } void dosort() { m_objects.quicksort(comp); } //edit: member function needed sorting int calculatethenewvalue(int v) { // calculation using other members variables, not m_objects } }; it doesn't compile because comp non static member function. comp cant static, because needs access member variable m_objects. also defeat encapsulation of m_objects have static function , call this myclass::dosort(myclass.m_objects) edit this declaration of btalignedobjectarray http://bulletphysics.org/bullet/bulletfull/btalignedobjectarray_8h_source.html line 365 has declaration or quicksort if need make comp binary function

jquery - SlideToggle not working correctly after using .load (ajax) -

i experimenting custom lightbox effect , finding quite complicated. experience getting more refined have found once load modal window (contact) , remove instances of slidetoggle no longer work correctly. this code: (not sure helps) $('.viewinfo').on( 'click', function(e){ e.preventdefault(); $(this).parent('.project').find('.project-info').slidetoggle(1500, 'easeoutcubic'); $(this).toggleclass('closeinfo'); }); $('#icon-mobile-menu').on('click', function(){ $('#mobile-nav ul').slidetoggle(1500); }); i still new jquery there don't understand... appreciated view site try changing instead (delegated click event perhaps): get rid of easing effect , see if causes problem go away now: $('body').on( 'click', '.viewinfo', function(e){ e.preventdefault(); $(this).parent('.project').find('.project-info

java - My program keeps saying that the method cannot be resolved -

this program should tell me if can find file naming. eclipse has no red lines every time run error message , don't know why. thank in advance can provide. import java.io.file; public class stockmarket { public stockmarket(string[] args) { readfiles r = new readfiles(); system.out.println(r.checkisfile()); } } and second class import java.io.*; import java.util.stringtokenizer; public class readfiles { public static void main(string[] args) { system.out.println("test"); file file = new file("c:\\stocks\\yahoo.csv"); int row = 0; string[] [] items; } public boolean checkisfile() { file file= new file("c:\\stocks\\yahoo.csv"); return file.isfile(); } } error message: exception in thread "main" java.lang.error: unresolved compilation problem: checkisfile cannot resolved or not field @ stockmarket.main(stockmarket.java:6) a few

unix - Sed to replace first forward slash in line after match with a string -

so have following in file: /icon.png /my/path/tester/icon.png /logo.png /my/path/tester/logo.png i want replace lines not contain 'tester' , add '/my/path/tester/' beginning... leaving: /my/path/tester/icon.png /my/path/tester/icon.png /my/path/tester/logo.png /my/path/tester/logo.png i prefer edit file in place using sed. thanks in advance! if have sed supports -i option (eg, gnu-sed): sed -i '/tester/!s@^@/my/path/tester@' file note ask for, not robust. want limit replacement lines not match '/tester/' rather 'tester', , there no point -i option (see sed edit file in place ). using -i obfuscates temporary file, reason people not want , think avoid using -i .

jquery - How to save a clicked link's data-attribute for use with other functions in JavaScript -

i'm new jquery , js , trying use chosen "subject" matter when user chooses list of buttons. using subject, data-attribute value, beyond me when using data in , out of scope. what pros , con's of saving data window object? best or better ways it... what pro's , con's of saving , retrieving input field? are there better ways don't know about? we'll call link #link data attribute foo var data; //this function called when link clicked - making sure var *only* created clicked links $('#link').click(function() { data = $(this).data('foo'); //code whatever want }) so have, page, variable data value of foo stored inside it. functions can use data stored in variable, , store somewhere later use using either localstorage or cookie. if use jquery cookie plugin on github , can call function , set cookie this: $.cookie('name','value'); so in instance: $.cookie('foo',data); alternative

javascript - Trying to get jQuery to fire alert when textarea of a certain class focusout -

i trying alert id of textarea when focus out of textarea. either or if value changes inside textarea doesn't matter much. have read .live has depreciated , textarea doesn't have .focusout function. here have tried far <textarea id="<?php echo $row->payid; ?>" class="someclass"> that html using $("textarea").on('focusout','.someclass',function () { alert("hello"); }); and here jquery any appreciated you want use blur not focusout , so: $("textarea").on('blur','.someclass',function () { alert("hello"); });

python - Extract date from Pandas DataFrame -

i want download adjusted close prices , corresponding dates yahoo, can't seem figure out how dates pandas dataframe . i reading answer this question from pandas.io.data import datareader datetime import datetime goog = datareader("goog", "yahoo", datetime(2000,1,1), datetime(2012,1,1)) print goog["adj close"] and part works fine; however, need extract dates correspond prices. for example: adj_close = np.array(goog["adj close"]) gives me 1-d array of adjusted closing prices, looking 1-d array of dates, such that: date = # do? adj_close[0] corresponds date[0] when do: >>> goog.keys() index([open, high, low, close, volume, adj close], dtype=object) i see none of keys give me similar date, think there has way create array of dates. missing? you can goog.index stored datetimeindex. series of date, can do goog.reset_index()['date']

mysql - select substring of column returns null and empty -

i'm having trouble using mysql's substr function. my query is: select distinct(substr(col1,0,10)) table; the results returned null , empty row. am using substr incorrectly, or can not use distinct or column name? thanks firstly, position of first character of string 1, not 0; should fix it: select distinct(substr(col1, 1, 10)) `table` secondly, table contains @ least 1 row in col1 null . rows, result of substr null well.

selenium - Junit in Eclipse can not deal with a LinkText apostrophe -

a testcase runs in selenium ide when exported webdriver , executed in eclipse junit script can not find linktext element apostrophe in name. i escaped apostrophe still junit can not find it. the line in question highlighted in code i exported selenuim testcase did not contain apostrophes , able run webdriver junit test in eclipse without issues. i continue using testcases without apostrophes great if figure out how deal special characters. sincerely, rick doucette import java.util.regex.pattern; import java.util.concurrent.timeunit; import org.junit.*; import static org.junit.assert.*; import static org.hamcrest.corematchers.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.firefoxdriver; import org.openqa.selenium.support.ui.select; public class firstselidedemo { private webdriver driver; private string baseurl; private boolean acceptnextalert = true; private stringbuffer verificationerrors

Null Pointer Exception error in android- fatal build error -

hi got null pointer error on line layout = (linearlayout) inflater.inflate(r.layout.instructions1, null); i have checked everything. instructions 1 xml file , exists in layout folder within resources folder. try relaunch eclipse if use it.

Why are elements from my Android RelativeLayout not showing up when inflated in ListView? -

Image
i have custom view i've put that's kind of supposed google cards. here's looks in android studio: ignore fact android studio renders rest of screen around it; view rectangle bounded dropshadow @ bottom of it. if set main content view , inflate 1 @ runtime, looks correct. if inflate 1 part of listview @ runtime, looks this: the thing views disappeared seem have in common attached things other edge of layout. here's layout: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="340dp" android:layout_height="260dp" android:cliptopadding="true" android:background="@drawable/card_background" android:minheight="260dp" android:minwidth="340dp"> <textview android:layout_width="wrap_content"

php - Cannot retrieve text box value in java script popup -

i want pass text box value in parent.php popup window(child_page.php). following code. parent.php- <html> <head> <script type="text/javascript"> var popupwindow=null; function child_open() { popupwindow =window.open('child_page.php',"_blank","directories=no, status=no, menubar=no, scrollbars=yes, resizable=no,width=600, height=280,top=200,left=200"); } function parent_disable() { if(popupwindow && !popupwindow.closed) popupwindow.focus(); } </script> <input type="text" name="mytextfield" id="mytextfield" required="required"/> </head> <body onfocus="parent_disable();" onclick="parent_disable();"> <a href="javascript:child_open()">click me</a> </body> </html> child_page.php <h1>child page</h1> <script> window.onunload = refreshparent; function refreshpar

Mono Compiler as Service or Microsoft Roselyn for a vb parser -

i want analyze vb code parse roselyn or mcs, want c sharp code want analyze in vb code. i have seen in both frameworks, can pass code , gives syntax tree, example if writting in c sharp, can parser visual basic code? syntaxtree tree = syntaxtree.parsecompilationunit(@"imports system imports system.collections imports system.linq imports system.text namespace helloworld     module program           sub main(args as string())             console.writeline(“hello, world!”)          end sub      end module end namespace"); var root = (compilationunitsyntax)tree.getroot(); my question if can done mcs mono or microsoft roslyn? yes, can that. need use types namespace roslyn.compilers.visualbasic (in assembly same name) instead of types roslyn.compilers.csharp .

php - Plugin options from FlexForms in TYPO3 -

i built extension using extension builder , added plugin this. add plugin options @ time of adding plugin page, determine controller action page. have 2 pages list , search , should able give plugin option choose myextcontroller->list list page , myextcontroller->search search page. so far did this: in ext_tables.php : $pluginsignature = str_replace('_','',$_extkey) . 'myext'; $tca['tt_content']['types']['list']['subtypes_addlist'][$pluginsignature] = 'pi_flexform'; \typo3\cms\core\utility\extensionmanagementutility::addpiflexformvalue($pluginsignature, 'file:ext:' . $_extkey . '/configuration/flexforms/flexform_myext.xml'); my flexform in configuration/flexforms: <t3datastructure> <sheets> <sdef> <root> <tceforms> <sheettitle>function</sheettitle> </tceforms>

jquery - Post data back to server using Knockout mapping -

i've bind list of objects check boxes list using knockoutjs , knockoutjs mapping plugin, code server side class public struct filterlistitem { public string text { get; set; } public string value { get; set; } } javascript $(document).ready(function () { var dto = { 'categoryid': geturlvars()["scid"] }; $.ajax({ url: "productlisttest.aspx/getfiltersweb", data: json.stringify(dto), type: "post", contenttype: "application/json", datatype: "json", timeout: 10000, success: function (result) { bindfiltermodel(result); } }); }); function bindfiltermodel(data) { console.log(data); var jsonobject; jsonobject = ko.mapping.fromjs(data); var viewmodel = { categorylist: jsonobject.d }; ko.applybindings(viewmodel); } html <div data-bind="foreach: categorylist.subcategorylist"> <div

.net - Flyout Pane in C# Windows Store (Metro) app -

this question has answer here: where flyout control in winrt xaml? 2 answers how make flyout panes (like ones flyout when open charms options) in our metro apps? can find javascript samples in documentation , there doesn't seem support in c# documentation. correct? flyout not available xaml/c# windows 8 store apps. available in 3rd party tool-kits callisto . note: microsoft has added flyout in windows 8.1

c# - Threading: Thread.CurrentThread.Name and Thread.CurrentThread.ManagedThereadId -

i trying identify threads assigning names them (property: system.threading.thread.currentthread.name ) realized use system.threading.thread.currentthread.managedthreadid . question is: if assign "thread1" in property currentthread.name , currentthread.managedthreadid "1", true? or threadpool can assign different managedthreadid thread name "thread1"? msdn states: the value of managedthreadid property not vary on time, if unmanaged code hosts common language runtime implements thread fiber. so wouldn't worry correspondence thread name -> managed thread id breaking.

Changing the datetime format in php -

here format 'd-m-y h:i:s'(15-11-2008 7:16:09) i want change format 'y-m-d h:i:s' (2008-11-15 07:16:09) tried strtotime() function, takes 'm' 'd' , 'd' 'm' help! new php.. current code` $dt = strtotime($this->input->post('insert_dts')); $formated_date_time = date("y-m-d h:i:s",$dt);` as per code : $dt = strtotime('15-11-2008 7:16:09'); echo $formated_date_time = date("y-m-d h:i:s",$dt); output : 2008-11-15 07:16:09

webdriver - java.lang.ClassCastException: com.sun.proxy.$Proxy8 cannot be cast to org.openqa.selenium.internal.WrapsDriver -

i have following pointcut , given advice in aspectj @pointcut("(call(* org.openqa.selenium.webelement.sendkeys(..)))") public void onwebelementaction() { } @after("onwebelementaction() && target(webelement)") public void afterwebelementaction(joinpoint joinpoint, webelement webelement) { system.out.println(webelement.getattribute("name")); //1 webdriver driver = ((wrapsdriver) webelement).getwrappeddriver(); //2 //do here } while line 1 executed without error. on line 2 error java.lang.classcastexception: com.sun.proxy.$proxy8 cannot cast org.openqa.selenium.internal.wrapsdriver the casting works in other places without issues. can please help? this wild guess since don't see case worked. exception seems webelement being passed afterwebelementaction initialized via pagefactory . guess if pass webelement derived driver.findelement(), afterwebelementaction , wouldn't casting exception. how must working i

ms access - selstart returns position 0 if text is entered in memo field (not clicked) -

Image
i have memo field , list. want accomplish if typing in memo field , click on text record in list text shows in memo positioned beginning cursor was. after research, , googling succeed make it. did .selstart property. but me seems selstart has bug. works if click somewhere in memo (then works great.) if typing something, , click on text in list (without clicking in memo field) selstart returns position 0. this makes me huge problem. can help? thank you. as found out, problem cursor position lost when move away memo. due fact access form controls not "real" controls: real windows controls when have focus. rest of time, sort of images of control pasted onto form. so, need track cursor position (and selected length of text) during various interractions: when user moves cursor using keyboard ( keyup event) when user clicks inside memo ( click event, position cursor or select text using mouse) when memo gets focus ( getfocus , first time, whole text s

jquery - bootstrap tooltip is not working in IE -

this question has answer here: bootstrap tooltips not working 22 answers i using bootstrap in ie not working here html page <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>twitter bootstrap popover example</title> <meta name="description" content="this example create popover twitter bootstrap."> <link href="/twitter-bootstrap/twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet"> </head> <body> <div class="container"> <h2>example of creating popover twitter bootstrap</h2> <div class="well"> <a href="#" id="example" class="btn btn-success" rel="popover" data-content

Error installing Recess PHP framework -

i downloaded recess php framework source , untar in /var/www/html. i did modification per readme in recess-conf.php. { recessconf::$defaultdatabase = array( //'sqlite:' . $_env['dir.bootstrap'] . 'data/sqlite/default.db' 'mysql:host=localhost;dbname=testdb', 'root', 'root' ); } i getting error when open google-chrome , type localhost pdo has not been imported. location: line 19 of /var/www/html/recess/recess/database/pdo/pdodatasource.class.php followed call stack. please let me know how resolve issue. regards sachin var_dump(extension_loaded ('pdo_mysql')); check pdo_mysql loaded or not.

where - SQL Combine same bind variable -

i have clause says: select * tablename :x < y or y null , :x > z i tried rewrite uses :x once shown below don't understand why keep getting error says 'sql command not ended'. where z < :x < y or y null any appreciated, thanks. the expression trying use z < x < y not standard sql. you can come close with: where :x between y , z or y null; the difference between 'y <= x <= z' . if inequality needed , values integers, can do: where :x between y + 1 , z - 1 or y null;

ruby on rails - rspec expect condition OR condition -

how write rspec tests defensively, in scenario @ least 1 expectation must met yet failure of others accepted? (without input changing). and easy enough listing multiple expectations , how or expressed? as example, user has many posts, , user bob hacks form when submits create post form sends id of user dunc . application ignores passed dunc id, , uses bob 's id bob creating post. test newly created post has bob 's user_id. however, if in future code refactored returns error message instead of assuming bob 's id, test wrongly fail. want test intent, not implementation. so need test either no post created, or if 1 created, bob . this example simple can solved testing expect { run }.not_to change( post.where(user_id: @other_user.id), :count ) however i'm looking general solution, in more complex cases there can many conditions. how "or" achieved in rspec? (or not possible?) i don't think possible. i think mistaken when testing i

php - How to get nepali characters from url? -

my url like: index.com/controller/method/उ-अहिले-कहाँ-छ-त i tried echo parameter, looks like: e0%a4%85%e0%a4%b9%e0%a4%bf%e0%a4%b2%e0%a5%87-%e0%a4%95%e0%a4%b9%e0%a4%be%e0%a4%81-%e0%a4%9b-%e0%a4%a4 i want parameter showed उ-अहिले-कहाँ-छ-त , idea? thanks in advance use rawurldecode() function: $string = '%e0%a4%89-%e0%a4%85%e0%a4%b9%e0%a4%bf%e0%a4%b2%e0%a5%87-%e0%a4%95%e0%a4%b9%e0%a4%be%e0%a4%81-%e0%a4%9b-%e0%a4%a4'; echo rawurldecode($string); output: उ-अहिले-कहाँ-छ-त

java - Struts 1.1 and Servlet 2.5 - NoClassDefFoundError for JspException during tests -

after updating servlet-api provided dependency in pom 2.3 2.5, unit tests our custom struts 1.1 requestprocessor started fail noclassdeffounderror: javax/servlet/jsp/jspexception, indeed lacking in servlet-api-2.5, compared 2.3. i use junit 4.11 , jmockit 1.2 unit testing. interestingly, application works fine after deploying jboss 5.1. is struts 1.1 compatible web apps using servlet api 2.5? maybe jboss 5.1 servlet-api different servlet-api-2.5 taken maven repository? javax.servlet.jspexception exception defined in jsp api. jsp api extension of servlet api. the reason why don't experience issue in jboss 5.1 because jboss 5.1 contains jsp-api.jar inside jboss_home\common\lib directory. just include same jar dependency in struts test project. i hope helps.

c# - EmguCV Image size different from Image.Data size -

i copy part of image new one: bigimage.roi = somerectangle; emgu.cv.image<emgu.cv.structure.rgb, byte> roiimage = bigimage.copy(); now roiimage.cols==roiimage.width==1 , roiimage.rows==roiimage.height==106 ; size of roiimage.data [106,4,3] . width of image not equal second dimension of data. why occur? emgucv requires each row of image aligned 4 bytes improve efficiency in fetching data.

mysql - Qt application with Inno setup : runtime error -

i'm doing software qt 5.1 , want create setup it. took inno setup .exe of application , linked libraries. when install app on computer (windows 7) it's right when try install on other computer (xp) have error "runtime error". don't have more informations error, no code, no log, nothing, don't know error come from. maybe can usefull said app use mysql , lib inpout32.dll. so question is, how know error come ? i don't know else said issue if have more question.. thanks. make sure have built application release. check using depends wich dlls used app , include them in installer. if building app visual studio, may have install redistributable package try start app under supervision of depends (i think menu item called "profile") may give clue dlls missing or in dll crash occurs. i hope helps.

php - Date format: not updating existing record -

i working on project have update record on basis of date, record not updating , if update record without date clouse working fine. have change format of date becouse date in mysql table column in different format. ist changed date format as: <option value="<?php $dat1=$q['dt_period_start_date']; //for example $dat1=2011-04-01; echo date('d-m-y',strtotime($dat1));?>&nbsp;to&nbsp;<?php $dat2=$q['dt_period_end_date']; echo date('d-m-y',strtotime($dat2));?>"> //now have date in 01-apr-2011 31-mar-2012 format 2nd have update date for updating using this: $qry=mysqli_query($con,"update dbo_tbfeemaster set nu_amount='$amount3' nu_sub_id='$subscription3' , vc_member_type='$member_type3' , vc_financial_year='$financial_year2' "); and code not working , data not being update. 3rd if give date manualy if give static fetched database date in sql query code working fine

jpa - When I call EclipseLink merge why does it do a select query first when I've already requested the object via it? -

when call eclipselink merge why select query first? using sql statement logging see select before update. i have through due l2 cache wouldn't need thye select first. thanks if object in cache not issue select. either object not in shared cache, or invalid. if still having problems include code , config.

php - How to display my output in a dropdown list -

i want program list data mysql table in list in dropdown menu on page. here's code: <fieldset> <legend> selecteer uw categorie </legend> <label ="categorie"> categorie </label> <select name ="categorie" id="categorie"> <datalist id ="categorie"> <option value="router">router</option> <option value="switch">switch</option> <option value="toestel">toestel</option> <option value="basisstation">basisstation</option> <option value="repeaters">repeaters</option> <option value= <?php $con=mysqli_connect("localhost","root","admin","inventarisdb"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $result = mysqli_query($con,"select * categorien"); while($r

How can I run a ruby class from rake file? -

i want run ruby class sample.rake file. consider myruby.rb ruby file. i want run sample.rake ruby myruby.rb adding @tobias has here go example script sample content of myruby.rb puts "hello world" create file called rakefile task :default => [:test] task :test ruby "my_file.rb" end now if invoke rake should file hello world text in console. update it make more sense if wrap call in function call suggested @tobias so rakefile become like require './myruby.rb' task :default => [:test] task :test ruby "my_file.rb" end task :test2 do_something end and myruby.rb def do_something puts "do something" end now rake test2 should spit out do something

PHP and SQL one page insert into database -

i have written php page form on submit button set action php form page. <form id="form1" method="post" action="../control_lbs/lbs_trace.php"> the insert basic sql load information database. the problem have every time open page sends blank information rows. there away can prevent happening? $sql = "insert lbs_trace_etrack (lbs_msisdn, lbs_req_by, lbs_date_req, lbs_reason, lbs_station, lbs_cas, lbs_traced_by) values ('$_post[lbs_msisdn]','$_post[lbs_req_by]','$_post[lbs_date_req]','$_post[lbs_reason]' ,'$_post[lbs_station]','$_post[lbs_cas]','$_post[lbs_traced_by]')"; the above php action code this new code , full code use if ($con = mysql_connect($host, $username, $password)) { if ( !empty($_post["send"])) { $sql = "insert lbs_trace_etrack (lbs_msisdn, lbs_req_by, lbs_date_req, lbs_reason, lbs_station, lbs_cas,