Posts

Showing posts from August, 2012

asp.net - enabalajx() not defined -

i m building web control in aspx 3.5 in m using ajax hover menu extender. works fine in chrome. in ie8 crashes when hover on button. when check in chrome error given there uncaught referenceerror: enabalajax not defined. please me in regard try using enableajax

regex - How to create inverse of scrubbing script in SED? -

i wrote sed script deletes rows ("/d") match set of ip regular expressions. want re-read same source file , create inverse output - delete not in list. if throw "!" expression, delete since match "not" condition of other ip list entries. here's example of regex in internal.lst: /10\.10\.50\.0/d /10\.100\.0\.0/d /10\.101\.0\.0/d /10\.101\.0\.128/d and example of sed execution (in .bat file): for /f %%f in ('dir /b source\*.txt') ( sed -f ..\internal.lst staging\%%f > scrubbed\external\%%f rem inverse of above line!!!! >scrubbed\internal\%%f move staging\%%f scrubbed\original ) edit: confirm understand bobbogo's comment, i'd like: sed -f list.lst staging\in.txt > out.txt and i'll put in list.lst file: /10\.100\.0\.0{p;n} /10\.101\.0\.0{p;n} /10\.101\.0\.128{p;n} is right? in gnu sed , -n option suppresses automatic printing of pattern space, allows use p command print select line...

image - speech bubbles like in comics for iphone -

i new iphone application development. building iphone app user needs able add speech bubbles (think comics) on existing images. have questions on how implement this, have empty speech bubble image , overlay on existing image - use separate uiimage speech bubble? or should draw speech bubble myself? allow user move speech bubble using touch- pointers or examples great! also let him resize speech depending on amount of text - pointers or examples great! finally should able add text speech bubble - there way add textbox on existing image? thanks, update - found similar example on site move/resize uiview - http://www.switchonthecode.com/tutorials/creating-basic-animations-on-iphone i use transparent uiview uiimageview containing bubble , uitextview set editable. use resize text view whenever text view changed notification sent: cgrect frame = textview.frame; frame.size.height = textview.contentsize.height; textview.frame = frame; subclass uiview , use touchesb...

jboss - Error deploying a Grails 1.3.2 war on JBoss6 -

we trying upgrade jboss 4 jboss 6 , receive following error when deploying our grails 1.3.2 war: 09:53:33,343 info [jmxkernel] legacy jmx core initialized 09:53:37,515 info [abstractserverconfig] jboss web services - stack cxf server 3.4.1.ga 09:53:38,000 info [jsfimplmanagementdeployer] initialized 3 jsf configurations: [mojarra-1.2, myfaces-2.0, mojarra-2.0] 09:53:42,515 warning [fileconfigurationparser] aio wasn't located on platform, fall using pure java nio. if platform linux, install libaio enable aio journal 09:53:52,593 warn [classloadermanager] unexpected error during load of:groovy.jmx.builder.package-info: java.lang.classformaterror: illegal class name "groovy/jmx/builder/package-info" in class file groovy/jmx/builder/package-info @ java.lang.classloader.defineclass1(native method) [:1.6.0_20] @ java.lang.classloader.defineclasscond(unknown source) [:1.6.0_20] @ java.lang.classloader.defineclass(unknown ...

arrays - Highest Percentage Increase -

lets have following set of numbers representing values on time 1 2 3 10 1 20 40 60 now looking algorithm find highest percentage increase 1 time another. in above case, answer pair (1, 60), has 6000% increase. so far, best algorithm can think of brute-force method. consider possible pairs using series of iterations: 1st iteration: 1-2 1-3 1-10 .. 1-60 2nd iteration 2-3 2-10 2-1 ... 2-60 (etc.) this has complexity o(n 3 ). i've been thinking approach. find strictly increasing sequences, , determine perecentage increase in strictly increasing sequences. does other idea strike guys? please correct me if ideas wrong! i may have misunderstood problem, seems want largest , smallest numbers, since 2 numbers matter. while true: indexofmax = max(list) indexofmin = min(list) list.remove(indexofmax) list.remove(indexofmin) if(indexofmax < indexofmin) contine else if(indexofmax == indexofmin) return -1 els...

version control - How to setup SVN repo for emergency fixes? -

being developer number of years should know don't. i working on released product on small team. main developer committing of code there couple other developers commit time time. currently, have staging server running hudson ci builds after every commit. production updated manually simple svn command when trunk stable , tested. this has worked fine except have situations requiring emergency/urgent changes production when code not finalized in trunk. how can setup repo accommodate situation? thought this response reply still little on head. i thinking, when updating production, create branch @ revision. however, if need make urgent production fixes, how access branch , how can update production pulling branch , not trunk? how make sure urgent fixes production branch committed trunk? ie. situation want have better solution because has occurred few times rev 1000 updated on production rev 1001-1005 new feature requests/bug fixes included in next version rev 10...

