Posts

Showing posts from January, 2013

Index of all words used in MS Word document -

i need create index @ end of ms word document lists words used in document, page number there used in alphabetical order. can built in index capabilities? if how go doing this? or need macro, , if can me script? this takes ever on large documents generate index fields need create index in word document. after macro has run can references > insert index have actual index in document. dim colwords collection set colwords = new colection 'add words don't want index colwords.add "and" colwords.add "you" dim wrd range each wrd in activedocument.words 'only if have 3 chars index if len(trim(wrd.text)) > 2 ' prevent field being indexed well... dim infield boolean infield = false dim fld field each fld in activedocument.fields if (wrd.start >= fld.code.start , wrd.end <= fld.code.end) infield = true exit 'break out end if next if (not infield)

I can't install Delphi Chromium Embedded rev. 306 on Delphi 7 -

so downloaded dcef-r306 folder , placed somewhere. i heard wouldn't latest edition, should called dcef3, saw dcef3 didn't have in \bin folder decided try one. i'm quite new @ delphi 7. programmed in bp7 when kid. long time ago. here's did: 1st attempt: a) went install components , installed dcef_d7 cefreg unit. don't have idea what's unit doing around package, went forward. @ point path packages appears on library path in environment options. b) opened guiclient project demos\guiclient compilation fails "file not found: 'cef.inc'" c) replacde cef.inc ..\..\src\cef.inc compilation fails "file not found 'ceflib.dcu'" d) revert reference cef.inc . so said, can't see units. 2nd attempt: a) opened guiclient project demos\guiclient. b). went install components , install dcef_d7 cefreg unit main compiles can't run ("cannot debug project unless host application defined") alas, project become

php - Sorting an Array of Dates using asort() -

i'm confused, tried lot of related approaches sort array of dates may have different formats. i have array of dates, example: "0"=>"09.10.2012" "1"=>"02.10.12" "2"=>"27.09.15" "2.0"=>"28.09.2012" "2.1"=>"29.9.2012" "2.2"=>"29.09.2012" "3"=>"9.10.2012" "3.1"=>"23.4.10" "4"=>"28.09.2012" "5"=>"26.10.2012" "6"=>"12.09.98" "6.0"=>"05.03.2013" "6.1"=>"23.4.2013" (the keys strings reason) now know in same format order - days, month, years . digits number can change can see in given array. i parsed them day-month-year (european format strtotime() recognize according documentation) , changed them unix time-stamp, i'm sorting array using asort() , received bad results: [6]-&g

java - Appending a String to a JTextPane -

i have question. appending string in jtextpane, chatwindow, insertstring, issue don't know how 'insertstring' jtextpane. here code: private void showmessage(final string string){ swingutilities.invokelater( new runnable(){ public void run(){ //chatwindow.append(string); //the bottom method used appending string jtextpane style try { //doc.insertstring(0, "start of text\n", null ); //doc.insertstring(doc.getlength(), "", string ); //doc.insertstring(int offset, string str, arributeset a); //setting style string (down below) styleconstants.setforeground(keyword, color.gethsbcolor(251, 89, 87)); //styleconstants.setbackground(keyword, color.

javascript - Should I send user tweet from browser side or server side? -

my web application send tweets on users' behalf. after getting token through oauth process, can think of 2 ways post tweet: send token browser, , use javascript post tweet twitter (there tricks post cross-domain). when receiving response twitter, post info server. way post synchronous, browser side has post twice: once twitter , once server. when client side need send tweet. post request server, server push request task queue , return asynchronously. way need set task queue on server, , tweet not real-time . which way best way go? pros , cons? to answer own question after bit of investigation: for web application, oauth token preserved on server, , rest apis called server side. calls can made synchronously, task queue not needed. for native app, oauth handled within app. webview used load authenciation uri, , when redirects, access code captured in url. access code used app obtain access token. for native apps, there authentication method referred sso. swi

sql server - show set of items using T-SQL CASE -

