Posts

Showing posts from March, 2013

Posting with facebook api a message containing friend's names as links -

i want simple thing yet seems none of fb api options (graph/others) seem able solve it. say "johny brown" friend , want include name in wall post. can type @johny brown facebook shows nice dropdown can select name. however same behavior cannot mimicked using facebook api. any tips appreciated. tried "@" before name, using full url, using "name" etc. none of them work. yup you're correct. in new graph api facebook removed feature (possibly due spamming).

postgresql - Engineyard using postgis -

i have instance in engineyard , want install postgis. i tried several things chef had no success @ all. has installed postgis on engineyard successfully? , can tell me how did it? i installed manually sudo...

Getting part of an image with MATLAB -

i'm doing final project in matlab on "license plate correlation". user selects plate roi function, afterwards want plate. how can this? after using roi function, use getposition on handle. gives vector [x_min y_min width height]. can use sub image. imshow(i,[]) h = imrect; cord = getposition(h); sub_i = i(cord(2):cord(2)+cord(4),cord(1):cord(1)+cord(3));

java - Why should i give a name to an If Statement? -

i discovered can give name , while statements. understand useful if want break or continue specific loop. why should give name if?? looks useless name: if(true){ //do } this compiles without problems if have code block name, can use break exit it, use have found naming blocks. name: if(true) { // if(/* condition */) { break name; } // more } it works without if: name: { // if(/* condition */) { break name; } // more } this comes in work when there set of guard conditions on logic, , set of logic fallen down regardless of outcome of guards. a further example alternative structures more difficult read , modify: block: if(/* guard */) { // prep work if(/* guard */) { break block; } // prep work if(/* guard */) { break block; } // real work } though use bare block , not if.

CSS3 Font Embedding doesn't work at Iphone OS3.0 safari? -

i tried embed font @ web pages. can see font rendering @ latest non-ie browsers, when tried iphone safari browser, doesn't render. want know whether iphone safari supports font embedding. thanks. they work in svg format. use fontsquirrel.com generator make svg version.

iphone - Created NSURL is null -

nsurl printing null . what's reason? nsstring *webstr = [[nsstring alloc] initwithformat:@"%@",[webarray objectatindex:1]]; nslog(@"urlstring = %@",webstr); // printing correct url string nsurl *weburl = [[nsurl alloc] initwithstring:webstr]; nslog(@"url = %@",weburl); // printing null [weburl release]; [webstr release]; you should following. nsstring *webstr = [[nsstring alloc] initwithformat:@"%@",[webarray objectatindex:1]]; nslog(@"urlstring = %@",webstr); // printing correct url string nsurl *weburl = [[nsurl alloc] initwithstring:[webstr stringbyaddingpercentescapesusingencoding:nsasciistringencoding]]; nslog(@"url = %@",weburl); // should print [weburl release]; [webstr release]; i have used nsasciistringencoding can use utf8 or other encoding.

iphone - UITableView with Activity indicator -

i want display huge amount of local data(sqlite3 database) in tableview, while loading want display activity indicator , after loading want disable it, not working. can me please? you can use table cell accessoryview, in case activity indicator placed on right of cell (in place of ">" disclosure). when action related activity indicator terminates, can replace activity indicator standard disclosure accessory.

android - Enable and disable auto rotate programmatically? -

there lot of cool widgets out there enable , disable auto rotate on phone. disabling turns off across apps on phone. any ideas how accomplishing it? this should trick you: import android.provider.settings; public static void setautoorientationenabled(context context, boolean enabled) { settings.system.putint( context.getcontentresolver(), settings.system.accelerometer_rotation, enabled ? 1 : 0); } add permission androidmanifest.xml <uses-permission android:name="android.permission.write_settings" /> you can find documentation here

ruby on rails - custom method_missing ignored if instance is defined via an ActiveRecord association -

i have submissions might in various states , wrote method_missing override allows me check state calls submission.draft? submission.published? this works wonderfully. i also, various reasons might not great, have model called packlet belongs_to meeting , belongs_to submission. however, surprised find that packlet.submission.draft? returns nomethoderror . on other hand, if hard-code #draft? method submission , above method call works. how method_missing methods recognized when instance defined via activerecord association? have added draft? method respond_to? method object? guess issue might arise there. happens when type: submission.respond_to?(:draft?) to fix this, write respond_to? method this: def respond_to?(method, include_priv = false) #:nodoc: case method.to_sym when :draft?, :published? true else super(method, include_priv) end end my recommendation implement without using method_missing instead though, doing meta-progr...

java - "Could not register destruction callback" warn message leads to memory leaks? -

i'm in exact same situation old question: warn: not register destruction callback in short: see warning saying destruction callback not registered beans. my question is: since beans destruction callback cannot registered 2 persistance beans, source of memory leak? i experiencing leak in app. although session timeout set (to 30 minutes), profiler shows me more instances of hibernate sessionimpl each time run thread dump. number of instances of sessionimpl number of times tried login between 2 thread dumps. thanks help... i think not - shouldn't have hibernate session. opened , closed transaction manager.

mysql - Autocompletion for Emacs in my-sql mode -

i know if there auto-complete feature in emacs my-sql. tried using sql-completion.el emacswiki , , when use emacs gives following error: symbol's value variable void: <!doctype how fix or there other auto-completing function emacs in my-sql mode. thanks. i guess sql-completion.el file downloaded somehow had html formatting. open file inside emacs, , if starts <!doctype html public... , there have problem.

java - where does downcasted object point to? -

public class animal{ int n = 5; public static void main(string[] args) { animal = new animal(); animal ah = new horse(); horse h = new horse(); system.out.println(h.n); // prints 7 system.out.println(ah.n); // prints 5 h = (horse) ah; system.out.println(h.n); // prints 7 } } class horse extends animal{ int n = 7; } my question: why h.n still print 7 after h = (horse) ah ? after assignment should point same object ah points , n field points 5? first, let's call field n of class animal " animal.n " avoid confusion. fields, unlike methods, not subject overriding. in horse class, may think overriding value of animal.n 7, declaring new variable called n (let's call horse.n avoid confusion). so really, have class called horse 2 fields: animal.n , horse.n . field when " n " depends upon static type of variable @ time. when have object type horse , upcas...

class - What's the proper way to make an Ocaml subclass with additional methods? -

in ocaml i'm struggling subclassing , types: class super = object (self) method doit = ... end; class sub = object (self) inherit super method doit = ... self#somethingelse ... method somethingelse = ... end; let myfunction (s:super) = ... myfunction new sub apparently in ocaml, class sub not "subtype" of class super , because sub#doit method calls method in sub not present in super . however, seems pretty common use-case oo programming. recommended way accomplish this? as mentioned rémi, problem code ocaml type system supports 1 type per expression: expression of type sub not of type super . in example, myfunction expects argument of type super , , expression new sub of type sub , hence issue. upcasting essential object-oriented programming, , ocaml support 2 distinct constructs. the first type coercion . if super supertype of sub (meaning semantically, values of type ...

python - Multiple inheritance with Django -

i'm using django project, , want use couple of apps extend admin subclassing admin class. how can have them both sublass admin class? from django.contrib import admin testing.models import * reversion.admin import versionadmin moderation.admin import moderationadmin class itemadmin(versionadmin): pass admin.site.register(item, itemadmin) both versionadmin , moderationadmin appear use "cooperative super" feature of python. i'd try use multiple inheritance: class itemadmin(versionadmin, moderationadmin): pass if fails, can see whether works better reverse order. if still fails, need study specific issue, , find out why cooperative super doesn't work.

objective c - Application works for me, but everyone else gets EXC_BREAKPOINT (SIGTRAP) -

my application works me, crashes before opening main window else! the information have (at moment) this... date/time: 2011-02-06 13:32:26.599 -0500 os version: mac os x 10.6.6 (10j567) report version: 6 exception type: exc_breakpoint (sigtrap) exception codes: 0x0000000000000002, 0x0000000000000000 crashed thread: 0 dyld error message: library not loaded: //cancelbuttonplugin.framework/versions/a/cancelbuttonplugin referenced from: /users/user/downloads/dash.app/contents/macos/dash reason: image not found binary images: 0x7fff5fc00000 - 0x7fff5fc3bdef dyld 132.1 (???) <b536f2f1-9df1-3b6c-1c2c-9075ea219a06> /usr/lib/dyld why getting problem? " exc_breakpoint (sigtrap) " , how can fix it? the problem system misses library promised it, in case c ancelbuttonplugin.framework one. luckily, easy solve, go xcode, , add copy files build phase project. destination frameworks , drag'n'drop third party frameworks it. recompile , done.

jQuery use link to change database -

can me out question: how can use link example: ?active=yes make changes database? use jeditble since i'm using other stuff well. i have no idea how search can't find examples. you'll need server-side application - can't jquery. need jquery ajax call - http://api.jquery.com/jquery.ajax/

web applications - Servlet Filter modify path to files -

could me implementation filter modify request files /dir/* /new_domain/new_context_path/dir/* map filter /dir/* use response.sendredirect(new_domain + "/" + new_context + request.getpathinfo()) (see getpathinfo() ). note if it's possible have query-string ( ?foo=bar ), you'd have append well.

c# - How to remove all zeros from string's beginning? -

i have string beginning zeros: string s = "000045zxxcc648700"; how can remove them string like: string s = "45zxxcc648700"; i use trimstart string no_start_zeros = s.trimstart('0');

How to add scrollbar in gwt in flowpanel? -

i developing mobile application , have problem can not add scrollbar in it. want add scroll bar in flow panel , want fix flowpanel's size fit screen size. if knows solution pls tell me in adv.... window.getclientwidth() , window.getclientheight() give client area add scrolling, use scrollpanel

c++ - Setting stdout/stderr text color in Windows -

i tried using system("color 24"); didn't change color in prompt. after more googling saw setconsoletextattribute , wrote below code. this results in both stdout , stderr both getting colored red instead of stdout being green , stderr being red. how solve this? prompt red don't care since know how fix it. should work in windows 7. @ moment i'm building prompt (using vs 2010 cl) , running in regular cmd prompt #include <windows.h> #include <stdio.h> int main(int argc, char **argv) { int i; unsigned long totaltime=0; handle hconsoleout; //handle console hconsoleout = getstdhandle(std_output_handle); setconsoletextattribute(hconsoleout, foreground_green); handle hconsoleerr; hconsoleerr = getstdhandle(std_error_handle); setconsoletextattribute(hconsoleerr, foreground_red); fprintf(stdout, "%s\n", "out"); fprintf(stderr, "%s\n", "err"); return 0; } ...

c++ - Pimpl with smart pointers in a class with a template constructor: weird incomplete type issue -

when using smart pointers pimpl idiom, in struct foo { private: struct impl; boost::scoped_ptr<impl> pimpl; }; the obvious problem foo::impl incomplete @ point destructor of foo generated. compilers emit warning there, , boost::checked_delete , used internally boost smart pointers, statically asserts class foo::impl complete , triggers error if not case. for above example compile, 1 therefore must write struct foo { ~foo(); private: struct impl; boost::scoped_ptr<impl> pimpl; }; and implement empty foo::~foo in implementation file, foo::impl complete. advantage of smart pointers on bare pointers, because can't fail implement destructor. so far, good. came across weird behaviour when try introduce template constructor in similar bar class (full code, please try yourself): // file bar.h #ifndef bar_h #define bar_h 1 #include <vector> #include <boost/scoped_ptr.hpp> struct bar { template <typename i> ...

Grouping Silverlight chart ColumnSeries -

Image
as title states, want group columnseries, i'm using silverlight charting toolkit. here image explain want: but in case, the columnserieses stuck together. the chart have included seems straightforward affair. columnseries designed generate. a set of 4 columnseries 1 each quarter , datetimeaxis , interval type of years , interval of 1. i suspect there more question because seems simple otherwise?

c++ - Is there a way to make C macros keyword agnostic? -

is there way concatenate keywords in macro , get c behave in more dynamic fashion in: #define macro(fun,ction,var,iable) function(variable) i know kind of thing exists in other languages. you can use ## concatinate names in macros fun##ction ...

matlab - How can I convert a color name to a 3 element RGB vector? -

in many matlab plotting functions, can specify color either string or 3 element vector directly lists red, green, , blue values. for instance, these 2 statements equivalent: plot(x, y, 'color', 'r'); plot(x, y, 'color', [1 0 0]); there 8 colors can specified string value: 'r','g','b','c','m','y','k','w' . there matlab built-in function converts these strings equivalent rgb vector? i found general alternative on mathworks file exchange handle color strings other default 8 in matlab: rgb.m ben mitch if you're concerned conversions default 8 color strings, here's function wrote myself use convert , forth between rgb triples , short color names (i.e. single characters): function outcolor = convert_color(incolor) charvalues = 'rgbcmywk'.'; %#' rgbvalues = [eye(3); 1-eye(3); 1 1 1; 0 0 0]; assert(~isempty(incolor),'convert_color:badinputsize...

html5 - Why doesn't Firefox support the MP3 file format in <audio> -

is there particular reason why firefox not support playback of mp3 files in <audio> elements, ogg format? is licensing issue? are there plans made possible future implementation? is possible develop addon support mp3 playback in <audio> elements? licensing issues: html5 video , h.264 – history tells , why we’re standing web , mozilla defends firefox's html5 support ogg theora video (despite titles, both talk mp3 licensing, albeit briefly). all can fall flash , play them through that.

osx - GHC 6.12 and MacPorts -

i installed (from binary installers) ghc 6.12 , haskell platform 2010.1.0.1 on intel macbook running os x 10.5.8, , initially, worked fine. edit: had install cabal , alex , , happy source, after that , did seem work fine. however, discovered if use cabal install install package depends on macports library ( e.g. , cabal install --extra-lib-dirs=/opt/local/lib --extra-include-dirs=/opt/local/include gd ), things work fine in ghci, if try compile, error linking test ... undefined symbols: "_iconv_close", referenced from: _hs_iconv_close in libhsbase-4.2.0.0.a(iconv.o) "_iconv", referenced from: _hs_iconv in libhsbase-4.2.0.0.a(iconv.o) "_iconv_open", referenced from: _hs_iconv_open in libhsbase-4.2.0.0.a(iconv.o) ld: symbol(s) not found collect2: ld returned 1 exit status after googling, found a long haskell-cafe thread discussing problem. upshot seems macports installs updated version of libiconv , , binary interface ...

java - Do Hibernate table classes need to be Serializable? -

i have inherited websphere portal project uses hibernate 3.0 connect sql server database. there 130 hibernate table classes in project. implement serializable. none of them declare serialversionuid field, eclipse ide shows warning of these classes. is there actual need these classes implement serializable? if so, there tool add generated serialversionuid field large number of classes @ once (just make warnings go away) ? is there actual need these classes implement serializable? the jpa spec (jsr 220) summarizes pretty (the same applies hibernate): 2.1 requirements on entity class (...) if entity instance passed value detached object (e.g., through remote interface), entity class must implement serializable interface. so, strictly speaking, not requirement unless need detached entities sent on wire tier, migrated cluster node, stored in http session, etc. if so, there tool add generated serialversionuid field large number of classes @ ...

c++ - how to make a name from random numbers? -

my program makes random name have a-z code makes 16 char name :( code wont make name , idk why :( can show me what's wrong this? char name[16]; void make_random_name() { byte loop = -1; for(;;) { loop++; srand((unsigned)time(0)); int random_integer; random_integer = (rand()%10)+1; switch(random_integer) { case '1': name[loop] = 'a'; break; case '2': name[loop] = 'b'; break; case '3': name[loop] = 'c'; break; case '4': name[loop] = 'd'; break; case '5': name[loop] = 'e'; break; case '6': name[loop] = 'f'; break; case '7': name[loop] = 'g'; break; case '8': name[loop] = 'z'; break; case '9': name[loop] = 'h'; break; } cout << nam...

Button template with image and text in wpf -

i want create buttons images , text inside. example, use different images , text buttons 'browse folders' , 'import'. 1 of options use template. had @ simliar question creating image+text button control template? but there way can bind source of image without using dependency property or other class? thanks no. bind image.source to? need dependencyproperty this. of course, define normal class contains 2 properties: text , imagesource or uri , , use datatemplate render instances of class, more code write, , little "smelly". what reason not want use dependency property or custom class?

java - No GPS Update retrieved? Problem in Code? -

i've got serious problem gps on nexus one: wrote kind of hello world gps, toast should displayed isn't :( i don't know i'm doing wrong...maybe me getting work. here's code: package gps.test; import android.app.activity; import android.content.context; import android.location.location; import android.location.locationlistener; import android.location.locationmanager; import android.os.bundle; import android.widget.toast; public class gps extends activity { private locationmanager lm; private locationlistener locationlistener; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); // ---use locationmanager class obtain gps locations--- lm = (locationmanager) getsystemservice(context.location_service); locationlistener = new mylocationlistener(); lm.requestlocationupdates(locationmanager.gps_provider, 100, 1, ...

c++ - boost::variant recursive trouble -

is there way make work? hope you'll idea, i'm trying create list means of recursive pairs #include <boost/variant.hpp> #include <utility> struct nil {}; typedef boost::make_recursive_variant<nil, std::pair<int, boost::recursive_variant_ >>::type list_t; int main() { list_t list = { 1, (list_t){ 2, (list_t){ 3, nil() } } }; return 0; } no. point of boost::variant has fixed size, , not dynamic allocation. in way it's similar union. recursive boost::variant have have infinite size in order contain largest possible value - impossible. you could, however, passing through pointer. example: struct nil { }; typedef boost::make_recursive_variant<nil, std::pair<int, boost::scoped_ptr<boost::recursive_variant_> > > variant_list_int;

jquery - How do I keep this from pushing down? -

http://removed.com/jquery/test.html playing jquery , upon pressing "more" on top left, pushes down "brown" layer. how can keep brown layer steady? happens in chrome, not firefox. personally, i'd put fieldset li thats child of 1 more link in it. absolutely position that. imo, neater code positioning absolutely within page, means if move nav ul, won't have fiddle around moving fieldset again.

ruby on rails - solr or sphinx? which is better? -

possible duplicate: choosing stand-alone full-text search server: sphinx or solr? i use full text search in ruby on rails app. which best choice. solr use java job. or sphix in ruby? i have no experience solr, sphinx easy install, fast , works great thinking sphinx: http://freelancing-god.github.com/ts/en/indexing.html there railscast: http://railscasts.com/episodes/120-thinking-sphinx this guy gives arguments why go sphinx: http://jamesgolick.com/tags/ultrasphinx.html (he uses ultrasphinx plugin connect rails , sphinx. tried both , ended using thinking sphinx) you can find comparison of both plugins here: http://reinh.com/blog/2008/07/14/a-thinking-mans-sphinx.html

asp.net - FormsAuthentication: Is it secure? -

using formsauthentication build asp.net it's quick , easy create login system creates cookie authenticated users: formsauthentication.setauthcookie(uniqueusername, false); paired code in web.config file: <authentication mode="forms"> <forms loginurl="login.aspx" timeout="30" defaulturl="dashboard.aspx" protection="all" /> </authentication> <authorization> <deny users="?" /> </authorization> this bounce requests login.aspx until user approved , cookie created using setauthcookie() method call. is secure enough? rule of thumb use don't store data on client they've not sent me. i've done in past hold username , password used in cookie, re-authentic every request. there's overhead of re-authenticating everytime approach, means i've not storing server data on client. my worry concern using setauthcookie() method call, username being stored on cl...

asp.net - Sorting & Grouping in a Repeater -

in asp.net can achieve both grouping , sorting in repeater control. if possible please suggest me way of doing or links .. have implement in application thank you. if mean visual grouping, way have done sort of thing in past add itemdatabound event repeater checks previous item using myrepeater.items[e.item.itemindex-1] . if i've determined new group has started (i.e., if previous item started different letter current item, , sorting alphabetically , grouping letter) inject appropriate html markup literal control in itemtemplate create visual groupings.

PHP, JSON and \u-somethings -

i'm using php 5.2. file , db table utf8. when insert column json_encoded data in it, converts non-ascii chars \u-something. ok. when json_decode data \u-somethings still there! wasn't json_decode supposed convert normal chars when displaying on utf8 page. example, instead of f\u00f6tter, should display fötter. have use function conversion? json_encode , json_decode kind of weak in php. both minimum produce valid, not intended output. json_decode has no idea if \u00f6 supposed ö or \u00f6 . there no way make json_decode aggressively convert unicode characters back. remember json designed directly eval'able javascript, , javascript evaluate escapings. but why json encoding data store in mysql?

android - How to override the generic "Could not be found" msg for the app doesn't exist on the market -

in app, i'd put android market link points future version of app doesn't exist yet. startactivity(new intent(intent.action_view,uri.parse("market://details?id=com.example.mystuff.future_app"))); currently, if user click button, android show "the requested item not found" message. instead of generic message, i'd show customized message --- "coming soon... please stay tuned". how can catch error , override message? thanks in advance! you can't change behavior of application processes intent. instead, why not have message in app? when upload other app, can update original app point download location.

sql - How can I exit an inner loop and continue an outer loop? -

this follow-up my previous question (thanks answer, btw!) if have 2 loops: while @@fetch_status=0 begin set y=y+1 set x=0 while @@fetch_status=0 begin x=y+1 if y = 5 'exit second while , first while --> y=y+1 end end ...how can exit inner loop , continue outer (see comment)? i think you're looking break books online great resource tsql

java - Default Button after dispose and setVisible -

given following code: public class dialogtest implements actionlistener { public static void main(string[] args) {dialogtest g = new dialogtest();} public dialogtest() { jbutton b1 = new jbutton("button a"); b1.addactionlistener(this); jdialog d = new jdialog(); d.setdefaultcloseoperation(jdialog.dispose_on_close); jpanel p = new jpanel(); p.add(b1); d.add(p); d.getrootpane().setdefaultbutton(b1); d.pack(); d.setvisible(true); d.dispose(); d.pack(); d.setvisible(true); } public void actionperformed(actionevent e) {system.out.println("hello");} } shouldn't pressing enter key write console? according docs ( http://java.sun.com/javase/7/docs/api/java/awt/window.html#dispose() ): the window , subcomponents can made displayable again rebuilding native resources subsequent call pack or show. the states of recreated window , subcomponents identical states of these objects @ point w...

c# - Generic cast type to primitive -

is there way below? imagine generic result wrapper class. have type , associated error list. when there no result return user use boolean indicate success failure. want create constructor takes in error list, , if list null or count 0, and type bool/boolean want set true.... seemingly simple, amazingly not possible. public class result<t>{ private t valueobject { get;set;} private list<error> errors{ get;set;} public result(t valueobj, list<error> errorlist){ this.valueobject = valueobj; this.errors = errorlist; } public result(list<error> errors) { this.valueobject = default(returntype); if (valueobject boolean) { //wont work compile //(valueobject boolean) = ((errors == null) || errors.count == 0); //compiles detaches reference //bool temp = ((bool)(valueobject object)) ; //temp = ((errors == null) || errors.count == ...

linq to sql - How to write Sql or LinqToSql for this scenario? -

how write sql or linqtosql scenario? a table has following data: id username price date status 1 mike 2 2010-4-25 0:00:00 success 2 mike 3 2010-4-25 0:00:00 fail 3 mike 2 2010-4-25 0:00:00 success 4 lily 5 2010-4-25 0:00:00 success 5 mike 1 2010-4-25 0:00:00 fail 6 lily 5 2010-4-25 0:00:00 success 7 mike 2 2010-4-26 0:00:00 success 8 lily 5 2010-4-26 0:00:00 fail 9 lily 2 2010-4-26 0:00:00 success 10 lily 1 2010-4-26 0:00:00 fail i want summary result data, result should be: username date totalprice totalrecord successrecord failrecord mike 2010-04-25 8 4 2 2 lily 2010-04-25 10 2 2 0 mike 2010-04-26 2 1 1 0 lily 2010-04-26 8 3 1 2 totalprice sum(price) groupby username , date totalrecord count(*) groupby use...

websphere - com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Unknown command -

i'm trying create datasource connection pooling mysql database in websphere application server. i've set jdbc provider, set implementation class name : com.mysql.jdbc.jdbc2.optional.mysqlconnectionpooldatasource my mysql driver version 5.1.6. but got error while try connect datasource: the test connection operation failed data source btn_itb_ds on server server1 @ node qnode following exception: com.mysql.jdbc.exceptions.jdbc4.mysqlnontransientconnectionexception: unknown command. view jvm logs further details. i have read http://bugs.mysql.com/bug.php?id=38388 trouble shooting. suggest upgrade mysql driver version 5.1.x , have that. i've got same error.

Facebook "like" functionality in a kiosk -

i've been tasked client write application kiosk (think checkin machine @ airport) , 1 of options users "like" client in facebook. i've read plugin documentation , able render "like" button on browser page, facebook pops login web browser window... kiosk application can't have web browsers popping (since it's kiosk). how can send request little no browser ui user? thoughts? thanks, ~bill the fundamental problem user, in order "like" something, must authenticated facebook. in case of public kiosk, if deployment scenario of app, think logging in facebook credentials not idea: trust public kiosk , log in facebook it? i don't know if facebook authorization dialog can embedded in iframe or that, think maybe context not appropriated button.

flash - intercept all buttons clicks -

my question is: is there way can intercept button click event in flex(air) app, because need add sound when button clicked, , dont want go on screens , add function , change each click event in each button. so there way can this? thanks! it depends on specific site structure how easy might this. buttons have own unique class, or otherwise share distinguishing feature (a common hungarian style _btn marker in instance names)? if so, try this: root.addeventlistener(mouseevent.click, onbuttonclickplaysound); private function onbuttonclickplaysound(e:mouseevent):void{ if(e.target extendedbutton){ // play sound here... } // or.... if(e.target.name.indexof("hungariannotation") >= 0){ // play sound here... } } this won't work if handlers down display list stop event propagation. mouse clicks must bubble way root.

jquery - How can I enable 'draggable' on a element with contentEditable? -

i'd have div @ same time editable , draggable, using jquery ui. content editability seems work if draggable not enabled. missing something? i'm using jquery 1.4.4 , jquery ui 1.8.9 javascript: $(function(){ $('#draggable').draggable(); }); html: <div contenteditable="true" id="draggable">text</div> it working jquery draggable hijacking click event. can still tab it. quick fix. $('#draggable').draggable().bind('click', function(){ $(this).focus(); })

send email C# using smtp server with username password authentification -

Image
i have piece of code sends email.. heres code this not working me. remote smtp service ... , double checked email web access works fine .. can login using gui, recieve , send emails. but when try through code .. fails message ... {system.net.mail.smtpexception: smtp server requires secure connection or client not authenticated. server response was: 5.7.0 no auth command has been given. can advise ... , dont have ews exposed ie.e exchange web service ./.. way go .. port 25 , no ssl or tls button b = sender button; try { mailmessage msg = new mailmessage(senderemail, recieveremail, "afdasfas", "safasfa"); //mailmessage msg = new mailmessage(senderemail, recieveremail, subject, subject); system.net.mail.smtpclient mailclient = new system.net.mail.smtpclient(emailsmtpserver, outgoingport); system.net.networkcredential auth = new system.net.networkcredential(senderemail, senderpassword); mailclient.host = emailsmtpserver; mailc...