Posts

Showing posts from June, 2014

In salesforce, can you verify that an email sent by a workflow was opened by the recipient? -

i using salesforce workflow send out product information , invoices clients running problems thinking of how verify if client receives email , or opens it. there way prove client received inventory list or invoice? doing prior research on subject have come across following suggestions: adding 1x1 invisible image email unique id adding regular image instead of 1x1, maybe company logo having recipient click link see invoice with these solutions, have detect image requests or link request them , extract/produce unique id each client. not sure how in salesforce appreciated, along other detection ideas. if have salesforce content, there ways expose documents clients features need. you'll send email link , later can track confirmation of opening, count how many times downloaded.. can set expiration date document (can't downloaded anymore after date). as "pure" email apex/visualforce , manually recreating content's functionality... nowadays mail cl...

javascript - Protect jQuery function from outside access -

i'm using jquery in app registers user clicks perform given action through .click() binding, , want functionality available only through user mousedown. 1 of friends pointed out today it's possible run $(element).click() javascript terminal in firebug (or similar), , achieve same functionality clicking on element -- i'd prevent. ideas on how go doing this? input. short answer: no, can't prevent it. long answer: event click event bound such called event handlers . handlers functions executed when given event occurs. if click on element, browser checks if event handlers bound it, if fires them. if not, browser try bubble up event parent elements , again checks if there event handlers bound kind of event .. , forth. jquerys .trigger() method (which call if calling .click() instance) same thing. calls event handlers bound specific element, specific event. edit there might simple ways somekind of soft detect real click, instance might check...

c# - Help Understanding .Net Configuration Options -