Where should signal handlers live in a django project? -

i have started implementing signal listeners in django project. while understand , how use them. having hard time figuring out should put them. documentation django site has say: where should code live? you can put signal handling , registration code anywhere like. however, you'll need make sure module it's in gets imported on signal handling gets registered before signals need sent. makes app's models.py place put registration of signal handlers. while suggestion, having non model classes or methods in models.py rubs me wrong way. so then, best practice/rule storing , registering signal handlers? i make them classmethods of model itself. keeps within 1 class, , means don't have worry importing anything.

sqlite - Storing float numbers as strings in android database -

so have app put arbitrary strings in database , later extract them this: cursor dbresult = mydatabase.query(false, constant.database_notes_table_name, new string[] {"mystuff"}, where, null, null, null, null, null); dbresult.getstring(0); this works fine in cases except when string looks float number, example "221.123123123". after saving database can extract database computer , inside db-viewer, , saved number correct. however, when using cursor.getstring() string "221.123" returned. cant life of me understand how can prevent this. guess cursor.getdouble() on every single string see if gives better result, feels sooo ugly , inefficient. suggestions? cheers, edit: made small test program. program prints "result: 123.123", when print "result: 123.123123123" sqlitedatabase database = openorcreatedatabase("databas", context.mode_private, null); database.execsql("create table if not exists tabell (ny...

Pycharm (Python IDE) doesn't auto complete Django modules -

my python ide (pycharm) has stopped auto completing modules (suggestions). unresolved references after every django module try import so: from django - works, add 'dot' fails from django.db import models gives me unresolved errors... the ackward thing after compiling references work. i discovered __init__.py files (everywhere) no longer marked python icon , notepad icons. opening init files in interpreter gives non-color marked text (no syntax highlighting). think python doens't recognizes these files. my python interpreter python 2.6.1 django 1.2.4 , django installed under: /lib/python/2.6/site-packages (full directories, not egg) when unfold sitepackages external libraries within ide see colored mark .py files except __init__.py files. hence thats issue lives. (i have found posts on google similar problems no answers...) i had same issue , couldn't find definitive answer. invalidating caches didn't work me. problem lies in fact that, ...

html - ASP.NET <Body onload="initialize()"> -

i creating asp.net custom control. i want set body onload event of aspx page control resides. please note cannot rely on body tag in aspx page having runat="server". any ideas?? cheers. inline javascript! incase can't use jquery function addloadevent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } } } addloadevent(initialize); link read http://www.webreference.com/programming/javascript/onloads/ credits goto http://simonwillison.net/

lambda - Compute Dot Product of Two Vectors -

i'm supposed create predicate in prolog such iprod(list1, list2, result) takes 2 lists of equal length , each contain integers. result dot product of 2 vectors. for example, list1 = [1,2,3] , list2 = [4,5,6] , result 1*4 + 2*5 + 3*6 . i'm not supposed use built-in dotproduct function. my code far: iprod([],[], 0). iprod([h1|list1], [h2|list2], result h1 * h2) :- iprod(list1, list2, result). in visual prolog: domains ilist=integer* predicates iprod(ilist, ilist, integer, integer) clauses iprod([], _, r, r). iprod([x|xs], [y|ys], a, r):- m = x * y, rnew = + m, iprod(xs, ys, rnew, r). goal iprod([1,2,3],[4,5,6], 0, r). results in 32 . sorry, no other prolog implementation available @ hand.

creating large database 10gb for informix -

creating large database 10gb informix as long ensure have enough disk space allocated in chunks dbspaces associated instance, there no particular problem creating medium size database such 10 gb one. these days, 'large database' doesn't start until reach 100 gb; arguably, not until reach 1 tb. 10 gb not small, isn't large. where data come from? there large number of possible loading strategies, depending on data sources , version of ids. note latest versions of ids (11.50.xc6 or later) include 'external tables' (and extremely fast) loading mechanism, , merge statement combined external tables provides 'upsert' - update or insert (or delete) - mechanism too.

design - Command Pattern leading to class explosion -

it seems whenever use command pattern, leads larger number of classes when don't use it. seems pretty natural, given we're executing chunks of relevant code in separate classes. wouldn't bother me if didn't finish 10 or 12 command subclasses might consider small project have used 6 or 7 classes otherwise. having 19 or classes usual 7 class project seems wrong. another thing bothers me testing of command subclasses pain. feel sluggish after last few commands, if i'm moving slower , no longer agile. does sound familiar you? doing wrong? feel i've lost agility late in project, , don't know how continuously implement , test speed had few days ago. design patterns general templates solving problems in generic way. tradeoff seeing. happens because need customize generic approach. 12 command classes not seem lot me, though, personally. with command pattern, commands simple (just execute method, right?) , hence easy test. also, should testable ...

.net - How to use C# regular expressions to emulate forum tags -

i building forum , want able use simple square bracket tags allow users format text. accomplishing parsing string , looking tags. it's tedious, when run tag [url=http://www.something.com]some text[/url]. having parse attribute, , value, , make sure has proper opening , closing tags kind of pain , seems silly. know how powerful regular expressions i'm not @ them , frustrate me no end. any of regex gurus willing me out? think example me started. regex finding tags [b]bolded text[/b] , tags attributes link 1 listed above helpful. in advance! edit: links laymen's terms tutorials regex helpful. this should work. "=something.com" optional , accommodates single or double quotes , makes sure closing tag matches opening tag. protected void page_load(object sender, eventargs e) { string input = @"my link: [url='http://www.something.com'][b]some text[/b][/url] awesome. jazz hands activate!!"; string result = parse(...

asp.net - Viewstate in a .ashx Handler? -

i've got handler (list.ashx example) has method retrieves large dataset, grabs records shown on given "page" of data. allowing users sorting on these results. so, on given page run, retrieving dataset got few seconds/minutes ago, reordering them, or showing next page of data, etc. my point dataset hasn't changed. normally, dataset stuck viewstate of page, since i'm using handler, don't have convenience. @ least don't think so. so, common way store viewstate associated current user's given page when using handler? there way take dataset, encode somehow , send user, , on next call, pass , rehydrate dataset bits? i don't think session place store since might have 1000 users viewing different datasets of different data, , bring server knees. @ least think so. does have experience kind of situation, , can give me advice? in situation use cache type of user , query info key. reason being large dataset. right there don't w...

plot - Plotting Implicit Algebraic equations in MATLAB -

Image
i wish plot implicit functions in matlab. x^3 + xy + y^2 = 36 , equations cannot made simple parametric form. there simple method ? here couple of options... using ezplot (or fplot recommended in newer versions): the easiest solution use function ezplot : ezplot('x.^3 + x.*y + y.^2 - 36', [-10 10 -10 10]); which gives following plot: using contour : another option generate set of points evaluate function f(x,y) = x^3 + x*y + y^2 , use function contour plot contour lines f(x,y) equal 36: [x, y] = meshgrid(-10:0.1:10); % create mesh of x , y points f = x.^3+x.*y+y.^2; % evaluate f @ points contour(x, y, f, [36 36], 'b'); % generate contour plot xlabel('x'); % add x label ylabel('y'); % add y label title('x^3 + x y + y^2 = 36'); % add title the above give plot identical 1 generated ezplot :

What hash/map based programming language exist? -

much lisp considered list based programming language languages considered map based? i remember reading 1 few years back, can not longer find reference it. looked like: [if:test then:<code> else:<more code>] edit: , more quoted code blocks conditional evaluated. in fashion if/cond , others not special form in lisp/scheme. the syntax above supposed map/dictionary lisp's syntax list like. if key value of test. then key value of . ... that looks misc , lazy lisp maps instead of lists fundamental datatype. (it's lazy, has deep integration of metadata (similar clojure) , couple of other things, still lisp: functional, homoiconic, macros, implemented metacircular interpreter, stuff.) here's code samples blog : [if [> 5 10] then:[+ 5 10] else:[- 5 10]] [let '[square:[lambda '[x:1] '[* x x]]] '[square 12] ] [take 20 [numbers from:0]] unfortunately, seems besides 2 blog articles long ago, there's not going...

