Posts

Showing posts from January, 2012

jQuery, DataTables, ajax error handling: get rid of "Processing" message -

i using jquery datatables, ajax , bootstrap in small project. working , testing error states. have setup html datatables table. there table-responsive div surrounding <table> . <div id="errordiv"></div> <div id="resulttablediv" class="table-responsive"> <table id="resulttable" class="table table-striped table-bordered table-hover table-condensed" cellspacing="0"> <thead> <tr> <th>...</th> ... </tr> </thead> <tfoot> <tr> <th>...</th> ... </tr> </tfoot> </table> </div> </div> in datatables init setup ajax call , specify error callback function. "works" in can force error in server side ajax code , callback

vba - Nested Loops & Ifs, loop without Do -

i keep getting loop without every time run code , not see missing or if loop misplaced. need code find key words in specific columns copy paste them summary tab. your appreciated. sub summary() dim mainloop double dim secondloop double dim thirdloop double dim trow double dim counter integer dim psku integer dim pdesc string dim ppkg integer dim csku integer dim cdesc string dim cpkg integer dim cstatus string mainloop = 5 secondloop = 0 thirdloop = 0 trow = 5 counter = 0 worksheets("final").activate while mainloop < activesheet.cells(rows.count, "b").end(xlup).row worksheets("final").activate parentsku = range("f" & mainloop).value parentdesc = range("g" & mainloop).value worksheets("summary").activate sumrow = (activesheet.cells(rows.count, "a").end(xlup).row) + 1 range("a" & sumrow).value = parentsku

list - How to take any number of inputs in python without defining any limit? -

now, thing supposed take unknown amount of input user on 1 run can enter 10 terms on run can enter 40. , cannot ask user enter value of n can run range loop , start storing input in list. if somehow can have created loop not case. so, question how define endpoint user? or how pass unknown number of arguments function? def fibi(n): while n<0 or n>=50: print "enter value of n greater 0 less 50" n = int(raw_input()) if n==0: return n else: a, b = 0, 1 in range(n): a, b = b, + b return main calling function starts n =[] ???? //this loop calling fibi function , printing output on each diff line in n: print (fibi(n[i])) sample input:each entry should on new line 1 2 3 4 5 . . . n sample output 1 1 2 3 5 this how read many integer inputs user: inputs = [] while true: inp = raw_input() if inp == "": break inputs.append(int()) if want pass unknow

=SUMIF Google Spreadsheet Help needed -

i new spreadsheets , need help. i created sheet register money reimbursed. what want is: a) total shows total amount in column 'c' subtract row value if/when column 'e' says yes. b) total should on display time in merged cells on 'f'. i using this: =sumif(e2:e9; "yes"; b2:b9) but think way off. any kind of welcome. spreadsheet reference: link here does formula work want: =sumif(e:e;"no";c:c)

java - Can't catch clipboard event in a background service android -

i'm trying catch clipboardchanged event in background service public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); intent = new intent(mainactivity.this, translateservice.class); startservice(i); } } public class translateservice extends intentservice implements clipboardmanager.onprimaryclipchangedlistener { public translateservice() { super(null); } public translateservice(string name) { super(name); clipboardmanager manager = (clipboardmanager) getsystemservice(clipboard_service); manager.addprimaryclipchangedlistener(this); } @override protected void onhandleintent(intent intent) { } @override public void onprimaryclipchanged() { toast.maketext(this, "working", toast.length_long).show(); } }

Resize a fixed image inside an Image-sprite using css -

created image-sprite images. in css using background-image:"spriteimage" position , height:150px , width:150px , full particular image inside sprite coming.(that image has got h&w 150px only) want resize particular image 35px 35px (small size)but when use background-size: readjusts whole sprite image

Storm - Conditionally consuming stream from kafka spout? -

