Posts

Showing posts from January, 2014

angular ui router - Why don't comment upvotes work? thinkster.io, angularjs tutorial, mean, incrementUpvote() -

i'm following thinkster angular js tutorial here: https://thinkster.io/angulartutorial/mean-stack-tutorial/ and clicking on upvotes icon next comment fails increment upvote count. in ui-router template(included inline in index.html), ng-click calls addupvote()--but addupvote() defined controller specified in state. way template can call addupvote() if template's associated state/controller somehow inherits other state/controller. , in fact, according ui-router docs here: https://github.com/angular-ui/ui-router/wiki/nested-states-%26-nested-views the way states defined in app.js, app.js: app.config([ '$stateprovider', '$urlrouterprovider', function($stateprovider, $urlrouterprovider) { $urlrouterprovider.otherwise('home'); $stateprovider .state('home', { url: '/home', templateurl: '/home.html', controller: 'mainctrl' } ) .state('posts', { url: '/p

jquery - Is it possible to display a single image bigger when our website is viewed on a mobile? -

we have login button showing @ top right of our page "customer login". is possible make image bigger only when site viewed on mobile phone? clearly in ideal world we'd have whole mobile version of our site created, unfeasible @ moment. if helps our site can viewed - here you can use media queries that: @media (max-width: 768px){ /* ipad , below */ img{width: 100%;max-width: 100%;} }

javascript - How to center a PopupPanel -

in web app built in google apps script , want show popup containing som text , links. figured popuppanel way go. i've done: var app = uiapp.getactiveapplication(); var popup = app.createpopuppanel() .setanimationenabled(true) .setmodal(true) .setglassenabled(true) .setautohideenabled(true); popup.add(app.createlabel('text text text')); popup.setpopupposition(100, 100); popup.setheight('300px'); popup.setwidth('500px'); popup.show(); but instead of setting fixed position, center box in current window. since there seems no such functionality, tried pixel size of window, or form app, or panel sized 100%, can't size anywhere, there seems possible set size. is there way center popuppanel , or create popup other way, centered? i found way of doing want. not beautiful solution, works. var app = uiapp.getactiveapplication(); var popup = app.createpopuppanel() .setanimationenabled(true) .setmodal(true) .s

android - Fragment slide out animation doesn't work -

i have android app in loading fragment 1 fragment on click of button fragment fragment = new editimagesfragment(); fragmentmanager fragmentmanager = getfragmentmanager(); fragmenttransaction tran = fragmentmanager.begintransaction(); tran.setcustomanimations(r.anim.push, r.anim.pop); tran.replace(r.id.content_frame, fragment).addtobackstack(null).commit(); and have push , pop (slide in , out ) kind of animations defined follows <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <objectanimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500" android:propertyname="x" android:valuefrom="1000" android:valueto="0" android:valuetype="floattype" /> </set> <?xml version="1.0" encoding="utf-8"?> <set

css - Preventing Render-Blocking in Bootstrap 3.2 -

i have issue client's website uses twitter bootstrap 3.2 less. technical lead @ client has flagged google pagespeed insights showing red flag against several of css files in site causing render blocking issues: https://developers.google.com/speed/pagespeed/insights/?url=http%3a%2f%2fwww.ukessays.com%2fservices%2fessay-writing-service.php&tab=mobile however, above fold content on majority of pages contains of css elements used in site idea of "in-lining" of css render above fold content seems ridiculous. make things worse important pages in site have lowest speed scores: http://www.ukessays.com/services/essay-writing-service.php : 71/100 vs http://www.ukessays.com/essay-help/referencing/ : 77/100 as website re-built using twitter bootstrap make more responsive i'm left looking bit of idiot scores less previous non-responsive website. fact css compiled using less has effective prevented implementing dynamic solution problem server-side has come a

javascript - How to read array inside JSON Object this is inside another array -