Suppress one command's output in R -

i'm looking suppress output of one command (in case, apply function). is possible without using sink() ? i've found described solution below, in 1 line if possible. how suppress output it isn't clear why want without sink , can wrap commands in invisible() function , suppress output. instance: 1:10 # prints output invisible(1:10) # hides otherwise, can combine things 1 line semicolon , parentheses: { sink("/dev/null"); ....; sink(); }

orm - JPQL / SQL: How to select * from a table with group by on a single column? -

i select every column of table, want have distinct values on single attribute of rows (city in example). don't want columns counts or anything, limited number of results, , seems not possible directly limit results in jpql query. original table: id | name | city --------------------------- 1 | john | ny 2 | maria | la 3 | john | la 4 | albert | ny wanted result, if distinct on city: id | name | city --------------------------- 1 | john | ny 2 | maria | la what best way that? thank help. in jpql, this: select e myentity e e.id in (select min(e.id) myentity e group e.city) this returns: myentity [id=1, name=john, city=ny] myentity [id=2, name=maria, city=la]

hibernate - Trouble using the Transactional annotation in groovy -

has had experience spring transactions (class-level, proxy, annotation-driven) not getting started in groovy class? i've been struggling unexplained lazyinitialization exception noticed stacktrace not include call start transaction. sounds crazy have wonder whether groovy picks on transactional annotation. actually found source of problem. spring documentation (i added in emphasis): 24.5.1. aop - advising scripted beans possible use spring aop framework advise scripted beans. spring aop framework unaware bean being advised might scripted bean, of aop use cases , functionality may using or aim use work scripted beans. there 1 (small) thing need aware of when advising scripted beans... cannot use class-based proxies, must use interface-based proxies. of course not limited advising scripted beans... can write aspects in supported dynamic language , use such beans advise other spring beans. advanced use of dynamic language support though. my problem was using ...

