Posts

Predefined Interface exposes some method,we are using that method but interface doent have definition part ,then how its working in c#? -

interface exposes method,we using method in class interface doent have definition part ,then how working in c#. example class productnamecomparer : icomparer { public int compare(object x, object y) { product first = (product)x; product second = (product)y; return first.name.compareto(second.name); } } here icomparer exposes compareto() method, icomparer doesn't have compareto() method definition part, how working? interface contract declares method rather having implementation part.... class implements particular interface should have implemenation detail. for instance, have ianimal interface , dog class implements ianimal interface, public interface ianimal { void walk(); // declares method, not implemenation } //class implementing interface //must define method specified in interface class dog : ianimal { public void walk() { console.writeline("dog can ...

php - Filtertering HTML tags -

is there way filter html tags except tags of choice <strong>, or <b>, <i> ? know htmlentities job filter of html tags. check this: http://www.php.net/strip_tags // allow <p> , <a> echo strip_tags($text, '<p><a>'); edit: actually, mean "filter"?

Android Uploading apk first time with apk exapansion -

i uploading game apk expansion.but when upload first apk not showing popup expansion file upload,second time updated version show popup upload expansion file. let me know if have solution it. thank you. this issue of google developer console. you have upload second apk able add expansion file.

Magento XML configuration -

i have follow instruction per magento u, configuration xml. xml configuration not working side. here code have done. app/etc/first_module.xml <?xml version="1.0"?> <config> <modules> <first_module> <active>true</active> <codepool>local</codepool> </first_module> </modules> </config> in local codepool first/module/etc/config.xml <?xml version="1.0"?> <config> <default> <some> <ranadom> <xpath>here value</xpath> </ranadom> </some> </default> </config> now, want call xpath value in cmscontroller indexaction() for have put code in cms/contollers/indexaction() echo "test"; echo mage::getstoreconfig('some/random/xpath'); die; with of echo mage::getstorecon...

hibernate - How to update columns value with new value -

i update column value new entity value incrementally, example: support have table user column name balance for specific user, balance 3000. now, set value 3500. i have hibernate "user" entity has 'balance' value of 500. how can make update?? if make using pure sql query, simple do: "update user set balance = balance+500 user_id=3" i avoid calling sql , use hibernate. have tried below code? remeber mention possible solutions tried before asking question. user user=session.get(user.class, 3); // 3 id of user. user.setbalance((user.getbalance()+500)); session.saveorupdate(user); session.commit();

"time" command in Cygwin works, but not in NetBean -

i can in cygwin, adding time command user@user_pc ~ $ time ./helloworld shows smthing like hello world!!! real 0m0.270s user 0m0.270s sys 0m0.270s i've deployed similar c/c++ project @netbean7.2 @win 7. it shows error message @ run time, when add time command ,like: time "${output_path}" ,at text field of projcet_file-> r_click -> properties -> run -> run_command: ,and default value ${output_path} only. error message c:\projectfolder\time not exist or not executable ,seems netbean consider time excutable any better ways solve it?? full command bash needs in quotes if calling cmd shell bash -c "time ls"

php - Sort the contents of the textfile in ascending -

i trying develop code sort contents of text file in ascending order. have read contents of file , able display texts. having difficulty sorting them out in low high order, word word. i have tried asort php.net, not code work well. thanks. to answer second question, can read text file into variable (like you've said have already), eg. $variable, use explode ( http://php.net/manual/en/function.explode.php ) separate, @ each space, each word array: //$variable content text file $output = explode(" ",$variable); //explode content @ each space //loop through resulting array , output ($counter=0; $counter < count($output); $counter++) { echo $output[$counter] . "<br/>"; //output screen line break after each } //end loop if paragraph contains commas etc don't want output can replace in variable before exploding it.

unity3d - IOS (IPad) How to load a screenshot created at runtime into a Texture or Texture2D -

we facing issue unity. developing ipad app. 1 feature take screenshot , use button. because tree directory in ipad doesn't exist resources folder, can't use "resources.load", , so, because how feature must work, texture won't available @ beginning, can't put in resources folder. have tried several solutions, creating in ipad resources folder (inside documents folder) , trying load texture it, or piece of code: public texture loadtexturefromfile(string filename) { texture2d texture = new texture2d(1024, 768); filestream fs = new filestream(filename, filemode.open, fileaccess.read); byte[] imagedata = new byte[fs.length]; fs.read(imagedata, 0, (int)fs.length); texture.loadimage(imagedata); return (texture texture); } any appreciated. we've been stuck issue several days you can try following: texture2d tex = new texture2d(screen.width, screen.height); tex.readpixels(new rect(0, 0, screen.width, screen.height), 0, 0)...

php - Store magento contact form data in database? -

i want store magento contact form data database. don't know posts controller? i want send email store data in custom table. thanks. once have custom table built create module in local pool , extend mage_contacts_indexcontroller . @ ticket submitted in magento.stackexchange.com . code use in post below contact form. use right $_post variable pass custom form. see code here , how extend it

javascript - Firefox gives error for an event object -

this code works great on chrome, wont work on ie or firefox. $('.modal').on("click", ".action", function() { if($(event.target).hasclass('added')) { if($(event.target).hasclass('remove_vehicle')) { //code } i error on firefox console: referenceerror: event not defined [break on error] if($(event.target).hasclass('added')) { what wrong here? both event.trigger , hasclass supposed work on firefox. try - $('.modal').on("click", ".action", function(event) { // see difference in line if($(event.target).hasclass('added')) { if($(event.target).hasclass('remove_vehicle')) { //code }

android - Performing a Scheduled task from a Service and Keeping that service Alive -

public class myhibernatedservice extends service{ public void oncreate() { super.oncreate(); //declaring intents .. //some codes... alarmmanager = (alarmmanager)getsystemservice(alarm_service); pendingintent pendingintent = pendingintent.getservice(this, 0, intentservicetoberun, 0); calendar calendar = calendar.getinstance(); calendar.add(calendar.millisecond, 10000); am.setrepeating(alarmmanager.rtc_wakeup, calendar.gettimeinmillis(), alarmmanager.interval_day, pendingintent); } } i want service launch intentservice every single day @ time. however, i've read somewhere on internet, stackoverflow, google,etc.. service cannot stay alive forever, how android works. have kill service whenever android needs memory or using memory. guarantees me code run everyday , service not killed? edit : i noticed in android docs: the android system attempt keep process hosting service around long servi...

Google Drive mobile offline app -

i'm developing mobile app have hyperlinks user's google drive documents. if mobile device offline, hyperlinks still function if mobile device owner has installed google drive android/ios app? i.e. document url retrieved online work offline access? google drive android/ios app downloads online files local storage , serve local file system when device got offline. should follow similar approach.

XPATH Error : Unable to evaluate expression -

i have xml mentioned below. trying obtain value cardnumber using following expression. xpath : paymentservice/ns0:submit/ns0:order/ns0:paymentdetails/ns0:visa-ssl/cardnumber but it's giving me error. can any1 guide me on this? <?xml version="1.0" encoding="utf-8"?> <paymentservice version="1.0"> <ns0:submit xmlns:ns0="http://www.tibco.com/ns/no_namespace_schema_location/payment/paymentprocessors/worldpay_cc/sharedresources/schemas/paymentservice_v1.dtd"> <ns0:order> <description>description</description> <amount value="500" currencycode="eur" exponent="2"/> <ns0:paymentdetails> <ns0:visa-ssl> <cardnumber>00009875083428500</cardnumber> <expirydate> <date month="02" year="2008"/> ...