i newbie json, parsing json object , struck @ point have read array elements inside object, again in array.. here json { "definitionsource": "test", "relatedtopics": [ { "result": "", "icon": { "url": "https://duckduckgo.com/i/a5e4a93a.jpg" }, "firsturl": "xyz", "text": "sample." }, { "result": "", "icon": { "url": "xyz" }, "firsturl": "xyz", "text": "sample." }, { "topics": [ { "result": "", "icon": { "url": "https://duckduckgo.com/i/10d02dbf.jpg" }, "firsturl": "https://

javascript - Trying to scrape data generated by ajax request using scrapy, but the ajax request redirects to home page -

i new scraping not sure why getting problem. trying scrape customer vendor chats anyvan.com. normal job page of site looks this . clicking on pink view button in bids session sends ajax request loads chats. xhr request can been seen in developers tool -> network -> filter xhr request. i using following simple spider simulate request using scrapy seems getting redirected anyvan.com class avspider(spider): name = "anyvanscraper" allowed_domains = ["anyvan.com"] # start url job url start_urls = ["http://www.anyvan.com/view-listing/1935650"] def parse(self, response): # receives response start url. don't it. url = 'http://www.anyvan.com/ajax-bid-comment/bid/14916780' return request('http://www.anyvan.com/ajax-bid-comment/bid/14916780' , callback=self.parse_stores) def parse_stores(self, response): y = response.body f = open('html.txt','w')

java - Could not play a sound in swing -

i trying play .wav file everytime press button. i've put resource in workspace, project. wrong? i error message: javax.sound.sampled.audioinputstream@341bdd4c /home/fred/workspace/projekt/src/gui/sound/gangnam.wav java.lang.illegalargumentexception: invalid format here code: public static void main (string [] args) { jframe customboardframe = new jframe("custom size."); customboardframe.getcontentpane().add(new customsize()); customboardframe.setdefaultcloseoperation(jframe.exit_on_close); customboardframe.setsize(450, 310); customboardframe.setvisible(true); customboardframe.setresizable(false); } public class customsize extends jpanel implements actionlistener { jbutton playbutton = new jbutton(" >> play <<"); jbutton stopbutton = new jbutton(" >> stop <<"); jbutton pausebutton = new jbutton(" >> pause <<"); public customsize(){

how to get data from mongodb collection by match data in subdocument? -

i have mongodb collection data var data = [ { name: 'test1', attributes: [ { name: 'color', value: 'red' }, { name: 'size', value: 'l' } ] }, { name: 'test2', attributes: [ { name: 'color', value: 'blue' }, { name: 'size', value: 's' } ] }, { name: 'test3', attributes: [ { name: 'color', value: 'red' }, { name: 'size', value: 's' } ] } ] how query database return documents matching attribute name 'color' having value 'red' , attribute name 'size' having value 'l'? means should return var output = [ { name: 'test1', attributes: [

version - Jasper Reports Backward Compatibility -

i using 3.7.4 version of jasper reports library , planning upgrade 5.6.1 latest version , supports dynamic row generation outcoming reports. there exists lot of jrxml templates in db prepared use jasper reports 3.7.4. is 5.6.1 provides compatibility reports works version 3.7.4? or can practical make them work 5.7.1 version? if use newer version of ireport, creates new jrxml tags uuid etc not valid in previous versions. jasper file (.jrxml or .japser) produced ireport not usable older version of jasperreports (or @ least not guaranteed work). can end screw report. this in jaspersoft roadmap in future releases no idea when fixed , released.

How would you represent a dropdown menu in ARIA? -

i adding aria tags code , wondering right way of adding role attribute dropdown menu? is role="option" or role="combobox" or role="listbox" ? use role=combobox dropdown. see example here: http://test.cita.illinois.edu/aria/combobox/index.php http://test.cita.illinois.edu/aria/combobox/combobox1.php

how to get and set the list of user names shown in recent changes as environment variable in jenkins -

i need list of user names recent changes section in jenkins job , add argument external script. can please help. traverse through [jenkins_home_dir]/jobs/[job]/builds/[buildids]/changelog.xml , grab in between <author></author>

umbraco6 - Courier Build for - Umbraco v6.2.4 -

i have finished umbraco project , want install courier. how ever bit confused version of courier should install. i using umbraco v6.2.4 (assembly version: 1.0.5394.15649) but on courier package page > http://our.umbraco.org/projects/umbraco-pro/umbraco-courier-2 this can see under compatibility. 7.1.x (0%) 7.0.x (0%) 6.2.x (0%) 6.1.x (100%) 6.0.x (untested) 4.11.x (100%) 4.10.0 (untested) 4.9.1 (untested) 4.9.0 (100%) does mean not work @ latest version of umbraco? if how can change v6.2.4 umbraco down 6.1.x (i used nuget install it) i have finished umbraco project, content done etc... don't want have start again. any ideas? according this issue , appears work in umbraco 6.2.x this correspond build courier_2.7.8.42.v6.zip onwards, @ nightly courier downloads here

r - How to find the min of the previous n values for every element of a vector? -

so far use loops within function this: # x vector of numbers # [1] 0 1 -1 -5 100 20 15 function(x,n){ results <- numeric(length(x)-n+1) for(i in 1:(length(x)+1-n)){ results[i] <- min(x[i:(i+n-1)]) } return(results) } ## outputs x , n = 3 # [1] -1 -5 -5 -5 15 i wondering if there more efficient solution potentially not require looping. edit:: i ran 2 of solutions microbenchmark on vector 6019 observations. when time (/figure out how), can try each solution various observation sizes see effectiveness of each solution. now: rcpp solution: > microbenchmark(nmin(x,3)) unit: microseconds expr min lq mean median uq max neval nmin(x, 3) 53.885 54.313 57.01953 54.7405 56.023 93.656 100 catools solution: microbenchmark(runmin(x[[1]],3,endrule='trim')) unit: microseconds expr min lq mean median uq max neval runmin(x[[1]], 3, endrule = "trim") 231.7

excel - Calculate the difference and sum of two times and round to the nearest 1/4 hour in decimal format -

i trying create simple spreadsheet accurately calculate difference between 2 times, on 3 separate periods in day staff payroll purposes. there start , end time each input exact minute in 24 hour time (07:21, 22:42 etc). there total column each of 3 periods needs sum work time, convert decimal, , round nearest 1/4 hour (i.e: 4.75 hours) in 1 formula. i can achieve 1 or other, cannot formulas work reason. have tried int, round, minute etc based on following: =((round(c9*96,0)/96)*24)-((round(b9*96,0)/96)*24) =int(c9)*24+hour(c9)+round(minute(c9)/60,2)-int(b9)*24+hour(b9)+round(minute(b9)/60,2) and several hundred variations. i think overthinking one, , not using correct formula. mround allows round nearest multiple (which doesn't have integer). date/time values in excel stored fractional numbers of days, convert hours can multiply 24. putting gives: =mround(24*(c9-b9),0.25)

css - Polymer : My core-list is no rendered when is in core-animated-pages element -

i have render problem(no render) of core-list element when custom element in core-animated-pages here jsfiddle when works( grey list) ==> album-grid outside core-animated-pages http://jsfiddle.net/flagadajones/yq30u78d/ here jsfiddle when id doesn't works( no grey list) ==> album-grid inside core-animated-pages http://jsfiddle.net/flagadajones/m87sd0x3/2// could me thanks here code: <script src="https://www.polymer-project.org/components/webcomponentsjs/webcomponents.js"> </script> <link href="https://www.polymer-project.org/components/core-drawer-panel/core-drawer-panel.html" rel="import"> <link href="https://www.polymer-project.org/components/core-icons/core-icons.html" rel="import"> <link href="https://www.polymer-project.org/components/core-icon-button/core-icon-button.html" rel="import"> <link href="https://www.polymer-project.org/com

c# - Kendo Data Picker format Doesnot Work -

hi using mvc kendo ui want change culture en-gb used link http://docs.telerik.com/kendo-ui/aspnet-mvc/globalization to change culture , that's works fine for the grid not date time picker i used format method , parse format , still not work try following 1- editortemplate date.cshtml @model datetime? @(html.kendo() .datepickerfor(m => m) .htmlattributes(new { tabindex = viewdata["tabindex"] }) .format("dd mmm yyyy") .parseformats(new string[]{"yyyy-mm-dd"}) ) 2- in global.asax protected void application_beginrequest(object sender, eventargs e) { cultureinfo info = new cultureinfo("en-gb"); info.datetimeformat.shortdatepattern = "dd mmm yyyy"; info.datetimeformat.longdatepattern = "dd mmm yyyy hh:mm"; info.numberformat.numberdecimaldigits = 2; thread.currentthread.currentculture = info; thread.currentthread.currentuiculture = i

How to use Gaana API to play songs? -

i trying information gaana.com api in order play songs it. can 1 me how play songs using gaana.com api after getting data of particular "track"(song)? is possible playing song api's provided gaana? these of music api available, , solves of purpose. https://musicmachinery.com/music-apis/ having categories >>music metadata >>discovery / playlisting >>audio content >>audio identification >>audio analysis >>lyrics >>events >>music analytics

mysql - How to close database connection in php while database file is included? -

i have page pae1.php has code like include_once('db.php'); in db.php connection established $con= mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("dbname") or die(mysql_error()); i run query on page1.php as $delete_s1ql="delete tbl_info id='$id' "; $res_del=mysql_query($delete_s1ql) or die(mysql_error()); now want close database connection on page1.php. how can this? change db.php (to make sure selected database bound resource): $con= mysql_connect("localhost", "username", "password") or die(mysql_error()); mysql_select_db("dbname", $con) or die(mysql_error()); in page1.php add end (use global resource-variable close correct connection): mysql_close($con); ps: take @ pdo better way connect , talk database.

shell - Diff command for two files and output to third -

i have small problem comparing 2 files diff command in shell script. have 2 ascii files, file1.txt , file2.txt, contents: file1.txt blah/blah2/content.fits/ blah3/blah4/content2.fits/ blah5/blah6/content3.fits/ blah7/blah8/content4.fits/ file2.txt content.fits content2.fits i make comparison of 2 files based on .fits extensions write out output ascii file keeping formatting in file1.txt, i.e in particular example output file after comparing these 2 should give: blah5/blah6/content3.fits/ blah7/blah8/content4.fits/ any ideas? you can use awk output: awk -f/ 'fnr==nr {a[$1];next} !($(nf-1) in a)' file2.txt file1.txt blah5/blah6/content3.fits/ blah7/blah8/content4.fits/

c# - default property when Com interface type is IDispatch -

in c# com interface, 1 can define default member this [interfacetype(cominterfacetype.interfaceisdual)] [comvisible(true)] public interface imycomclass { [dispid(0)] string item{get;} } with idispatch (or dual) works expected, , vba can omit property this dim o1 new mycomclass debug.print o1 'this equivalent o1.item but if define interface iunknown, doesn't work. in excel object browser still see property marked 'blue dot', , labelled 'default member'. .item must explicitly specified in vba code. is there way have default properties in iunknown behave in idispatch? no, default properties notion can apply idispatch derived interfaces. late binding use in debug.print statement cannot work on iunknown interfaces, coclass implements interface doesn't have machinery required call function selected number. review idispatch::invoke() method , that's 1 gets job done. using default member done passing 0 first argument. dismiss qui

java - WildFly/JBoss server group deployment understanding -

according jboss documentation: in managed domain deployments associated server group. deployments provided server belongs particular group. ...the multiple servers in common server group become single 1 virtually. but how jboss choose target actual server deployment? for example, have 2 different vps servers jboss running, combined single main-server-group . vps server host application following command? [domain@localhost:9999 /] deploy ~/desktop/test-application.war --server-group=main-server-group 'test-application.war' deployed successfully the application deployed both servers. if go http://server1:8080/myapp should see same if went http://server2:8080/myapp the reason have web server or proxy load balance between 2 servers. if want have 2 separate servers don't have apps deployed each, put them in different server groups or, better solution run jboss in standalone mode, rather domain mode.

bruteforce string matching javascript -

function search(pattern, text) { var m = pattern.length; var n = text.length; (var = 0; < n - m; i++) { var j =0; while (j < m) { if (text.charat(i + j) != pattern.charat(j)) {break;} } if (j == m) {return i;} } return -1; } console.log(search("rf", "jdsrfan")); i want make brute-force string matching algorithm in javascript. can tell me whats wrong above code? i did fixed myself fixed code follows: // return offset of first match or -1 if no match function bruteforcepatternsearch(spattern, stext) { var m = spattern.length, n = stext.length; (var = 0; <= n - m; i++) { var j=0; while (j < m) { if (stext.charat(i+j) !=spattern.charat(j)){ break; } j++; } if (j == m) {return i;}

plone - Custom template for collection -

Image
i'd create page template lists of particular content type value true. i assume best way make custom page template collection. so follow these instructions here: http://www.uwosh.edu/ploneprojects/docs/how-tos/a-minimalist-view-for-collections but error "macro expansion failed" described here: page template macro expansion failed however answer there doesn't make sense me. i'm not sure define macros, in type's .py file? does combination of these 2 links describe whole process or more it? process described in full anywhere else? or thinking wrong way, should not using collection, new view content type sorting itself? you're getting error message right after paste tutorial's example code portal_skins/custom/collection_minimal_view, right? that's because zope trying anticipate you're doing, doesn't know variable 'context' going , can't sure 'context' have 'standard_view' attribute. at

css - why isn't my font face loading? -

i scored sweet font called cubano regular , it's first time using @font-face. i'm not sure if i'm doing right code : @font-face { font-family: 'cubanoregular'; src: url('...fonts/cubano-regular-webfont.eot'); src: url('...fonts/cubano-regular-webfont.eot')format('embedded-opentype'), url('...fonts/cubano-regular-webfont.woff') format('woff'), url('...fonts/cubano-regular-webfont.ttf') format('truetype'), url('...fonts/cubano-regular-webfont.svg#')format('svg'); i'm rookie , awesome if out! you path isn't correct. src: url('.../fonts/cubano-regular-webfont.eot');

string - How have null value inside basic_string in c++ -

is there way have , process null value inside std::basic_string ? sometimes string sequence being passed has null values. example below code outputs 1234,5678 instead of whole string. #include <iostream> #include <string> #include <cstring> int main () { int length; std::string str = "1234,5678\000,abcd,efg#"; std::cout << "length"<<str.c_str(); } i need complete string. first, you'll have tell string constructor size; can determine size if input null-terminated. work: std::string str("1234,5678\000,abcd,efg#", sizeof("1234,5678\000,abcd,efg#")-1); there's no particularly nice way avoid duplication; declare local array char c_str[] = "1234,5678\000,abcd,efg#"; // in c++11, perhaps 'auto const & c_str = "...";' std::string str(c_str, sizeof(c_str)-1); which might have run-time cost; or use macro; or build string in pieces std::string str = &

How to create a list from list of list using scala? -

i have following list: list(list(vmnic4), list(vmnic5)) i want change list(vmnic4,vmnic5) how do using scala?? you can use flatten : list(list(vmnic4), list(vmnic5)).flatten

c# - Missing DLLs from a class library that uses separate DLLs -

in c# .net 4.0 creating class library / dll plan reuse in many other projects. class library use several dlls itself. example, class library creating may reference several dlls like: serverconnectorlibrary references: lib1.dll lib2.dll lib3.dll when build this, serverconnectorlibrary.dll output in bin\debug folder. what want use serverconnectorlibrary.dll in other projects. however, when add dll new projects , run following error: filenotfoundexception: not load file or assembly "lib1.dll". if add lib1.dll bin\debug folder of new project, problem not solved. you may able combine of dependencies single assembly. here old example on codeproject. http://www.codeproject.com/articles/9364/merging-net-assemblies-using-ilmerge there stackoverflow thread here... how merge multiple .net assemblies single assembly? otherwise, make sure properties each dependency set copy local , include dependencies along library. these dlls, dynamically linked @ run

android - ImageView size issue within ListView -

Image
i encounter error when first load listview images url size not displayed correctly. happens first time. if go previous fragment , again listview, image sizes fixed ( although can see momentarily had wrong size before being fixed ). i use android query retrieve images , example listview : http://javatechig.com/android/android-listview-tutorial searchresultadapter.java public class searchresultadapter extends baseadapter{ private context context; private arraylist listdata; private layoutinflater layoutinflater; public searchresultadapter(context context, arraylist listdata) { this.context = context; this.listdata = listdata; layoutinflater = layoutinflater.from(context); } @override public int getcount() { return listdata.size(); } @override public object getitem(int position) { return listdata.get(position); } @override public long getitemid(int position) { return positi

Getting row data from invisible row in jqGrid -

how can data row that's not in current page, knowing row id? grid has datatype:"json" i tried using $('#grid').jqgrid ('getrowdata', rowid); but works visible rows (rows in current page) i suppose use datatype: "local" . in case can use getlocalrow : var rowdata = $('#grid').jqgrid ('getlocalrow', rowid);

knockout.js - Knockout Subscribe to any change in observable complex object -

i have viewmodel contains observable, initialized object. object contains observables. my goal notified whenever object changes (or: when observable in object changes) jsfiddle complex object : var ns = ns || {}; ns.complexobj = function (item) { var self = this; if (!item) { item = {}; } self.id = item.id || ''; self.company = ko.observable(item.company || ''); self.email = ko.observable(item.email || ''); self.company.subscribe(function () { console.log('debug: company changed'); }); return self; }; viewmodel ns.mainvm = function () { var simpleobject = ko.observable('i pretty simple'); simpleobject.subscribe(function (newvalue) { document.getelementbyid('simplesubscribtionfeedback').innertext = newvalue; }); var complexobject = ko.observable(ns.complexobj()); complexobject.subscribe(function (newvalue) { // react change in complex ob

excel - Lookup and Reference Other Row Contents -

Image
basically i'm trying merge data 1 excel document another. while names (students) have same cell data name, order little off on 1 uses middle names occasionally. what need have 1 document lookup students name in another, on row student name specified column data bring main excel sheet.

java - Processbuider do not execute application only in windows 7 32bit -

i have faced interesting issue signed java applet unable run process via processbuilder under windows 7 32bit. i've tested applet on windows 7 64 bit, windows vista 32bit , windows 8 32/64 bits java 7 , java 8 , working flawlessly. problem seems application i'm trying run applet needs higher permissions java cannot provide. i'm looking hear there workaround (registry patch or something) in order provide needed security rights java? tested solutions: applet manifest modified added line: permissions: all-permissions ; run administrator ie, mozilla browsers; modified c:\program files\java\jre7\lib\security\java.policy line: permission java.security.allpermission ; i've found solution! if trying lounch executable application java applet requires administrator rights, must put executable system32 directory.

chunked encoding - Abort HTTP chunk encoded response with Error Page -

i'm extending previous question: aborting http/1.1 chunk encoded response when abort chunked response chrome displays blank page , dev console reports net::err_incomplete_chunked_encoding. ie displays incomplete page. there way send user actual 500 error page? can output corrupts document browser won't use it? if so, what's shortest string can send achieve this? unfortunately, there no chunk can send says browser "hey, forget sent far - went wrong". sending tcp reset packet cause browsers display "server reset connection" page, requires access 1 level down network stack. the other can think of try sending chunk negative length. don't know how browsers react that.

Encrypt text using AES in Javascript then Decrypt in C# WCF Service -

i trying encrypt string using aes 128bit encryption. have code both javascript , c#. main objective encrypt string using javascript cryptojs , take resultant cipher text , decrypt using c# aes aescryptoserviceprovider. javascript code: function encrypttext() { var text = document.getelementbyid('textbox').value; var key = cryptojs.enc.hex.parse("psvjqrk9qtepnvu1dwuzcrvfgv1vvt0="); var iv = cryptojs.enc.hex.parse("ywlflvezzufnawl="); var encryptedtext = cryptojs.aes.encrypt(text, key, {iv: iv, mode: cryptojs.mode.cbc, padding: cryptojs.pad.pkcs7}); //var decrypted = cryptojs.aes.decrypt(encrypted, "secret passphrase"); var encrypted = document.getelementbyid('encrypted'); encrypted.value = encryptedtext; } c# code: private string aes_decrypt(string encrypted) { byte[] encryptedbytes = convert.frombase64string(encrypted); aescryptoserviceprovider aes = new aescryptoserviceprovider(); aes.blocksize =

c# - Crystal report not printing as it shows while design time when using PrintToPrinter method -

hi intelligent peoples, i stuck @ problem , cant find solution anywhere on internet. problem : printtoprinter method not print same design. print out same when printing preview of crystal report in crystal report viewers, user don't want click print on windows form , press print again in print preview(crystal report viewer). want print report directly printer without asking user again. page setup : page size : 8.5*8.5 inches. no printer(optimize screen size) : checked dissociate formatting page size , printer paper size : checked user defined size : selected printout crystalreportviewer desired. printed paper printtoprinter method comes different. please me, stuck. edit: following event handler btnprint . want user click on btnprint on windows form once , want print out. no other step. print comes out not expected. if open crystal report viewer on click of btnprint after user clicks on print button on crystal report viewer , after selecting pri

sql server - How to add a db_datareader to a secondary in SQL Azure -

we have sql azure database configured online secondary. configure user/login on secondary support reporting workload. this, have done following: created login on both servers same name created user in database on primary server, linked login verified user has been replicated secondary confirmed successful connectivity primary database using login using management studio , specifying correct database (not master) confirmed failed connectivity secondary database using login using management studio , specifying correct database (not master) each time attempt connect second login, message "cannot open database master". suspect issue sid login created on secondary not match sid on primary, , user on secondary not linked login. have attempted remedy following: alter user [myuser] login=[mylogin] however, receive message "failed update database [mydatabase] because database secondary database". i've attempted running on primary, succeeds, not have cas

Excel filled data donot clear when sheet is activated -

i have filled combo boxes sheet1 depending 1 values in sheet2 i have wrote vba code such data filled on 1 combo boxes , selection of first combo other combi filled. at first when select sheet1 , selected values in combo 1 , accordingly 2 , 3. but when select sheet 2 , come again sheet 1 selected values reset. want preserve selected values. i have code in sheet activate selectedclient = sheets("2. tss").range("c17").value dim col new collection dim itm dim long dim cellval variant totalrows = sheets("3. bc").usedrange.rows.count = 5 totalrows cellval = sheets("3. bc").range("j" & i).value on error resume next col.add cellval, chr(34) & cellval & chr(34) on error goto 0 next sheets(2).oleobjects("combobox1").object .clear each itm in col .additem itm 'debug.print itm next end thanks, binaya acharya

javascript - Recurring function to reset variable/counter at midnight (moment.js, node.js) -

i want reset variable during midnight. every night. i'm trying build function moment.js node can't seem recurring part work properly. this got far. // calculate time midnight function timetomidnight(){ var midnight = new date(); midnight.sethours(0,0,0,0); var = new date(); var mstomidnight = midnight - now; console.log(' ' + mstomidnight + 'ms until midnight'); return mstomidnight; }; // reset counter @ midnight settimeout(function(){ console.log("midnight, something"); }, timetomidnight()); how can best make recurring @ midnight, every night? thanks in advance. if you're using moment , consider instead implementation var moment = require('moment'); function timetomidnight() { var = new date(); var end = moment().endof("day"); return end - + 1000; } like function, takes now milliseconds , calculates number of milliseconds until midnight, supported directly when us

types - What does `:-` mean in clojure's core.typed? -

what :- mean in this code core.typed library? (t/ann play-many [(ta/chan rpsresult) t/int -> (t/map t/any t/any)]) (defn play-many "play n matches out-chan , report summary of results." [out-chan n] (t/loop [remaining :- t/int, n ;; <======== line results :- (t/map playername t/int), {}] (if (zero? remaining) results (let [[m1 m2 winner] (a/<!! out-chan)] (assert m1) (assert m2) (assert winner) (recur (dec remaining) (merge-with + results {winner 1})))))) as mentioned, :- keyword. however, in context it's part of core.typed 's annotations, marking loop bindings being of specific type: (t/loop [remaining :- t/int, n results :- (t/map playername t/int), {}] ...) this means remaining integer, while results map associating player name integer. these can verified using core.typed 's type checker.

javascript - How to get PHP page returned by a jQuery Ajax request -

so have send data php page, , return me php page based on data. i send data way: $(document).ready(function() { $.ajax({ url: '//www.example.com/page.php', type: "post", datatype: 'jsonp', data: { myvar:myvalue }, success: function(response) { console.log("success."); }, error: function(xmlhttprequest, textstatus, errorthrown) { console.log("error."); }, complete: function() { console.log("complete."); } }); }); it shows alert saying jquery180014405992737595236_1357861668479 not called (numbers copied other question) think reason it's expecting json result page, when it's not. in chrome says uncaught syntaxerror: unexpected token < referring returned php page, assume code isnt expecting kind of file returned. to sum up, works, that jquery alert , console error needs fixed , , think right way handling returned result page. hope guys can me

windows - Print all PID from a tasklist command result -

i trying display pid several processes printed result tasklist command. can me please ? i have issue.when run tasklist /fi "imagename eq javaw.exe" /fi "windowtitle ne jenkins*" result ok. when run taskkill /f /im javaw.exe "windowtitle ne jenkins*" no task found,but exist. checked taskkill /f /fi "imagename eq javaw.exe" "windowtitle ne jenkins*" any ideea why strage behaviour ? i figured out myself. the code bellow print processes pid application (in case : javaw.exe ) for /f "tokens=1,2 delims = " %%a in ('tasklist /fi "imagename eq javaw.exe" ^| find ^"javaw^"') echo %%b my seconds question still has no answer yet.

html - How to parse javascript from web page -

i need links javascript. using jsoup, didn't work. screen need link source of page. can me how it? string url = "http://www.cda.pl/video/149016ec/rybki-z-ferajny-2004-1080p-dubbing-pl"; document doc = jsoup.connect(url).get(); elements scriptelements = doc.getelementsbytag("script"); (element element :scriptelements ){ (datanode node : element.datanodes()) { system.out.println(node.getwholedata()); } system.out.println("-------------------"); } i marked on screen urls want get. you can use code: string url = "http://www.cda.pl/video/149016ec/rybki-z-ferajny-2004-1080p-dubbing-pl"; document doc = jsoup.connect(url).get(); //we pick script node element script = doc.select("#player > script").get(0); string text = script.html(); //then parse script desired uri final string prefix =

Excel version of QlikView 'aggr' function -

Image
i wonder if can me. i’m working excel 365 (with power bi plugins). i have seems simple problem solve through googling have not found answer. my outcome show how many times ‘x’ has been given location.   location table (this pivot table) locations visits x1 2 x2 2 x3 2 x4 2 x5 2 x6 2 x7 2 x8 2 x9 2 x10 2 x11 2 x12 2 x13 2 x14 2 x15 2 x16 2 x17 2 x18 2 x19 2 x20 2 x21 2 x22 2 x23 2 x24 2 x25 4     turn data in ‘location table’ ‘times visited’ table below   times visited table times visited count 2 24 4 1   created table counting how many times ‘2’ , ‘4’ appears in ‘location table’   this shows that: 2 appears 24 times (i.e. 24 x’s have been ‘location 1’ 2 times) 4 appear once (i.e. 1 x has been ‘location 1’ 4 times)   solved using qlikview proving difficult me in excel 2013. in qlikview can use function called ‘aggr’.   have

java - Unable to change button bound during its translation android -

in app i'm translating button position when listview scrolling code below public void onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount, int pageposition) { int scrolly = getscrolly(view); viewhelper.settranslationy(profilebutton, math.max(-scrolly, mmintranslation)); } but i'm having problem. it's not changing bound position staying position before scroll.

Using File Download Control with Java Bean in XPages -

i use standard xpages xp:filedownload control , bind java bean rather document source. i have rtf field in form - 'resourceattachments' - along several other fields in in storing several attachments , nothing else. can provide me example or point me documentation. have similar requirement xp:uploadcontrol, can find samples create new document, struggling implement adding , saving existing documents, guess should post question though, 2 go thought @ least mention here. many thanks. mark public class trainingmodule implements serializable { private static final long serialversionuid = -6998234266563204541l; private string description; private ???? resourceattachments; --something here ?? private string unid; public trainingmodule() { string documentid = extlibutil.readparameter(facescontext.getcurrentinstance(), "key"); if (stringutil.isnotempty(documentid)) { load(documentid); } } public string getunid() {return unid;} public void

php - Symfony2 - Add another custom Symfony2 project as a vendor -

i have 2 symfony2 projets , b. goal add project b project vendor. what did: edited composer.lock file in project include project b vendor: "name": "sciforum/journals_revie_bundle", "version": "dev-master", "target-dir": "sciforum/journalsreview", "source": { "type": "git", "url": "ssh://git@dev.mdpi.lab:22/~/projects/journals_review", "reference": "dc8ea6a551e5d42b972dd302b75d9ce0a26735f3" }, "require": { "php": ">=5.3.3" }, "type": "symfony-bundle", "extra": { "branch-alias": { "dev-master": "2.0-dev" } }, "autoload": { "psr-0": { "sciforum\\journalsreview\\": "" } }, "descript

bash - Can't get wireshark -R working in unix shell -

i following wireshark command working in unix shell (bash). tshark -i host $ip -r 'udp.port == $port' for reason tshark command doesn't see value in $port in between single quotes, variable id $port, script fails. any info appreciated. single quotes stop environment variables being evaluated. change double quotes allow shell expand variable. see following shell expansion differences myport=1234 echo '$myport' echo "$myport"

c# - Iterating an AX 4 Container getting out of range error -

i trying iterate ax container using buisnessconnector. index out of range exception on below code, though container returns count of 4. happens on first iteration of loop. axaptacontainer path = (axaptacontainer)ax.callstaticclassmethod("documenthandling", "itemdata", "1000000"); (int = 0; < path.count; i++) { string somestring = path.get_item(i).tostring(); } i using ax 4 this. i think container starts @ 1. so: for (int = 1; <= path.count; i++) or obvious?

Removing Only Adjacent Duplicates in Data Frame in R -

i have data frame in r is supposed have duplicates. however, there duplicates need remove. in particular, want remove row-adjacent duplicates, keep rest. example, suppose had data frame: df = data.frame(x = c("a", "b", "c", "a", "b", "c", "a", "b", "b", "c"), y = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) this results in following data frame x y 1 b 2 c 3 4 b 5 c 6 7 b 8 b 9 c 10 in case, expect there repeating "a, b, c, a, b, c, etc.". however, problem if see adjacent row duplicates. in example above, rows 8 , 9 duplicate "b" being adjacent each other. in data set, whenever occurs, first instance user-error, , second correct version. in rare cases, there might instance duplicates occur 3 (or more) times. however, in every case, want keep last occurrence. thus, following example above, final data set like a 1 b 2 c

sql - Use includes() instead of joins() with Rails -

i have 2 models invoice , payevents . relationship between them invoice has_many payevents . i'm using following query bills have been paid.: invoice.joins(:payevents).group("invoice.id").having("sum(payevents.amount) >= invoice.amount") this query works fine. however, not optimal since result doesn't include payevents . tried use includes instead of joins doesn't work. invoice.includes(:payevents).group("invoice.id").having("sum(payevents.amount) >= invoice.amount") the error is activerecord::statementinvalid: pg::groupingerror: error: column "payevents.id" must appear in group clause or used in aggregate function any ideas wrong here? i use postgresql , rails 4.1 if correctly understand - should use subquery. this: subquery = invoice.joins(:payevents) .group("invoice.id") .having("sum(payevents.amount) >= invoice.amount")

python 2.7 - tkinter button to open new window and run script -

i have tkinter button want use run existing python script in new cmd window. how that? can new cmd window appear, how run script in it? thanks, chris. multiline code more readable if edit question add (allowed, mark edited , in comment) rather in comment. from tkinter import * sys import executable subprocess import popen, create_new_console import os def delprof(): popen(["cmd.exe"], creationflags=create_new_console) ` if console prompt, can run python or else. run particular python program, following works me (3.4). from tkinter import * subprocess import call pyprog = 'tem2.py' def callpy(): call(['python', '-i', pyprog] ) root = tk() button(root, text='run', command=callpy).pack() root.mainloop() when running program, console disappears when program ends. prevent python program, output can seen, either put like input('hit enter exit') at end of program or start '-i', did above. allows executi

javascript - Stop a For Loop From Repeating in AngularJS -

i'm trying replace html code javascript when user searches email. have working correctly, reason error displays around 20+ times, replace div , "user existuser existuser existuser existuser existuser exist" instead of putting error message once. idea how can fix it? $scope.checkemail = function findusersmatchingemail(emailaddress) { ref.child('users').orderbychild('email'). equalto($scope.emailaddress).once('value', function (snap) { var output = '<div>', myerror = document.queryselectorall('#d'); (var key in arguments[0]) { output += (snap.name() + (snap.val() === null ? ' not' : ' does') + ' exist'); } output += '</div>'; (var = myerror.length - 1; >= 0; i--) { myerror[i].innerhtml = output; } }); }; as wrote in comments, never manipulate d