php - zend_db_select join using 3 or more tables -

so zend_db_select has methods `joinusing(table, join, [columns]) , joininnerusing(table, join, [columns])` `joinleftusing(table, join, [columns])` `joinrightusing(table, join, [columns])` `joinfullusing(table, join, [columns])` etc but if want join 3 or more tables (eg many many association)....eg: query: select * (j left join e on j.id = e.eee) left join w on w.www = e.id how go doing zend_db_select try doing ... not sure works 2 fields have not tried 3 fields $dbmodel->select(false) ->setintegritycheck(false) ->from(array('t1' => 'table1')) ->joinleft(array('t2' => 'table2'), 't1.somefeild = t2.somefeild') ->joinleft(array('t3' => 'table3'), 't2.somefeild = t3.somefeild') you try build query, , can check query die((string)$select)

c# - comboBox with checkList -

how can combobox checklist in in c#? i've been messing around myself. here's small sample of control has real checkboxes in rather drawing them. way can use checkbox class has offer. replaces regular drop down of combobox custom 1 inherites toolstripdropdownmenu allows add actual controls , solves problem of drop down closing whenever click on item. want extend mycombobox class quite bit fit needs, should place start. public partial class form1 : form { public form1() { initializecomponent(); var mcb = new mycombobox() { left = 6, top = 6 }; this.controls.add(mcb); (int = 0; < 20; i++) { mcb.additem("item " + i.tostring() ); } } } public class mycombobox : combobox { private mydropdown _dropdown; public mycombobox() { _dropdown = new mydropdown() { width = 200, height = 200 }; } public void additem(string text) { _dropdown.addcontrol(ne...

content management system - Creating directory in Joomla -

what easiest way go creating directory based in joomla similar craigslist? thanks you have @ component http://www.mosets.com/tree/

What is the most efficient way to merge byte arrays in C? -

say have 2 arrays of char, , each position either 1 or 0. 2 arrays calculated in different processes , sent master combined, each 1 writes range of array: p1 : [0, 0, 0, 0, 1, 1, 0, 1] p2 : [1, 0, 1, 1, 0, 0, 0, 0] goal: [1, 0, 1, 1, 1, 1, 0, 1] however, these large arrays. there super fast way of doing besides looping on 1 of them? to clarify, should or'd. assuming byte granularity enough, you'd want use memcpy copy them output array: memcpy(goal, p2, 4); memcpy(goal + 4, p1 + 4, 4); you can further optimize letting p1 , p2 contain own ranges, eg: char p1[4] = { 1, 1, 0, 1 }; char p2[4] = { 1, 0, 1, 1 }; char goal[8]; memcpy(goal, p2, 4); memcpy(goal + 4, p1, 4); note may want bit vector packing - pack 8 bits each char. save lot of memory large arrays, although complicates access.

php - codeigniter passing the same information (like login status) to all the views -

i'm using dx_auth handle autentication in codeigniter app. want display in each page login status, i'm used develop view throught template inheritance. i'm looking way access login information views without passing each time. views shouldn't engage in "lookups". why not make template view can passed authentification information. then, build template controller, other controllers inherit, passes authentification info template view. way, write code once template view , template controller.

Rails request forgery protection settings -