ok, know , understand have no chance explain correctly. english not ideal. i'll try. it's question t-sql case expression. have stored procedure. need display goods ids both 2 , 3 if user selects item 1. that's because item 1 contains items 2 , 3 inside, when select item 1 in drop down list, should see items 2 , 3 in results. so, idea, user selects filter criteria, let's call item 1. if selects item 1, not real item, doesn't exist in database, drop down option must show items 2 , 3 in results. the beginning of procedure usual, select items tables. issue belongs section. it's difficult me explain in words. can better shown in example. where items.item_id = @itemid or @itemid null or items.item_id in (case when @itemid=1 (3, 2) end)) -- here (2, 3) abstract thing, issue so how can display items ids 2 , 3 if parameter equals specific number, =1? i tried this: where items.item_id = @itemid or @itemid null or items.item_id=(

java - GET requests are being forbidden while POST requests go through fine -

in web application, need make calls to different web service (developed/managed me) start/manage resources through rest apis. web service runs on tomcat6. can see browser logs post requests getting through requests being forbidden. if make same calls web service itself, not seeing issues. have defined cross origin filter tomcat6 , mentioned in supported methods still problem persists.. i have defined cross origin filters way in web.xml @ application server level itself. using cors filter libraries http://software.dzhuvinov.com/cors-filter.html . tomcat6 server , filter has been defined @ ($tomcat6_home/conf/web.xml) follows <filter> <filter-name>cors</filter-name> <filter-class>com.thetransactioncompany.cors.corsfilter</filter-class> <init-param> <param-name>cors.alloworigin</param-name> <param-value>*</param-value> </init-param> <init-param> <param-name>cors.supp

node.js - Positional write to existing file [Linux, NodeJS] -

i'm trying edit existing binary file using nodejs. my code goes this: file = fs.createwritestream("/path/to/existing/binary/file", {flags: "a"}); file.pos = 256; file.write(new buffer([0, 1, 2, 3, 4, 5])); in os x, works expected (the bytes @ 256..261 replaced 0..5 ). in linux however, 5 bytes appended end of file. mentioned in nodejs api reference : on linux, positional writes don't work when file opened in append mode. kernel ignores position argument , appends data end of file. how around this? open mode of r+ instead of a . r+ portable way want read and/or write arbitrary positions in file, , file should exist.

c++ - Linking and using netCDF with gcc -

im trying use netcdf library in c++ project, cannot, reason, use it. here make file netcdf = -l/usr/lib -lnetcdf_c++ wilxapp = -lsrc src/wilxtest.cpp -o bin/debug/wilxastaktest debug: g++ -wall -ggdb $(netcdf) $(wilxapp) in cpp file have (removed bloat) #include <iostream> #include <netcdfcpp.h> int main(int argc, char* argv[]) { ncfile datafile("simple_xy.nc", ncfile::replace); } and this: undefined reference `ncfile::ncfile(char const*, ncfile::filemode, unsigned long*, unsigned long, ncfile::fileformat)'| i'm not sure errors you're providing match source you're showing, since undefined reference constructor signature has no relationship way you've invoked constructor in example. anyway, suspect problem order matters on link line. linker walks through libraries etc. 1 time, if comes later on link line needs comes earlier on link line, fail. must order link line such things require other things come first

How to access columns on a cursor which is a join on all elements of two tables in Oracle PL/SQL -

i trying run cursor on full join of 2 tables having problem accessing columns in cursor. create table apple( my_id varchar(2) not null, a_timestamp timestamp, a_name varchar(10) ); create table banana( my_id varchar(2) not null, b_timestamp timestamp, b_name varchar(10) ); i have written full join return related rows tables , b of 2 timestamps in future. i.e. if row in table apple has timestamp in future fetch row apple joined row banana on my_id similarly, if row in table banana has timestamp in future fetch row banana joined row apple on my_id full join works me. select * apple full join banana b on a.my_id = b.my_id ( a.a_timestamp > current_timestamp or b.b_timestamp > current_timestamp ); now want iterate on each joined record , processing. able access columns present in 1 tables getting error when trying access column names same in both tables. ex. id in case. crea

objective c - Fgets isn't getting any input from stdin or stdin isn't being equaled to the input? -

example code: char cnumb1[2]; nslog(@"do have account already?(1 yes, 0 no)"); int c; //flushes input while((c = getchar()) != '\n' && c != eof); fgets(cnumb1, sizeof cnumb1, stdin); size_t length = strlen(cnumb1); if (cnumb1 [length-1] == '\n'){ // in case input string has 1 character plus '\n' cnumb1 [length-1] = '\0';} // plus '\0', '\n' isn't added , if condition false. nsstring* string = [nsstring stringwithutf8string: cnumb1]; nslog(@"string:%@", string); with input "0" (edit: reason, need press enter twice), output "string:" far can tell, stdin isn't being set correctly. also, started without flush lines, caused lots of problems because have more fgets later on , stdin initial input, added those. why isn't input being set stdin? or problem entirely? the line while((c = char()) != '\n' && c

python - how to make my maze function print out the solution -

i working on maze solution problem. after code can find goal, not let python print out list of solution. it's required homework. can me? learned python 3 weeks. want print out every step python goes toward final goal. here code: def mazedetector(row,col): c= m[row][col] solution=[] if c =="w": print "wall here: "+ str(row)+ ","+ str(col) return false elif c =="v": print "visited: " + str(row)+ ","+ str(col) return false elif c=="f": print "found: "+ str(row)+ ","+ str(col) print solution return true print "visiting:"+ str(row)+ ","+ str(col) solution.append((row,col),) m[row][col]=="v" if (col>0 , mazedetector(row,col-1)): return true elif (row< len(m)-1 , mazedetector(row+1,col)): return true elif (row>0 , mazedetector(row-1, col

ajax - PHP/JSON Login script (Twitter style) not setting sessions -

i'm having trouble getting twitter style login work properly, reason gets stuck at session_register("useremail"); session_register("userpass"); and doesn't redirect after it. if enter wrong account data, works , appropriate error message pops up. this full code: <?php if(empty($_post['email']) || empty($_post['password'])) { die(msg(0,"all fields required")); } if(!(preg_match("/^[\.a-z0-9_\-\+]+[@][a-z0-9_\-]+([.][a-z0-9_\-]+)+[a-z]{1,4}$/", $_post['email']))) die(msg(0,"you haven't provided valid e-mail")); $host="localhost"; $username="root"; $password="x"; $db_name="x"; $tbl_name="x"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select db"); $useremail=$_post['email']; $userpass=

php - Add attachment through PHPMailer -

i have following piece of code of phpmailer. problem is, file uploads server attachment not sent in mail. attachment code seems right best of knowledge. please review code , let me know have gone wrong. form <form name="contactform" method="post" action="send1.php" enctype="multipart/form-data"> <table width="100%" border="0"> <tr> <td id="ta"> <label for="title">title *</label> </td> <td id="ta"> <select name="title"> <option value="0">title</option> <option value="1">mr.</option> <option value="2">ms.</option> <option value="3">mrs.</option> </select></td></tr><tr><td id="ta"> <label for="first_name">first name *</label> </td> <td id="ta">

wpf - StackPanel don't grow with Textblock in Windows Phone 8 Application -

i'm trying show text in page of application in 3 textblocks. want scroll because text dynamically changed , depends on choose in previous page. when did that: <!--layoutroot root grid page content placed--> <grid x:name="layoutroot" background="transparent"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <!--titlepanel contains name of application , page title--> <stackpanel name="titlepanel" grid.row="0" margin="12,17,0,28"> <textblock text="asystent barmana" style="{staticresource phonetextnormalstyle}"/> <textblock name="pagename" text="page name" margin="9,-7,0,0" style="{staticresource phonetexttitle1style}"/> </stackpanel> <scrollviewer name="scroller"

html - A CSS table in one of parallel divs -

on webpage have container div , inside 2 divs next each other. in first inner div trying set css table has 4 columns evenly fill div. the problem having cells seem width relative page's width, not table/it's parent div. if decrease width 25% lower, fit, if scale page, still wrap, div on right hits rightmost table cell. how should setup layout keep them inside div? <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style type="text/css"> html,body, div { display: block; height: 100%; width: 100%; } #container { position: absolute; height: 300px; width: 100%; } .sidebyside { position: absolute; float: left; height: 100%; } #galleria { background-color:#0c0; l

core audio - How to manually convert 8.24-bit deinterleaved lpcm to 16-bit lpcm? -

i have chunk of data (void*) 2 ch, 44100 hz, 'lpcm' 8.24-bit little-endian signed integer, deinterleaved. need record chunk file 2 ch, 44100 hz, 'lpcm' 16-bit little-endian signed integer. how convert data? can imagine need this: uint databytesize = sizeof(uint32) * samplescount; uint32* source = ...; uint32* dest = (uint32*)malloc(databytesize); (int = 0; < samplescount; ++i) { uint32 sourcesample = source[i]; uint32 destsample = sourcesample>>24; dest[i] = destsample; } but how convert deinterleaved interleaved? ok, i've spent time investigating issue , realized question contains few information answered =) heres deal: first, non-interleaved: thought this: l1 l2 l3 l4...ln r1 r2 r3 r4...rn turned out in data right channel missing. turned out wasn't non-interleaved data, plain mono data. , yes, should multiple buffers in case data non-interleaved. if it's interleaved, should l1 r1 l2 r2 l3 r3 l4 r4... second, a

c++ - Receiving an error when requesting members for an array -

#include <iostream> #include <fstream> #include <vector> using namespace std; int winnings[4] = {0,0,0,0}; int* p_winnings = winnings; void calculategame(int* p_games); int main() { int games[6] = {12,13,14,23,24,34}; int* p_games = games; int favorite_team,games_played,team1,team2,score1,score2,i; ifstream data("data11.txt"); data >> favorite_team >> games_played; vector<int> standings(4); (i = 0;i < 4; i++) standings[i] = 0; (i = 0;i < games_played;i++) { data >> team1 >> team2 >> score1 >> score2; if (score1 > score2) standings[team1 - 1] += 3; if (score1 == score2) standings[team1-1]++,standings[team2-1]++; if (score1 < score2) standings[team2-1] += 3; (i = 0; < games.size();i++) { int temp1,temp2,temp; temp = games[i]; temp2 = te

c++ - generic typetrait to convert to string or double -

i need type trait convert input string or double. have this: template<typename t> struct sh_trait{ }; template<> struct sh_trait<float>{ typedef double type; }; template<> struct sh_trait<double>{ typedef double type; }; template<> struct sh_trait<char*>{ typedef std::string type; }; template<> struct sh_trait<const char*>{ typedef std::string type; }; template<std::size_t n> struct sh_trait<const char[n]> { typedef std::string type; }; template<std::size_t n> struct sh_trait<char[n]> { typedef std::string type; }; template<> struct sh_trait<std::string>{ typedef std::string type; }; template<> struct sh_trait<tstring>{ typedef std::string type; }; and using as void f(t input) { sh_trait<t>::type myvalue(input); class template_class(myvalue); ... } i doing because template_class specialized double , string . the point is: suppose user use example int . want c

php - MySQL "LIKE" search doesn't work -

i've imported .txt database in mysql through "load data infile", , seemed working, problem if search record on db following query: "select * hobby name 'beading'" it returns 0 rows, while if use ""select * hobby name '%beading%'" it returns 1 row, if exist 1 record name=beading. know depend on? when using sql like : you should use wildcard identifier such (or not): '%word' - return results value ends letters: "word". 'word%' - reurn results begin letters: "word". %word% - return results include letters: "word" anywhere. there more pattern search combination like: 'abc' 'abc' true 'abc' 'a%' true 'abc' ' b ' true 'abc' 'c' false if want exact match should use: "select * hobby name='beading'" but like 'beading' should work also, space

c# - Sitecore content tree load really slow -

i have issue in 1 of legacy sitecore solutions, item node takes long time load (about 5 mins). not thing, looked how setup. dictionary item node, setup this: sitecore - content ----definitions ------ -------- def 1 -------- def 2 -------- def 3 ------ b ------ c ------ d so apparently did try make items broken separate folders. under each letter, there 200-250 items. can understand if expand of each letter takes long time, in case, slowdown when click on 'definitions'. can assume trying load children , sub children. is there way stop 1 level opened? can possibly try group sub-tree more granular , make deeper tree, i'm thinking won't in case, because i'm not trying open node has many items (definitions node has 26 children - 1 each letter). after first load, caching helps, people ticked off @ first load. any ideas how can improve performance of this? see contenteditor.checkhaschildrenontreenodes setting in web.config file. turning o

How to export ASP.NET GridView to Excel and add a formula column -

i trying export gridview created in asp.net excel. has 3 columns ( a thru c ), , want add blank column d , column e . in column e want put excel formula multiply each cell in column c each cell in column d , sum total. in other words column e=c1*d1 , have sum of column e appear @ end of row e . don't want populate column d or e . want user have spreadsheet can type in value in column d , have spreadsheet calculate column e . i know how gridview excel, , using rendercontrol it. works fine , pretty easy. can please me familiar exporting excel way. need know how code formula , put in html export code. have looked through gridview export answers couple days can't seem find working formulas in export code. not knowledgeable excel. i'm sure there must simple way want do, can't find it.

wpf - Refresh datagrid from child window -

i found lot of answers questions buy sadely couldn't fix want exactky project. let consider have 2 windows, window1 contains 1 datagrid , 1 button, when click in button sends me window2 fill fields save record in database, problem when wondow2 closed cannot see record in datagrid in windows1 directly. knows how solve problem, please? in advanvce!

html - Unknown div adding length to page if page is shorter than window -

i trying put sticky footer on site. not "sticks bottom of window no matter how scroll" stickyfooter, "no matter how long page, footer go @ bottom of window, provided scroll way down" sticky footer. i have tried implementing 4-5 different versions around web, have run problem: every time have page less than height of user's browser, page add in around 100px after content, before footer, , see page, big blank space, , if scroll down, footer. here page having problem: https://elcheapohost.com/contact so here shortened version of code: <head>...snip...</head> <div id="wrap">content here</div> </div><!-- /wrap--><div id="foot"> <footer> <div class=" copyright">&copy; copyright <?php echo date('y'); ?> <a href="http://www.joshuapedroza.com">joshua pedroza</a>. rights reserved. <a href="/tos">terms of servic

Django equivalent of PHP's date -

does know similar function date() php in django? i'm starting learn nice framework, i'm happy (at momment) haven't found function yes. date formats date according given format. uses similar format php’s date() function ( http://php.net/date ) differences. for example, can do: {{ value|date:"d d m y" }} if value datetime object (e.g., result of datetime.datetime.now() ), output string 'jul 22 2013' . documentation: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date https://docs.djangoproject.com/en/dev/ref/settings/#date-format https://docs.djangoproject.com/en/dev/topics/i18n/timezones/#naive-and-aware-datetime-objects

r - vectorized parallel selection that's random? -

i have 2 vectors "h" , "l" have 200 numeric values. want create third vector called "hl" contains 200 random samples h , l. however, them selected in parallel, same way pmin , pmax function do. simplified example: h <- 1:5 l <- 6:10 # rbind(h,l) # [,1] [,2] [,3] [,4] [,5] # h 1 2 3 4 5 # l 6 7 8 9 10 # intended result random pick each 'column' shown above, e.g: hl <- c(6,2,8,4,10) is there way of doing without using loop? any advice appreciated thanks you simpliy need n samples bernouli (ie, 0 or 1) distribution, n number of values in h/l. use sampling pick h or l respectively. using ifelse ensures "parallel selection" require. set.seed(1) n <- length(h) horl <- rbinom(n, 1, 0.5) # select results <- ifelse(horl, h, l) results # [1] 6 7 3 4 10 this wraps nice 1 liner: ifelse( rbinom(h, 1, 0.5), h, l) from @arun: (relatively) faster way of implement

vb.net - Show child data in a DataGridView control related to multiple parent entity records -

Image
i have vb winforms form 3 bindingsource controls, each showing data (via datagridview s or bound textboxes) 3 related entities created db first. i need have datagridview showing & allowing adding/editing/deleting tbl_distribution_dealermodel_overalts records related both current tbl_primarydealergroup record (joining on fields tbl_primarydealergroup.dealergroupid = tbl_distribution_dealermodels_overalts.firstdealergroupid ) , current tbl_seriesmanufacturer record (joining on 2 common fields: aus_series_cde , manufacturerid ). tbl_distribution_dealermodel_overalts on many-side of relationships 2 other tables: how can have child entity's datagridview show records related each of 2 (or more) parent entity records? may necessary me relate child entity 3 or more parents in project, generically applicable answers appreciated i sorted out myself: private sub bs_tblsm_tblpdg_currentchanged(sender system.object, e system.eventargs) handles bs_tbl_series_ma

python - Pass variables from one script to another and save to file every X minute(s) -

i have spent hours pouring through other questions , have not been able find solution problem. i have program calls python script argument @ events. every time script called need increment variable 1 , save file. tried doing directly (open, increment one, , save file) every time called had loss of precision due how fast calls being made @ times. trying figure out how have script run , count, every x minutes write count file. have write file part working great, need how keep variable count , write file every x minutes. i tried doing single script using threading every time called global variable declarations overwrite count. ahead of time. i read through query , researched on internet too. prior describing research had couple of queries: is main program calls python script callee.py python script? if yes, main script written or have permission change source code in main script? do require call python script asynchronous? i ask because in case main program python

osx - Subviews become disabled when title bar is hidden -

Image
writing app in xcode osx using osx 10.8 sdk. of windows work fine, until use interface building rid of title bar in nib (i uncheck title bar param on attributes inspector of window element). windows still show, subviews disabled. can no longer input text , process bars greyed out. does know why happening? , how have window without title bar, subviews enabled? here view looks title bar: and here's looks without: as can see, disabled. update someone asked code display windows. example didn't use code. 2 screens above here steps followed: created new cocoa application using xcode. (automatically creates xib). dragged out 2 controls (text field , progress bar) onto existing window. ran, , took screen shot closed , checked off title bar attribute window. restarted app. took second screen shot. there answer question @ link: xcode 4, cocoa title bar removing interface builders disables textview editing if read documentation nswindow can see me

iphone - CATextlayer set line spacing? -

i have problem catextlayer. set wrapped == yes catextlayer , auto set multi line this. line spacing small , verry bad. there way set line spacing catextlayer? thanks. you can refer following tutorial : height-for-width layout catextlayer

ios - Print In app purchase transaction receipt? -

iam using following code in app purchase , and working wanna know transaction receipt .i know in encoded format have send server.so please tell me can find ? how add code iam using code please click here - (void)completetransaction:(skpaymenttransaction *)transaction { nslog(@"completetransaction..."); uialertview *alert=[[uialertview alloc]initwithtitle:@"alert" message:@"transaction completed." delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alert show]; [self providecontentforproductidentifier:transaction.payment.productidentifier]; [[skpaymentqueue defaultqueue] finishtransaction:transaction]; } is receipt ?? "skpaymenttransaction: 0x147e1860" nsstring *receiptstr= [base64encoding base64encodingfordata:(transaction.transactionreceipt) withlinelength:0]; try may you.

python - how to make dynamic field creation capability in openerp module? -

hi have created openerp module using python (eclipse) . want add feature in form admin able create own fields whenever , whatever wants . needed guidance of how done . new openerp , me . thanks hopes advice i can't think of easy way of doing this. when openerp connects database sets registry containing models , fields , part of this, loads fields database, performs database refactoring etc. idea is simple inherit existing models , add fields way require coding. i have done similar where: i predefined fields on model (field1, intfield1, charfield1 etc.). provide model/form admin can use intfield1 , give label of 'my value' override fields_view_get on model , change xml include field correct label. but tricky right. want spend time learning elementtree module xml manipulation in fields_view_get .

css - On a hover event, change the content with data from the parent element -

i want hover pseudo element set child's content data parent (the hover). following snippet shows small test: css .word:hover { color: blue; } .word:hover ~ #lookup:after { content : attr(data-test); } html <span class="word" data-test="elke dag / 每天">everyday</span> <span class="word" data-test="ik / 我">i</span> <span class="word" data-test="drink / 喝">drink</span> <span class="word" data-test="koffie / 咖啡">coffee</span> <div id="lookup" data-test="duh!">lookup: </div> however, content gets set data-test target 'duh!' instead of 1 being hovered over. can solve javascript, looking if possible using css only. http://jsfiddle.net/u7tye/1951/ according mozilla docs, no: https://developer.mozilla.org/en-us/docs/web/css/attr the attr() css expression used retrieve value of attribute of

javascript - How to animate div for a fixed (offset) position using jQuery? -

i have simple div move (animate) known position on screen ("fixed"). have found animate() method in jquery moves element in given pixels not i'm looking for. example: div's name "framearea" , move offset top: 5px / left: 260px. if write following, move div 5px down , 260px right . doing wrong? possible? $("#framearea") .animate({ left: 260px, top: 5px }, 5000); i'm new html , jquery, please gentle :) thanks! try example. make sure u start animation after element loaded. may in document.ready example

Splash Page with progress bar in qml for blackberry 10 -

i'm developing application blackberry 10 native sdk. i want show splash page/screen progress bar whenever application launches i.e when user clicks on application icon. first want create sqlite database , tables after data server , store data in sqlite database tables. after work done, i've remove splash page , i've show home page. regarding splashscreen itself, you'll not able use blackberry splashscreen functionality, it's displaying static picture. you'll have create simple sheet this: set image static splashscreen, , create sheet same image in background. on top of image, display progressbar or that. when initialization complete, close sheet . the progress computation split in 2 parts: first, getting content. you'll have use qnetworkreply::downloadprogress signal monitor download. you'll have add hard-coded "progress" database creation/filling. depending on data quantity, i'll split in 90% download, 10% database f

collections - Implementing COMPARATOR in java -

i new java , in implementing comparator. have arraylist of type qualitydata following values. **sequence nr** **súb sequence_nr** **flag** 100 1 true 100 1 false 101 1 true 100 2 false 100 1 false 100 3 true desired output order: orderíng based on sequence_nr , sub_sequence_nr. **sequence nr** **súb sequence_nr** **flag** 100 1 true 100 1 false 100 1 false 100 2 false 100 3 true 101 1 true i have class sequence_number, sub_sequence_number , boolean flag. public class qualitydata{ private int sequence_number; private int sub_sequence_nr; private boolean flag;

javascript - Prevent automatic close of the Facebook share popup -

i using below mentioned code share page facebook. my problem when click share button shares page correctly closes popup window don't want close popup.please advice me. <html> <head> <title>fb</title> </head> <body> <a href="#" onclick=" window.open( 'https://www.facebook.com/sharer/sharer.php?u=http://google.com', 'facebook-share-dialog', 'width=626,height=436'); return false;"> share on facebook </a> </body> </html>

ios - NSFetchedResultsController sorts in wrong order -

i working on project based on coredata example xcode. have entity-class named entity updated key stores timestamp entity updated, , nsfetchresultscontroller set sort in descending order: nsfetchrequest *fetchrequest = [[nsfetchrequest alloc] init]; [fetchrequest setentity:[nsentitydescription entityforname:@"entity" inmanagedobjectcontext:_managedobjectcontext]]; [fetchrequest setfetchbatchsize:20]; [fetchrequest setsortdescriptors:@[[[nssortdescriptor alloc] initwithkey:@"updated" ascending:no]]]; nsfetchedresultscontroller *frc = [[nsfetchedresultscontroller alloc] initwithfetchrequest:fetchrequest managedobjectcontext:_managedobjectcontext sectionnamekeypath:nil cachename:nil]; this works fine on initial load, when insert nsmanagedobject should inserted in between other objects, gets inserted @ top. when relaunch app, gets inserted @ right position. e.g: table like: updated: 300 updated: 200 updated: 100 and when insert managedobject: updated:

sql - MYSQL Order by with case -

i have product table has following structure. productid productname producttype 1 irrigation 1 2 landscape 2 3 sleeving 3 4 planting 4 now need returns rows in order of product type 3,2,4,1 used mysql field method works fine this select * product order field(producttype,3,2,4,1) this working fine, my problem if productname empty producttype 3, should take next productname not empty, in such case result order should 2,4,1,3. so first condition records need in following order of product type sleeving 3 landscape 2 planting 4 irrigation 1 but if productname producttype 3 empty order need be landscape 2 planting 4 irrigation 1 3 and further productname producttype 2 empty order need be planting 4 irrigation 1 3 2 from result need pick first record. i hope clear

windows server 2012 - Error publishing log file TFS2012 -

i have en problem tfs2012 after have install visual studio 2012 on microsoft server 2012. im gettting error: exception message: tf270016: error occurred publishing log files 'd:\builds\3_2\mes_projects\pjdgatewaytester - main\sources\src\lps_cmdata\pjdgatewaytest.log' '\\server\drop\build\pjdgatewaytester - main\pjdgatewaytester - main_.6\logs'. details: access path '\\server\drop\build\pjdgatewaytester - main\pjdgatewaytester - main_.6\logs' denied. (type publishlogfileexception) exception stack trace: @ system.activities.statements.throw.execute(codeactivitycontext context) @ system.activities.codeactivity.internalexecute(activityinstance instance, activityexecutor executor, bookmarkmanager bookmarkmanager) @ system.activities.runtime.activityexecutor.executeactivityworkitem.executebody(activityexecutor executor, bookmarkmanager bookmarkmanager, location resultlocation) inner exception details: exception message: access path '\\server\drop

perl/dbi/sql stumped by "operation must use an updatable query" error -

i've perl script builds sql cmd set fields null in table in ms access db ( sorry). here's simplified mockup. my $nonkeyfields_hashref = { "country" => "zzz", "address3" => "foo" }; $keyfields_hashref = { "address1" => "1212 o'mally street", # embedded single quote here causing problem "client id" => "1234567" }; $sqlcmd = "update mytable set "; $sqlcmd .= join( ", " , map{ "[?} = null "} keys $nonkeyfields_hashref; $sqlcmd .= " "; $sqlcmd .= join( " , " , map{ "[?} = ? "} keys $keyfields_hashref; # sqlcmd contains "update mytable set [?] = null, [?} = null [?] = ? , [?] = ?" $sth = $dbh->prepare( $sqlcmd); if( !defined( $sth)) { _pusherrormsg("sth failed define - ".$dbi::errstr); $er

Javascript driven forms in Django -

django uses forms api input validation. form sent template, , rendered html ( as_p , friends ). when user ready, post form, data validated, , form re-rendered on template if not valid. this odd when form not valid because lack of enough caracteres (i.e. min_length) on field or invalid characters: 1 post tell user missing basic. so, there available way (django or app) of rendering form javascript code "tests"[*] of form' fields on client-side? i.e. have form rendered as_javascript(...) dynamically shows error messages shown form.errors? this should not work fields because require database hit, should work on simple (and common) fields, namely charfield, textfield, etc. [*] "tests" because validation has made on server-side. so want validate in js before submitting. here's 1 way that. instead of putting input of type submit in form should put button of type button: <form id="my-form" submit="..."> ...

javascript - Creating JQuery div class filter not working -

i trying make filter jquery hides div's , shows div's depending on class inside called "brand", managing hide div's not show ones matching class. the alert have added inside statement showing think may parent show, has got ideas? the html: <div class="section-link" id="section-tooltip" data-content="popup option trigger" rel="popover" data-placement="right" title="" data-original-title=""> <div class="section-features" style="display: none;"> <p><i class="icon-star"></i> protective, waterproof lid</p> <p><i class="icon-star"></i> enhanced wooden coating</p> <p><i class="icon-star"></i> long lasting materials</p> <p><i class="icon-star"></i> 2 year warranty</p> <p><i cl

image processing - What instead of SURF in logo (visual sample) finding? -

i have task find logo image within photographic picture. need locate logo , calculate it's perspective distortion (logos on plastic cards). classic way textbooks use surf. unfortunately, surf has several disadvantages here: 1) logo image has relatively few features , hard find within big picture (actually effectiveness appeared low) 2) logo image has significant coloring, surf not use my questions are: 1) correct name of task of finding small distorted image inside big picture? 2) there methods task, other surf features matching? for example, can imagine many samples of distorted logo image, digitized different resolutions. think if start finding @ low resolution, filter out bad hypotheses early. going gradually higher resolutions, simultaneously match image , determine it's projection parameters. are methods resembling approach? have tried mser algorithm ? worked great me. ---end of standard answer, proceed if have time , enjoy playing image pro

ruby - Validating a blank field Rails Model -

this may basic cannot find definitive answer anywhere. have set contact form within app , have put in hidden field when completed disables submit button jquery. attempt @ stopping automated spam.. can add validations in model? validates :ghost, :presence => false looking @ docs invalid? want form fail if field filled in. not sure how go one edit so have read possibly use validates_exclusion_of :ghost, :on => :create though still failing dont think passing correct arguments. :presence => false means disable presence validator. you need write own absence validation (though in rails 4.0 such validation exists, absence: true ). validate :ghost_is_absent def ghost_is_absent errors.add :ghost if ghost.present? end

scheduled tasks - How to use Heroku-Scheduler -

i've installed https://addons.heroku.com/scheduler in heroku app, cannot make instruction work. i think don't know correct syntax, i've tried heroku pgbackups:capture --expire --app running-app command , selected frequency 10 mins. it's been more hour , still hasn't done anything. how can work? thanks edit: command example command, nor want use 1 you should using pgbackups addon, https://addons.heroku.com/pgbackups scheduled based on level pick. heroku scheduler more if need run rack task within application codebase. update based on revised question: you write rake task (assuming using rails?) run locally using rake taskname , schedule on heroku enter rake taskname command in scheduler page them execute it.