Posts

Showing posts from February, 2014

asp.net - Pass parameters to a webmethod from querystring -

guys. i'm developing website asp , vb.net 4. i'm using fullcalendar jquery plugin, have trouble: catching parameter querystring webmethod in .asmx. i've tried refer querystring property request.querystring() , doesn't work. here's webmethod: <%@ webservice language="vb" class="wbscalendario" %> imports system.web imports system.data imports system.data.sqlclient imports system.web.services imports system.web.services.protocols imports system.web.script.services imports system.collections.generic imports system.configuration.configurationmanager <webservice(namespace:="http://tempuri.org/")> _ <webservicebinding(conformsto:=wsiprofiles.basicprofile1_1)> <scriptservice> _ public class wbscalendario inherits system.web.services.webservice <webmethod()> _ public function listareventos(byval starte string, byval ende string, byval v string) list(of calendarioevento) dim conexaosql new sqlconnectio

c# - Help, i can't get my properties into the designer PropertyGrid -

what wrong this? property leftimage doesn't show in propertygrid (winforms .net 3.5) private image _leftimage; /// <summary> /// sets small image appearing left of trackbar /// </summary> [ description("the small image appearing left of trackbar"), category("appearance"), editorattribute(typeof(system.drawing.design.imageeditor), typeof(system.drawing.design.uitypeeditor)), defaultvalueattribute(typeof(image),"null"), browsable(true), editorbrowsable(editorbrowsablestate.always) ] public image leftimage { private { return _leftimage; } set { if (value.height != 16 || value.width != 16) { _leftimage = new bitmap(value,new size(16,16)); } else _leftimage = value; invalidate(); } } where go wrong??? ide doesn't complain anything, , compiles fine, , other properties sh

Dijkstra's algorithm with negative weights -

can use dijkstra's algorithm negative weights? stop! before think "lol nub can endlessly hop between 2 points , infinitely cheap path", i'm more thinking of one-way paths. an application mountainous terrain points on it. going high low doesn't take energy, in fact, generates energy (thus negative path weight)! going again wouldn't work way, unless chuck norris. i thinking of incrementing weight of points until non-negative, i'm not sure whether work. as long graph not contain negative cycle (a directed cycle edge weights have negative sum), have shortest path between 2 points, dijkstra's algorithm not designed find them. best-known algorithm finding single-source shortest paths in directed graph negative edge weights bellman-ford algorithm . comes @ cost, however: bellman-ford requires o(|v|·|e|) time, while dijkstra's requires o(|e| + |v|log|v|) time, asymptotically faster both sparse graphs (where e o(|v|)) , dense graphs (wh

c# - SharePoint Web Part & Singletons -

