Posts

Showing posts from June, 2013

Excel publish multiple sheet using VBA -

i trying publish multiple sheets in excel using vba. need publish sheet 2 , 3. below code. with activeworkbook .weboptions.allowpng = false .publishobjects(2) range("a1").activate .filename = "d:\reports\09192014\mnm.html" .publish (true) end end in publishobjects(2) changing number 2 3 manually below. with activeworkbook .weboptions.allowpng = false .publishobjects(3) range("a1").activate .filename = "d:\reports\09192014\coal.html" .publish (true) end end still though, in html report coal.html getting mnm.html data , has half of data. how can iterate sheets , publish objects? shouldn't adding first this?: activeworkbook.publishobjects.add(xlsourcesheet, _ "d:\reports\09192014\mnm.html", "sheet1", , _ xlhtmlstatic, , "") .publish (true) .

objective c - AdMob not working: undefined reference to 'kGADAdSizeSmartBannerLandscape' -

i've made cocos2d game sprite builder , uses admob, conversion works fine without admob. after enabling admob these errors: [5/7] linking build/android-armeabi-debug/vitamins/apk/lib/armeabi/libapplication.so failed: path=/users/aukevalk/.apportable/sdk/toolchain/macosx/binutils/arm-linux-androideabi/bin:$path ccache_cpp2=yes /users/aukevalk/.apportable/sdk/toolchain/macosx/clang/bin/clang++ -o /users/aukevalk/.apportable/sdk/build/android-armeabi-debug/vitamins/apk/lib/armeabi/libapplication.so -arch armeabi -target arm-apportable-linux-androideabi -wl,--build-id --no-undefined -fuse-ld=gold -shared -wl,@/users/aukevalk/.apportable/sdk/lib/linker/bionic.wrap -wl,@/users/aukevalk/.apportable/sdk/lib/linker/opengl.wrap -wl,--as-needed -framework corefoundation -framework security -framework systemconfiguration -framework cfnetwork -framework foundation -framework coregraphics -framework imageio -framework bridgekit -framework coretelephony -framework googleplayservices -framew

php - How to combine several file parts (Blobs) to the original file after ajax upload with unix cat command? -

i created uploader script can upload large files because splits blobs. figured out using php's fopen , fwrite won't work putting parts again (maybe memory thing). i figured out there unix command cat put ( http://www.cyberciti.biz/faq/linux-unix-appleosx-bsd-cat-command-examples/ ) but question is: how can select fileparts , put in 1 php exec command? i think syntax kinda have no idea how select parts: exec('cat "'.$all_my_parts.'" >> "' . $original_filename.'"');

php - remove wishlist and product compare from Opencart 1.5 -

i using opencart journal theme. now no longer want 'wishlist' , 'product compare', want disable it. i tried many options tried following link. 1) http://www.opencart.com/index.php?route=extension/extension/info&extension_id=11879 where deletes code 'wishlist' , 'product compare' using vqmod, not working me journal theme, , never remove functionality completely. so how please me. okay, wrote vqmod in last couple of hours. removes wishlist , product compare functionality 'controller' layer, , removes of themes, using default theme's html parts. since don't know theme (and 1 you've mentioned paid-for theme far know), have necessary modifications yourself, remove wishlist , compare links 'view' layer. might work if theme built upon default theme. here is: <?xml version="1.0" encoding="utf-8"?> <modification> <id>remove wishlist , product compare</id>

oop - Can we apply the REP, CRP, CCP, etc. principles to Java packages as well as to JARs? -

uncle bob's principles of ood ( http://butunclebob.com/articles.unclebob.principlesofood ) describes: the 5 principles of class design the 6 principles of package design (the release reuse equivalency principle, common closure principle, etc.) the article states that: in context package binary deliverable .jar file, or dll opposed namespace java package or c++ namespace. does mean 6 "package principles" not applicable java packages (which defined keyword package ) @ all? mean mistake apply them in manner? if so, point out such namespace-package principles can found? yes, package principles can applied single java packages, or equivalent groupings of classes (or other single units of software) in other languages. the first article in martin's series of articles package principles, release reuse equivalency principle , explains principles groupings of classes. rather arbitrarily chooses "package" name groupings, mentions that wor

jQuery - toggled allowed animations.. nothing works -