please newbie in rails :) have protect_from_forgery call (which given default) no attributes in applicationcontroller class. basically here's code: class applicationcontroller < actioncontroller::base helper :all # include helpers, time protect_from_forgery helper_method :current_user_session, :current_user filter_parameter_logging :password, :password_confirmation what assume should is: should prevent post requests without correct authenticity_token . when send post request jquery 1 below, works fine (there's update statement executed in database)! $.post($(this).attr("href"), { _method: "put", data: { test: true } }); i see in console there's no authenticity_token among sent parameters, request still considered valid. why that? upd found config setting in config/environments/development.rb config.action_controller.consider_all_requests_local = true because of dev environment , local requests, these jquery post request...

php - i getting data from a db sql -

i getting data db , want each row data other table $query = "select use ur user='gue'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['use']; echo '<br>'; } now want each $row['use'] should data table 'my' $query = "select sum(mon) use='$use'"; //$use = row['use'] $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['sum(mon)']; } is there solution? select ur.use, sum(my.mon) ur inner join on ur.use = my.use ur.user = 'gue' group ur.use

How to connect menu click with action in Qt Creator? -

i new qt. i started new qt4 gui application. using designer, have created menu so: file - exit how action associated menu item? i found called 'signals , slots editor' have no idea how use it. click on green plus sign after selected signals slots editor. give 4 fields fill in. sender select creating signal. example actionexit might name created exit menu item. signal going clicked(). receiver class created has of methods. slot method created in class want execute. example: actionexit clicked() <nameofclass> exitgame() hope helps.

regex - Python regular expression with wiki text -

i'm trying change wikitext normal text using python regular expressions substitution. there 2 formatting rules regarding wiki link. [[name of page]] [[name of page | text display]] (http://en.wikipedia.org/wiki/wikipedia:cheatsheet) here text gives me headache. the cd composed entirely of [[cover version]]s of [[the beatles]] songs george martin [[record producer|produced]] originally. the text above should changed into: the cd composed entirely of cover versions of beatles songs george martin produced originally. the conflict between [[ ]] , [[ | ]] grammar main problem. don't need 1 complex regular expression. applying multiple (maybe two) regular expression substitution(s) in sequence ok. please enlighten me on problem. wikilink_rx = re.compile(r'\[\[(?:[^|\]]*\|)?([^\]]+)\]\]') return wikilink_rx.sub(r'\1', the_string) example: http://ideone.com/7oxuz note: may find mediawiki parsers in http://www.mediawiki.org/wik...

javascript - How do you get a list of the names of all files present in a directory in Node.js? -

i'm trying list of names of files present in directory using node.js. want output array of filenames. how can this? you can use fs.readdir or fs.readdirsync methods. fs.readdir const testfolder = './tests/'; const fs = require('fs'); fs.readdir(testfolder, (err, files) => { files.foreach(file => { console.log(file); }); }) fs.readdirsync const testfolder = './tests/'; const fs = require('fs'); fs.readdirsync(testfolder).foreach(file => { console.log(file); }) the difference between 2 methods, first 1 asynchronous, have provide callback function executed when read process ends. the second synchronous, returns file name array, stop further execution of code until read process ends.

c# - Mouse coordinates on Screen -

how track mouse position on screen regardless of application.i.e. whenever user clicks or select mouse in application, want display own menu @ point itself. is there way mouse position on screen using c#? to this, you'd need p/invoke user32.dll , use setwindowshookex() . have here: setwindowshookex (user32) how set windows hook in visual c# .net

How to run a c or c++ program on a Android Device like Samsung galaxy tab? -

hi im wondering how execute simple helloworld c or c++ program on android phone googled dont find crystal clear working methods guys direct me in this.... you need use android ndk (native development kit). the ndk package contains some demos can compile , run.

Javascript: How can I replace the contents of a string but not in an HTML tag? -

i want write javascript function change text lasvegas in string: example: " hello every 1 in lasvegas, come <a href='xxx'>lasvegas</a> me " how can change text "lasvegas" not change content lasvegas in html tag? may that str.replace(/lasvegas[^<]/,'123')

Equivalent of Oracle’s RowID in MySQL -

is there equivalent of oracle's rowid in mysql? delete my_table rowid not in (select max(rowid) my_table group field1,field2) i want make mysql equivalent of query!!! what i'm trying is, : my_table has no primary key.. i'm trying delete duplicate values , impose primary key (composite of field1, field2)..!! in mysql use session variables achive functionality: select @rowid:=@rowid+1 rowid table1, (select @rowid:=0) init order sorter_field but can not make sorts on table trying delete in subqueries. upd : need create temp table, insert ranging subquery temp table , delete original table joining temporary table (you need unique row identifier): create temporary table duplicates ... insert duplicates (rowid, field1, field2, some_row_uid) select @rowid:=if(@f1=field1 , @f2=field2, @rowid+1, 0) rowid, @f1:=field1 field1, @f2:=field2 field2, some_row_uid testruns t, (select @rowid:=null, @f1:=null, @f2:=null) init order field1, field2 desc; d...

