Posts

Showing posts from June, 2012

qt - What does the c++ class access keyword "signals" mean? -

i came across declaration similar (names changed per nda ): class foo { int bar; public: explicit foo (fu *parent = null); private: void somefunc (string); signals: // ??? ??? void windowclosed(); }; this compiled g++ 4.4.7 (from 2012). additionally, vim recognizes keyword similar public , private highlighting them in brown. (dis)similiarly, vim uses green highlight keywords namespace , class , void , int , double , float , char , unsigned , etc. the stackoverflow code formatter not highlight signals above public , private ! it has proved quite difficult google (lots of noise), haven't found mentioning it, not on so. looked in enhancements section of g++ documentation. this codebase large (23+ million lines), oldish (~1998), , has distinct accent. example, same class definition has class access private slots: before 2 member functions. possible there #define obfuscation or trickery going on, can't find using grep . possi...

swift - Push to UINavigationController from AppDelegate via remote notification -

my initial view controller tab bar controller, in tab controller there several uinavigationcontrollers, in 1 of uinavigationcontrollers modal presented uinavigationcontroller created flow of uiviewcontrollers. i need respond received remote notification in app delegate pushing 1 of “deepest” parts of view hierarchy. i can recreate uinavigationcontroller , launch proper uiviewcontroller name, leaves user high , dry no other place go. is there way user proper flow of navigation? the way got work, in didreceiveremotenotification method of app delegate: let roottabbarcontroller = self.window?.rootviewcontroller uitabbarcontroller let mainstoryboard : uistoryboard = uistoryboard(name: "main", bundle: nil) let firstnavigationcontroller = mainstoryboard.instantiateviewcontrollerwithidentifier("firstnavvc") uinavigationcontroller roottabbarcontroller.viewcontrollers![0] = firstnavigationcontroller let vcontrollerforfirstnavcontroller = (roottabbarco...

Change position of Columns In Excel file using C# -

hello , i'm using microsoft.office.interop in c#. there easy way change columns position of excel worksheet. example: position of first column 1. position of second column 2. . . . position of tenth column 10. what need change position, example : position of first column 5. thanks in advance response. try this.. // cut column c , insert a, shifting columns right excel.range copyrange = xlws.range["c:c"]; excel.range insertrange = xlws.range["a:a"]; insertrange.insert(excel.xlinsertshiftdirection.xlshifttoright, copyrange.cut());

r - Trouble relying on third party package imports in my package -

my package uses ggplot2 extensively make custom plots. import ggplot2 in namespace file. can build, install, , load package r without errors. when call function package, complains can't find function in imported package. function called had absolute nothing plotting , didn't make use of ggplot2 . how can make function calls package work without these types of errors? error in theme_beata() (from plot.r#14) : not find function "theme_classic" the first function erroring is: #' custom ggplot2 theme beata #' @import ggplot2 #' @family themes #' inheritparams ggplot2::theme_classic #' @export theme_beata <- function(base_size = 14, base_family="serif", ticks = true) { ret <- theme_classic() + theme(axis.line = element_line(size=0.6), axis.text = element_text(size = base_size), axis.title = element_text(size= base_size + 2), title = element_text(size=base_size + 4)) if (...

Piping cmd output to variable in PowerShell -

i have following in powershell script: cmd /c npm run build-release $succeeded = $lastexitcode what i'd is: pipe output of cmd variable doesn't write host only if $succeeded eq $true , write-host output variable cmd how can done? use invoke-expression : $output = invoke-expression "cmd /c npm run build-release" $succeeded = $lastexitcode if($succeeded -eq 0) { write-output $output }

How to find the mode of an array using Java -

i'm trying find mode program, user inputs amount of numbers 0-100 many want, i'm attempting find mode of these numbers each time attempt find mode gives me 3, i've found else, need mode. import java.util.scanner; public class deveation { public static void main(string args[]) { scanner kbreader = new scanner(system.in); int sum = 0; int bob[] = new int[101]; int total = 0; int = 0; int min = 0; int max = 100; int mode = 0; boolean stay_in_loop = true; while (stay_in_loop) { system.out.println("please enter interger(s) 0-100: "); int number = kbreader.nextint(); if (number < 0) { stay_in_loop = false; } else { total++; bob[number]++; } } int median = total / 2 + 1; while (median > 0) { median -= bob[a]; ...

java - What is the best way to convert an absolute path name to be used as sub-path? -

i writing backup program using java , save files , directories backup destination based on absolute path names of sources. the backup program supposed work under different operating systems (unix, windows, mac os x), need convert absolute pathnames of source files , directories. so @ end convert absolute source path regular sub-path of destination. let me give examples. unix absolute source path: /home/thomas/data destination path: /backup effective destination: /backup/home/thomas/data windows absolute source path: c:\documents , settings\thomas destination path: e:\backup effective destination: e:\backup\c\documents , settings\thomas i use string replacement operations expect run several trouble , start never ending correction story. i think windows environment needs special handling because of leading drive letters. under *nix concatenate 2 paths. note source path unc-path under windows \\share\data. i have searched around , found several similar questions no...

php - Merging combining arrays if certain key/values matches in an array -

let's have array looks this: array ( [0] => array ( [id] => 44091 [epid] => 109912002 [makes] => honda [models] => civic [years] => 2000 [trims] => [engines] => 1.6l 1590cc 97cu. in. l4 gas sohc naturally aspirated [notes] => ) [1] => array ( [id] => 77532 [epid] => 83253884 [makes] => honda [models] => civic [years] => 2000 [trims] => [engines] => 1.6l 1595cc l4 gas dohc naturally aspirated [notes] => ) [2] => array ( [id] => 151086 [epid] => 109956658 [makes] => honda [models] => civic [years] => 1999 [trims] => [engines] => 1.6l 1590cc 97cu. in. l4 gas sohc naturally asp...

html - Positioning a div between two buttons -

Image
i'm trying have remote control buttons, , div playing info between 2 of them. but doesn't work. as can see, on actual ipad, renders differently, , don't know how fix it. html: <div id="buttons"> <button id="prev" class="control" onmousedown="skip('prev')"></button> <div id="info"> gfegrbhthehrerhg</div> <button id="next" class="control" onmousedown="skip('next')"></button><br /> <button id="rwd" class="control" onmousedown="changespeed(-2)"></button> <button id="stop" class="control" onmousedown="emitcommand('stop')"></button> <button id="play" class="control" onmousedown="emitcommand('play: loop: true speed: 100')"></button> <button id="ffwd" class="con...

xaml - WPF: DatePicker text centered vertically -

Image
i using datepicker in app defined such: <datepicker width="200" margin="20, 20, 20, 0" selecteddate="{binding periodenddate, mode=twoway}" /> here how date picker displayed: how can date (4/22/2015) center vertically in textbox (the dotted line around date actual textbox boundary)? i have tried setting both verticalcontentalignment , verticalalignment center doesn't affect date centering. if dig date picker using snoops can see element called part_textbox within datepicker . if change part_textbox verticalcontentalignment center , text centered (is set stretch default). however, not know how access subcomponent change it's verticalcontentalignment

angularjs - ng-repeat add style on querystring -

i trying add class active on list of li elements being generated angularjs if current li key field equal id parameter in querystring. kind of behavior: foreach person in people { if person.id = urlparameter.id { writeline <li id=person.id class="active">person.name<li/> } else { writeline <li id=person.id class="">person.name<li/> } } the first issue how return value of query string parameter , secondly how use add in ng-repeat add class conditionally. appreciated this answer shows how url parameters then if have $scope.people , $scope.idfromurl defined in controller html should want <li ng-repeat="person in people", ng-class="{'active':person.id==idfromurl}" > {{person.name}} </li>

exchangewebservices - EWS call using Managed API 2.2 never returns -

i'm using ews managed api v2.2 make ews calls. @ 1 of customers, have weird situation service calls, service call, never receives response. we setting explicit timeout, surrounding service calls logging , using ews trace listening. listener show ewsrequest soap message, , that's it. logging shows "before service call" log entry not "after service call" entry. i suspected throttling might behind , have temporarily removed ews throttling limits no effect , in case, expect error response if throttling kicking in. this how service initialised: public exchangewebservice(string username, string password, string emailaddress, string exchangeurl, string exchangeversion) { exchangeversion exversion = (exchangeversion)enum.parse(typeof(exchangeversion), exchangeversion); _exchangeservice = createexchangeservice(username, password, emailaddress, exchangeurl, exversion); _exchangeservice.timeout = 30000; } private static exchanges...

java - TOMCAT 7, Can't change the heap size -

i have set heap size of tomcat 7 adding boot script: export catalina_opts="-xms1024m -xmx248m" i change /etc/init.d/tomcat7 : if [ -z "$java_opts" ]; java_opts="-djava.awt.headless=true -xmx2048m -xms1024m" fi i reboot computer , restart tomcat: service tomcat7 restart and verify $catalina_opts works: > echo $catalina_opts -xms1024m -xmx2048m but when go tomcat manager, note heap has not changed. free memory: 38.02 mb total memory: 123.75 mb max memory: 123.75 mb please, need this. check setenv.sh in tomcat/bin , according manual should right place put params. another option, depend on os tomcat package, may config param overrided in /etc/conf.d/tomcat/ or /etc/tomcat . check init script , catalina.sh find settings overrided. btw if run ps -ef | grep tomcat should see full command line arguments: may give idea of how init script build command, , can investigate params set.

looking for a data structure that support relation m-m between two concepts -

Image
i looking data structure model following relations between 2 concepts type , entity. number of entity , type more 100 million. the direction of arrow show need access type entity , reverse. i looking n efficient data structure; otherwise implemented 2 maps: (type,entities) , (entity, types) you can use bipartite graph model type of data adjacency list representation. you want efficient data structure, type of operations need perform on data? see this operations , time complexities. for adjacency list implementation, nodes can represented in array. node name->index number mapping can stored lookup table. reference here .

jsf ajax process different parts of form -

i have detected strange behaviour of ajax: i have 1 form ajax-components (e.g. buttons or textfields ajax-submit on focuslost). when process e.g. first textbox, fine in backing bean (viewscoped). when process second textbox seconds later, values first submit lost completely, , second value in backing bean. is normal?

.net - Azure websites (Standard) SSL certificate -

i've scaled azure website standard instance. azure's pricing tier standard says comes "5 sni ssl , 1 ip ssl included @ no cost". i'd set ssl binding custom domain using 1 of these supposed "certificates". however, cannot find on azure portal pointing me 1 of these certificates. option upload certificate. wrong in thinking azure includes or provides these certificates in standard mode? or "5 sni ssl , 1 ip ssl included @ no cost" mean "ssl slots", still have purchase certficates? for custom domain still have purchase own ssl certificate, https supported on non custom domains no cost ("websites provides ssl connections urls under 'azurewebsites.net' domain @ no additional charge. securely access website @ https://.azurewebsites.net.") this link show how add custom ssl once you've bought domain.

security - Java jersey importing packages -

i'm trying remake solution found here basic http authentication jersey / grizzly i've included these imports far import javax.ws.rs.webapplicationexception; import javax.ws.rs.container.containerrequestfilter; import javax.ws.rs.core.response; import javax.ws.rs.core.httpheaders; import javax.ws.rs.core.response.status; and after search included one import org.glassfish.jersey.server.containerrequest; my problem these errors ... authfilter not abstract , not override abstract method filter(containerrequestcontext) in containerrequestfilter ... method not override or implement method supertype ... cannot find symbol [error] symbol: method getheadervalue(string) [error] location: variable containerrequest of type containerrequest and code if don't want switch tabs here @override public containerrequest filter(containerrequest containerrequest) throws webapplicationexception { // automatically allow requests. string...

mysql - Warning: mysqli_fetch_row() expects parameter 1 to be mysqli_result, null given in C:\wamp\www\widget_corp\data_base.php -

i trying select data mysql table, warnings: notice: undefined variable: result in c:\wamp\www\widget_corp\data_base.php on line 40 and one: warning: mysqli_fetch_row() expects parameter 1 mysqli_result, null given in c:\wamp\www\widget_corp\data_base.php on line 40 this code: $connection = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname); // test if connection occured if (mysqli_connect_errno()){ die ("database connection failed: " . mysqli_connect_errno() . " (" . mysqli_connect_errno() . ")" ); } // perform database query $query = "select * subjects " ; $resut = mysqli_query($connection, $query); // test if there query error if (!$resut){ die ("database connection failed!"); } // use return data if while ($row = mysqli_fetch_row($result)){ //output data each row var_dump($row); echo "<hr />"; }...

php - SQLite Alternatives -

i looking alternative sqlite. have application has lighttpd built , serves php scripts interact multiple instances of application. architectural questions aside, reason, person wrote chose use sqlite database php scripts -- store , retrieve information scripts themselves. such, appears have locking issues. deal programmer used stuff this: $executed = $storedb->exec($updatesql); while($executed === false && $i<10) { $storedb->close(); $storedb = new sqlite3('c:/path/path2/lighttpd/store.db'); $pragmadb = "pragma journal_mode=wal"; ($storedb->exec($pragmadb)); $executed = $storedb->exec($updatesql); $i++; } i understand why sqlite chosen can copied on , over, not need installed server, , small. however, multiple instances of application hitting php scripts, concurrently, can see causing problems: information retrieval operations fail , data not updated. warnings in log this. an update statement [07...

javascript - primefaces jquery ui tabs -

context : trying use jquery ui plugins (tabs , dialog) in primefaces application directly javascript (due requirement). problem : getting 'length undefined' , 'undefined not function' errors on calls. more specifically, $("#id").tabs() throwing error. what did : search in stackoverflow; checked $.fn.* , $.ui.* in console; surprisingly lot of ui plugins available (datepicker, droppable, selectable) dialog , tabs seem missing. $.ui.version 1.11.3. tried using outputscript , directly <script> tags include jquery ui, none seemed include these plugins; tried noconflict. additional info : worked @ point intermittently.. not sure caused work , preventing working now. spent lot of time troubleshooting this. advance time , shall drop additional info if required. primefaces contains customized (subset) of jquery-ui components. others have added you. , make sure use them compatible version. compatible jquery version primefaces uses. including...

ruby - Execute Javascript in Sinatra -

i searched lot can't seem find clear answer how execute javascript code via sinatra, symply renders code html me. here tried far : require 'sinatra' set :public_folder, 'public' class dashboard < sinatra::base '/' send_file file.join(settings.public_folder, 'javascripts/index.js') # renders code html '<script type="text/javascript" src="index.js"></script>' # nothing '<script>alert("hello, world !")</script>' # works correctly end end figured out, path in src must : <script type="text/javascript" src="javascripts/index.js"></script>

javascript - How to set JSON result to 'src' of 'img' to show an image in ASP.NET MVC4? -

i’ve got absolute path of image in json format ajax @ view. looks like: var addresimg=data.result.sourcefile;//address 'd:/jqueryfileuploadmvc4/mvc4appl/app_data/1.png' however, view cannot render image attribute “src” image should like: <img src="@url.content("~/app_data /" + "1.png")" /> but src of view is: // not correct address of image should address server js: <script type="text/javascript"> $(document).ready(function () { $('#fileupload').fileupload({ datatype: 'json', url: '/home/uploadfiles', autoupload: true, done: function (e, data) { var addresimg=data.result.sourcefile;//address 'd:/jqueryfileuploadmvc4/mvc4appl/app_data/1.png'' $(".file_source").attr('src', data.result.sourcefile);//it sets absolute path , incorrect. image iddress should src="@url.content("~/app_data /...

ios - Black bars simulating iPhone 5 - Xcode -

when running iphone 5 simulator 2 black bars appear making resolution of iphone 4(s). question is: how able use full screen resolution? (it creates black bars around app when trying simulate ipad) now, know questions has been answered multiple times here on stackoverflow, of them give solution of adding default-568h@2x.png launch image. want make use of launchscreen.xib instead of creating seperate launch screen images. anyone got solution this? thanks! - merijn you must use specific launch image take account 4" inches screens... or either way can use specific launch screen autolayout constraint example if don't want add many launch images : http://useyourloaf.com/blog/2014/12/24/using-a-launch-screen-storyboard.html

java - Creating GUI with using border layout Swing -

Image
i'm trying create gui java. gui simple. can see want here : http://sketchtoy.com/64839370 in order that, have decided use borderlayout suggested on web. have 2 jpanel object , have put them jframe layout borderlayout. can see simplified code below : private display display= new display(); // display extends jpanel public simulation() { super(); // frame settings settitle("label of jframe "); setdefaultcloseoperation(exit_on_close); setbounds(100,100,1094,560); contentpane=this.getcontentpane(); setresizable(false); contentpane.setlayout(new borderlayout()); try { leftpanellogo=imageio.read(new file("logo.png")); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } // generate left panel (information panel) leftpanel=new jpanel(){ @override public voi...

ajax - how to include js file using asset on yii2 advanced template -

i have folowoed following guide http://www.yiiplayground.com/yii2/web/index.php?r=ajax/index how can include js file using assets. following file have created under /frontend/assets <?php namespace frontend\assets; use yii\web\assetbundle; class ajaxasset extends assetbundle{ public $basepath = '@frontend'; public $baseurl = '/view'; public $css = [ ]; public $js = [ 'ajax/ajax.js', ]; public $depends = [ 'yii\web\yiiasset', 'yii\bootstrap\bootstrapasset', ]; } ?> i have managed make work updating following //public $basepath = '@webroot'; //public $baseurl = '@web'; public $sourcepath = '@frontend/views/ajax'; however having problem javascript file. views/ajax/ajax.js 'reportsviewdone': function (response) { // called link attribute 'data-on-done' => 'simpledone' console.dir(response); $('#css3buttons...

aes - WM-Bus extended layer decoding -

i trying decrypt wm-bus telegram kamstrup multical21 in c1 mode extended link layer. payload ell info following: 23 44 2d 2c 45 45 71 63 1b 16 8d 20 6a 31 fb 7c 20 39 a3 79 60 4b 90 bd fc 8d d8 cb 18 ce 77 dc 41 ce 8c analysing ci = 8d found there ell following data: ci (1 byte) cc(1 byte) acc(1 byte) sn(4 bytes) crc(2 bytes) 8d 20 6a 31 fb 7c 20 39 a3 the documentation says buffer should decrypted shall contain crc ell, i.e: 39 a3 79 60 4b 90 bd fc 8d d8 cb 18 ce 77 dc 41 ce 8c i have got aes key manufacturer: b9 7a 6d 4e c2 74 a4 6d 87 0e 31 27 d9 a0 af 63 initialization vector ell shall be: m-field a-field cc-field sn-field fn bc 2d 2c 45 45 71 63 1b 16 20 31 fb 7c 20 00 00 00 after decrypting, following result: 08 3a 5f ce b2 8d 51 97 94 a2 5b fb 61 ab 2e c0 e4 20 c8 2a 43 ff 3a 75 6f 93 d0 ac 8c 79 b7 a1 since there no 2f 2f in beginning, wrong! can me , t...

android - Apktool build fails due to Translation error -

Image
i took apk file decompiled using apktool , made few changes tried recompiled , got error. aapt: warning: string 'auth_client_needs_enabling_title' has no default translation in c:\users\dell\android-sdks\platform-tools\magesimi\simicart_com.magestore.simicart_2.0_5\res; found: af ar bg ca cs da de el en_gb en_in es es_us et_ee fa fi fr fr_ca hi hr hu hy_am in iw ja ka_ge km_kh ko lo_la lt lv mn_mn ms_my nb nl pl pt pt_br pt_pt ro ru sk sl sr sv sw th tl tr uk vi zh_cn zh_hk zh_tw zu aapt: warning: string 'auth_client_needs_installation_title' has no default translation in c:\users\dell\android-sdks\platform-tools\magesimi\simicart_com.magestore.simicart_2.0_5\res; found: af ar bg ca cs da de el en_gb en_in es es_us et_ee fa fi fr fr_ca hi hr hu hy_am in iw ja ka_ge km_kh ko lo_la lt lv mn_mn ms_my nb nl pl pt pt_br pt_pt ro ru sk sl sr sv sw th tl tr uk vi zh_cn zh_hk zh_tw zu aapt: warning: string 'auth_client_needs_update_title' has no default translat...

c# - How to update client endpoint binding in code -

i have question modifying client endpoint binding in code. have added web service reference , created client endpoint binding it. in web.config binding set basic https, want change ex. http, have specified in web.config under name "basichttpbinding". when create instance of web service reference, there no way of using address , binding there not constructor takes such arguments. <endpoint address="http://localhost/localservice/sendrequest.asmx" binding="basichttpsbinding" bindingconfiguration="basichttpsbinding" contract="localservice.sendrequest" name="localserviceclient" /> any advice how solve problem appreciated. cheers! var binding = new system.servicemodel.basichttpbinding() { name = "localserviceclient", namespace = "localservice.sendrequest" }; var endpoint = new system.servicemodel.endpointaddress("http://localhost/localservice/sendrequest.asmx"); var cl...

Delphi 7 - Not Enough Actual Parameters -

i'm new delphi 7, in forum , i've questions. i have converted url string hex using jorlen young's function strtohex - advanced encryption standard (aes) interface unit v1.3 !. but, when implement function encryptstring , got error @ bottom of code: encrypt := encryptstring('www.website.com'); following messsage: [hint] unit1.pas(xx): variable 'st' declared never used in 'encryptstring' [error] unit1.pas(xx): not enough actual parameters [fatal error] project1.dpr(5): not compile used unit 'unit1.pas' could give me tips in how implement "key" , "keybit" option syntax: encrypt := encryptstring('www.website.com'); ? i appreciate help. ...here code : ..................... ..................... type tkeybit = (kb128, kb192, kb256); ..................... ..................... procedure idmappedporttcp1execute(athread: tidmappedportthread); private { private declarations ...

python - Rolling argmax in pandas -

i have pandas timeseries , apply argmax function rolling window. however, due casting float rolling_apply, if apply numpy.argmax() , obtain index of slice of ndarray. there way apply rolling argmax series/dataframe? series.idxmax() or series.argmax() both return timestamp object pandas.rolling_apply(series, window=10,func=lambda x: pandas.series(x).idxmax()) return float64. edit: here example: import pandas pd import numpy np import pandas.io.data web import datetime start = datetime.datetime(2001,1,1) end = datetime.datetime.today() close = web.datareader('aapl','yahoo',start,end).close close = close / close.shift(1) - 1 close.resample('w-mon').idxmax() # timestamp object close.resample('w-mon').argmax() # timestamp object pd.rolling_apply(close.resample('w-mon'), window=52, func=lambda x: pd.series(x).argmax()) a working way be ix = pd.rolling_apply(close, window=52, func=np.argmax) ix = np.where(np.isnan(ix),0,ix...

android - if condition of string and editText -

i'm newbie in android programming. , i'm being confused of error in line saying, "incompatible operand types edittext , string" the usertype variable spinner while user variable edittext if((usertype.getselecteditem()=="administrator")&(user=="1500110001")) { login(); } hope newbie here. thank in advance! change usertype.getselecteditem() usertype.getselecteditem().gettext() , compare strings equals() , , change & && (for reasons mentioned @nicholassimon), this if(usertype.getselecteditem().gettext().equals("administrator") && (user.equals("1500110001"))

javascript - Div auto scroll (Mobile) -

i need able make div scroll left right , move start or bounce , loop over. although when 'app' selected scrolling stops. the version want scroll can found @ etreecycle.co.uk on web making page mobile size or viewing site on small device. the basic layout is; <div id="scroll-me"> // scroll when page less 650px wide. <div id="app-wrapper"> // changes width make contence responcive, 3240px wide , 270px high when scrolling. <div id="app"></div> // apps have hover tag, when hovering scrolling needs stop. (or click on mobile device.) <div id="app"></div> <div id="app"></div> <div id="app"></div> <div id="app"></div> <div id="app"></div> </div> </div> is there way make work on mobile device? thank you.

ios - How to send sms programatically in background without open sms popup? -

i want send sms functionality in background without open popup sms any framework or sdk that i have used ctmessagecenter ( coretelephony framework) not working code: bool success = [[ctmessagecenter sharedmessagecenter] sendsmswithtext:@"test 1234..." servicecenter:nil toaddress:@"+1234567890" withmoretofollow:no]; if(success){ nslog(@"message sent"); }else{ nslog(@"message not sent"); } any other way pls let me know. no, don't allow sending sms or email without user interaction, trick, rejected

javascript - jQuery/Ajax - Trying to create a POST method by Ajax and get response to HTML -

guys i'm trying create simple html post method ajax. here code: <?php function callinstagram($url) { $ch = curl_init(); curl_setopt_array($ch, array( curlopt_url => $url, curlopt_returntransfer => true, curlopt_ssl_verifypeer => false, curlopt_ssl_verifyhost => 2 )); $result = curl_exec($ch); curl_close($ch); return $result; } $tag = mage::getstoreconfig('vivastags/vivasgroup/instagra_tag'); $client_id = "1e0f576fbdb44e299924a93cace24507"; $next_url = $_get["nexturl"]; if($next_url == ""){ $url = 'https://api.instagram.com/v1/tags/'.$tag.'/media/recent?client_id='.$client_id.'&count=24'; } else { $url = $next_url; } $inst_stream = callinstagram($url); $results = json_decode($inst_stream, true); $maxid = $results['pagination']['next_max_id']; $nexturl = $results['pagination...

html - unable to position div at bottom of another div -

am trying position div in bottom of div unable that <div class="div"> <img src="dual.png"/> <h1>boot cd or usb drive on pc</h1> <div>footers</div> </div> css .div{ float:left; height:300px; width:22%; margin-top:15px; margin-left:15px; background-color: #e4f2ff } .div img{ width:100%; height:180px; } .div h1{ font-size:20px } .div div{ background:red; float: bottom; position: absolute; bottom: 0; } here jsfiddle trying make design http://i.stack.imgur.com/cdgky.png can me how position div @ bottom of parent div.. in advance display:table : http://jsfiddle.net/j1raqvc8/4/ .div { float:left; height:300px; width:22%; margin-top:15px; margin-left:15px; background-color: #e4f2ff; dis...

css - Selenium IDE, identify row in table based on 3 columns -

i trying find row in table contains specific values on 3 columns. i have tried methods in @paul trmbrth's answer find xpath identify cell in table based on other column . worked fine 2 columns, didn't worked 3. didn't find example cases more 2 values. vehicle category | category | subcategory | exteriors | badges | exteriors | badges | exteriors | mirrors | interiors | wheels | interiors | rears want cell combination contains: a | exteriors | mirrors i have tried no success: //tr[contains(td[1], 'a')]/td[2][contains(., 'exterior')] td[3][contains(., 'mirror')] //tr[contains(td[1], 'a')]/td[2][contains(., 'exterior')] /td[3][contains(., 'mirror')] css=tr([td:contains('a')][td:contains('exterior')][td:contains('mirror')]) css=tr([td:contains('a')][td:contains('exterior')][td:contains('mirror')]) can...

haskell - Ambiguous type variable with Haskeline auto-completion -

i'm trying implement autocompletion function haskeline : import system.console.haskeline import system.console.haskeline.io import data.list mysettings :: settings io mysettings = defaultsettings { historyfile = "myhist" , complete = completeword nothing " \t" $ return . search } keywords :: [string] keywords = ["point","line","circle","sphere"] search :: string -> [completion] search str = map simplecompletion $ filter (str `isprefixof`) keywords main :: io () main = inputline <- initializeinput mysettings putstrln "done" but bit disappointed ghc error : ambiguous type variable `t0' in constraint: (control.monad.io.class.monadio t0) arising use of `defaultsettings' probable fix: add type signature fixes these type variable(s) i set type each function didn't solve pr...

mysqldump - mysql get the columns sum and also get the distinct values at a time -

i have data base this id project_id client_id price 1 1 1 200 2 2 1 123 3 2 1 100 4 1 1 87 5 1 1 143 6 1 1 100 7 3 3 123 8 3 3 99 9 4 3 86 10 4 3 43 11 4 3 145 12 4 3 155 now here want sum price columns same client_id. made query this select `project_id`, sum(`price`) `table-name` group `client_id` this 1 doing sum price getting 2 project_id in result. want result should distinct project client id , price summed group clients. can tell me how this? , suggestions appreciable. thanks you should not have "bare" column in group by query not in group by statement. if want list of projects, can ...

topology - Kafka Spout fails to acknowledge message in storm while setting multiple workers -

i have storm topology subscribes events kafaka queue. topology works fine while number of workers config.setnumworkers set 1. when update number of workers more 1 or 2, kafkaspout fails acknowledge messages while looking @ storm ui. might possible cause, not able figure out, exactness of problem. i have 3 node cluster running 1 nimbus , 2 supervisors. my problem got resolve. reason being kafka unable acknowledge spout message conflict hostname. had mistakenly same host name in /etc/hostname , /etc/hosts file of both workers. when check worker able exception - unable communicate host. there figured out, problem was host name .i updated host name in etc/hosts mapping , /etc/host name file. message started acknowledged. thank you.

javascript - Mean js - display updates in real time -

i'm new meanjs , created new module adding products. these products displayed in home page. display in home page not getting updated real time . added new product in 1 tab, , products list in other tab need refreshed see change. how can done @ real time ? edit: by updation meant is, when ever new record been added database, product display should update in realtime. need refresh page see newly added product. code is client $http.get('/latestproducts'). success(function(data, status, headers, config) { $scope.latestproducts = data; }) server exports.getlatestproducts = function(req, res) { product.find().sort('-created').populate('user', 'displayname').exec(function(err, products) { if (err) { return res.status(400).send({ message: errorhandler.geterrormessage(err) }); } else { res.jsonp(products); } }); ...

r - Subset data.frame based on a column that matches a separate vector -

this question has answer here: filtering data.frame 5 answers once again stumped here. i have data.frame of 4 columns: col1 col2 col3 col4 1 1.lsm 0.43 0.34 2 1.lsm 0.47 0.30 3 1.lsm 0.27 0.85 1 2.lsm 0.35 0.55 2 2.lsm 0.71 0.46 3 2.lsm 0.53 0.37 4 2.lsm 0.63 0.34 col1 cell number cells have been tracked on time. i have vector containing integers pertaining cells want keep: keep=c(3, 4) now, want use vector "keep" decide rows of data.frame kept , output new data.frame columns keep relevant rows. i.e. ideal output here be: col1 col2 col3 col4 3 1.lsm 0.27 0.85 3 2.lsm 0.53 0.37 4 2.lsm 0.63 0.34 you can try df[df$col1 %in% keep, ] # ...

php - Cakephp retrieves pages over limit -

i'm using cakephp 1.3 paginator, works fine, except this: if have 5 pages, accessing kind of url http://example.com/blog/5 i'll last page, if access to http://example.com/blog/10 i last page. want not retrieve values, since not valid page. my configuration this: var $paginate = array( 'post' => array( 'limit' => 10, 'order' => array('post.id' => 'desc') ) ); $posts = $this->paginate('post'); well, that's unfortunately how works until cakephp 2.3 , , it's buried in middle of controller::paginate() method: https://github.com/cakephp/cakephp/blob/1.3.20/cake/libs/controller/controller.php#l1214-l1215 // ... if ($page === 'last' || $page >= $pagecount) { $options['page'] = $page = $pagecount; // ... so pretty have 1 option, calculate page count , use validate current page.

java - iText: Why the last item of an unordered html bullet list is not showing on my PDF? -

Image
i'm following itextpdf example http://itextpdf.com/sandbox/htmlworker/htmlcontentforcell . i'm facing problem where, whenever there bulletlist in html-content i'm parsing elements , filling pdfcell with, else shows fine in except last item missing. cause that? i have following code: // relevant code main part of class: bytearrayoutputstream baos = new bytearrayoutputstream(); document document = new document(pagesize.a4, 40, 40, 40, 40); pdfwriter writer = pdfwriter.getinstance(document, baos); document.open(); document.add(buildcontent()); document.close(); // method should provide content document. public pdfptable buildcontent() throws ioexception { infolist infolist = infolistinstance.get(); pdfptable table = new pdfptable(2); (infolistmessage message : infolistlist.getmessages()) { rendermessagemetadata(message, table); rendermessagecontent(message, table); } return table; } // method pr...

r - How to code a multiplicative ARIMA (non-consecutive lags) -

i'm working weekly data , based on form of typical seasonal multiplicative arima, want fit following process time series: y_t = phi* y_t-1 + phi* y_t-52 + phi* phi* y_t-53 + e_t i want obtain coefficients phi, phi, , residuals (e's). i unaware of packages or functions , have been trying use arima() while shutting off ma , differencing components keep restricted ar. isn't capturing process above. in advance!

oz - How to use absolute values in Mozart? -

i'm trying absolute value of expression z=:x-y it's not working. here code: declare pso proc {pso w} x y z w in x=5 y=2 z=:y-x w=:abs(z) w=w(w:w) {fd.distribute ff w} end {exploreone pso} i know i'm doing wrong , how fix it. i noticed things: in first line can omit pso , declaring writing body. can't understand code @ all, abs function, have write w = {abs z} obtain absolute value of z in w . compiles, it's not clear me goal is. hope helped.

WebDriver: Why latest versions of Eclipse and Selenium Server is not compatible with latest version of Firefox -

i tried execute script in webdriver following latest versions of eclipse, selenium server , firefox, firefox gets executed , script not execute further: eclipse luna service release 2 (4.4.2) selenium jar selenium-server-standalone-2.45.0 firefox 36.0.4 , firefox 38 beta version however, when used firefox 32.0, scripts runs completely. what technical reason behind non-compatibility of latest firefox version latest eclipse , selenium jar? please see here in changelog. seems mozilla has rewritten of there apis not available selenium relied on this. changelog v2.45.0 important changes in release: native events in firefox relied on api mozilla no longer provides. such, fall synthesized events on recent firefox versions. i have been looking latest firefox version supported. other people have found same problem , rolling using v35.0.1 see here

python - Save multiple objects in same model using tastypie in a Django project -

i have django project following model: from django.contrib.auth.models import user class installedapps(models.model): user = models.foreignkey(user) app_package_name = models.charfield(max_length=50) i'm using tastypie create post api endpoint, user can post multiple objects installedapps model in single api call: class installedappsresource(modelresource): class meta: queryset = installedapps.objects.all() resource_name = 'apps' authorization= authorization() authentication = authentication() #validation = installedappsvalidation() list_allowed_methods = ['post', 'get'] always_return_data = true def hydrate(self, bundle): usrname = bundle.request.meta['http_authorization'][7:].split(':')[0] usr = user.objects.get(username__exact=usrname) if not bundle.obj.pk: bundle.obj.user = usr return bundle when try post e...

javascript - Wordpress theme, best way to find code location -

so have wordpress theme & need replace logo upon scrolling down. should simple enough after hours of sifting through code , testing, no dice. could tell me best way view front end of production website , follow code through correct location in files/code? i using filezilla & notepad ++, have followed file names , searched elements. thank in advance. all theme files located in /wp-content/themes/your-theme-name/ go folder current, active theme - can either search elements after inspecting them in browser, or can learn little wordpress template hierachy can expect find block/snippet of code trying edit.

iphone - Is there such a thing as Localized Images for Cocos2dx? -

i wish localize iphone game. i understand text in app can automatically changed different language. how image? some of text displayed in our app in form of images. is there way can app display different images based on different locales. thanks.

windows - npm hangs on any command -

Image
i installed last version of node.js (12.2 x64 windows) after run cmd administrator , try call npm command (except npm -v) cmd window hanging. after ctrl+c returns terminate batch job (y/n)? i trying left cmd several hours didn't give results. strange because node.exe process consuming cpu , memory quite hard. i trying reinstall node.js several times without success. can't debug information. i faced such issue on vm using connecting via rdp. same version installed on laptop works ok. on vm had kaspersky antivirus, after switching off got same result. did face such issue? there way more information problem? please recommend me way resolve? i've resolved issue. according suggestion our local read me file node.js (with npm) note: on windows server machines, instead of node modules been installed @ user %appdata% path, better install @ global path e.g c:\npm. acheived npm command: $ npm config set prefix 'c:\npm' not required on individual de...

Transparent plot area of heatmap using highcharts -

how make heatmap's plot area transparent. remove white blocks in chart , make transparent, background colors visible. refer fiddle $(function () { $('#container').highcharts({ chart: { type: 'heatmap', margintop: 40, marginbottom: 40, backgroundcolor: { lineargradient: { x1: 1, y1: 0, x2: 0, y2: 1 }, stops: [ [0.23, 'rgb(240, 59, 9)'], [0.5, 'rgb(255, 224, 80)'], [0.67, 'rgb(54, 64, 207)'], [0.99, 'rgb(13, 163, 35)'], [1, 'rgb(217, 186, 50'] ] }, }, title: { text: 'sales per employee per weekday' }, xaxis: { categories: ['alexander', 'marie', 'maximilian', 'sophia', 'lukas', 'maria', ...

java - Getting OauthException using Restfb latest version 1.9.0 -

we using restfb latest version 1.9.0. after migrating latest version unable fetch posts using public search. how make access token active. > active access token must used query information i getting following error while running code github run-reader-examples: [java] * fetching single objects *30 mar, 2015 6:51:05 pm com.restfb.defaultwebrequestor execute [java] [java] fine: making request https://graph.facebook.com/me?access_token=517312558337191%7c5ohy9t3czico_tcek8odxkg5y08&format=json [java] 30 mar, 2015 6:51:09 pm com.restfb.defaultwebrequestor execute [java] fine: facebook responded http status code 400 , response body: {"error":{"message":"an active access token must used query information current user.","type":"oauthexception","code":2500}} [java] exception in thread "main" com.restfb.exception.facebookoauthexception: received facebook error response of...