nothing happens when click. if assign variable inside first if statement click works.. guess makou variable incorrect. var makou = true; if(makou == true){ $( ".box_box" ).click(function() { $( ".box" ).animate({ top: "+=300", }, 50, function() { }); makou = false; }); } if(makou == false){ $( ".box_box" ).mouseleave(function() { $( ".box" ).animate({ top: "-=300", }, 50, function() { }); makou = true; }); } true , false has written small letters @spokey said , second event mouseleave never set because variable makou true . , when click makou going false mouseleave not set aga

html - li active and a hover not showing same result -

Image
i have created navbar <li class="active"> not showing desired result. it showing this: i have used same css .active , .hover . .hover working fine .active not. this html code: <div class="navbar"> <ul> <li class="active"><a href="#">home</a></li> <li><a href="#">about</a></li> <li><a href="#">servies</a></li> <li><a href="#">contact</a></li> </ul> </div> and css: /*navbar css*/ .navbar{ width: 920px; height: 37px; text-align: right; text-shadow:3px 2px 3px #321; background-color: #666633; border-radius: 5px; } .navbar ul{ list-style-type: none; height: auto; padding: 8px 0px; margin: 0px; } .navbar li{ display: inline; padding: 20px; font-family: 'play', sans-serif; font

hyperlink - Protect a PHP file to include before opening by other people -

i'm working on small php project. want include many php files, want protect them before opening via directlink other people. for example: <?php include 'content/scripts/php/sample.php'; ?> i don't want people access sample.php via http://samplepage.com/content/scripts/php/sample.php if in shared hosting , can't place files outside web server folder or can't use .htaccess common method define constant in main php file , check constant @ top of each included file , die() if not defined. in way people can still access file path see blank page. wordpress uses approach example. in main php file: define('app', true); in included files: if(!defined('app')) die();

debugging - Not able to debug/trace a large Win64 application -

i have large application of around 1 million lines of code, 500 .dfm , .pas files spread out many folders. not many user components used, few. no external packages used/embedded. when try trace or breakpoint win64-bit exe target, not stop, breakpoint line stays green. as 32-bit target exe, no problem @ all. this run on x64 os. if try small basic test application (around 1000 lines) can trace win64 target. same behavior xe3, xe6 , xe7. i discarded config files project , used dpr file load, config reset scratch. i can compile, no problem, same issue there, no way trace it. breakpoints stay green. this annoying because have no means debug / trace application. any workaround highly appreciated. i have no clue comes from.

apache pig - Unable to Remove Special Characters In Pig -

i have text file want load onto pig engine, text file have names in in separate rows, , data has errors in it.....special characters....something this: ja@@$s000on j@@a%^ke t!!ina mel@ani i want remove special characters names using regex ....one way found job in pig , have output as... jason jake tina melani can please tell me regex job in pig. write command unable use regex_extract , regex_extract_all function. can explain significance of number 1 pass function argument after defining regex. any highly appreciated. you can use replace regex solve problem. input.txt ja@@$s000on j@@a%^ke t!!ina mel@ani pigscript: = load 'input.txt' line; b = foreach generate replace(line,'([^a-za-z\\s]+)',''); dump b; output: (jason) (jake tina melani)

iOS Objective-C wrap text of UITextField in UIAlertView and dynamically adjust height based on content -

i have uialertview alertviewstyle of uialertviewstyleplaintextinput . i'm trying find way make uitextfield of uialertview adjust height , wrap text based on content user types. to quite honest, haven't slightest clue how this. here of code: -(void)updateticket:(id)sender { uibutton *sndr = (uibutton*)sender; int index = sndr.tag; uialertview *alert = [[uialertview alloc] init]; [alert settag:-7]; [alert setdelegate:self]; [alert settitle:[nsstring stringwithformat:@"update ticket #%i", [ticketids[index] intvalue]]]; alert.alertviewstyle = uialertviewstyleplaintextinput; [alert textfieldatindex:0].placeholder = @"note"; [alert textfieldatindex:0].tag = index; [alert textfieldatindex:0].autocapitalizationtype = uitextautocapitalizationtypesentences; [alert textfieldatindex:0].autocorrectiontype = uitextautocorrectiontypeyes; [alert textfieldatindex:0].autoresizingmask = uiviewautoresizingflexiblehe

python - Get error code for disabling in pylint from error message -

if have main.py file , command line run pylint main.py pylint throws errors/status/etc wrong hanging indentation. 'name': | ^ (bad-continuation) how find out error code of (bad-continuation) can disable it? i know can run pylint main.py -d e1101 -d f0401 so want either master list of pylint error codes mapped messages or way messages. thanks do mean this? pylint codes for how have pylint directly print out relevant codes, see this answer .

c# - Is it possible to obtain Request Body via Application_BeginRequest? -

just stated title; researching didn't find specifics on retrieving full request body post. ideas if possible, need populate server variable iis. i have following code: private void application_beginrequest(object source, eventargs e) { httpapplication application = (httpapplication)source; bindingflags temp = bindingflags.nonpublic | bindingflags.instance | bindingflags.static; methodinfo addstatic = null; methodinfo makereadonly = null; methodinfo makereadwrite = null; type type = application.request.servervariables.gettype(); methodinfo[] methods = type.getmethods(temp); foreach (methodinfo method in methods) { switch (method.name) { case "makereadwrite": makereadwrite = method; break; case "makereadonly":

Spring MVC | Could not instantiate property type to auto-grow nested property path -

folks, i'm using spring mvc (4.1.0.release) , have form want display user. here snippet thymeleaf view: <form class="form-login" th:action="@{/admin/question/add}" th:object="${question}" method="post"> <div class="login-wrap"> <input type="text" class="form-control" placeholder="question" th:field="*{questionstr}" autofocus> <br> <input type="text" class="form-control" placeholder="option one" th:field="*{answeroptions.optionone}" autofocus> <br> <input type="text" class="form-control" placeholder="option two" th:field="*{answeroptions.optiontwo}" autofocus> <br> <input type="text&q

asynchronous - Xamarin.Forms using SQLite.Net.Async -

i have followed instructions here http://developer.xamarin.com/guides/cross-platform/xamarin-forms/working-with/databases/ - connect sqlite database synchronously. public sqliteconnection getconnection() { var dbfilname = "localdb.db3"; string docspath = system.environment.getfolderpath(system.environment.specialfolder.personal); var path = path.combine(docspath, dbfilname); var plat = new sqliteplatformandroid(); var conn = new sqliteconnection(plat, path); return conn; } i want change asynchronous connection (sqliteasyncconnection) can't work. according instructions here - https://components.xamarin.com/gettingstarted/sqlite-net -it needs path parameter var conn = new sqliteasyncconnection(path); that doesn't work, error says parameters expected are: a connection function, taskscheduler , taskcreationoptions i have no idea , have not been able find examples work. thanks in advance you reuse getconnection meth

ios - How to get date in "yyyy-MM-dd'T'HH:mm:ss.SSSZ" format? -

i have date in format 2014-09-20 04:45:20 +0000 , need convert yyyy-mm-dd't'hh:mm:ss.sssz format.i tried following code nsdateformatter * formatter = [[nsdateformatter alloc] init]; [formatter setdateformat:@"yyyy-mm-dd't'hh:mm:ss.sss'z'"]; nsdate *date = [formatter datefromstring:@"2014-09-20 04:45:20 +0000"]; nslog(@"%@",date); but date giving me null value.. i geting 2014-09-20 04:45:20 +0000 time picker anythg needs done on picker side me. try this: nsstring *astrdate = @"2014-09-20 04:45:20 +0000"; nsdateformatter *adateformatter = [[nsdateformatter alloc] init]; adateformatter.dateformat = @"yyyy-mm-dd hh:mm:ss z"; nsdate *adate = [adateformatter datefromstring:astrdate]; adateformatter.dateformat = @"yyyy-mm-dd't'hh:mm:ss.sss'z'"; nslog(@"%@",[adateformatter stringfromdate:adate]);

How to decrease the interval levels in R -

my data looks case degree income slab 1 graduate $1000-$2000 2 high school $2000- $3000 so on.. for degree category have 4 levels income slab have 20+ levels. these 20+ levels in range of $1000. want decrease 10 or less range of $10000. $1000-$10000, $10000-$20000 on. how can that? appreciated. try: ori = c('$1000-$2000','$3000-$4000','$5000-$6000','$7000-$8000','$9000-$10000') > ddf = data.frame(ori) > ddf ori 1 $1000-$2000 2 $3000-$4000 3 $5000-$6000 4 $7000-$8000 5 $9000-$10000 > > ddf$ori = gsub('$','',ddf$ori, fixed=t) > ddf ori 1 1000-2000 2 3000-4000 3 5000-6000 4 7000-8000 5 9000-10000 ddf$min = lapply(strsplit(ori, '-'), function(x)x[1]) > ddf ori min 1 1000-2000 1000 2 3000-4000 3000 3 5000-6000 5000 4 7000-8000 7000 5 9000-10000 9000 > > ddf$new = ifelse(ddf$min<5000, '$1000

javascript - Ruby on rails - How to make controller execute 2 actions simultaneously with ajax? -

i calling 2 different actions same controller ajax in development environment. in 1 action updating database in slow process. on other action want percentual concluded update progressbar. can see both executing, problem second action waiting first finish execute , should executing every second actual percentual. can rails execute 2 actions in parallel? or webrick problem? i tried puma suggested it's still waiting first action, heres ajax code call $(document).ready(function() { $(':button').click(function(){ var formdata = new formdata($('form')[0]); $.ajax({ url: '/quotes/upload', //server script process data type: 'post', //ajax events beforesend: progress, success: completehandler, error: function(ts) { alert(ts.responsetext) }, // form data data: formdata, //options tell jquery not process data or worry content-type. cache: false, co

java - How to extract operators from specific portion of a linear expression using regex -

i have linear expression have extract operators specific places.i dont need extract operators.i.e expression c*(a+b)+(a-b)/log(a+b)-(b-c/d)+(d-tan90) the operators inside bracket dont need separated. operators in between 2 elements separated.i.e desired output *,+,/,-,+ can help? if need operators, think expression parser overkill. it's simple loop through characters , store off operators. (minor) complexity keeping track of count of parentheses. this snippet give output desired, , work if end nested expressions: string expression = "c*(a+b)+(a-b)/log(a+b)-(b-c/d)+(d-tan90)"; list<character> operators = new arraylist<character>(); int parentheses = 0; (char c : expression.tochararray()) { // throw away inside ( ) if (c == '(') { parentheses++; } else if (c == ')') { parentheses--; } if (parentheses > 0) { continue;

2D Java Game Programming Animation Issue -

i'm working on swimming animation. when player collides watertile , swimming animation not play when player goes left (lt) , when player goes right (rt), animation plays. here render method player.java : -edited- if (isswimming){ if (up) { swimup.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (dn){ swimdown.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (rt){ swimright.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (lt){ swimleft.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } } if (!isswimming){ if(up){ upanimation.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale); } if (dn){ downanimation.render(g, x, y, game.tilesize * game.scale, game.tilesize * game.scale);

java - Derive CSS selector based on Element instance -

background many questions ask how obtain particular dom element given css selector. question opposite direction. document parsed jsoup , converted of: jdom dom4j htmlunit use case for particular problem domain (e.g., chemical compounds), thousands of web pages list chemicals in similar ways, mark-up differs across web sites. example: <div id="chemical-list"> <div class="compound"> <span class="compound-name">water</span> <span class="compound-periodic">h2o</span> </div> <div class="compound"> <span class="compound-name">sodium hypochlorite</span> <span class="compound-periodic">naclo</span> </div> </div> another site might list them differently: <ul class="chemical-compound"> <li class="chem-name">water, h2o</li> <li class="chem-name"

git - Can't push repo after reset -

i had 3 commits ahead of origin master , read should "git reset --hard origin/master". removed repo github. problem if init git same folder reupload repo doesn't recognize file. after git init have add remote url git repository origin, have push code. use following commands process check remote url following command, know whether repository contains remote url git remote -v if donot find url add remote url using follwing command push code work. git remote add [shortname] [url] here shortname - origin url - remote url and check this link once

python - What happens if I put an entity to Google App Engine Datastore twice? -

suppose have create new entity follows: item = item() item.property = property_value item_key1 = item.put() question 1 : in same file after line, happens if following: item_key2 = item.put() now, datastore have 1 entity - item, or datastore have 2 entities identified item_key1 , item_key2, respectively? question 2 : in same file after line (without code added in question 1), happens if following: item.property = new_property_value item.put() does same entity in datastore updated, or datastore create new entity property equals new_property_value? a follow question question 2: if datastore creates 2 entities in case, mean have following update entity, if entity created in same function? item = item() item.property = property_value # entity written datastore item_key = item.put() # entity datastore make sure entity update item = item_key.get() # update value item.property = new_property_value # put datastore item.put() this looks silly, , cost twice in datastor

xml - How would you go about making a Simple RSS Feed URL Detecter Action Extension in iOS 8 -

Image
im trying make basic rss reader action extension detect rss feed url (xml based) webpage safari or other web browsers ios. cant figure out how program such thing i've got ui working , basic code ready plug data need can't figure out how parse , check xml based rss feed urls on webpages. can't find tutorial on subject , i'm writing in swift. action extension looks this

css - HTML5 website to support different screen resolutions -

i'm designing website 1 <div> . need design screen support screen resolutions (for mobile devices, laptops, , surface). works screen while zooming, when try open website laptop, horizontal , vertical scrollbars automatically comes page. can me avoid scrollbars appearing different screen resolutions? style i'm using: <style> div { background-image: url('../maps/plan.png'); width: 1514px; height: 960px; margin: 0px 0px 0px 190px; border: 2px groove; table-layout:fixed; } .container { margin-right: auto; margin-left: auto; width: 1514px; height: 960px; } .container:before, .container:after { display: table; line-height: 0; content: ""; clear: both; } </style> use foundation or bootstrap (grid system) it'll take care you.

Rounding UP double values in java based on parameters -

i have following scenario , let assume 125,250,500 rounding parameter based on have rounding. when rounding parameter 125 need round off 1/8 th dollar, ie, value = 10.01 should return 10.125 value = 110.2 should return 110.250 when rounding parameter 250 need round off quarter dollar, ie, value = 10.01 should return 10.250 value = 110.3 should return 110.500 when rounding parameter 500 need round off half dollar, ie, value = 10.01 should return 10.500 value = 110.6 should return 111. i have written code using math.round(8f * value/8f) rounds of nearest 1/8 th dollar rounding should in case 10.01 rounds off 10 first off, you're not rounding, you're doing ceiling. this code want: math.ceil(n * 1000 / factor) * factor / 1000; here code bundled method: public static double ceil(double n, int factor) { return math.ceil(n * 1000 / factor) * factor / 1000; } note no casting required, because in java arithemtic if 1 of operands double , others automat

node.js - Handling CRUD with mongodb using Express.js building a REST API -

i working on rest api using express 4. api layer access mongodb database. database have hundreds of different objects. example there looking like alt1 { name: sting, number: int } alt2 { name: sting, temp: int, length: int } my questions each object needs own data model mongoose , basic crud routes defined? for example above there 2 datamodels , 2*4 routes define basic crud operations?

php - MongoDB Update GridFS Record -

i have implemented crud operations using php + mongodb . below code used upload file using gridfs . $conn = new mongoclient(); $db = $conn->selectdb('mydb'); $gridfs = $db->getgridfs('uploads'); foreach ($_files $file) { if(in_array($file['type'], $acceptedtypes)){ $id = $gridfs->storefile($file['tmp_name'], array('filename' => $file['name'], 'type' => $file['type'], "id"=> 13, "parentid" => "10", "title" => $file['name'], "isfolder" => 0)); }else{ echo 'file not of correct type'; } } $conn->close();` i able upload document using above code, when try update title of file not work. code update file name below. $files = $db->fs->uploads; $primid = $_get['id_value

video - vlc beta for android intent not working -

hi have created android app uses vlc play live streams having problem i using vlc beta neon play streams app have problem i using androids intent to open .m3u playlist play the codes using intent package : org.videolan.vlc.betav7neon activity : org.videolan.vlc.betav7neon.gui.video.videoplayeractivity data type : video/* video url : http://uk-iptv.co.uk/istream/rob/69314.m3u now works , opens vlc perfect problem starts wen loads vlc gets stuck on screen spinning cone saying please wait play button behind , stream never starts play no matter how long leave it i know playlist ok because if open vlc app self , play stream opens in second problem seems wen open stream threw intent :/ i tried using mx player tho says supports m3u , live streams app says cant play video :/ could have no idea whats going on action "view" instead of possibly default "main" seems thing you're missing. 'action': 'view',

Importing and saving big text data to MATLAB format -

i have big txt files (~25mb). don't open in excel , doesn't work try import it. using following comands can read there inside... can not save matlab file use other data. i'm trying: fid = fopen('file.txt') while~feof(fid) tline = fgets(fid); disp(tline); end i tried both fgets() , fgetl() . reads entire file. doesn't store information in workspace. if variable tline not exist in matlab workspace after run code, it's possible running in function instead of script. in addition, need save each line read in array of kind doesn't overwritten next line read in. i.e. function foobar(foo,bar) fid=fopen('file.txt') n = 0; while~feof(fid) tline=fgets(fid); disp(tline); n = n + 1; data{n} = tline; end if calling in function, commenting out function line cause variables persist in workspace. alternatively add line of code save variables need mat file , open later. function foobar(foo,bar) fid=fopen('fil

mysql - How do I return multiple results of sum based using where and Group by -

i trying perform query can sum of column based on clause , group date not behaving expect , not sure why. i have table of transactions with: a timestamp ( transaction_date ) value ( amount ), type (payin or payout ), pervious balance before transaction ( carry ), , closing balance ( balance ). here json export of table: [ { "id":"2", "type":"payout", "carry":"2340", "amount":"50", "balance":"2290", "transaction_date":"2014-09-15 00:00:00", }, { "id":"1", "type":"payin", "carry":"340", "amount":"2000", "balance":"2340", "transaction_date":"2014-09-22 09:10:03", }, { "id":"3", "type":"payout",

wordpress - How to create a page and attach a category to your page template automatically? -

i've created custom page template pulls in post entries based on category. i'm using query post category name pull them (page , category same). wondering if there way make don't have create page template each category/page? i seems easier me create category template in category.php, , let template hierarchy deal queries. however, if there pressing need page, , page's slug same category's slug, custom query achieve asking for: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); $cat_query = new wp_query( array ( 'category_name' => $post->post_name ) ); if ( $cat_query->have_posts() ) : while ( $cat_query->have_posts() ) : $cat_query->the_post(); // inside custom category loop, // category posts' magic happen the_title( '<h2>' , '</h2>' ); the_content(); endwhile; endif; endwhile; endif; ?>

html - Autofill on textbox (in Chrome) results in being prefilled without pushing enter -

i have strange issue, results in quite lot of problems our visitors. on normal textfield, chrome (and other browsers) suggests strings prefill. when hover them , move mouse away, not selected , written in textbox. however, in setup, have weird case. when hover options, , move mouse it, selects item in box. results in awful lot of "please enter email" messages, while user sees e-mail on screen. see problem in video: https://www.youtube.com/watch?v=vh2nb0_ir3q my markup particular e-mail: <input type="text" name="email" placeholder="e-mail" id="newuseremail" class="email_input newinputtxt"> does have hint? because lost... edit: full asp.net mvc markup: <asp:content id="content1" contentplaceholderid="plhmain" runat="server"> <h2>indtast e-mail adresse</h2> <div class="checkout__section checkout__section--login checkout_auth">

javascript - Select my troublesome input by value using jQuery -

i have html inputs similar , go voucher1 - voucher10: <input maxlength="20" type="text" name="voucher1" id="voucher1" title="voucher" class="input" value=""> there 10 fields , each 1 has unique name , id. have function combines field values array , returns variable known duplicate if voucher typed in previously. goal select input greatest id (i.e. alphanumerically: voucher10 greater voucher8) , null field containing duplicate while displaying "no duplicates allowed" message. my duplicate variable function working , returns duplicate value using .on(input, function) . have message displaying whenever type duplicate value. problem i'm having selecting 1 input matches duplicate value. if inspect inputs in browser, there appears no dom representation of typed value. type "ninja" in 3 or 4 fields , never show. because of that, seems can't select inputs based on value. i rathe

javascript - JQuery not loading data when $.get is called -

experimenting js/jquery , jquery .get function. i'm getting pop up/alert open there no text after "data loaded:" what missing? i have .js file (called lab1.js) looks this: var person = prompt("please enter name", "harry potter"); if (person != null) { document.getelementbyid("demo").innerhtml = person + "'s favorite links:"; } $(document).ready(function(){ $.get("/users/rabdelaz/desktop/labs/lab1.txt", function(data){ alert("data loaded: " + data); }); }); with following in lab1.txt file: "a line of text of choosing" finally here html: <!doctype html> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="lab1.css"> <meta charset="utf-8"/> <title>lab 1</title> <script src="http://ajax.googleapis.com/ajax/li

algorithm - Complexity of large matrix multiplication -

what time complexity of fastest algorithm known today multiply large matrices? what theoretical optimal time complexity reached? this active area of research, answer may out of date. :-) to best of knowledge, current fastest matrix multiplication algorithm runs in time o(n 2.373 ), due result virginia williams . algorithm large family of algorithms give rise complex nonlinear system of equations give overall time bound, , in fact there people doing work right trying see how improve bound finding better , better solutions equations. believe algorithm of theoretical interest, though. the holy grail of matrix multiplication o(n 2 )-time matrix multiplication algorithm, , whether such algorithm exists still open problem. theoretical limit, since o(n 2 )-time algorithm couldn't read entries of matrices multiply. hope helps!

Grails word separating -

i using take param user after want separate strings check words existing or not in database. code/algorithm should use separate words string param? you should send words array parameter, e.g. ?word=hello&word=world&word=something&word=else in controller can retrieve words list of strings with list<string> allwords = params.list('word')

c++ - Compile error using gcc - strprintf("%"PRId64, n) -

i trying compile code github on my, (up date), centos 6.5 using gcc++. error message below when try compile code. the line below 1 failing: ... #define __stdc_format_macros 1 ... #include <inttypes.h> ... inline std::string i64tostr(int64_t n) { return strprintf("%"prid64, n); // <-- errors here. } ... and error is: error: expected ')' before 'prid64 what issue , how resolve it? edit 1: line of code failing. https://github.com/rat4/blackcoin/blob/master/src/util.h#l226 edit 2: replacing code printf("%" prid64, n); (note space), suggested in proposed answer not work, (the same error message given). it seems, error somewhere outer. - http://ideone.com/dqemty - copied code, but mistaked , missed # sign before define __stdc_format_macros 1 , , ... i've got same error near prid64 . try comment half of code before suspicious line, half , on.

Hierarchy facets using Elasticsearch -

i using aggregations/sub-aggregations navigate through facets hierarchy. holds long single row contains 1 value each attribute. how can achieve proper hierarchy filtering below case. let consider following 3 rows of course. each of course available in different locations course id, contintent, country , location course 1 asia ,india, hyd asia ,india, bangalore course 2 asia ,india, hyd asia ,pak, hyd course 3 europe, germany , brussels asia,india,hyd once if navigate through facets asia selected facet, in country should not have germany coming facet. countries asia should listed. of multi valued data brings germany in consideration. is there way can implement filtering considering real hierarchy?

sql - SQLite: Calculate col based on the result of other Calculated Col -

in sqlite database have table "test" containing integer-typed col "a". based on col, want calculate 2 more cols, second needs result of first. so tried following: select a, a+1 b, b*2 c test but in sqlite not work: error: no such column: b in other dbms seems work, tried similar @ w3schools following query. select customerid a, a+1 b, b*2 c customers ... , there erevything alright. is there way achive same in sqlite without sub-selects? check this link talks limitations of column aliases in mysql. quoting relevant line link: the clause determines rows should included in group clause, refers alias of column value not known until after rows have been selected, , grouped group by. i guess, extension, using alias select within same query fail same reason. instead, try using column names in expressions. way code can work across dbms. select a, a+1 b, (a+1)*2 c test

java - Close was never specifically called when using ContentProvider -

i having issue android content provider loadermanager. using loadermanager load cursorloader contentprovider , contentprovider calling sqlite class. in sqlite class, calling sql query , returning cursor, not closing cursor or database. understood, that's how supposed work (and doesn't work when close cursor/db), after second visit in activity, getting exception database not being closed. must stupid. i calling initloader of loadermanager in onactivitycreated of fragment. here query method in contentprovider: public synchronized cursor query(final uri uri, final string[] projection, final string selection, final string[] selectionargs, final string sortorder) { final songdbhandler songdbhandler = abstractactivity.getlocalservice(getcontext()).getdbhandler(); string order = " "; if ("author".equals(sortorder)) { order = constants.order_author; } else if ("song".equals(sortorder)) { order = constants.order_son

angularjs - why does {form.$valid} not match $scope.form.$valid -

in html, have input type submit tag following attribute disabled="{form.$valid}" in controller have if ($scope.form.$valid) { if remove disabled attribute, able submit form, if add in, not. any idea why {form.$valid} not match $scope.form.$valid ? cheers try using notation: <input type="submit" ng-disabled="form.$valid"> it's angular ngdisabled core directive doing want.

symfony - How to detect a change in the number of entities in an ArrayCollection -

does doctrine have event triggers when add or remove entry doctrine collection part of manytomany relationship? i have entity has id , collection of tags in manytomany relationship. however, want able run event listener when tag added or removed entity. there way this?

Use compiled class in a gradle build script -

i trying gradle task evaluate static field in class compiled in same build file have not found way achieve without doing stuff javaexec , have java main or groovy script output stdout (something running groovy scripts gradle ). there way evaluate java or groovy expression in task , set classpath compile or runtime classpath of project? task depend on compilejava, can sure code compiled before expression evaluated.

ssis - Importing Excel data into SQL table via Script component -

Image
this question has answer here: script task in ssis import excel spreadsheet 1 answer i have large excel file different data such text, date, currency etc. found data conversions , derived columns not helpful need lot of conversions , add new output fields. i'm @ c# easy required transformations using script component. want achieve is excel file -> script componenet -> sql table i know how add output columns script component, can not find way hook excel script component. how link excel source , read excel data in script component, out opening , reading excel file within script component. please advise. many john try .. for script component .. add derived columns might need. in script editor, each row, can reference input columns , derived output columns .. public override void input0_processinputrow(input0buffer row) { /*

python multiprocessing.Process executes a wrong target (packaged with py2exe) -

i have problem. i using python(2.7.7, 32bit) , py2exe(0.6.9) on windows7(64bit). my application structure such following: from multiprocessing import process def child(): print "child" def main(): print "main" p = process(target=child) p.start() p.join() if __name__ == "__main__": main() (1)result before packaged: main child (2)result after packaged: main main main ...(forever) i want (1) after packaging. please tell me how (1) after packaging. love. as mentioned in comments, need call multiprocessing.freeze_support() when packaging python script executable use on windows. call should come after if __name__ == '__main__': before calling main() . link multiprocessing.freeze docs

how to prevent any key long pressing jquery -

i trying restrict inputs user.like user should not press key continuously..it can take maximum 4 exmp: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa want restrict this.now textbox should not take input after 4 aaaa..like same letters. below code you $(document).ready(function(){ var flag=0; $("#txt").on('keydown',function(e){ flag++; if(flag>4){ e.preventdefault(); } }); $("#txt").on('keyup',function(e){ flag=0; }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <input type="text" id="txt">

SOLR Stats on date field -

im trying stats on date field results failing when retrieve using pysolr - the problem sum field. date - 28129-09-01t23:59:59.999z - not in correct format , while formatting date, errors. <lst name="orderdate_tdt"> <date name="min">2013-08-16t00:00:00z</date> <date name="max">2014-08-21t00:00:00z</date> <long name="count">588</long> <long name="missing">0</long> <date name="sum">28129-09-01t23:59:59.999z</date> <date name="mean">2014-06-28t08:36:44.081z</date> <double name="sumofsquares">-2.0737443528198062e20</double> <double name="stddev">nan</double> <lst name="facets"/> </lst>

ruby on rails - Stop nesting data of the active model serializer gem -

i using active model serializer gem, , works fine now. have stumbled upon issue, wan't stop nesting of data retrieved. lets have 3 models: users has_many orders has_many addresses . normally in users serializer class have have has_many orders model , , in orders model serializer have has_many relationship addresses . i have users controller, don't want orders out, not nested addresses. can done without creating whole new serializer class? update, clarify: i have following 3 models: class user < activerecord::base has_many orders end class orders < activerecord::base belongs_to user has_many addresses end class addresses < activerecord::base belongs_to order end i have 3 serializers identical models. for orders api retrieve addresses well, when query users wants associated orders , not addresses. when query users both returns orders , addresses, since have has_many addresses orders. is option create separate serializers 2 options