c++ - inline functions returning incorrect results -

i have large application working on in c++, , have class inline functions returning wrong value. looks offset 1 entry. here example of how code set up: class test { private: uint myval1; uint myval2; uint myval3; uint myval4; public: uint myfunct1() const { return myval1 }; uint myfunct2() const { return myval2 }; }; what seeing myfunct1 returns myval2 , myfunct2 returns myval3. if dont make functions inlined works expected. any ideas on why happening? thanks in advance. (i assume posted above fragment header file.) things typically happen when different source files in program compiled different memory-layout-related settings, class packing , alignment settings. header file included these different translation units , interpreted differently because of discrepancies in memory-layout settings. once start passing test objects between these translation units, problem reveals itself. 1 translation unit creates test object 1 memory...

is there any trouble with wmode and flash -

our site's user claimed display trouble wmode , flash. said: flash display broken do have experiment it? setting wmode transparent, when playing video, has been known cause performance issues... setting wmode transparent when don't have background graphic cause unexpected display issues.... need more information if you.

sql - Transactional isolation level needed for safely incrementing ids -

i'm writing small piece of software insert records database used commercial application. unique primary keys (ids) in relevant table(s) sequential, not seem set "auto increment". thus, assume, have find largest id, increment , use value record i'm inserting. in pseudo-code brevity: id = select max(id) some_table id++ insert some_table values(id, othervalues...) now, if thread started same transaction before first 1 finished insert, 2 identical ids , failure when trying insert last one. check failure , retry, simpler solution might setting isolation level on transaction. this, need serializable or lower level? additionally, this, generally, sound way of solving problem? other ways of doing it? one way of doing merge first 2 lines insert statement: insert some_table values ((select max(id) + 1 some_table),othervalues...) or insert some_table select st2.id, othervalues (select max(id)+1 some_table) st2 otherwise, want lock in transaction , pr...

c# - SharePoint 2007 timer job -

i have developed custom timer job in sharepoint 2007. issue , timer job executes few times, after stops working , if check status of job stuck on "initialized" mode. if remove , add job definition start working again few times "succeeded" status, after again same issue. any ideas? hrayr it might developing customized content deployment job export , import of contents between different web applications. so, export not performed or perhaps export failed during job execution. there might dependency between different jobs. i recommend take following actions: if working import , export timer jobs, try increase span of export timer job 5mins 10 mins. let import run run in short durations e.g. 2mins. start debugging code. for debugging: important here attach debugger "owstimer.exe" process in visual studio debug code of affected timer service. make sure set breakpoints in code. make sure reset sharepoint timer services after done timer job ...

cpanel cron job url -

i need create cron job runs webpage (and retrieve data) (not file on server). tryed wget , works if set cron job manually in unix, not if create cron job in cpanel. wget -o http://someurl.somehting . cron jobs not run under user , environment. path wget may not in cron user's path . specify full path (e.g. /usr/bin/wget ).

Java JFileChooser getAbsoluteFile Add File Extension -

i have issue working know if there better way of adding file extension? what doing right is: string filepath = chooser.getselectedfile().getabsolutefile() + ".html"; im adding extension hard coded. , saving it. just wondering if there more robust/logical manner can implemented? thank time. edit: ask app portable across platforms. adding .html manually may make windows solution. edit: think ive surfed enough know .html hard coded safe havent found documentation says dont take approach (not sure). issue: if want save file in format, text, example how detect user selected format? filenameextensionfilter can add filters dialog how return value file type selected? edit: have studied this still unclear how retrive user selected file type. edit: rephrase of issue: alt text http://img98.imageshack.us/img98/4904/savef.jpg question how can retrieve/find out 1 of 2 filters user has selected save format. html or jpeg? how retrieve info jfilechooser? thank yo...

collections - How to make Groovy arrays comparable? -

tried this: arraylist.metaclass.compareto = {arg -> this?.size() <=> arg?.size() } [1]<=>[2] it doesn't work. there still exception rises groovy.lang.groovyruntimeexception: cannot compare java.util.arraylist value '[1]' , java.util.arraylist value '[2]' one approach implement comparator interface. another use metaclass wanted, not able use <=> operator since list doesn't implement comparable . list.metaclass.compareto = { collection other -> delegate.size() <=> other?.size() } def x = [1, 2, 3] def y = [4, 5] println x.compareto(y) // x <=> y won't work