i'm confused various configuration options .net configuration of dll's, asp.net websites etc in .net v2 - when considering impact of config file @ ui / end-user end of chain. so, example, of applications work use settings access with: string blah = applib.properties.settings.default.templatepath; now, option seems cool because members stongly typed, , won't able type in property name doesn't exist in visual studio 2005 ide. end lines in app.config of command-line executable project: <connectionstrings> <add name="appconnectionstring" connectionstring="xxxx" /> <add name="applib.properties.settings.appconnectionstring" connectionstring="xxxx" /> </connectionstrings> (if don't have second setting, releasing debug dll live box have built debug connection string embedded in - eek) we have settings accessed this: string blah = system.configuration.configurationmanager.appset...

c# - Is it possible to let linq to sql auto submit my new records back to database? -

i using linq sql , , return queryable result linq sql : var qry = p in table select p; then use bind xtragrid: gridcontrol.datasource = qry; then if edit records in xtragrid, need call datacontext.submitchanges() submit changes database. my question : am possible add new records qry result, , after need call datacontext.submitchanges() , linq can create new records on database automatically ? is possible ? can point me right direction ? in advance ! shot answer no. need call add method on table property on context. something this: var qry = p in mydatacontext.table select p; gridcontrol.datasource = qry; mydatacontext.table.add(newrecord); // how add new recrod datacontext.submitchanges(); read more here: http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx

deployment - Managing software with custom local patches -

i'm trying find way deploy software custom patches in production. base software opensource own repos (svn) , we've got patches select 1 service , not other (so we've got base+patcha+patchb on 1 server , base+patcha+patchc on another). everything deployed packages, pretty simple. issue i'm thinking is: how store modifications? these ways thought about: i've tried using quilt / patch series + downloading specific revision upstream when building. works well, until need port patches new version. since quilt needs copy of tree patch modifications, takes long time fix stuff. also, having different versions deployed on different servers means need have different build-scripts. i clone repository local git/hg , create branch local modifications. that's great porting patches forwards , can make local release tags on branch, unfortunately lose information separate patches. can see diff upstream of course, lose clear separation of different local modifications. ...

php - Allow users to download PDFs in PHP5, ZEND, MVC environment -

all, i have php5 application written zend framework , mvc style. application allows multiple users login , see content based on privileges. have dropdown on home page. upon selecting dropdown, ajax call occurs populates page table. also, generates pdf file table data using mpdf library. there link called "download pdf" in page allow user download generated pdf. my question is, in such environment, how best serve pdfs multiple users? should serve single pdf common name or should create multple pdfs based on dropdown value (looks overkill)? don't want let users see each other's pdfs. also, should store pdfs pretty entire application directory have 750 acccess. thanks, user clicks "downlod pdf" parameters id sent ajax is there cached version of pdf id saved? ok, show user; else: generate pdf cache it show pdf user i have cache key userid-documentid (user1-document1 example) , name document make them recognize in "downloads fo...

wpf - Is it possible to re-show and closed dialog window? -

some context here...i have system.windows.window used display modal message box. created show() method initializes content of window, , calls showdialog(). user clicks button on window, information clicked button set in tag property, , window closed via close(). as expected, showdialog exception when attempting call showdialog() on window once has been closed. there way reuse same window instance don't have new instance every time need message box? for example... messageboxwindow mbw = new messageboxwindow(); result = mbw.show("caption", "message 1"); mbw.show("caption", "message 2"); // above throws exception, have this... mbw = new messageboxwindow(); result = mbw.show("caption", "message 2"); any appreciated! use .hide() instead of .close(). removes without destroying it. can call show() again when needed. mainwindow test = new mainwindow(); test.show(); test.hide(); test.show();

git rm - Will git-rm --cached delete another user's working tree files when they pull -

i wish stop tracking files still keep them in working tree. i've gathered git rm --cached file let me that. however, if else pulls change, their local copies deleted? yes, copies automatically deleted. imagine if deletion wouldn't happen--then working copies of users polluted piles of deleted files, aren't needed anymore. however, if remote users made local changes these files, won't deleted, since pull result in merge conflict. as jefromi suggests in comment, while files removed @ other users' sides, can restored--they're under version-control, aren't they? ;-) files gotten git checkout <revision> -- <files...> . revision may specify id of previous commit, pull it's saved in orig_head (see this question details): git checkout orig_head -- removed_file

objective c - Parsing data in iphone -

i m using nsurlrequest , post data server. after processing returned in html format how parse it. untitled document 30 please give refrence. i want use 30 in code. use libxml2, part of ios sdk.

How to build large/busy RSS feed -

i've been playing rss feeds week, , next trick want build 1 our internal application log. have centralized database table our myriad batch , intranet apps use posting log messages. want create rss feed off of table, i'm not sure how handle volume- there hundreds of entries per day on normal day. exceptional make-you-want-to-quit kind of day might see few thousand. thoughts? i make feed static file (you can serve thousands of these), regenerated periodically . have broader choice, because doesn't have run below second, can run minutes. , users still perfect download speed , reasonable update speed.

flash - "this" is undefined -

i java/php developer helping actionscript. don't understand why "this" undefined in below code. snippet of code, it's gives idea of i'm trying reference "this". i'm trying find out movie tween moving can load next movie. tweens used move movies in , out of screen. var tween_move_1:tween = new tween(movie_0, "_x", strong.easeout, 1600, 150, 0.5, true); tween_move_1.onmotionfinished = function() { stop(); settimeout(function () { trace(this);//when trace runs shows undefined var tween_move_2:tween = new tween(movie_0, "_x", strong.easeout, 150, 1600, 0.5, true); tween_move_2.onmotionfinished = function() { var tween_move_1:tween = new tween(movie_1, "_x", strong.easeout, 1600, 150, 0.5, true); }; } ,2000);//end of settimeout };//end of tween.onmotionfinished update! here working code after applying tips responses/answers: var tween_move_in:tween = new ...

c++ - IDebugProgramProvider2.GetProviderProcessData on Vista -

as part of javascript profiler ie 6/7 needed load custom debugger created ie. got working fine on xp, couldn't working on vista (full story here: http://damianblog.com/2008/09/09/tracejs-v2-rip/ ). the call getproviderprocessdata failing on vista. have suggestions? thanks, damian // create msprogramprovider idebugprogramprovider2* pidebugprogramprovider2 = 0; hresult st = cocreateinstance(clsid_msprogramprovider, 0, clsctx_all, iid_idebugprogramprovider2, (void**)&pidebugprogramprovider2); if(st != s_ok) { return st; } // idebugprogramnode2 instances running in process ad_process_id processid; processid.processid.dwprocessid = getcurrentprocessid(); processid.processidtype = ad_process_id_system; const_guid_array enginefilter; enginefilter.dwcount = 0; provider_process_data processdata; st = pidebugprogramprovider2->getproviderprocessdata(pflag_get_program_nodes|pflag_debuggee, 0, processid, enginefilter, &processdata); if(st != s_ok) { shower...

visual studio - Deleting lines of code in a text editor -

edit: question had been tagged "tolstoy" in appreciation of quality , length of writing:) reading first , last paragraph should enough:) if tend select , move code mouse, stuff in middle interesting you. this question how use text editors in general. i’m looking best way delete plurality of lines of code (no intent patent it:) extends transposing lines, i.e. deleting , adding them somewhere else. importantly, don’t want creating blank lines have delete separately. sort of visual studio's shift+delete feature, working multiple lines @ once. say want delete line 3 following code (tabs , newlines visualized well). naïve way select text between angle brackets: if (true) {\n \t int = 1;\n \t <i *= 2;>\n \t += 3;\n }\n then hit backspace. creates blank line. hit backspace twice more delete \t , \n. you end with: if (true) {\n \t int = 1;\n \t += 3;\n }\n when try select whole line, visual studio doesn't let select trailing newline character. ex...

stream - What is an open free to use radio / music streaming service I can access via java -

i looking free use radio or music streaming service can access using java. i making game , instead of creating our own music - there must better alternative , hoping coughs pretty good. would cool have different music streamed game whilst playing. thanks in advance, andy there countless free music streams online. java sound in combination mp3spi should enable stream of them java application.

c++ - Rectangle class -

hi im new c++ , may in on head on problem im trying solve. visual explanation , solution errors or better revised source code ask of. invest there interest question. heres problem: design class named rectangle represent rectangle. class must contain: two double data fields named width , height specify width , height of rectangle. a no-arg constructor creates default rectangle width 1 , height 1. a constructor creates rectangle specified width , height the accessor , mutator functions data fields the function named area() returns area of rectangle a function named getperimeter() returns peremter. draw uml diagram class. implement class. write test progranm creates 2 rectangle obejects. assign width 4 , height 40 first object , width 3.5 , height 35.9 second. display properties of both objects , find areas , perimeters. heres have far: #include <iostream> using namespace std; class rectangle { public: double height; public: double width; rect...

branch - How to remove local (untracked) files from the current Git working tree? -

how delete untracked local files current working tree? as per git documentation git clean remove untracked files working tree step 1 show deleted using -n option: git clean -n clean step - beware: delete files : git clean -f to remove directories, run git clean -f -d or git clean -fd to remove ignored files, run git clean -f -x or git clean -fx to remove ignored , non-ignored files, run git clean -f -x or git clean -fx note case difference on x 2 latter commands. if clean.requireforce set "true" (the default) in configuration, 1 needs specify -f otherwise nothing happen. again see git-clean docs more information. options -f --force if git configuration variable clean.requireforce not set false, git clean refuse run unless given -f, -n or -i. -x don’t use standard ignore rules read .gitignore (per directory) , $git_dir/info/exclude, still use ignore rules given -e options. allows removing untracked files, including ...

.net - Error when two server controls have same ID's -

i not programmer, dont have access code behind. i style pages , whatnot. problem: trying hide/show elements of page based on language selected. some of these elements server controls , couple of them have specific id's , graphics associated. i need change graphics language selected. i have tried this: <%if request.querystring("lang")="es" then%> <div><asp:imagebutton id='go' imageurl='go-spanish.png'></asp:imagebutton></div> <% else %> <div><asp:imagebutton id='go' imageurl='go-english.png'></asp:imagebutton></div> <% end if %> no dice. i tried using response.write write imagebuttons dynamically, does, arent visible in browser. i tried changing image path in control dynamically , apparently isnt allowed. could please give me idea of how work around this? have 1 imagebutton , in page_load event set it's imageurl property based...

permissions - Can an iPhone App Be Run as Root? -

i thinking design of iphone app i'd create. 1 possible problem application have run root (to access network ports). in typical unix app, i'd app run setuid, i'm wondering if possible iphone app. i've read question in apple's forum, discouraging: http://discussions.apple.com/thread.jspa?threadid=1664575 i understand apple wants limit program can do, there plenty of good, legitimate reasons user run program elevated privileges. i'm not trying create hacker tool here. i'm sure around on jail-broken iphone, that's not i'm after. there way run app elevated privileges on unbroken iphone? (btw, there no need warn me nda.) section 3.3.4 of iphone sdk agreement suggests mustn't work outside sandbox. given apple has been arbitrary on applications permit , should double-check them before start developing. compared 2.0.x, the sandbox restrictions have increased in 2.1 ; can no longer read application's sandbox. so, if is ...

Using bash shell inside Matlab -

i'm trying put large set of bash commands matlab script , manage variables (like file paths, parameters etc) there. needed because workflow requires manual intervention @ steps , use step debugger this. the problem is, don't understand how matlab interfaces bash shell. can't system('source .bash_profile') define bash variables. can't define them hand , read them either, e.g. system('export var=somepath') , system('echo $var') returns nothing. what correct way of defining variables in bash inside matlab's command window? how can construct workflow of commands use variables defined in .bash_profile? if need set environment variables, in matlab: >> setenv('var','somepath') >> system('echo $var')

c - What is an efficient way to convert a bignum type structure to a human readable string? -

i've got bit of problem. in order grow in knowledge of c, i've decided try implement basic bigint library. the core of bigint structure array of 32 bit integers, chosen because fit in register. allow me operations between digits overflow in 64 bit integer (which fit in register, i'm on x86-64), , can bitshift out each part of result. i've implemented basic addition, , test working, have print array. own testing purposes, it's fine if use printf() , output each digit in hex. can read fine. however, people can't read hex. number stored in (essentially) base 2^32, printing bit of problem. way convert base 10? edit: this deals not knowing how convert base base, way implement this. thinking along lines of making bigint base conversion printing. first of all, can't i/o in sensible way without basic operations(e.g. division , modulus). provide efficient implementation of converting bigint base-10 string, researching 2 possible optimizations: ...

iphone - Clean autorotation transitions in a paging UIScrollView -

i have paging uiscrollview in user pages horizontally through images, apple's photos.app. works, i'm trying add rotation support. i've got view rotating ok , have managed set contentsize, bounds, , subviews' frames adapt different orientations. before , after rotation, ok. however, transitions awkward. first image rotates perfectly, if axis of rotation in dead center of image (scrollview frame). second image "swings" in because axis of rotation in same place: center of first image. farther away first image, faster "swing." i can mask overlaying opaque uiview before rotation , hiding after. that's hack. there must elegant way this... frankly, don't know you're doing, since haven't shown @ all. but! i created sample project few views in scroll view, , works fine. feel free pick apart wish. works creating 5 views, , adding them scroll view. after these views set first time, , every time application rotates, calls m...

Redirect response output with VBScript in ASP classic -

in plain .asp file, content outside of <% %> tags sent directly output buffer. additionally, expression in <%= %> tags evaluated , sent output buffer. i want redirect that, in context establish, result of 2 constructs instead sent buffer control. if possible, i'd able dynamically, can redirect output different buffers @ runtime. the problem open-ended, largely because i'll planning i'm building around solution. use way exists capture output. performance , ease of use not major considerations. this sequel this question , in try 1 possible solution turns out not work. in effect, trying rewrite asp.dll isapi filter. if wanted this, try write wrapper dll around asp.dll overrides writeclient function. not straightforward , begs question of trying accomplish. a far simpler solution avoid using <% %> altogether , instead assemble entire page (or of it) in code page nothing more than: <html> <%=outputhtml()%> </html> ...

iPhone Debugging: Get a black screen when debugging a universal app -

i working on universal app (4.0.1 sdk) , unable run on ipod touch. works on ipad, , on both ipad simulator , ipod simulator when try launch app on touch, main gets called , can stop @ break point (i assume means provisioning , certs right) nothing after that. there isn't in gdb log. can debug simple "hello world" type app on touch. have suggestions of else try? if not using .nib files might want make sure code creates window gets executed: window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; if using .nib (.xib) files make sure have window appropriately delegated app delegate in interface builder. in case subclassing app delegate , accidently removed line calling [super didfinishlaunchingwithoptions...] window being created. i hope helps someone. cheers

python - finding the app window currently in focus on Mac OSX -

i writing desktop usage statistics app. runs background daemon wakes @ regular intervals, finds name of application window in focus , logs data in database. i manage on linux desktop of xprop utility (you can find here ). how can same on mac osx? there direct/indirect way python script? (pyobjc?) you can applescript: get title of current active window/document in mac os x you can try using appscript generate applescript events python.

php - Getting PEAR to work on XAMPP (Apache/MySQL stack on Windows) -

i'm trying install laconica , open-source microblogging application on windows development server using xampp per instructions provided . the website cannot find pear, , throws below errors: warning: require_once(pear.php) [function.require-once]: failed open stream: no such file or directory in c:\xampplite\htdocs\laconica\lib\common.php on line 31 fatal error: require_once() [function.require]: failed opening required 'pear.php' (include_path='.;\xampplite\php\pear\pear') in c:\xampplite\htdocs\laconica\lib\common.php on line 31 pear located in c:\xampplite\php\pear phpinfo() shows me include path .;\xampplite\php\pear what doing wrong? why isn't pear folder being included? you need fix include_path system variable point correct location. to fix edit php.ini file. in file find line says, " include_path = ... ". (you can find out location of php.ini running phpinfo() on page.) fix part of line says, " \xamp...

ruby on rails 3 - Rails3 setting focus on a textfield -

when have errors in form, set focus first textfield error. i've done php , javascript in past, i'm not sure how approach in rails3. thanks in advance <%= javascript_tag "$('foo_bar').focus()" %>

out of memory error dealing with large bitmaps and the android activity life cycle -

i have scrollable map app has huge bitmap. loads fine on startup, when looses foreground status , user brings backs again im getting out of memory error. in onpause trashes bitmap using recycle, , marks null. onresume checks see if map==null , load bitmap again, crashing program despite me recycling bitmap...here bits of code. of other references bitmap map first check if null before loading/drawing. onpause protected void onpause() { super.onpause(); log.e("sys","onpause called"); if (map != null) { map.recycle(); map = null; system.gc(); log.e("sys","trashed map"); } } my onresume protected void onresume(){ super.onresume(); log.e("sys","onresume called"); if (map == null) map = bitmapfactory.decoderesource(getresources(), r.drawable.lowresbusmap); log.e("sys","redrew map"); } try way: protected void onresume(){ su...

iPad SDK: How to play a series of videos with MPMoviePlayerViewController -

i wondering how efficiently play series of video mpmovieplayerviewcontroller? for example, play in series following: video1.mp4 video2.mp4 video3.mp4 and on... any suggestions appreciated. use nsnotificationcenter monitor mpmovieplayerplaybackdidfinishnotification notification. then, set player next item wish play.

android - How to get the current Y offset of a ScrollView -

scrollview has method setting x , y scroll offset, no method getting current offset (all i'm interested y offset, since scrollview supports vertical scrolling). don't see method work in superclasses, , tried gettop() content view, zero. missing something? call getscrolly() on scrollview. see here more details: http://developer.android.com/reference/android/view/view.html#getscrolly%28%29

Why is this returning a "Not Found" with PHP and cURL? -

my script works other links tried, , same response curl (and lot smaller, code): <?php $url = $_get['url']; $header = get_headers($url,1); print_r($header); function get_url($u,$h){ if(preg_match('/200/',$h[0])){ echo file_get_contents($u); } elseif(preg_match('/301/',$h[0])){ $nh = get_headers($h['location']); get_url($h['location'],$nh); } } get_url($url,$header); ?> but for: http://www.anthropologie.com/anthro/catalog/productdetail.jsp?subcategoryid=home-tabletop-utensils&id=78110&catid=home-tabletop&pushid=home-tabletop&popid=home&sortproperties=&navcount=355&navaction=top&fromcategorypage=true&selectedproductsize=&selectedproductsize1=&color=sil&colorname=silver&isproduct=true&isbigimage=&templatetype= and: http://www.urbanoutfitters.com/urban/catalog/productdetail.jsp?itemdes...

makefile - crti.o file missing -

i'm building project using gnu tool chain , works fine until linking it, linker complains missing/can't find crti.o . not 1 of object files, seems related libc can't understand why need crti.o , wouldn't use library file, e.g. libc.a ? i'm cross compiling arm platform. have file in toolchain, how linker include it? crti.o on 1 of 'libraries' search path, should .o file on library path? is search path same gcc , ld ? crti.o bootstrap library, quite small. it's statically linked binary. should found in /usr/lib . if you're running binary distribution tend put developer stuff -dev packages (e.g. libc6-dev) it's not needed run compiled programs, build them. you're not cross-compiling you? if you're cross-compiling it's problem gcc's search path not matching crti.o is. should have been built when toolchain was. first thing check gcc -print-search-dirs , see if crti.o in of paths. the linking done ld has ...

Code indentation converted from tabs to spaces: is it trackable in git? -

i'm trying adapt soft tabs in projects testing python project tracked git showing issues; naturally git thinks has changed, , not i'd prefer. while git diff understands drop whitespace comparison -w switch, there's no such switch git commit . is transition impossible nicely or there way achieve git ignore sudden change? can git automatically switch between spaces , tabs?

asp.net - Is there a way to programmatically determine if a font file has a specific Unicode Glyph? -

i'm working on project generates pdfs can contain complex math , science formulas. text rendered in times new roman, has pretty unicode coverage, not complete. have system in place swap in more unicode complete font code points don't have glyph in tnr (like of "stranger" math symbols,) can't seem find way query *.ttf file see if given glyph present. far, i've hard-coded lookup table of code points present, i'd prefer automatic solution. i'm using vb.net in web system under asp.net, solutions in programming language / environment appreciated. edit: win32 solution looks excellent, specific case i'm trying solve in asp.net web system. there way without including windows api dlls web site? here's pass @ using c# , windows api. [dllimport("gdi32.dll")] public static extern uint getfontunicoderanges(intptr hdc, intptr lpgs); [dllimport("gdi32.dll")] public extern static intptr selectobject(intptr hdc, intptr...

before filter - in Rails : Retrieve user input from a form that isn't associated with a Model, use the result within the controller -

here's simplified version of i'm trying : before other actions performed, present user form retrieve string. input string, , redirect default controller action (e.g. index). string needs exist, no other validations necessary. the string must available (as instance variable?) actions in controller. i'm new rails, doesn't seem ought exceedingly hard, i'm feeling kind of dumb. what i've tried : have before_filter redirecting private method looks like def check_string if @string return true else get_string end end the get_string method looks def get_string if params[:string] respond_to |format| format.html {redirect_to(accounts_url)} # authenticate.html.erb end end respond_to |format| format.html {render :action =>"get_string"} # get_string.html.erb end end this fails because have 2 render or redirect calls in same action. can take out first respond_to , of course, happens controller get...

Is there any way to inherit the existing TLD definition for particular JSP Tag? -

i planning extend basic html input tag provided spring incorporate more features it. did similar kind of exercise in past struts too. @ point of time had create tld file attributes introduced plus attributes available in parent tag. this bit tiresome , repetitive question is there anyway inherit existing tld definition particular jsp tag? or shortcut? i don't think there option inherit tld definition. the shortest solution, think, inherit tag class , change tld new (derived) class.

java - How do you ensure multiple threads can safely access a class field? -

when class field accessed via getter method multiple threads, how maintain thread safety? synchronized keyword sufficient? is safe: public class someclass { private int val; public synchronized int getval() { return val; } private void setval(int val) { this.val = val; } } or setter introduce further complications? if use 'synchronized' on setter here too, code threadsafe. may not sufficiently granular; if have 20 getters , setters , they're synchronized, may creating synchronization bottleneck. in specific instance, single int variable, eliminating 'synchronized' , marking int field 'volatile' ensure visibility (each thread see latest value of 'val' when calling getter) may not synchronized enough needs. example, expecting int old = something.getval(); if (old == 1) { something.setval(2); } to set val 2 if , if it's 1 incorrect. need external lock, or atomic compare-and-set me...

cocoa - Mac sample code using USB and CFRunLoopSource -

i'm trying (re-)write program uses usb controlled scanners. i've got usbiointerfaceinterface set up, can send , receive messages on pipes. calling writepipeto , readpipeto synchronously want read scanner asynchronously. i've tried using readpipeasyncto , callback never gets called until call timesout. reason appears i'm not registering callback somewhere. if add cfrunlooprun after async read, appears work, having many nested calls cfrunlooprun , can't idea. i've seen functions: err = (*usbinterfaceinterface)->createinterfaceasynceventsource(usbinterfaceinterface, &cfsource); cfrunloopaddsource(cfrunloopgetcurrent(), cfsource, kcfrunloopdefaultmode); but haven't figured out how tell source callback should called when happens on interface. when create source, , call readpipeasyncto , callback doesn't called until timeout. is there same sample code somewhere can see how these functions supposed work together? calli...

Wordpress: disable wptexturize globally -

i have wordpress page title "paper 10x10". in sidebar navigation page displayed "paper 10×10" (note x texturized wordpress , therefor x became multiplication sign ×). i have plugin raw html plugin installed. disables wptexturizing the_content . navigation not in the_content in get_sidebar() . i tried remove_filter: remove_filter('the_content', 'wptexturize'); remove_filter('the_excerpt', 'wptexturize'); but disables texturizing content or excerpt. how can disable wptexturize filter globally in wordpress blog? try: remove_filter('the_title', 'wptexturize');

c# - Elevating process privilege programmatically? -

i'm trying install service using installutil.exe invoked through process.start . here's code: processstartinfo startinfo = new processstartinfo (m_strinstallutil, strexepath); system.diagnostics.process.start (startinfo); where m_strinstallutil qualified path , exe "installutil.exe" , strexepath qualified path/name service. running command line syntax elevated command prompt works; running app (using above code) not. assume i'm dealing process elevation issue, how run process in elevated state? need @ shellexecute this? this on windows vista. running process in vs2008 debugger elevated admin privilege. i tried setting startinfo.verb = "runas"; didn't seem solve problem. you can indicate new process should started elevated permissions setting verb property of startinfo object 'runas', follows: startinfo.verb = "runas"; this cause windows behave if process has been started explorer "run administrato...

javascript - passing parameters to running silverlight application -

the scenario have list of items in html; when click on item use js dynamically create html load silverlight app passing in specific item # (using initparams); , silverlight app visualizes in nice way. on same page rather loading new webpage, , transition smooth. i know possible have silverlight call js function on page (opposite need). i'm thinking possible js function raise event/call method in silverlight, not sure how - has tried this? while workaround recreate silverlight app each time, raising event in existing, loaded sl app would perfect solution problem. regards ewart. you can call method in silverlight application javascript. see blog post you need create class in silverlight app registers callable js: [scriptabletype] public partial class someclass { private bool mousehelddown = false; private point movemeoffset = new point(); public someclass() { htmlpage.registerscriptableobject("silverlightobject", this); ...

How to embed a SWF file in an HTML page? -

how embed swf file in html page? the best approach embed swf html page use swfobject . it simple open-source javascript library easy-to-use , standards-friendly method embed flash content. it offers flash player version detection. if user not have version of flash required or has javascript disabled, see alternate content. can use library trigger flash player upgrade. once user has upgraded, redirected page. an example documentation: <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>swfobject dynamic embed - step 3</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript" src="swfobject.js"></script> <script type=...

Can you recommend Performance Analysis tools for PHP? -

can recommend useful performance analysis tools php scripts? me find problematic or unusually slow blocks of code, details execution time, etc. helpful. know there tools out there, i'm wondering people recommend being useful , well-designed. try webgrind . gives profiling of cachegrinder in easy read, browser based format. i'm on mac , has made profiling breeze.

SQL Append table queries -

i have 2 tables, table1 2 rows of data row11 , row12 , table2 3 rows of data sat row21, row22, row23 can provide me sql create query returns row11 row12 row21 row22 row23 note: dont want create new table return data. use union all , based on example data: select * table1 union select * table2 union removes duplicates - if both tables each had row values "rowx, 1", query return 1 row, not two. makes union slower union all , because union all not remove duplicates. know data, , use appropriately.

dom - Sometimes object.setAttribute(attrib,value) isn't equivalent to object.attrib=value in javascript? -

it appears object.setattribute(attrib,value) isn't equivalent object.attrib=value in javascript? i've got following code, works fine: var lastmonthbn = document.createelement('input'); lastmonthbn.value='<'; // works fine lastmonthbn.type='button'; // works fine but following code doesn't: var div = document.createelement('div'); div.class = 'datepickerdropdown'; // no luck here! so need use following: div.setattribute('class','datepickerdropdown'); my question is, why? reading this , thought object.setattribute(blah,value) same object.blah=value?? properties , attributes aren't same, dom exposes standard attributes through properties . the problem you're facing class attribute class future reserved word . in implementations use of future reserved word can cause syntaxerror exception. for reason, htmlelement dom interface provides way access class attribute, through ...

linux - How can I search for a multiline pattern in a file? -

i needed find files contained specific string pattern. first solution comes mind using find piped xargs grep : find . -iname '*.py' | xargs grep -e 'your_pattern' but if need find patterns spans on more 1 line, i'm stuck because vanilla grep can't find multiline patterns. so discovered pcregrep stands perl compatible regular expressions grep . for example, need find files ' _name ' variable immediatelly followed ' _description ' variable: find . -iname '*.py' | xargs pcregrep -m '_name.*\n.*_description' tip: need include line break character in pattern. depending on platform, '\n', \r', '\r\n', ...

android - can an image be manipulated using canvas -

is possible manipulate images using canvas? how image onto canvas? @override protected void ondraw(canvas canvas) { bitmap bitmap = bitmapfactory.decoderesource(getresources(), r.drawable.icon); bitmap mbitmap = bitmap.copy(bitmap.getconfig(), true); canvas = new canvas(mbitmap); matrix matrix = new matrix(); canvas.drawbitmap(mbitmap, matrix, mpaint); } i'm unable see image on screen. canvas.drawbitmap() shouldn't necessary since i'm using constructor , passing mbitmap. yes can, don't "get image onto canvas," canvas interface draw onto bitmap. so, create canvas , give reference mutable bitmap: canvas c = new canvas(mybitmap); very easy :)

php - How to apply privacy settings on posts the appear in a news feed with MySQL? -

what trying achieve complex privacy routine, have following tables. posts posts_privacy privacy_global followerlist we have news feed sort of thing on our site, gets 10 latests posts people user following, there 3 levels of privacy, first privacy_global user can set privacy options on posts , 0 , 1 , 2 "only me", "everyone", "followers only" respectively, there posts_privacy user can choose list people wants show or hide post before posting it, setting overrides privacy_global settings , posts_privacy instead if set. now problem that, when apply privacy in news feed using php ask posts this. select `post`.*, `users`.`fullname`, `users`.`username`, `posts_privacy`.`hide`, `posts_privacy`.`show`, `post` left join `posts_privacy` on `post`.`id`=`posts_privacy`.`postid` inner join `users` on `post`.`userid` = `users`.`id` (`post`.`userid` in (1,2,3,4,5,6) , 12 not in ( select `hide` `posts_privacy` `postid`=`post`.`id`) or `s...

algorithm - What is a decent beginner graph puzzle? -

i'm trying more acquainted problems require graphs solved (are best solved graphs). if has old acm programming competition problem utilized graphs, or have problem found particularly enlightening worked out appreciate it. want familiarize myself graphs, identifying graph-type problems , able utilize basic graph traversal algorithmns. anyone have sweet problem can send way? i found book extremely useful (amazon link): programming challenges not give pretty indepth explanation of graphs, trees, basic data structures gives handful of programming challenges involving each type! document more useful me textbook! here of graph problems in it: problems involving graph traversal : bicoloring : pg 203 playing wheels : pg 204 the tourist guide : pg 206 slash maze : pg 208 edit step ladders : pg 210 tower of cubes : pg 211 from dusk till dawn : pg 213 hanoi tower troubles (again!) : pg 215 problems involving graph algorithms (dijkstra's, m...

conventions - what is actually "EXTENT" in gis slang? -

i not understanding extent parameter in gis applications. ex, in mapserver map file using name "cgi-context-demo" status on size 400 300 **extent -2200000 -712631 3072800 3840000** units meters imagecolor 255 255 255 imagetype png here extent means lower left x,y , upper right x,y. long,lat values not used here , value? how arrived? extent area(square) specified left lower , right upper x , y. in example doesn't lon lat because it's different coordinate system.

java - Using Quotes within getRuntime().exec -

i'd invoke bash using string input. like: sh -l -c "./foo" i'd java. unfortunately, when try invoke command using getruntime().exec , following error: foo": -c: line 0: unexpected eof while looking matching `"' foo": -c: line 1: syntax error: unexpected end of file it seems related string not being terminated eof. is there way insert platform specific eof java string? or should looking approach, writing temp script before invoking "sh" ? use this: runtime.getruntime().exec(new string[] {"sh", "-l", "-c", "./foo"}); main point: don't put double quotes in. that's used when writing command-line in shell! e.g., echo "hello, world!" (as typed in shell) gets translated to: runtime.getruntime().exec(new string[] {"echo", "hello, world!"}); (just forget moment shell has builtin echo , , calling /bin/echo instead. :-)) ...

debugging - What's the toughest bug you ever found and fixed? -

what made hard find? how did track down? not close enough close see also https://stackoverflow.com/questions/175854/what-is-the-funniest-bug-youve-ever-experienced a jpeg parser, running on surveillance camera, crashed every time company's ceo came room. 100% reproducible error. i kid not! this why: for doesn't know jpeg compression - image kind of broken down matrix of small blocks encoded using magic etc. the parser choked when ceo came room, because had shirt square pattern on it, triggered special case of contrast , block boundary algorithms. truly classic.

asp.net - Accessing Controls on page loaded in IFrame in MS CRM 4.0 using Javascript -

i have custom aspx page loaded in iframe in 1 of modules in ms crm 4.0. page has 6 textboxes (txtvalue1, txtvalue2 , on..) values in it. want access these values through javascript code either on load event or save event. know how ? tried couple of codes got net nothing seems work. on appreciated. try following snippet... var textbox1value = document.frames.iframe_name.document.all.txtvalue1.value; where iframe_name name of iframe define in form customizations , txtvalue1 id of textbox on iframe.

serial port - How to read gyroscope data with Arduino? -

i got 1 of these gyros, http://www.xheli.com/wag0diadpiin.html . it has 6 pins 3,3. i'm afraid might harm device, wanted ask here. how should connect arduino? , code should use? i have salvaged 1 of these off old walkera helicopter , want same thing. if no 1 has posted here, try sort out , post reply. for it's worth, female 3 pin connector connects walkera brushed speed controller (which in turn connects 6-15 v battery power). other 3 pins connected main circuit had radio control , servo outputs. connector must have pin sample. speculating, guess work best connect int0 or int1 on arduino, instead of trying poll it. i guess 2 axis values might come chip, problem knowing how data encoded/muxed on single output pin. if find out more, post update. luck.

operating system - The stack size used in kernel development -

i'm developing operating system , rather programming kernel, i'm designing kernel. operating system targeted @ x86 architecture , target modern computers. estimated number of required ram 256mb or more. what size make stack each thread run on system? should try design system in such way stack can extended automatically if maximum length reached? i think if remember correctly page in ram 4k or 4096 bytes , doesn't seem lot me. can see times, when using lots of recursion, want have more 1000 integars in ram @ once. now, real solution have program doing using malloc , manage own memory resources, know user opinion on this. is 4k big enough stack modern computer programs? should stack bigger that? should stack auto-expanding accommodate types of sizes? i'm interested in both practical developer's standpoint , security standpoint. is 4k big stack? considering normal program execution, point of view of classes in c++, notice source code tends malloc/new data...

Visual Studio 2010 WPF Designer issues -

i using: visual studio 2010 professional, silverlight 4 toolkit the wpf designer don't show (invisible) - while component toolbox showing relevant controls, , windows->windows option shows designer active. xaml me, regardless of complexity. have tried /resetskippkgs no avail. had coderush , devexpress installed (demo) version removed both since. can along xaml switching source code /text editor, boils chops run app find out have made silly mistake in xaml (while preview sort out quicker, , no, please don't suggest expression blend non-nonsensical me switch continuously between these applications). when switch wpf designer open encoding following error - assume related issue not showing xaml editor/designer in non-encoding: an unhandled exception has occurred click reload designer system.nullreferenceexception object reference not set instance of object. at ms.internal.providers.vsdesignercontext.vsdesignercontextholder..ctor(iserviceprovider services, vs...

Editor or IDE supporting django templates and HTML/CSS validation? -

is there ide supports editing django templates , able validate html , css? requirements: be able detect , highlight errors in css , example: forgot close "}", or invalid css attribute be able make learn new css attributes (like css3 ones or browser specific ones) - don't want see them invalidating css validate partial-html, 1 inside django templates . has run on windows python support (optional / bonus) i know there many cool python ides found none can used edit , validate html/css django-templates. pycharm intellij.

sql server - Is it possible to get a list of relevant words from a full-text index given a specific row? -

i wuld som automatic tagging of incoming text in our system , wondering if full-text index capable of providing a ranked list of words given indexed row. if not, have suggestions on how this? have system in place auto tagging brute-force (aka. slow) in method , not yielding list of words. i think so. here the scenarios given using sys.dm_fts_index_keywords_by_document are “i want know how many keywords full-text index contains” “i want know if keyword part of given doc/row” “i want know how many times keyword appears in whole full-text index” (sum(occurrence_count) keyword=……) “i want know how many times keyword appears in given doc/row” “i want know how many keywords given doc/row contains” “i want retrieve keywords belonging given doc/row”

css - What methods of ‘clearfix’ can I use? -

i have age-old problem of div wrapping two-column layout. sidebar floated, container div fails wrap content , sidebar. <div id="container"> <div id="content"></div> <div id="sidebar"></div> </div> there seem numerous methods of fixing clear bug in firefox: <br clear="all"/> overflow:auto overflow:hidden in situation, 1 seems work correctly <br clear="all"/> solution, little bit scruffy. overflow:auto gives me nasty scrollbars, , overflow:hidden must surely have side effects. also, ie7 apparently shouldn't suffer problem due incorrect behaviour, in situation it's suffering same firefox. which method available robust? depending upon design being produced, each of below clearfix css solutions has own benefits. the clearfix have useful applications has been used hack. before use clearfix perhaps these modern css solutions can useful: css flexbox...