i have sharepoint project override search box , other things. have web part page responds search box. these components should share single configuration. thought creating singleton, not sure how ever cleaned / removed memory / uninstalled. any ideas? warnings using singletons in sharepoint? also, there proper way share instance of object between these componenets? edit: thinking simple singleton. configuration needs contain 5-20 strings , dozen integers @ most. no complex objects :) as long objects being managed singleton class thread-safe there shouldn't issue. example: have series of object-calls taking long-time process (7+ seconds). so, decided try using comet-styled long-polling technique process them. such, host service (as static singleton) in single thread , process requests using asynchronous httphandler's...and works great! , because i'm using service asynchronously it's highly efficient because calling thread gets released (upon completi

asp.net - Microsoft Speech Object Library - Client or server? -

i know can use microsoft speech object library asp.net sites. depend on client, or come server? want know if client dependent @ on using macs or linux? using system; using system.collections.generic; using system.linq; using system.web; using system.web.mvc; using speechlib; using system.threading; namespace aries.web.controllers { public class homecontroller : controller { public static spvoice speach; public actionresult index() { viewbag.message = "welcome asp.net mvc!"; speach = new spvoice(); //speach.speak("this test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test ", speechvoicespeakflags.svsfdefault); speach.speak("this test test test test test test test test test test test", speechvoicespeakflags.svsflags

java - How to call a web security with message security and client certificate authentication? -

i need call web service java client. service authenticates clients through certificates @ message level (ws-security, not ssl). it should possible since, can generate web services jax-ws mutual certificate security in this dialog . but don't manage create client. has idea ? i did not tried myself , http://download.oracle.com/docs/cd/e17802_01/webservices/webservices/docs/2.0/tutorial/doc/ : configuring message security using xwss the application server contains of jar files necessary use xws-security securing jax-ws applications, however, in order view sample applications, must download , install standalone java wsdp bundle. can download java wsdp http://java.sun.com/webservices/downloads/webservicespack.html . to add message security existing jax-ws application using xwss, follow these steps on client side: create client security configuration. client security configuration file specifies order , type of message security operations used client applicatio

Temporary ASP.NET Hosting -

so found several questions on asp.net , hosting, none of them (as far find) quite answered question. basically, i'd able temporarily deploy websites work on server can verify deployment process goes okay. essentially, i'm looking "trial" hosting doesn't require follow purchase; temporary hosting. does know of such thing? or , better off getting myself separate computer "host" home , deploy that? you can use reliable come 15 day money guarantee. if think can need in 15 days can this. however see need pay first , request money back. think never seen hosting site yet give x days without sort of registration , @ least put credit card down. 15 day money policy(reliable policy) if reason within first 15 days of period wish cancel account, issue full refund no questions asked. request refund please submit account cancellation ticket using our billing portal @ http://payments.reliablesite.net . in reason cancella

ruby on rails - Devise: Overriding create action in Registrations Controller for Recaptcha -

i'm trying override create method registrations controller in devise include recaptcha verification (as seen here , here ): class registrationscontroller < devise::registrationscontroller def create if verify_recaptcha super else build_resource clean_up_passwords(resource) flash[:alert] = "bad words." render_with_scope :new end end end also changed routes.rb accordingly: map.devise_for :users, :controllers => {:registrations => "registrations"}, :path_names => { :sign_up => 'signup', :sign_in => 'login', :sign_out => 'logout' } when trying visit new registration page (with new path name: http://localhost:3000/users/signup ) errors shows up: loaderror in registrationscontroller#new expected /home/benoror/project/app/controllers/registrations_controller.rb define registrationscontroller full error trace any appreciated. btw , i'm

iPhone Use UIImagePickerController to capture selective frames from a video -

i wanted use uiimagepicker record video let user browse frames using scrollview built in uiimagepicker , while @ it, select few frames interest user. i know can overlay control on top of uiimagepicker trigger selection what not sure whether have programatic access current frame shown uiimagepicker me extract image out of it. please let me know if doable/possible. are there other time efficient/elegant ways achieving above? i had created own view video recording , frame selection (using avcapturesession, avcapturevideodataoutput) take me quite bit of time polish make uiimagepicker plus familiar default camera app in iphone. i hope makes sense want achieve. i know 1 can kind of achieve goal taken screenshot of screen want user click 1 button capture current show frame. thanks screenshot method did not work frozen frame video recording. went custom avfoundation based frame capture.

PHP SOAP issue feeding in results -

i'm trying create page displays current results ca lottery using php. i've used xml before, having issues soap. found this page , not lot of help. i've put code below, , able return object. can't feed in results need. amazing. try { $options = array( 'soap_version'=>soap_1_1, 'exceptions'=>true, 'trace'=>1, 'cache_wsdl'=>wsdl_cache_none ); $client = new soapclient('http://services.calottery.com/calotteryservice.asmx?wsdl', $options); } catch (exception $e) { echo "<p>exception error!</p>"; echo $e->getmessage(); } echo '<p>connection: success;</p>'; try { $response = $client->getcurrentgameinfo(); } catch (exception $e) { echo 'caught exception: ', $e->getmessage(), "\n"; } $x = simplexml_load_string("<?xml version=\"1.0\"?>".$response->getcu

html - Embed youtube video into facebook wall when user uses facebook like button -

when user clicks facebook button on site, post hits wall. i'd post have video embedded in youtube. possible? right i'm using following code: <meta content="http://www.youtube.com/embed/g5t76rigxpq" property="og:video" /> <meta content="560" property="og:video:height" /> <meta content="349" property="og:video:width" /> <meta content="application/x-shockwave-flash" property="og:video:type" /> a button alone won't you. you'll have programmatically post video via fb api. examples , docs: programatically add , youtube video wall post http://developers.facebook.com/docs/reference/api/post/#publishing

Building a very large website, need advice on whether to use Zend, Symfony, Ruby or Django -

i'm starting build website, based on idea i've been thinking through past 2 years. i'll go in bit of detail website do, more of audience have. when website launched, used associations throughout west midlands (i'm in uk). altogether there on 130 associations, each association has between 5 25 members. there possibility of lot of traffic here. add this, when website rolled out, every association (hopefully) in every county of uk on website. further this, there traffic generated people know what's going on these associations, may not in them. as can see, have potential large user base. website code (i know server issues) needs able deal these effectively. doesn't have lightening quick, can't take 10 minutes process request either. it's important there lot of content being uploaded (images , videos being 2 main content hogs) , viewed @ same time. so, while planning website, can't make mind use out of zend, symfony, ruby or django. know lot of

Javascript to stop HTML5 video playback on modal window close -

i've got html5 video element on modal window. when close window video continues play. i'm total newbie js. there easy way tie video playback stop function window close button? below html page: <!doctype html > <html lang="en"> <head> <meta charset="utf-8" /> <title>modal test</title> <script type="text/javascript" src="jquery.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $("#showsimplemodal").click(function() { $("div#simplemodal").addclass("show"); return false; }); $("#closesimple").click(function() { $("div#simplemodal").removeclass("show"); return false; }); }); </script> <style type="text/css"> div#simplemodal { position:absolute;

wpf - How can I change the DataTemplate for DayTitleTemplate in a CalendarItemTemplate -

when try change default datatemplate daytitletemplate in calendar , if root element not textblock, application crashes. does knows how avoid crash? here simplified version of template demonstration purposes. (kaxaml ready) <page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <grid> <calendar> <calendar.calendaritemstyle> <style targettype="calendaritem"> <setter property="template"> <setter.value> <controltemplate targettype="calendaritem"> <controltemplate.resources> <!-- ___________________________________________________________________ --> <!-- default data template --> <datatemplate x:key="{componentr

objective c - Invalid Summary in NSString assignment -

i trying implement simple calculator have update current operation (+, -, * etc) in variable of type nsstring. current operation received model parameter. -(double)dooperation:(nsstring *)operation withoperand:(double)operand { if (!currentoperation) { anoperand = operand; } currentoperation = operation; //invalid summary in currentoperation; + in operation } what wrong in this? if direct assignment of pointers not allowed nsstring, alternate method? edit to more precise, legal in ios assign nsstring = sign? if not, way go. note: currentoperation private variable in controller class , operation parameter method. here complete code @interface calculatorbrain : nsobject { double anoperand; nsstring * currentoperaion; } - (double) dooperation: (nsstring *) operation withoperand: (double) operand; @end @implementation calculatorbrain - (double) dooperation: (nsstring *) operation withoperand: (d

interface - Persisting one table per class hierarchy using NHibernate without discriminator? -

i have interface , class implements interface. public interface iphase { string description { get; set; } int id { get; } string phase { get; set; } } public class phase : iphase { // implementation here... } now, using nhibernate 2.1.2.ga, wish use table-per-class-hierarchy map interface , implementor, , indeed, don't need discriminator, implementor class persisted in table. haven't used nhibernate year , half now, , i'm suffering memory blanks here... i have read question , answers related, except i'm not using fnh. nhibernate mapping: save hierarchy single table without discriminator i wonder whether discriminator attribute obligatory while using subclass ? what shall xml mapping in particular context? thanks kindly help! of course nhibernate needs discriminator table-per-class-hierarchy mapping, how should identify different subclasses when getting row database otherwise? if there 1 implementation of interface, why want

c# - WPF forcing redraw of canvas -

okay, in windows forms can use .refresh() cause redraw event on element. there similar solution in wpf? an explanation of i'm doing, i'm drawing maze on canvas object, , watch maze drawn (so can see progress) instead of waiting 28 min solution appear. drawing blocks on canvas series of rectangle s. should refresh on rectangle or canvas? here recent output: http://imgur.com/ftfov i'd solution in c# if possible. thanks. you want use dispatcher object. suggest take shawn wildermuth's article: build more responsive apps dispatcher (msdn magazine october 2007).

java me - how to convert a j2me application into android application? -

i working in j2me application .and on want convert in android (.apk). want know there tool available doing conversion stuffs. try http://www.assembla.com/wiki/show/j2ab/converting_from_j2me

html - Can I define a rollover CSS style in-line? -

possible duplicate: how write a:hover in inline css? is possible this: <a href="#">link</a> a{ color: red; } a:hover{ color: blue; } as inline? <a href="#" style="color: red; ....;">link</a> no. style="" allows define list of style properties. no css selectors allowed there.

java - instead of arrayCollection -

i trying return values java flex front end using blazeds.successfully blazeds connecting while retrieving values showing [object asynvtoken] not getting values java method. my flex code is: <fx:script> <![cdata[ import mx.collections.arraycollection; import mx.controls.alert; import mx.rpc.asynctoken; import mx.rpc.events.faultevent; import mx.rpc.events.resultevent; public function get_user():void { var token:asynctoken = ro.getoperation('getuser').send(); user_grid.dataprovider = token.tostring(); alert.show(user_grid.dataprovider.tostring()); } private function fault(e:faultevent):void { alert.show("code:\n" + e.fault.faultcode + "\n\nmessage:\n" + e.fault.faultstring + "\n\ndetail:\n" + e.fault.faultdetail); } pri

iphone - how to get the bytes count of unsigned char datatype in iphonesdk -

wrote below code... how can count of bytes in byteptr variable. unsigned char *byteptr = (unsigned char *)[imagedata bytes]; thanks.....in advance the number of bytes given [ imagedata length ]

Java Generics Type Casting -

lets say... <t, s extends t> void work(final class<t> type, final s object) {} or <t> void work(final class<t> type, final t object) {} how can pass following parameters work()? final class<?> type = <not null> // reflection output. final object object = <not null> assert type.isinstance(object); // absolutely guaranteed work(type, type.cast(object)); // compile error; how can this? work(type, object); // compile error; how can this? you'd need class<t> work, can that. once have that, can this: work(type, type.cast(object)); now, since you've got class<?> can't assign class<t> , can work around providing additional method: <t> void checkedwork(final class<t> type, final object object) { work(type, type.cast(object)); }

outlook - Delphi and MSG file -

how display outlook message file using delphi 2010? there way wrap outlook app , open within delphi? toutlookapplication ? exists in d2007 , in delphi xe. assume exists in d2010 too. as alternative can import outlook object library through component->import component... menu option.

java - runtime error inputstream cannot be null -

i have runtime error in logcat: 05-11 06:24:23.672: error/androidruntime(327): java.lang.runtimeexception: unable create application net.osmand.activities.osmandapplication: java.lang.illegalargumentexception: inputstream cannot null ... after debugin found exception comme how??? in methode : private baseosmandrender loadrenderer(string name, set<string> loadedrenderers) throws ioexception, saxexception { inputstream = null; if(externalrenderers.containskey(name)){ = new fileinputstream(externalrenderers.get(name)); } else if(internalrenderers.containskey(name)){ = osmandrenderingrulesparser.class.getresourceasstream(internalrenderers.get(name)); } else { throw new illegalargumentexception("not found " + name); //$non-nls-1$ } baseosmandrender b = new baseosmandrender(); b.init(is); loadedrenderers.add(name); list<baseosmandrender> dep

android - Start Activity on AlertDialog -

i using alertdialog add new contact , inside button supposed let user choose picture source, either taking picture or selecting 1 gallery. if use startactivity inside alertdialog, able return alertdialog without alertdialog closing? tried adding dialog dialog in other fields input validation alertdialog seems close before other popup shows up. you should use activity in dialog mode this. alertdialog not supposed doing , yes close , lose context. here how it. <activity android:name=".mydialogactivity" android:theme="@android:style/theme.dialog" android:configchanges="keyboardhidden|orientation|keyboard"></activity>

c# - The calling thread cannot access this object because a different thread owns it.How do i edit the image? -

i know there's lot of these type of questions. wanted post can share specific prob because im getting frustrated. im running thread query path db , put in image element.problem is, created image in xaml when run thread throws cannot access object error cant access image element. then how set without using xaml??here's code snippet: public partial class window1 : window { thread frame1; public window1() { initializecomponent(); intializedb(); #region start frame 1 thread frame1 = new thread(frame1); frame1.setapartmentstate(apartmentstate.sta); frame1.isbackground = true; frame1.start(); #endregion } public void frame1() { string k; command.commandtext = "select * imageframe1"; sqlconn.open(); reader = command.executereader(); while (reader.read()) { bitmapimage logo = new bitmapimage(); logo.begin

python try/exception help -

i'm trying support repetition user inputs filename, inputs 2 integers. if exception thrown, want user prompted input again. my problem if valid file entered invalid integer entered ask file again instead of integer. how can fix code ask integer again. here have: while true: try: f = raw_input("enter name of file: ") infile = open(f) # more code except ioerror: print ("the file not exist. try again.") else: try: integer = int(raw_input("enter integer: ")) integer2 = int(raw_input("enter integer: ")) # more code except (typeerror, valueerror): print ("not integer. try again.") try use multiple while loops: while true: filename = raw_input("enter name of file: ") try: # more code here detect or open file break except exception: # can ioerror or else

how to reduce the rework on Informatica ETLs due to change of table and column names -

currently, have lot of etls developed , underlying table , column names going change. example, physical names used abbreviated names rather full names since wanted deploy on oracle, now, decided use sql server, hence there discussion on using full names @ db level. impact etls have developed. i wondering whether there efficient way remap etl changed column names? can provide file old , new table/column names input. any on appreciated. one possible way use sql override value in of source qualifier transformations contains sql query parameter file substitutions. way can change column names , select them in mapping sources without modifying source definitions. of course require up-front refactoring of existing source qualifier transformations. alternatively, @ database level create views onto existing tables use old abbreviated column names, providing translation between new column name , old one. not require changes existing etl. however, advise against changing in c

javascript - Efficiency of using php to load scripts? -

i have website that's 10-12 pages strong, using jquery/javascript throughout. since not scripts necessary in each , every page, i'm using switch statement output needed js on given page, reduce number of requests. my question is, how efficient that, performance-wise ? if not, there other way selectively load needed js on page ? this may not necessary @ all. bear in mind if caching set up, embedding javascript take time on first load - every subsequent request come cache. unless have big exceptions (like, specific page using huge js library), consider embedding @ times, maybe using minification in 1 small file. i don't see performance issues method using, though. after all, it's deciding whether output line of code or not. use whichever method readable , maintainable in long term.

javascript - java - checking file content before uploading to server -

i have got situation now. i need develop webpage user can select file upload , before uploading file server need check first few lines of file whether data valid or not , if data valid upload file, if not through error message. the file text file. thanks, sandeep html/javascript not offer way of reading contents of local file. must either upload , check in server. if want client side check, must build signed applet(or activex) run in webpage , handle upload instead of using plain html.

mysql - Full table search and data encryption -

i had developing client software in vb6 , mysql. table create table if not exists `main_table` ( `f_id` int(11) not null default '0', `id` mediumint(15) not null auto_increment, `text_to_encrypt` mediumtext primary key (`id`), key `f_id` (`f_id`) ); the client wants data encrypt column of text_to_encrypt. easy encrypt data real problem text searchable keywords provided user , show data after decrypting encrypted data. column has 900,000 , going increase, want solution windows os. do? if client 1 determines how should behave, client has know cannot search encrypted data keywords without decrypting it. that means taking entire contents of table, decrypting , searching.

javascript - How to check a text in HTML content using jQuery? -

i want check particular word/text in html content using jquery. eg: let html content be &ltp>i love stackoverflow&lt/p&gt so how can check & highlight sentence if contains word 'love'? thanks in advance. :) you can use jquery.contains() $(document).ready(function(){ $("p:contains('love')").css("background-color","red"); }); hope helps!!!

c# - Unit testing void method that creates a new object -

i have method following: public void executesomecommand() { new mycommand( someint, someenum.enumvalue ).execute(); } i'd test enum value passed in constructor of icommand object i'm creating correct value. there way can rhino.mocks? option 1: use seam the easiest way refactor method seam: public void executesomecommand() { this.createcommand(someint, someenum.enumvalue).execute(); } // seam protected virtual icommand createcommand(int someint, someenum someenum) { return new mycommand(someint, someenum.enumvalue); } this way can intercept creation of 'new' operator extending class. when doing hand, might this: public fakesomeservice : someservice { public int someint; public someenum someenum; protected override command createcommand(int someint, someenum someenum) { this.someint = someint; this.someenum = someenum; return new fakecommand(); } private sealed class fak

c# 4.0 - wpf Treeview CheckBox Item ForeGround Color cannot Change when it is disabled? -

this xaml style treeview checkbox item. i'm using syncfusion treeview. <style x:key="contractlistitemcontainerstyle" targettype="{x:type syncfusion:treeviewitemadv}"> <setter property="isexpanded" value="true" /> <setter property="isselected" value="{binding isinitiallyselected, mode=onetime}" /> <setter property="keyboardnavigation.acceptsreturn" value="true" /> <setter property="iseditable" value="false" /> <setter property="isenabled" value="{binding enable}" /> <setter property="foreground" value="red" /> <style.triggers> <trigger property="isenabled" value="true"> <setter property="foreground" value="green" /> </trigger> <trigger property="isenabled"

c# - Image loading slow in WPF -

i creating slide-show application in wpf. storing image list of strings, , creating new bitmapimage host image when requesed. caused images take longer load up, not ideal. ideal scenario application startip slower change images quickly, rather vise-versa, instead decided load of images application @ start (ie creating list of bitmap images) , cycle through these. imrpvoed matters, there still 1 slight issue. in image set using test there 1 large image, , on first run takes 1 or 2 seconds load. subsequently however, image loads instantly. image stored bitmapimage in code persitantly, can onyl assume wpf kind of graphics caching when loads image, means same image load quicker if displayed again. can verfiy that, , if so, there simple way programatically make wpf perform caching on of images? many in advance, rob

.net - Publish a website. net 4.0 on a host with. net 3.5 -

develop site on webmatrix , trying publish it. on host hired support .net framework 3.5, , site runs on .net 4.0. is there way make work in 3.5. in webmatrix have option of exchanging .net 4.0 2.0 , there's no way switch 3.5, .net 2.0 not work. you paid host, not possible change host. the whole of web pages (razor) framework compiled against .net 4.0. cannot asp.net web pages sites run unless .net 4 installed on web server.

php - Automatically update $_SESSION variables without refreshing -

i using $_session variable send emails via ajax (they need sent without refreshing page), $_session variable doesn't automatically update, when changes need refresh page update variable. is possible update $_session variable without refreshing? this code i'm using send email: $(document).ready(function(){ $("#medicalembassy").validate({ debug: false, rules: { name: "required", email: { required: true, email: true } }, messages: { name: "please let know are.", email: "", }, submithandler: function(form) { // other stuff valid form $.post('http://www.example.co.uk/erc/process.php?imei=<?php echo $_session['imei2']; ?>&send_type=2', $("#medicalembassy").serialize(), function(data) { $('#results').html(data);

reference - Return the current object (*this) in C++? -

i have following code: code 1 class student { int no; char grade[m+1]; public: student() { no = 0; grade[0] = '\0'; } void set(int n, const char* g) { no = n; strcpy(grade, g); } const student getobject() { return *this; } void display() const { cout << no << ", " << grade << endl; } }; code 2: // no change code 1 const student& getobject() { return *this; } // no change code 1 as book reading explains difference in getobject() of code 1 , 2 getobject() of code 2 returns reference current object, instead of copy (for efficiency reasons). however, have tested (code 2) follows: tested code: student harry, harry1; harry.set(123, "abcd"); harry1 = harry.getobject(); harry1.set(1111,"mmmmmm"); harry.display(); // line 1 => displayed: 123, abcd harry1.display(); /

c# - log parser 2.2 query, Text parsing and validating -

there simple text file have parse using log parser. started using log parser not understanding parsing limit. mean can such thing using logparser textline parse: 1022303name wxp3 this have parse like first digit 1 row name next 3 digit 022 errornumber next 3 digit 303 userid next ten char name username next 4 char wxp3 systemname i not able understand can query log parser or not... if yes give sample query. any other tool perform welcomed you want substr function. logparser -i:textline "select substr(text, 0, 1) rowname, substr(text, 1, 3) errornumber, substr(text, 4, 3) userid, substr(text, 7, 10) username, substr(text, 17, 4) systemname temp.txt this assumes lengths set particular size. temp.txt text used above: 1022303name1 wxp3 1022303name 2 wxp4 1022303name 3 wxp5 1022303name 4 wxp6 1022303name 5 wxp7 1022303name 6 wxp8 1022303name 7 wxp9 1022303name 8 wxpa since it's been linked before, i'll p

html - Display Div + span on same line? -

having trouble displaying div , span on same line.. styles are.. div color: black; display: inline; font-family: arial, sans-serif; font-size: 13px; height: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-y: visible; padding-top: 0px; white-space: nowrap; width: 0px; span color: black; display: inline; font-family: arial, sans-serif; font-size: 13px; height: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-y: visible; padding-top: 0px; width: 0px; div both wrapped in color: black; display: block; float: left; font-family: arial, sans-serif; font-size: 13px; height: 20px; margin-bottom: 0px; margin-left: 8px; margin-right: 0px; margin-top: 0px; overflow-y: visible; padding-top: 1px; width: 373px; what need change div , span displaying on same line? div displays , span on line under it. you need add display:inline;

How to stop a restore of a database with Microsoft SQL Server 2005? -

how stop or cancel or kill restore of database microsoft sql server 2005? can give me request or procedure in ssms type sp_who list of open spids (session id's). find 1 contains restore. command restore database . use kill xxx xxx spid of transaction.

WPF: Problem with overlapping controls and grid column widths -

i have problem regarding parent grid control in overlaps tabcontrol. i need child grid (in tab control) resize columns according overlapping control. specifically, when overlapping control resized (due resize of window example) child grid inside tabcontrol needs resize columns child controls inside tabcontrol grid isn't overlapped control overlaps tabcontrol. i sincerely hope here knows solution problem, i've been fighting days :) thanks in advance! best regards, req edit: in response comments below: absolutely - figured should have, seeing was/am @ work didn't have code handy. can write similar example of xaml. <grid name="parentgrid" > <grid.columndefinitions> <columndefinition width="1*" /> <columndefinition width="1*" /> <columndefinition width="1*" /> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition height="1*" />

C# convert byte[] containing a c-style string to string - NOT Encoding.GetString(byte[]) -

stupid me tries convert byte-array received external source not unter control string. (and yes, know encoding.getstring(byte[]) . what have far: void myfunc() { byte[] rawdata = new byte[ 128 ]; for( int = 0; < rawdata.length; ++i ) { rawdata[ ] = 0; } rawdata[ 0 ] = (byte)'h'; rawdata[ 1 ] = (byte)'e'; rawdata[ 2 ] = (byte)'l'; rawdata[ 3 ] = (byte)'l'; rawdata[ 4 ] = (byte)'o'; string asstring = encoding.utf8.getstring( rawdata, 0, rawdata.length ); string asrealstring = encoding.utf8.getstring( rawdata ); } both strings contain hello part lot of \0's afterwards - not thing expected. output debugger: asrealstring = "hello\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&

vb.net - webservice to WCF -

we had developed webservice in vb.net,framework 2.0. need rewrite websevice in wcf framework 3.5. please provide guidance regarding , there many othersystems consuming our webservice url. conversion have impact on source system or involve build activity source system consume url developed wcf method? please provide sample example have better understanding on this. thanks! a few thoughts. case 1: webservice having consumers , want rewrite service , not disturb consumers. in case using basichttpbinding end point regular wcf service implementation do. can find many references build wcf service basichttpbinding. fit need. follwoing links may helpful you. http://msdn.microsoft.com/en-us/library/aa480190.aspx http://msdn.microsoft.com/en-us/library/ms731361(v=vs.90).aspx case 2: if want rewrite service, , acceptable have changes in consumers, worthy consider following points. endpoint choice a. if preference keep service interoperable (i.e. service serve diffe

How to Enter Captcha data with phpunit test -

is possible enter captcha information phpunit tests? something like $this->type("recaptcha_reponse_field", "information inside"); i understand captcha created prevent kind of things, i'm sure some1 out there once had test system automatically needs captcha information before submiting form. thanks d~~~ you can't that, unless ocr captcha image. no longer test :) usually kind of bypass implemented on server side. in pseudocode like: if ($config->bypass_captcha) { if ($recaptcha_response_field == 'correct') { // happens after submit } else { // happens on incorrect captcha } } else { // call recaptcha api perform real check } then need ensure "bypass_captcha" never enabled on on public servers. of course, there other ways - disabling captcha check given ip address (that belongs host run test from)

web services - Which is the best Java REST API? -

even though subjective question, know 1 best java rest api web services? we using spring in our application, if there api works spring us. the other important thing api needs interoperable. in future, might want invoke web services .net applications also. so, 1 thing need keep in mind while choosing api or framework. ps: don't know web services. need guidance in case. thanks the standard jax-rs ( jsr-311 ), of there multiple implementations : jersey (the reference implementation) resteasy restlet apache cxf the api identical across jax-rs implementations, modulo different api extensions implemented each.

HTML5 Video in Chrome/PC -

been working html5 video bit - found in order cover bases browsers, need 3 formats html5 video player: .mp4, .ogv, , .webm (with flash player fallback of course). been converting using combination of wondershare , firefogg, , i've had great success it. however, discovered chrome/pc playing audio video, video isn't rendering - 3 formats. it's fine on safari/mac, ff/mac, chrome/mac, ff/pc, , ie/pc - not chrome/pc. i've determined isn't issue html5 player, videos - accessing files directly yields same results, audio no video. has else encountered this? there special trick web-encoding videos chrome 11, or need 4th format? it'll codec problem. try when encoding mp4 format. video codec : mpeg-4 avc/h-264 audio codec : advanced audio codec(aac)

testing - how to test an REST app (built with apache-cxf) with jersey-test-framework -

know how can test rest application, developed using apache cxf , spring, jersey test framework (jtf). the application made of several maven modules, of "app-rest" 1 integrates them , exposes rest interface tested. i've made separate maven module contains tests, has "app-rest" dependency, i'm receiving exception : beandefinitionstoreexception: ioexception parsing xml document class path resource when running tests. think that's because app-rest not deployed in embedded container. i've tried put tests "app-rest" module, instead : runtimeexception: scope of component class org.apache.cxf.jaxrs.provider.atomfeedprovider must singleton i'm running test command line: mvn test -dtest=jerseyresttest -djersey.test.containerfactory=com.sun.jersey.test.framework.spi.container.grizzly.web.grizzlywebtestcontainerfactory these pom.xml file tests module: <project xmlns="http://maven.apache.org/pom/4.0.0"

semantics - Counting in SPARQL -

ok have query prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select distinct (count(?instance) ?count) { ?instance <http://dbpedia.org/ontology/ambassador> . } and result 286. cool. want number of ambassadors have http://dbpedia.org/property/name property. but prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select distinct (count(?instance) ?count) { ?instance <http://dbpedia.org/ontology/ambassador> . ?instance <http://dbpedia.org/property/name> ?name } results in 533 :(. counting more because there people have property 1 or more times. how number of ambassadors have property regardless of how many times have it. can in single query? thanks. you might want try this: prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> select (count(distinct ?instance) ?count) { ?instance <http://dbpedia.org/ontology/ambassador>; <http://dbpedia.org/property/name> ?name } it's giving me result