javascript - Cancel setTimeout if mouse is over div -

Image
i have 2 div classes, , b. when mouse on div a, div b should appear, if mouse on or b, div b should stay opened. if mouse out of both, , b divs, b should disappear. (as guess simple tooltip script) this jquery code wrote: $(document).ready(function() { function show() { $("bbb").css({'display':'block'}); } $("aaa").each(function() { $(this).mouseover(function() { show(); }); $(this).mouseleave(function() { time = settimeout("hide()", 200); }); $("bbb").mouseleave(function() { settimeout("hide()", 200); }); $("bbb").mouseenter(function() { cleartimeout(time); }); }); }); function hide() { $("bbb").css({'display':'none'}); } the problem when move b a, b disappears! want disappear if mouse neither on a, nor b. how can fix problem? ...

formapi - drupal form api checkboxes -

i using drupal form api , using checkboxes. getting problem in default checked values it. following code snippet... $result = db_query("select nid, filepath {content_type_brand}, {files} content_type_brand.field_brand_image_fid = files.fid"); $items = array(); while ($r = db_fetch_array($result)) { array_push($items, $r); } $options = array(); foreach( $items $i ) { $imagepath = base_path().$i['filepath']; $options[$i['nid']] = '<img src="'.$imagepath.'"></img>'; } $form['favorite_brands'] = array ( '#type' => 'fieldset', '#title' => t('favorite brands'), //'#weight' => 5, '#collapsible' => true, '#collapsed' => false, ); $form['favorite_brands']['brands_opt...

JSON stringify standalone function for JavaScript -

i know of yui has json.stringify utility , of json2 json.org. what other implementations of json.stringify? it should work in ie6, ie7 , not depend on framework. if depends on should included in 1 file. edit: use jquery-json, suggested in comments of accepted answer. did wanted. (it depends on jquery solved) consider "json-sans-eval" . i'm using in myna because super fast, ecmascript 5 conformant, , importantly, unlike json2, not use eval() there no danger of abusing json spec execute trojan javascript code.

What is the difference between "db_owner" and "the user that owns the database" in SQL Server 2000? -

i'm trying better understand why 1 of our database update scripts failed work @ particular customer site, , narrowed down (i think) database ownership , roles. disclaimer: i'm waiting hear customer's dba can tell if upgraded sql database , can @ database. i'm thinking sql 2000 sql 2005 conversion might have hosed our scripts if our applications's database login converted schema, because referencing dbo in few places in update script. anyway, i've been trying find better explanation of database ownership , roles , how impacts owner database object assigned when don't explicitly specify owner in t-sql statement. example, our update scripts typically create table foo instead of create table dbo.foo or else, found few explicitly using dbo , , ones causing problems @ moment (only 1 customer). i found this article (specific sql server 2000), table on page confusing. mentions db_owner , "owns database" 2 distinct possibilities role use...

flash - AS2 Load Image to Multiple MC -

how can load same image in multiple mc's without have load each one. check duplicatemovieclip() , attachmovie()

c# - Why isn't the Cache invalidated after table update using the SqlCacheDependency? -

i have been trying sqlcachedependency working. think have set correctly, when update table, item in cache isn't invalidated. can @ code , see if missing anything? i enabled service broker sandbox database. have placed following code in global.asax file. restart iis make sure called. void application_start(object sender, eventargs e) { sqldependency.start(configurationmanager.connectionstrings["sandboxconnectionstring"].connectionstring); } i have placed entry in web.config file: <system.web> <caching> <sqlcachedependency enabled="true" polltime="10000"> <databases> <add name="sandbox" connectionstringname="sandboxconnectionstring"/> </databases> </sqlcachedependency> </caching> </system.web> i call code put item cache: protected void cachedatasetbutton_click(object sender, eventargs e) { usi...

Remove the bottom divider of an android ListView -

i have fixed height listview . has divider between list items, displays dividers after last list item. is there way not display divider after last item in listview ? just add android:footerdividersenabled="false" listview description

Trying to Develop PostFix Notation in Tree Using Perl -

i'm using perl run through tree, , calculate leaf nodes of tree using internal nodes operators. want able print in postfix manner, , managed this basic operands (simply call left , right nodes respectively before calling parent) having trouble producing desired output average function. don't have trouble printing actual result of calculation, want able print operators , operands in postfix notation. for example, 1 + average(3, 4, 5) shown 1 ; 3 4 5 average +. here code: use strict; use warnings; use data::dumper; $data::dumper::indent = 0; $data::dumper::terse = 1; $debug = 0; # arithmetic expression tree reference list, can # of 2 kinds follows: # [ 'leaf', value ] # [ 'internal', operation, leftarg, rightarg ] # evaluate($ex) takes arithmetic expression tree , returns # evaluated value. sub evaluate { ($ex) = @_; $debug , print "evaluating: ", dumper($ex), "\n"; # kind of node given in first elem...

actionscript 3 - Some nav buttons working, others not -

the buttons within submenue movie clip don't work. one's not within submenu work fine. code validates , i'm not getting errors idea on else should checking? ///this 1 doesn't work//// aboutsub.bio.addeventlistener(mouseevent.click, gobio); function gobio(evtobj:mouseevent) { gotoandstop("bio"); } /// 1 works//// home.addeventlistener(mouseevent.click, gohome); function gohome(evtobj:mouseevent) { gotoandstop("home"); } for testing purposes try adding event listener aboutsub movieclip , see if works. if doesn't check don't have displayobject above , make sure have not set mouseenabled = false or mousechildren = false on aboutsub. if work check in aboutsub clip there no displayobjectsw above buttons etc (so same principle first paragraph)

php - Stopping the back button from exposing secure pages? -

i'm encountering (apparently common) problem browser caches, , secure pages being accessible via button (after user logout.) here logout.php <?php // 1. find session session_start(); // 2. unset session variables $_session = array(); // 3. destroy session cookie if(isset($_cookie[session_name()])) { setcookie(session_name(), '', time()-42000, '/'); } // 4. destroy session session_destroy(); redirect_to('index.php?logout=1'); ?> this logs out users on ie7, ie8, chrome , firefox--but in safari, i'm able press button (immediately after logging out) , still see secure content. if refresh secure page, boots me login screen (as should.) you can try @ http://labs.inversepenguin.com (user: stack & pass: overflow.) i've tried using: <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="expires" content="-1"> ...but ha...

php - $.get not returning any data in Internet Explorer -

i'm using jquery's $.get function fetch twitter feed , display on site. have no idea why seems not getting data (i.e. code inside function(d) { ... } doesn't called). works fine in else i've tried. have used code before no problems, thing can think of is running through https. (note example i've removed twitter user id feed url) js: $.get('proxy.php?url=http://twitter.com/statuses/user_timeline/999999999.rss', function(d) { $(d).find('item').each(function() { var theitem = $(this); var title = theitem.find('title').text(); var date = new date(theitem.find('pubdate').text()); var alink = theitem.find('link').text(); // code ommitted (inserts tweet page) }); }); proxy.php: <?php // php proxy // loads xml location. used flash/flex apps bypass security restrictions // author: paulo fierro // january 29, 2006 ...

css - remove a:hover using javascript (not using jquery... don't ask) -

i thought pretty simple.... basically, it's 5-star rating system. when user clicks, example, 3 stars... want freeze 3 stars right they're at. i've been trying remove hover href stays at... maybe that's not right method. i've exhausted absolutely can think of... way straight javascript, not jquery or anything. it's crazy, know of js written straight.... i've got class: .star-rating li a{ display:block; width:25px; height: 25px; text-decoration: none; text-indent: -9000px; z-index: 20; position: absolute; padding: 0px; } .star-rating li a:hover{ background: url(images/alt_star.png) left bottom; z-index: 2; left: 0px; } .star-rating a:focus, .star-rating a:active{ border:0; -moz-outline-style: none; outline: none; } .star-rating a.one-star{ left: 0px; } .star-rating a.one-star:hover{ width:25px; } and code: <ul class='star-rating'> <li><a href="#...

asp.net - How to show RequiredField validators before client-side JavaScript? -

i want show require filed validators first.then want validate page controls. how acheive this. i wrote onclientclick event this. want show required filed validators first . try below if(page_clientvalidate("validation group")) { }

java - How to POST data in Android to server in JSON format? -

i have json string. want post server (i.e. using post method). how can done in android? json string: { "clientid": "id:1234-1234", "device": { "useragent": "myua", "capabilities": { "sms": true, "data": true, "gps": true, "keyvalue": { "key2": "myvalue2", "key1": "myvalue1" } }, "screen": { "width": 45, "height": 32 }, "keyvalue": { "devckey2": "myvalue2", "devckey1": "myvalue1" } }, "time": 1294617435368 } how can form json array , post server? i did myself. jsonobject returnedjobject= new jsonobject(); jsonobject keyvalspairjobje...