i have scenario posting json kafka instance. using kafka spout emit stream bolt. but add additional field (call x ) json message. if x a consumed bolta, if x b consumed boltb. is there way direct stream proper bolt depending on streams contents? the simplest way should add splitbolt consumes kafkaspout , evaluates field x , , forwards different output streams: public class splitbolt extends baserichbolt { outputcollector collector; public void prepare(...) { this.collector = collector; } public void execute(tuple input) { object x = ... // field x input string streamid; if(x == a) { streamid = "stream-xa"; } else { // x == b streamid = "stream-xb"; } collector.emit(streamid, input, input.getvalues()); } public void declareoutputfields(outputfieldsdeclarer declarer) { fields schema = new fields(...) declarer.declarestream("stream-xa", schema); declarer.declarestream(

javascript - How to get onclick to work in edited innerHTML -

so in navigation javascript file, have this, has onclick event attribute load new page: function navload() { // runs when load page. document.getelementbyid("main nav").innerhtml = '<table class = "navbar"><tr>'+ '<th onclick = "goto("main_page")"> home </th>'+ '<th onclick = "goto("archive")"> archive </th>'+ '<th onclick = "goto("about")"> </th>'+ '<th onclick = "goto("faq")"> faq </th>'+ '<th onclick = "goto("fanart")"> fanart! </th>'+ '</tr>'+ '<tr><td class = "spacer"></td></tr></table>'; } function goto(page) { window.location.assign(""+page+".html"); } and, html code uses looks this: <html> <!--

pingfederate - Open Token expiration in Ping federate -

about ask 1 clarification on open token expiration. ex pf server running on , i'm accessing application asia. have set max life time open token 6hrs. time, open token reached browser expired. though i'm authenticated pf can continue access application again i'm sending same opentoken pf server(us server) authentication. in case how pf react? thanks in advance. not sure understand question believe asking how otk deals timezone differences? if so, timeout eval handled pf adapter , agent...not client browser (except persistent cookies..they have timestamp of own browser enforces). adapter , agent convert server time utc before evaluating timestamps within token long server time settings correct, doesn't matter client (browser) located.

How can I use both ActiveState and Strawberry perl on windows -

i have activestate installed already. due ease in installing libxml, installed strawberry. @ current, have 2 perl programs, activestate , strawberry. use strawberry, need remove activestate default of perl. how keep both programs , set strawberry default in classpath? right-click on "my computer". click on "properties". click on "advanced system settings". click on "environment variables...". select "path". click on nearest "edit". remove activeperl's bin directory "variable value". add strawberry perl's bin directory "variable value". click "ok". you may need reopen existing programs , consoles them see change. or don't use default , use full path perl.exe .

Python '==' incorrectly returning false -

i'm trying difference of 2 files line line, , python returning false; when diff of same files, python (almost) returns false. goofy example, replicates problem on python 3.4.3. file1.txt (example) 1 2 3 file1 = r"pathtofile\file1.txt" file2 = r"pathtofile\file1.txt" f1 = open(file1, "r") f2 = open(file2, "r") line1 in f1: found = false line2 in f2: if repr(line1) == repr(line2): found = true print("true") if found == false: print("false") python correctly identifies first line same, after false. can else replicate this? ideas? you have exhausted iterator after first iteration on f2 , need file.seek(0) go start of file. for line1 in f1: found = false line2 in f2: if repr(line1) == repr(line2): print("true") f2.seek(0) # reset pointer start of file you check first line of f1 against lines of f2 , after first

javascript - ngBindHtml not Rendering Sanitized HTML -

i've got simple angular app, , i'm trying inject html page using ngbindhtml. however, it's not being injected. here's html: <main id="main" ng-bind-html="oregen | trust"></main> and here's angular app: angular.module('programapp', ['programapp.controllers','programapp.filters','ngsanitize']); angular.module('programapp.controllers', []) .controller('programcontroller', ['$scope', '$filter', function($scope, $filter){ $scope.oregen = '<div class="orefunction" ng-click="collectfunction(\'parenthesis\', 1)">test text</div>'; $scope.collectfunction = function(value1, value2){ alert(value1 + value2); }; }]); angular.module('programapp.filters', []).filter('trust', ['$sce', function($sce){ return function(text) { return $sce.trustashtml(text); }; }]); when page lo

Concatenating Values in SQL Server using a CTE -

i have been trying concatenate values particular row. have query: select tblcontacts_2.contactid, (coalesce (tblsites_1.sitenm, '') + coalesce (' / ' + tblsites_1.sitenmalt, '') + ' ' + coalesce (tblsites_1.addr1, '') + ' ' + coalesce (tblsites_1.zipcodeid, '') ) sitenameaddr, tblsites_1.siteid dbo.tblcontacts tblcontacts_2 inner join dbo.tjncsitecontacts tjncsitecontacts_1 on tblcontacts_2.contactid = tjncsitecontacts_1.contactid inner join dbo.tblsites tblsites_1 on tblsites_1.siteid = tjncsitecontacts_1.siteid the output contactid sitenameaddr siteid -------------------------------------------------------------- 329 twin parks southwest / twin parks south... 1 1788 twin parks southwest / twin parks s.... 1 what want is, output of format sitenameaddrs 1 contact id concatenated below count of site ids associated

php - Dotenv not loaded when deploying Bedrock-Capistrano -

i'm doing first bedrock multisite install using bedrock-capistrano. everything works locally, once deployed, get warning: mysql_connect(): access denied user 'nobody'@'localhost' (using password: no) in <snip>/releases/<snip>/public/wp/wp-includes/wp-db.php on line 1474 obviously did set info in .env file, , nobody no password isn't information set ;) . have checked env file located; , is. have no other logs or error shown. somehow feels it's not accessing info properly. any ideas why dotenv not work? bedrock-capistrano , supposed run composer install part of deployment, did not expected. connecting server on ssh , running composer install manually did trick dotenv work. (now issue "why did composer not work", that's else entirely)

apache - Relative url done right with ProxyHTMLURLMap? -

for example psweb1.example.com:8002/main/login/login.jsp needs redirect psweb1.example.com/demo1/main/login/login.jsp and psweb1.example.com:8002/content/* needs direct psweb1.example.com/demo1/content/* i cannot proper relative paths redirected. appreciated. this config in httpd.conf <virtualhost *:80> servername psweb1.example.com serveralias psweb1.example.com proxypass /demo1/ http://psweb1.example.com:8002/ proxyhtmlurlmap http://psweb1.example.com:8002/ /demo1 <location /demo1/> proxypassreverse http://psweb1.example.com:8002/ setoutputfilter proxy-html proxyhtmlurlmap / /demo1/ proxyhtmlurlmap /demo1 /demo1 requestheader unset accept-encoding </location> </virtualhost>

python - What does (numpy) __array_wrap__ do? -

i diving scipy linalg module first time, , saw function: def _makearray(a): new = asarray(a) wrap = getattr(a, "__array_prepare__", new.__array_wrap__) return new, wrap what __array_wrap__ exactly? found documentation , don't understand explanation: @ end of every ufunc, method called on input object highest array priority, or output object if 1 specified. ufunc- computed array passed in , whatever returned passed user. subclasses inherit default implementation of method, transforms array new instance of object’s class. subclasses may opt use method transform output array instance of subclass , update metadata before returning array user. does mean reconverts output of whatever function array since broken else element-by-element processing? relatedly, regardless of explanation, mean wrap object? it? i looking @ code numpy.linalg.inv ...what wrap doing here? **a, wrap = _makearray(a)** _assertrankatleast2(a) _assertndsqua

Excel VBA - Extra Sheets cause my VBA to run slower -

i have macro runs fast when run vba sub/function interacts 2 sheets, when add others sheets have nothing sub calculation, sub takes 10x longer executed. i've trying disable others sheets sub/function faster again, couldn't find solution. me ?? in advance. that's part of code gets slower other sheets added : dim i, j, k integer 'fluxo de caixa iterators = 11 j = 10 'db interators k = 2 'cachflowref row rowreference = range("cashflowref").row debug.print timer.timeelapsed until cells(i, 2) = "t" if cells(i, 2) <> "" until cells(rowreference, j).value = "" if cells(i, j).value <> 0 sheets("fluxo_db") .cells(k, 1).value = cells(i, 2).value 'tipo .cells(k, 2).value = cells(i, 3).value 'plano de contas .cells(k, 3).value = cells(i, j).value 'valor .cells(k, 4).value = cells(3, j).valu

Redirecting pages to HTTPS in Wordpress -

my site , when opened in google chrome, giving error in site files , missing css files. if @ source code, urls point https. i've never done configuration https. looked woocommerce plugin , other plugins, can not find error. can me? site: http://isoflex.com.br i had same issue yesterday. outdated woocommerce version me. updated woocommerce , fixed it. i see said looked woocommerce, using current version of woocommerce?

javascript - jQuery removing a previous set class or removing with wildcard -

i have following js sets background class. however, possible remove previous set class? i cannot remove them contains other classes whatever set on mouseover function or maybe if that's not possible removing wildcard class? classes being set end *-bean-bags maybe guess not flexible. whats expected: hover item , set class hover item , remove previous set class , set new class anyone have ideas? $('.ty-menu__submenu-list li').on("mouseover", function () { var menubackground = $(this).attr("data-background"); //console.log(menubackground); $("div.ty-menu__submenu.ty-menu__submenu-to-right").removeclass (function (index, css) { return (css.match (/\b-bean-bags\s+/g) || []).join(' '); }); $("div.ty-menu__submenu.ty-menu__submenu-to-right").addclass(menubackground); }); store class remove in custom attribute, this: $(

javascript - How can I call a function after several callbacks have been called -

i need push data new array database, return promise object. 5 times need call. this. var items = []; function setdata() { facilityapis.getalllistitems.get({ listname: "samples" }). $promise.then(function(data) { alert("1"); (var j = 0; j < data.items.length; j++) { items.push(data.items[j]); } console.log(items); }).then(function() { facilityapis.getalllistitems.get({ listname: "controls" }). $promise.then(function(data) { alert("2"); (var j = 0; j < data.items.length; j++) { items.push(data.items[j]); } console.log(items); }); }).then(function() { facilityapis.getalllistitems.get({ listname: "fibroblast" }). $promise.then(function(data) { alert("3"); (var j = 0; j < data.items.length; j++) { items.push(data.items[j]);

javascript - angular ui-grid change row height creates checkbox bug -

Image
i have created ui-grid sub grid, sub grid rows height modified css: .expandablerow .ui-grid-row, .expandablerow .ui-grid- cell,.expandablerow .ui-grid-cell .ui-grid-vertical-bar { height: auto!important; } when enabling row selection ( enablerowselection:true) sub grid , when row have multiple rows inside (since changed row height) checkboxes duplicated. screen shot attached how can fix it?

ruby on rails - Setup for an uploader (carrierwave) -

i have image uploader in place following tutorial using gems carrierwave , fog. add additional uploader struggling. i have generated uploader ( rails generate uploader name ). in model file have mounted uploader right column ( mount_uploader :column_name, nameuploader ). in uploader have set def extension_white_list , store_dir . included (since in tutorial did same): if rails.env.production? storage :fog else storage :file end now i'm stuck don't know set specifications fog. is, specify amazon bucket should upload to. in carrier_wave initializer had code below. code specifies upload uploader had implemented. these specifications different new uploader. where/how should include these specs new uploader? if rails.env.production? carrierwave.configure |config| config.fog_credentials = { :provider => 'aws', :aws_access_key_id => env['s3_access_key'], :aws_secret_access_key => env['s3_secret_k

node.js - Kill fork on windows throws "write EPIPE" -

i kill forks after specific amount of time. however, in codebase, following error (only on windows) : events.js:85 throw er; // unhandled 'error' event ^ error: write epipe @ exports._errnoexception (util.js:746:11) @ childprocess.target._send (child_process.js:484:28) @ childprocess.target.send (child_process.js:416:12) @ sendhelper (cluster.js:676:8) @ send (cluster.js:512:5) @ cluster.js:488:7 @ sharedhandle.add (cluster.js:99:3) @ queryserver (cluster.js:480:12) @ worker.onmessage (cluster.js:438:7) @ childprocess.<anonymous> (cluster.js:692:8) this error seems happen whenever worker not yet started , killed (eg takes 1 second start , killed before having started) here's minimal example can reproduce. var cluster = require('cluster'); var http = require('http'); var numcpus = require('os').cpus().length; var workers=[]; if (cluster.ismaster) { // fork workers. (

model view controller - MVC for standalone application using python, sqlite3 and gtk -

i developing pygtk application have adopted mvc structure. don't think i'm following standard mvc pattern in implementation. please suggest how must use mvc following problem statement. i using python, gtk, sqlite3 in application problem statement application: data present in logfile. should extracted , shown in gui. gui can have multiple views(like browser tabs) show data extracted logfile(user can create multiple views same database table). users can filter/search data through gui views. filter condition can vary 1 view another. current implementation using mvc structure: currently, in gui, button "create view" present, upon clicking, creates view display extracted data. data extracted(controller extracts data) logfile , added sqlite database(model). data sqlite database table fetched , added gtk.treemodel displays in gtk.treeview(view). each time user clicks "create view", controller instantiates view class , creates new tab in gui. i have

html - Text is not showing or letter are being replaced with other letters -

solution: remove font-family, font-size , color parent div. edit: problem occurs when press ctrl + f5 edit2: tracked down problem .site-footer: position:absolute; .it seems if change relative problem dissapears. i'm getting weird error on website i'm developing. there 2 problems: somethimes text not showing @ (though border text showing) when hover on it, starts displaying. the text glitches ex: instead of "sydney" text "tzdoez" , have refresh page or change browser window dimensions remove problem. did else encountered problem? just clear: the text not same color background. the text inserted pure html not javascript, php, etc i use open sans font google fonts. it happens no matter font use. <footer id="colophon" class="site-footer" role="contentinfo"> <div class="full-width"> <div class="left"> <ul class="footer-list"> &l

sql server - Calculate Age of user WITH Datediff (?) -

i'm trying use datediff function give me years off user more complicated thought. select datediff( dd,'1963-07-22','2016-07-23') this give me 19360 days think because 2016 have leap year , fine. what year , not days. if change interval dd yy(yyyy) calculates year. the correct answer calculate someone's age, or difference in truncated years between 2 dates year(@today)-year(@birthdate)+floor((month(@today)-month(@birthdate)+floor((day(@today)-day(@birthdate))/31))/12); this work regardless of leap years. , correct whether person born on later month or later day in same month. ignore hours , minutes, should when calculating someone's age.

c# - Using Object Result to receive a query (stored procedure) in Entity Framework? -

[httppost] public actionresult data (formcollection form) { int qid = convert.toint32(form["emailaddress"].tostring()); using (var db = new adventureworks2014entities() ) { objectresult<getemail_result> em = db.getemail(qid); //error } //more code downwards this error message: cannot implicitly convert type 'system.data.entity.core.objects.objectresult' 'system.data.objects.objectresult' why getting error?

android - AlertDialog can't show custom layout -

i use following code snippet show custom dialog: btncancel.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { // 1. instantiate alertdialog.builder constructor alertdialog.builder builder = new alertdialog.builder(context); // 2. chain various setter methods set dialog // characteristics builder.settitle("question"); alertdialog dialog= builder.setpositivebutton("yes", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int whichbutton) { dialog.dismiss(); callmethod(); } }).setnegativebutton("no", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { dialog.dismiss(); } }).create(); dialog.setcontentview(r.layout.quest

c# - Multiple actions were found that match the request in Web Api -

i keep getting error when try have 2 "get" methods multiple actions found match request: webapi i been looking around @ other similar questions on stack don't it. i have 2 different names , using "httpget" attribute [httpget] public httpresponsemessage summary(myvm vm) { return null; } [httpget] public httpresponsemessage fulldetails() { return null; } your route map this: routes.maphttproute( name: "api default", routetemplate: "api/{controller}/{id}", defaults: new { id = routeparameter.optional }); but in order have multiple actions same http method need provide webapi more information via route so: routes.maphttproute( name: "api default", routetemplate: "api/{controller}/{action}/{id}", defaults: new { id = routeparameter.optional }); notice routetemplate includes action. lots more info here: http://www.asp.net/web-api/overview/web-api-routing-and-actions/routing-in-aspnet-we

locking - DMV to identify Database Lock scenarios in SQL Server 2012 -

i have batch process runs every night. once process completes, see there records has not processed completely. think might encountering locking scenario while running multiple updates on single table. what best way troubleshoot locking in database using dmvs? there particular dmv, can run in morning(after batch has completed) - provide me information on locked processes encountered sql engine,during nightly run. sys.sysprocesses contains information processes running on instance of sql server. the below command gets blocked processes select * sys.sysprocesses blocked > 0

mongoose - elasticsearch/mongoosastic : what is the differences between es_indexed and es_type -

i needed implement search in app found elasticsearcha , mongoosastic using mongoose crud mongodb. follow steps provided here indexing many fields in model , works fine. before put in action wanted figure out difference between title: {type: string, es_indexed:true} description: {type: string, es_type:'string'} iv'e figure out using es_boost:2.0 example give high proiorty. string: {type:string, es_boost:2.0}

jaxb - How to bind xsd to Java classes with element documentation? -

i have xml schema want bind java classes xjc. in xsd have fragments like: <xs:element name="author" type="author"> <xs:annotation> <xs:documentation> author of book. </xs:documentation> </xs:annotation> </xs:element> but documentation lost in java bindings. how can "the author of book." fragment java code?

postgresql - How can I generate dynamic SQL in WhereScape (on Greenplum)? -

we have table of business rules define column names , tests perform - null/populated, >=, <=, etc., , want create procedure or function implements these rules dynamically. can in wherescape red, or have create custom postgresql function build sql, , pass record it? i'm not sure if postgresql functions can take generic record input. you can create custom logic (called transformations) within columns in wherescape red, may possible. however, highly recommend raise on wherescape forum ( https://www.wherescape.com/support/forums/ ) you'll more quicker response.

asp.net mvc - MVC Entity Framework calling stored procedure -

i using asp.net mvc 4.5 , ef. import stored procedures ado.net entity data model. have .edmx , xx.tt storeprocedure_result.cs . i use var result = dbcontext.sp(param).asenumerable().first(); my problem stored procedures have select count(id) count table doesn't appear on sp_result.cs any ideas? i tried out myself , did not see "_result.cs" class created either sproc returns count(). i'm guessing _result.cs class not need created because single int, , specific type not needed. still able call sproc though. obtain int this... var result = db.getcount().first(); int = (int)result;

eclipse - Android, Renderscript, ScriptIntrinsicBlur, import libRSSuport.so and librsjni.so -

i developing app uses canny edge detection. time consuming step here initial application of gaussian blur (e.g. applying 11x11 kernel on 500k pics). in order speed want use scriptintrinsicblur method of renderscript. have set-up code in eclipse, included latest buildtools 22.0.1, described e.g. on http://developer.android.com/guide/topics/renderscript/compute.html#ide-setup . import of renderscrip-v8.jar works, compilation works, don't manage run, not on samsung s5. error related missing import of librssupport.so , librsjni.so. read dozens of threads on topic, didn't found solution. @ point give up... (and consider using smaller picsize , kernels - @ cost of lower quality) appreciated! just sidenote: made prototype in java, there using java.awt.image.convolveop gaussian blur. 1 fast - unfortunately not available in android. can try instructions http://android-developers.blogspot.com/2013/09/renderscript-in-android-support-library.html (except updating tools ver

Python function as a variable - different number of arguments -

maybe weird question. have code this: def foo(): print "foo" def bar(x): print x func = foo func() func = bar arg = 'a' func(arg) is there way have "empty" argument, can call assign foo() func , still call func(arg) ? not workaround if arg none: func() else: func(arg) sure, if use tuples/lists , argument unpacking . def foo(): print "foo" def bar(x): print x args = () func = foo func(*args) func = bar args = ('a',) func(*args) result: foo

mysql - ERROR 1005 (HY000): Can't create table 'tracker_phonetracker.location_share' (errno: -1) -

i facing problem in query . create table location_share ( circle_id int , user_id int , location_sharing_id int , primary key (user_id ,circle_id ) , constraint fkcircle1 foreign key (circle_id) references circle(id) on delete cascade on update cascade , constraint fkuser1 foreign key (user_id) references user(id) on delete cascade on update cascade , constraint fksharing_policy foreign key (location_sharing_id) references share(id) on delete cascade on update cascade ) engine = innodb mysql shows me error 1005 : error 1005 (hy000): can't create table 'tracker_phonetracker.location_share' (errno: -1) other tables on query dependent : table : circle create table circle ( id int auto_increment primary key , name varchar(35) ) engine=innodb table : user create table user ( id int auto_increment primary key , contact_no varchar(25) unique not null, email varchar(50) unique not null,

java - How to optimize the size of a pdf generated with JasperExportManager and JRFileVirtualizer -

i generate pdf in java method: ... jrfilevirtualizer virtualizer = new jrfilevirtualizer(2, stemppath); virtualizer.setreadonly(false); map.put(jrparameter.report_virtualizer, virtualizer); map.put(jrparameter.report_locale, locale.italian); jasperprint print = jasperfillmanager.fillreport(report, map, conn.getconnection()); jasperexportmanager.exportreporttopdffile(print, reportnamesaveto); ... now have optimize size setting "compression" pdf, how can that? you can set net.sf.jasperreports.export.pdf.compressed=true in jasperreports.properties, or equivalent in code .

javascript - How can i return something what callback function fetches -

i have ajax library can see code here . have function uses ajax function , needs return ajax function returns this function returnmydata(){ var data; ajax.get("somedomain",function(err,dt){ if(dt){data= dt} }); return data; } here looks fine javascript return null because callback wont fetch data yet due multi thread nature of javascript. question how can wait till data fetched , return tried use while freezes browser or gives unresponsive script error.

joomla2.5 - Can't get joomla update notification even after perge cache action -

Image
i wasn't getting updates notifications of joomla update current version 2.5.x , want update 3.x @ least. after doing purge cache action according this solution states. but after see (how can lower version new version?) is there other way can notify update joomla version 3.x ? go options of joomla update manager , switch long term support short term support.

sql - Remove repeated concurrent characters in ORACLE 10g -

i have aggregated varchar2 column, containing scans done, in oracle 10g. example being: my_column xxxoabboabbbboabbboabbboabbboabbbooabuxxx i need remove repeated concurrent characters, viz. need convert above string to: my_column xoaboaboaboaboaboaboabux i need relative order of each character conserved how can that? i'm thinking of using nested replace() functions clean string i'm looking less messier alternative you use regexp_replace . for example, sql> data(str) as( 2 select 'xxxoabboabbbboabbboabbboabbboabbbooabuxxx' dual 3 ) 4 select str, regexp_replace(str, '(.)\1+','\1') new_str data; str new_str ----------------------------------------- ---------------------------- xxxoabboabbbboabbboabbboabbboabbbooabuxxx xoaboaboaboaboaboaboabux sql>

javascript - Protractor TAB key has stopped changing focus and is now adding spaces -

we have protractor tests uses tab key change focus next input field, , working great. somewhere in last days has stopped changing focus , adding spaces instead. manually, pressing tab workers. we tested google.com , behaves same. did encounter change of behaviour? thanks! var tab = protractor.key.tab; describe('testing', function() { it('should stuff.', function() { browser.ignoresynchronization = true; // non angular page. browser.get('http://www.google.com'); browser.sleep(1000); $('.gsfi').sendkeys('123'); browser.sleep(1000); // have time look. browser.actions().sendkeys(protractor.key.tab).perform(); //different methods, same effect. $('.gsfi').sendkeys(tab); // different methods, same effect. }); }); it seems regression in chrome 44. i've pointed on an issue in protractor bug tracker in comments. here issue in chromedriv

mysql order by numeric column separating positive and negative values -

i want list positive values of weight column ordered weight in ascending order, followed negative values in whatever order. this i've tried: select * `mytable` weight >= 0 order weight union select * `mytable` weight < 0 order weight and got: sql error (1221): incorrect usage of union , order by just use single query , appropriate order by : select * `mytable` order (weight >= 0) desc, weight; mysql treats booleans in numeric context number, expression (weight >= 0) treated "1" (for positive) , "0" (for negative). you cannot depend on ordering of union query, in situation, because removal of duplicates can ordering. shouldn't depend on ordering union all , because nothing in sql mandates rows first subquery returned before rows second (although in practice true). as note: error getting caused first order by , not second.

javascript - AngularJS Redirecting after displaying the parameter -

this continuation of my question so far didn't url value. can able url paameter problem page getting redirected once showing alert here controller , route route .when('/showprofile/:userid', { templateurl: 'resources/views/layout/showprofile.php', controller: 'showuserctrl' }) controller ; app.controller('showuserctrl', function($scope, $routeparams) { var b = $routeparams.userid; alert(b); $scope.userid = $routeparams.userid; }); my view : {{userid}} the problem url this http://192.168.1.58/myapp/#/showprofile/18 after showing alert 18 it makes url http://192.168.1.58/myapp/#/showprofile/:userid how can stop redirection .. ?? i want final url http://192.168.1.58/myapp/#/showprofile/18 i found problem because of .run function have. after removing works good. here .run function .run(function ($rootscope, $location, data, $http) { $rootscope.$on("$routechangestar

azure - How to include large data set AzureWebRole -

we're trying setup service in azure webrole requires large dataset (approx 10gb on 35,000 files). what's best approach this? we've tried: i) including files in visual studio project content files - vs grinds halt ii) putting files blob storage , downloading them needed - service grinds halt, presumably because we've hit iops limit on instance saving files disk. don't want use large instance won't hit iops level in normal running. iii) including zip file , extracting @ startup - again grinds halt. i'm assumming there's way of including files in depolyment package without putting them in vs project, have upload 10gb deployment package everytime update doesn't seem ideal. files need local on ssd because of speed. have solution this? putting 10 gb files in package not desirable + not allowed maximum size of package file can 600 mb only. one possible solution problem make use of azure file service built on smb protocol. though in

javascript - Choppy animation bootstrap -

i use bootstrap collapse class on html elements. then, jquery, dynamically show collapsed elements. example of this:(html:) <form> <div class="checkbox"> <label><input type="checkbox" id="1">checkbox1</label> </div> <div class="sub_level collapse"> <div class="checkbox"> <label><input type="checkbox" id="2">checkbox2</label> </div> <div class="checkbox"> <label><input type="checkbox" id="3">checkbox3</label> </div> <div class="checkbox"> <label><input type="checkbox" id="4">checkbox4</label> </div> </div> </form> (javascript:) $(document).ready(function(){ $("#1").click(function(){

php - Error getting last 3 rows from mysql query -

i trying last 3 rows query keep getting error: sqlstate[42s21]: column exists: 1060 duplicate column name 'id' please, doing wrong here? $sql = "select * (select i.*, m.*, p.* message join members m on m.id = i.sender_id join profile_photos p on p.member_id = m.id (receiver_id = :receive , sender_id = :sent or receiver_id = :sent , sender_id = :receive) order date desc limit 3) t order date asc"; you have id column in more 1 table , select statement select i.*, m.*, p.* listing them all. either choose specific column want like select i.id, i.col1, m.col2, p.col3 ... or, use column alias like select i.id iid, m.*, p.id pid

c# - Operator '==' cannot be applied to operands of type int and 'Model' -

i know error on here few times cannot find solution particular problem. i have table foreach loop populates table data can see below, table has expand/close capability, within want display groups in there relevant sections. error operator '==' cannot applied operands of type 'int' , 'groupsection' appearing in line: if (item.sectionid == item.groupsectionid) i want make sure groups details can appear if groupsectionid same sectionid in particular loop table <table class="table table-striped"> <!-- render table headers. --> <thead> <tr> <th class="col-md-1">+</th> <th class="col-md-2">section id</th> <th class="col-md-3">section name</th> </tr> </thead> <tbody> <!-- render details of each employee. --> @foreach (var item in model) {

C++ errors for C code -

2nd edit : thank guys far!!! have corrected in terms of plain c assignment has written in. obviously, knowledge of c terrible. literally teaching myself c write this, using of c++ knowledge so. hence confusion of language literals. still having issues firstcheck() function though. explain directly below current code. the firstcheck() function not working should. in readfile() function have split text given file array line line. firstcheck() should take array "mystring" , read first string until " " occurs (basically first word/character/etc.) can evaluate it. updated assem.c #include "assem.h" int readfile(file *file, struct assem *item) { size_t =0; item->counter = 0; //this sort of constructor, if will. size_t maxlines = sizeof item->mylines / sizeof *item->mylines; //breaks

html5 - Difference between initial scale and user scalable -

what difference between initial-scale , user-scalable ? because feel there no difference between them. initial-scale , user-scalable serve different purposes, , far being same: initial-scale : specifies initial zoom factor window or viewing area. it translates zoom property. internally, values translated numeric values in range [0.1, 10]. user-scalable : specifies if user able change zoom factor. it translates user-zoom . internally, values translated zoom or fixed . so use initial-scale specify how zoomed/scaled page when loads, , use user-scalable specify if user able zoom in/out interacting page.