Posts

Showing posts from April, 2013

typescript - How do I extend a class thats using direct injection -

hopefully should relatively easy question of out there... i trying extend component not sure how deal constructor method of new component. below base component import { component, oninit } '@angular/core'; import { controlsservice } '../controls.service' @component({ moduleid : module.id, selector : 'app-base', templateurl : 'base.component.html', styleurls : ['base.component.css'], providers : [controlsservice] }) export class basecomponent implements oninit { constructor(_controlservice:controlsservice) {} ngoninit() { // console.log(this._controlservice.getcontrolbyid('b5ee385d-1d6a-335a-1e94-2f857428a6fb')) } } and below new component import { component, oninit } '@angular/core'; import { mdtoolbar } '@angular2-material/toolbar'; import { mdicon, mdiconregistry} '@angular2-material/icon'; import { panelcomponent }

javascript - Why are my Divs flashing on screen before hiding? -

i have tabber, , 3/4 tabs should hidden flash on screen before display:none; . i've tried adding .addclass jquery, tried inline styling display:none; on the divs , have display:none set in css file , still can't solve this? causing this? jquery(function($) { $('.professor__tabs').each(function() { $('.tabs__body', this).addclass('tabs__body--is-hidden'); $('.tabs__head', this).on('click', function(index) { var test = $(this).index(); $('.tabs__body').addclass('tabs__body--is-hidden'); $('.tabs__head') .removeclass('tabs__head--is-active') .filter($(this)) .addclass('tabs__head--is-active') .next('.tabs__body') .removeclass('tabs__body--is-hidden'); }) .filter(':first') .click(); }); }); .tabs__body { -webkit-box-flex: 0; -webk

reporting services - SSRS image with expression -

Image
i trying change "red" color in expression embedded image below code can't life of me show image. =iif(fields!lotqty.value = fields!siallocqty.value, "lightgreen", "image1") image should set in backgroundimage section not in backgroundcolor section. can set if value such display color, display lightgreen color, otherwise put nocolor or transparent. in backbroundimage put expression shows either image or nothing (depending on value).

java - Implementation of an abstract class -

i have abstract class want inherit from: public abstract class myfirstclass<k extends comparable<k>, v> implements iterable<mysecondclass<k, v>> { // abstract methods } i'm not sure how write declaration of class extends abstract class. thought like: public class myfirstclassimpl<k, v> extends myfirstclass<object, object> { @override public iterator iterator() { // code } // implementation of abstract methods myfirstclass } but dosen't seem work way , have trouble finding explanation kind of problem. if sub-class should generic, should have same generic parameter declaration base class : public class myfirstclassimpl<k extends comparable<k>, v> extends myfirstclass<k,v> { @override public iterator<mysecondclass<k, v>> iterator() { // code } } otherwise, sub-class shouldn't have generic type parameters @ : public class myfirstclas

javascript - EaselJS: Why does caching make my rendering slower? -

i'm trying improve performance on our canvas (multiple areas) being redrawn on every stage.update() , how works. i'd draw / add single area. can work, previous areas removed because of update . found caching might performance improvement, slows rendering down. example code: self.areamask = new createjs.shape(); self.areamask.graphics.beginfill("#000").drawrect(0, 0, 50, 50); self.areamask.cache(0, 0, 50, 50); the weird part moment enable caching, makes rendering slower. when decrease optional fourth scale parameter 0.1 performance is, slightly, better. i'd understand how possible, doing wrong? is there better way desired behaviour? (only draw / add specified areas, don't redraw areas) caching improve things in browsers, provided: the browser can put content on gpu. if can not, cpu used draw images, can slower. browsers work fine in cases, see opposite effect. example, easeljs cache demo performs worse in safari, despite working bet

css - How to use if else blocks to decide style in Razor? -

i know how format css syle of element in razor given condition using ternary operator, in following example: <div style="@(model.condition ? "float:left" : "float:right")"> but got more complex decision block , should nesting 2 ternary operators, not practice. have tried way: <div style="@{ if (model.condition) { "float:left" } else { "float:right" } }"> and showing error: ; expected after strings inside if-else block, , if add ; still giving error following only assignment, call, increment, decrement, , new object expressions can used statement is there way using if-else blocks? you can declare local variable @ begin of view: @{ var yourstyle = ""; if(model.condition) { yourstyle = "float:left"; } else { yourstyle = "float:right

Codeship restore PostgreSQL database? -

i have small subset of our db dump integration testing. restore using command: pg_restore --no-acl --no-owner --verbose --create -h localhost -p 5435 -j 4 -u $pg_user -d test latest.dump the problem in logs see: pg_restore: connecting database restore pg_restore: processing item 5308 encoding encoding pg_restore: processing item 5309 stdstrings stdstrings pg_restore: processing item 5310 database dlq8aimf0q2pf pg_restore: creating database dlq8aimf0q2pf pg_restore: connecting new database "dlq8aimf0q2pf" pg_restore: connecting database "dlq8aimf0q2pf" user "postgres" as see tries create "dlq8aimf0q2pf" not "test" specified. able database name? env var using name? as said in pg_restore doc --create option : when option used, database named -d used issue initial drop database , create database commands. all data restored database name appears in archive. if have existing database test , want restore it,

deezer - No release date for GET /artist/[id]/albums? -

in context of showing albums of given artist, returned e.g. http://api.deezer.com/artist/13/albums , ..i assume it's pretty common use case want sort albums in discographical order (i.e. release date) display. yet, haven't found way that, release_date property seems available when requesting single album, , haven't found way affect sort order in response. am missing something? any appreciated! thx. we added release_date property on endpoint /artist/[id]/albums . jimmy

Understanding load path in Ruby -

i working library has lot of ruby files generated protocol buffers ruby. the example of require path follows file in /path/to/source_folder/lib_name/level_1/level_2/level_3 require 'lib_name/level_1/level_2/level_3/file_name_1' require 'lib_name/level_1/level_2/level_3/file_name_2' all necessary files , folders contained inside source_folder location. had example been in c++ can run using g++ file_name.cpp -i "/path/to/source_folder" i cannot change every require require_relative , make changes main code cumbersome. trying find simple way run files. i have 2 solution. % tree . . ├── lib │   └── dir1 │   └── dir2 │   ├── a.rb │   └── b.rb └── main.rb % cat a.rb def method_a puts :execute_a end % cat b.rb def method_b puts :execute_b end no.1 add load path sub directories def add_load_path_recursive(dir) dir.glob(dir + "/**/*/").each |dir| $load_path << file.expand_path(dir) end e

c++ - Qt QVector allocation via resize() results in bad_alloc where reserve() seems to work -

so want allocate 1gb of data in qvector. far use this: void foo (float* data, size_t size) { qvector<float> resultvec; resultvec.resize(size); //i stuff on vector size_t paddinglength = nextpow2(size); //calculates next highest power 2 two //the paddinglength in case @ moment: 268.435.456 // results in bad_alloc resultvec.resize(paddinglength); } so in case of floats want reserve 1gb worth of space. should not problem @ all. still have 11gb on ram left. tried @ point in program , works fine, sizes in order of 4gb. my first guess don't have enough continuous space left, when try same reserving space before resizing it, works. void foo (float* data, size_t size) { qvector<float> resultvec; resultvec.resize(size); //i stuff on vector size_t paddinglength = nextpow2(size); //calculates next highest power 2 two //the paddinglength in case @ moment: 268.435.456 //this works tho resultvec.reserve(paddi

winapi - Distributing Win32 Application Practice: Windows Smart-screen compliant -

my winapi c++ program causing windows smart-screen popup (when download try run it). rightly because haven't digitally signed or etc. what things should done winapi application (&/or) installer make windows smart-screen compliant? signing exe & installer signtool or there other things? have purchase/register certificate? can generate own free? other steps produce 'well behaved'/smart-screen compliant win32 application?

report - webkit-region-break-inside dosn't work inside a table row / How suits long text on 2 pages always? -

i want print odoo qweb report long product descriptions. if description doesn't fit on first page, description printed on next page. depends on length of product description. short descriptions start @ page one, long descriptions page 1 start on page two, again extreme long descriptions start @ page 1 , broken automatically , have proper page break. how can change odoo standard qweb report, description starts on page one. adding webkit-region-break-inside table , tr , td or p tag inside td tag didn't solve problem.

swift - iOS Cell Reusing Changing Colors -

Image
i know common problem, researched not find problem. my code: func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let row = indexpath.row let cell1=tableview.dequeuereusablecellwithidentifier(textcellidentifier) as! messagecell cell1.setcell(swiftblogs[row]) return cell1 } messagecell.swift func setcell(message:message) { messagelabel.text = message.text if message.incoming != (tag == incomingtag) { var layoutattribute: nslayoutattribute var layoutconstant: cgfloat if message.incoming { tag = incomingtag bubbleimageview.image = bubbleimage.incoming bubbleimageview.highlightedimage = bubbleimage.incominghighlighed messagelabel.textcolor = uicolor.blackcolor() layoutattribute = .left layoutconstant = 10 } else { // outgoing tag = outgoingtag if message.issent == 1 {

SQL Server - How can I retrieve an ascending count-up of each value in a table, per row? -

not sure how i'd describe want, have table following values: id goodsnumber 1 700 2 701 3 700 4 700 5 701 how can retrieve id numbers (and associated goodsnumbers), along count of occurance of goodsnumber (ordered id), follows: id goodsnumber count 1 700 1 2 701 1 3 700 2 4 700 3 5 701 2 i've tried following doesn't work - gives me total count on each row: select a.id, a.goodsnum, b.count tbl inner join (select goodsnum, count(goodsnum) count tbl group goodsnum) b on a.goodsnum = b.goodsnum sql 2008+ use row_number() select id, goodsnumber, row_number() on (partition goodsnumber order id) [count] yourtable order id to add add subquery select * ( select id, goodsnumber, row_number() on (partition goodsnumber order id) [count] yourtable ) t id = <yourvariable>

dictionary - Merge dictionaries from multiple lists in Python -

i have 3 list multiple dictionaries inside. list1 = [{'question': u'fan offline information can found on screen under general menu? '}, {'question': u'what tool f5 bigip packet traces. '}, {'question': u'on http health monitor configuration. if receive string , disabling string matched , reverse enabled. status of pool members?'}] list2 = [{'answer': u'systeminfoscreen'}, {'answer': u'qkview'}, {'answer': u'offline'}] list3 = [{'correct_answer': u'systeminfoscreen'}, {'correct_answer': u'tcp dump'}, {'correct_answer': u'disabled'}] how can combine 3 list result similar this? [{'question': u'what tool f5 bigip packet traces. ', 'answer': u'qkview', 'correct_answer': u'tcp dump'}] another option if above problem not achievable list1 = ['fan offline information can found on screen u

angular strap - AngularStrap Typeahead with async call double popup -

i'm using angularstrap typeahead async call in webapplication , i'm noticing strange behaviour: when select 1 entry list selected value correctly displays in typeahead, popup disappears shortly after new popup comes out displaying 1 entry, 1 selected. happens async calls, , issue happens on official angulastrap showcase page . notice not-async calls working properly. has faced , solved issue? thank you.

ios - send POST request with body dictionary in afnetworking 3.0 -

this question has answer here: afnetworking 3.0 migration: how post headers , http body 10 answers i want ask how send post request body using afnetworking 3.0. appreciated! from afnetworking's github : nsmutableurlrequest *request = [[afhttprequestserializer serializer] multipartformrequestwithmethod:@"post" urlstring:@"http://example.com/upload" parameters:nil constructingbodywithblock:^(id<afmultipartformdata> formdata) { [formdata appendpartwithfileurl:[nsurl fileurlwithpath:@"file://path/to/image.jpg"] name:@"file" filename:@"filename.jpg" mimetype:@"image/jpeg" error:nil]; //set request body here } error:nil]; afurlsessionmanager *manager = [[afurlsessionmanager alloc] initwithsessionconfiguration:[nsurlsessionconfiguration defaultsessionconfiguration]]; nsurlsessionupl

python - How to efficiently compare rows in a pandas DataFrame? -

i have pandas dataframe containing record of lightning strikes timestamps , global positions in following format: index date time lat lon fix? 0 1 20160101 00:00:00.9962692 -7.1961 -60.7604 1 1 2 20160101 00:00:01.0646207 -7.0518 -60.6911 1 2 3 20160101 00:00:01.1102066 -25.3913 -57.2922 1 3 4 20160101 00:00:01.2018573 -7.4842 -60.5129 1 4 5 20160101 00:00:01.2942750 -7.3939 -60.4992 1 5 6 20160101 00:00:01.4431493 -9.6386 -62.8448 1 6 8 20160101 00:00:01.5226157 -23.7089 -58.8888 1 7 9 20160101 00:00:01.5932412 -6.3513 -55.6545 1 8 10 20160101 00:00:01.6736350 -23.8019 -58.9382 1 9 11 20160101 00:00:01.6957858 -24.5724 -57.7229 1 actual dataframe contains millions of rows. wish separate out events happened far a

java - How do I put numbers in a generic list? -

so made generic list , accept strings if cast them (t). here's code: package dz06; import java.util.arraylist; import java.util.list; public class exersise04<t> { public static void main(string[] args) { new exersise04(); } public exersise04(){ list<t> list = new arraylist<>(); list.add((t)"hello"); list.add((t)25); } } this gives me error when want add int 25 if cast (t). if it's generic list shouldn't take whatever give it? please help, in advance you cannot cast primitive int (t), try cast integer (t) list.add((t)((integer)25)); (you can cast primitive int integer ((integer)25) because of automatic boxing .)

mysql access via mysql command works while via mysqldump does not for same user -

i have brandnew mysql instance deployed , i'm attempting port elements development environment production enviroment. i created user , granted privileges. this user can access database command line using: mysql -u oper -p mydb and create tables, insert, delete, truncate, etc. now, use command mysqldump create script generate tables (and insert initial contents of them). now, i'm trying inject script new database using command: mysqldump -u oper -h localhost -p mydb < tables_only.sql and i'm getting error: got error: 1045: access denied user 'oper'@'localhost' (using password: yes) when trying connect. when querying granted privileges: show grants 'oper'@'localhost' ; +-----------------------------------------------------------+ | grants oper@localhost | +-----------------------------------------------------------+ | grant usage on *.* 'oper'@'localhost'

ios - Async image loading from url inside a UITableView cell - image changes to wrong image while scrolling? -

- (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; tvcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier forindexpath:indexpath]; if (cell == nil) cell = [[tvcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; cell.txtlabel.text = [[[arraydata objectatindex:indexpath.row] valueforkey:@"description"]stringbytrimmingcharactersinset:[nscharacterset whitespaceandnewlinecharacterset]]; cell.imglabel.contentmode = uiviewcontentmodescaleaspectfill; cell.imglabel.image = nil; nsurl *url = [nsurl urlwithstring:[nsstring stringwithformat:@"%@",[enclosureurlarray objectatindex:indexpath.row]]]; nsurlsessiontask *task = [[nsurlsession sharedsession] datataskwithurl:url completionhandler:^(nsdata * _nullable data, nsurlresponse * _nullable response, nserror * _nullable err

sql - Stored procedure has too many arguments specified C# -

i have sql server stored procedure like: alter procedure p_updatecampaigngadget @campaignid nvarchar(max), @accountnumber nvarchar(max), @phone01 nvarchar(max), @callresult nvarchar(max), @callstatuszone1 nvarchar(max), @callstatuszone2 nvarchar(max), @callbackdatetime01 nvarchar(max), @firstname nvarchar(max), @campaignenddatetime nvarchar(max) and code like: <asp:sqldatasource id="sqldatasource2" runat="server" connectionstring="<%$ connectionstrings:ccap_ccconnectionstring %>" selectcommand="p_showcampaigncontacts" selectcommandtype="storedprocedure" updatecommand="p_updatecampaigngadget" updatecommandtype="storedprocedure"> <selectparameters> <asp:querystringparameter defaultvalue="lab_outbound_c1_c" name="campaignid" querystringfield="id" type="string" />

node.js - Redirect to a URL fragment resets session on Chrome (Node/React/React-Router) -

i have app using node on backend , react (with hash history) on front end. this means api endpoint urls like: https://example.com/api/login and react endpoints fragments root: https://example.com/#/somepage after logging user in (through oauth2) want redirect user specific url fragment within react spa. my first thought doing have server redirect me url fragment. my route handler looks like: app.get('/oauthcallback', (req, res) => { req.session.token = 'some token' redirect('/#/someloggedinpage') } in safari works fine , further api requests made spa have share same req.session , therefore have token , can make authenticated downstream requests. however, in chrome, upon redirection next api request causes creation of new session, losing token , preventing authenticated requests succeeding. everything works fine when redirect api endpoint (not in spa). it not work if redirect / , root of spa. i'm wondering if there don&#

class - Segmentation Fault Accessing Singleton C++ -

overview i writing helper class make calls redis easier xredis drivers in c++, continually receiving segmentation fault upon requesting or sending information instance. i think has way i'm storing xredis , redisdbidx instances, , possibly way i'm storing redisadmin instance within main application, i'm unable see right way set these after several attempts. relevant code below, , few notes on debugging steps have taken myself. debugging notes redis server started successfully, , log output shows successful connection server on instance startup the call fails whether set or exists command sent server gdb output shows below, , logs show same happenning on either exists or set calls: program received signal sigsegv, segmentation fault. redispool::getconnection (this=0x0, cahcetype=0, dbindex=0, iotype=0) @ src/xredispool.cpp:124 124 || (iotype>slave) code redis_admin.h #include "xredis/xredisclient.h" #include <string.h> #inc

java - How to check enable or disable status from Google Fit -

when user disable google fit, want app check status whether google fit enabled or disabled. have found code disable app. public void disablegooglefit(){ if(!mclient.isconnected()){ log.e(tag, "google fit wasn't connected"); return; } pendingresult<status> pendingresult = fitness.configapi.disablefit(mclient); pendingresult.setresultcallback(new resultcallback<status>() { @override public void onresult(status status) { if(status.issuccess()) { log.i(tag, "google fit disabled"); }else{ log.e(tag, "google fit wasn't disabled " + status); } } }); } how detect when intent invoked? you can check google's getting started documentation, here code sample in document: if (mclient == null && checkpermissions()) { mclient = new googleapiclient.builder(this) .addapi(fitness.sensors_api) .add

matplotlib - How can I visualize a 3D volume with Python? -

similar how there's vol3d matlab, how can visualize 3d-array in python? i'm working matplotlib i'll take whatever works. mayavi has api 3d plotting in python

android - Calendar in Listview -

i want calendar in listview. have taken gridview inside listview not able populate different months .without using time square lib want achieve this. android scrollable calendar full year public class listviewcalendaradapter extends baseadapter { string [] result; context context; private static layoutinflater inflater=null; public listviewcalendaradapter(selectdateactivity selectdateactivity, string[] numberlist) { // todo auto-generated constructor stub context=selectdateactivity; result=numberlist; inflater = ( layoutinflater )context. getsystemservice(context.layout_inflater_service); } @override public int getcount() { // todo auto-generated method stub return result.length; } @override public object getitem(int position) { // todo auto-generated method stub return position; } @override public long getitemid(int position) { // tod

Objective c post with json data request to server -

i trying post data server , send data json this data: {"userid":"aaaaa","token":"12345","type":"bbb","version":"45"} here image nsdictionary *requestdictionary = @{@"data" : @{ @"{userid" : @"aaa", @"token ": @"12345",@"type":@"ios",@"version":@"1}"}}; nsurl *urls =[nsurl urlwithstring:[nsstring stringwithformat:@"http://url/send_code"]]; self.request = [[nsmutableurlrequest alloc]init]; [self.request seturl:urls]; nsstring *contenttype = [nsstring stringwithformat: @"application/json"]; [request addvalue:contenttype forhttpheaderfield: @"content-type"]; [request sethttpmethod:@"post"]; [request addvalue:@"ios" forhttpheaderfield: @"x-application-platform"]; [request setvalue:@&quo

python - Filling NAN data with mode() doesn't work -Pandas -

i have data set in there series known outlet_size contain either of {'medium', nan, 'high', 'small'} around 2566 records missing thought fill mode() value wrote : train['outlet_size']=train['outlet_size'].fillna(train['outlet_size'].dropna().mode()] but when tried find number of missing nan record command sum(train['outlet_size'].isnull()) it still showing 2566 nan records.why ? thank answers the problem here mode returns series , causing fillna fail, if @ simple example: in [194]: df = pd.dataframe({'a':['low','low',np.nan,'medium','medium','medium','medium']}) df out[194]: 0 low 1 low 2 nan 3 medium 4 medium 5 medium 6 medium in [195]: df['a'].fillna(df['a'].mode()) out[195]: 0 low 1 low 2 nan 3 medium 4 medium 5 medium 6 medium name: a, dtype: object so can

vba - Issue in TextToColumns with xlFixedWidth loosing blanks -

i trying implement way parse many fixed width formats (hundreds of them) simple vba macro. the software generates these formats provides me neat description of them parsed follows: fd1 fd2 fd3 fd4 -- -- -- -- 2 3 3 5 aaccc fuuuuu aahhh fggggg 55hhh fvvvvv 55hhh--lvvvvv ppnnn lvvvvv ppjjj--lddddd mock data created make tests reproduce issue. notice data can or cannot preceded (or succeeded) character, including spaces. wrote following (very naive , non reviewed) code: sub loopparser() const sizesrow = 3 const datastart = "a4" dim tocut tocut = 0 range(datastart).select until isempty(activecell) tocut = activesheet.cells(sizesrow, activecell.column).value call parseonefield(activecell.address, cint(tocut)) activecell.offset(0, 1).select loop range(datastart).select end sub sub parseonefield(targetcell, desiredsize integer) const maxlayout = 10000# range(targetcell).select

Generic ID type for "Clean Architecture" Go program -

i trying find proper type ids in go program designed using uncle bob martin's "clean architecture". type userid ... type user struct { id userid username string ... } type userrepository interface { findbyid(id userid) (*user, error) ... } i following uncle bob martin's " clean architecture ", code organized set of layers (from outside-in: infrastructure , interfaces , usecases , , domain ). 1 of principles dependency rule: source code dependencies can point inwards . my user type part of domain layer , id type cannot dependent on database chosen userrepository ; if using mongodb, id might objectid ( string ), while in postgresql, might use integer. user type in domain layer cannot know implementing type be. through dependency injection real type (e.g. mongouserrepository ) implement userrepository interface , provide findbyid method. since mongouserrepository defined in interfaces or infrastructure layer, can depend on definit

azure mobile services - Could not install MobileAppsManagement Site Extension -

i'm having problem microsoft azure. more specifically, i'm not able mobile app , running after creation , deployment. when enter "quick start" in mobile apps settings, error saying " could not install mobileappsmanagement site extension " followed "settinlistpart" , "microsoft_azure_mobileservices". i'm not able initialize backend. i have dreamspark subscription (student) active. have had no problems earlier, , occurred moved on free trial dreamspark subscription. (free trial disabled/inactive) this seems same or similar problem, however, find no similar solution. in azure mobile app quick start don't display result as long site f1 free in app service plan (which difference trial service), there should no problems. steps troubleshooting: go site, settings, scale down , ensure f1 free chosen you might have cached permissions issue - hard refresh of browser / clear cache.

ios - Quickblox Profile Pic issue in swift -

i developing chat application using quickblox api chat . able send , receive messages profile picture of sender missing. if knows please me how fetch sender image messages. you can profile pic using below code : nsuinteger userprofilepictureid = user.blobid; // user - instance of qbuuser class // download user profile picture [qbrequest downloadfilewithuid:userprofilepictureid successblock:nil statusblock:nil errorblock:nil];

my login in php doesn't work properly -

i trying login page in php, , have no errors, says "username missing" , "password missing" if aren't. here code, doing wrong? connection.php <?php $mysql_hostname = "localhost"; $mysql_user = "root"; $mysql_password = ""; $mysql_database = "simple_login"; $prefix = ""; $bd = mysqli_connect($mysql_hostname, $mysql_user, $mysql_password, $mysql_database) or die("could not connect database"); ?> login_exec.php <?php //start session session_start(); //include database connection details require_once('connection.php'); //array store validation errors $errmsg_arr = array(); //validation error flag $errflag = false; //function sanitize values received form. prevents sql injection function clean($bd,$str) { $str = @trim($str); if(get_magic_quotes_gpc()) { $str = stripslashes($str); } return mysql

c++ - Migration from QScriptEngine to QJSEngine -

i'm migrating qscriptengine code on qjsengine. now, have: class pars { public: static qscriptvalue printmainlog(qscriptcontext* c, qscriptengine* e); }; qscriptvalue pars::printmainlog(qscriptcontext* c, qscriptengine* e) { //some actions return e->globalobject().property(""); } ... qscriptengine engine; ... engine.globalobject().setproperty("printlog",engine.newfunction(pars::printmainlog)); so, user can put printlog("what ever"); in application in , example, qlineedit , function pars::printmainlog evalute. is there way qjsengine? so, user put same printlog("what ever");? way find here , user should put logger.printlog("what ever"); logger class inherited qobject printlog slot.

html - How to center text in menu excluding icon? -

Image
i have menu centered text in it, want add icons 2 of menu bookmarks. wanted them on left, used "float: left" text moved little bit right because of icon. i'll show on pictures: - this: - it's this: - , want that: i cant come clever idea solve problem in simple way :/ html: <ul> <li><a href="ofirmie.php" <?php if ($choosen == 0) {echo ' class="current" ';} ?> > <img src="structure/home.png" class="icon"> home</a></li> <li><a href="oferta.php" <?php if ($choosen == 1) {echo ' class="current" ';} ?> >oferta</a></li> <li><a href="realizacje.php" <?php if ($choosen == 2) {echo ' class="current" ';} ?> >nasze realizacje</a></li> <li><a href="kosze.php" <?php if ($choosen == 3) {echo ' class=&

c# - ContentPresenter layout pass -

Image
i trying profile wpf application (to speed listview displaying complex multi-column datatemplated items). , have problem understand figures in application timeline report: description says: here column template (xaml): <gridviewcolumn header="header"> <gridviewcolumn.celltemplate> <datatemplate> <stackpanel> <stackpanel orientation="horizontal"> questions: what means "element" type of timeline item? layout pass (as understand it) or else? why sum of children ( 1 child = 0.33 ms) not equal total time (7.82 ms) ? what contentpresenter doing 7.5 ms?

c++ - Error when multiplying matrices with armadillo library (CodeBlocks) -

am trying multiply 2 small matrices cant code compile #include <iostream> #include <armadillo> using namespace std; using namespace arma; int main() { mat a1(1,2) ; a1.ones(); mat theta1(6,1); theta1.randn(); mat tool = trans(theta1); mat z1= tool*a1; //cout<<z1<<endl; cout<<theta1<<endl; } i following errors ||=== build: debug in tutorialpp (compiler: gnu gcc compiler) ===| obj\debug\main.o||in function zn4arma4blas4gemvideevpkcpkis5_pkt_s8_s5_s8_s5_s8_ps6_s5_':| d:\downloads\armadillo-7.200.1b\armadillo-7.200.1b\include\armadillo_bits\wrapper_blas.hpp|36|undefined reference to wrapper_dgemv_'| obj\debug\main.o||in function zn4arma4blas4gemmideevpkcs3_pkis5_s5_pkt_s8_s5_s8_s5_s8_ps6_s5_':| d:\downloads\armadillo-7.200.1b\armadillo-7.200.1b\include\armadillo_bits\wrapper_blas.hpp|71|undefined reference to wrapper_dgemm_'| ||error: ld returned 1 exit status| ||=== build failed: 3 error(s), 0 warning(s) (0 minute(s), 6

php - Paypal IPN and wordpress failure -

i have website accepting paypal ipn's paypal. site wordpress website, on shared enviroment, have customized. using ipn simulator fails on webservice listener ipn succeeds base url. why can not receive success on webservice , log data? using browser , hitting below webservice write logfile. using ipn simulator never writes logfile. ssl access logs never receive post ipn http does. access log @ bottom hitting https://example.example.org/wp-content/plugins/myplugin/controllers/payments/ipn fails ipn simulator. "ipn not sent, , handshake not verified. please review information." hitting https://example.example.org/ succeeds in hitting ipn sent , handshake verified. core::error("in ipn function"); // step 1: read post data // reading posted data directly $_post causes serialization issues array data in post. // instead, read raw post data input stream. $raw_post_data = file_get_contents('php://i

gpgpu - Options for GPU computing in Julia -

i considering buying gpu card experiment gpu computing in julia. see there 2 options: nvidia or amd chipsets. my question is: there recommended option use julia? new gpu computing, focus more on ease of use on performance, can imagine current julia packages serve gpu interfaces determine answer. i use windows 7 based system. appreciated. a few points: 1) arrayfire pretty easy use gpu platform julia interface ( https://github.com/juliagpu/arrayfire.jl ). works both nvidia , amd gpus. 2) if want things go beyond in arrayfire, there more support nvidia cards through cuda c language proprietary nvidia. can see list of gpu packages julia here . you'll see, many more of them cuda opencl, c version works writing kernels work on either nvidia or amd. but, know if go route, you'll need start writing own kernels in c. in opinion, cuda c has convenient automation features automatically handle aspects of distributing work amongst cores in efficient way. cuda

php - Place variable into value attribute -

i have problem, system work need place php variable (function prefer) value attribute in html form, possible? may different way cope problem. <input type="hidden" name="sum" value="<?php $payment ?>"> <input type="hidden" name="account" value="<?php $acc ?>"> <input type="hidden" name="desc" value="<?php $info ?>"> use echo set value: <input type="hidden" name="sum" value="<?php isset($payment) ? $payment : '' ; ?>"> <input type="hidden" name="account" value="<?php isset($acc) ? $acc : '' ; ?>"> <input type="hidden" name="desc" value="<?php isset($info) ? $info : '' ; ?>">

What is Angular 2 RC angular2-in-memory-web-api? -

what angular2-in-memory-web-api? i've seen references in angular.io documentation code seems work without it. it's used demos only: for example get heroes scenario work without webapi, loading demo data json file, want save data too. can't save changes json file. need web api server. the in-memory web api not part of angular core. it's optional service in own angular2-in-memory-web-api library installed npm (see package.json) , registered module loading systemjs (see systemjs.config.js) the in-memory web api gets data custom application class createdb() method returns map keys collection names , values arrays of objects in collections.

profile - Access SD card data from android for work app -

my emm vmware airwatch, , have setup android work environment , installed work profile on nexus 5x device. work apps not able access sd data, or files stored on external storage. i have tried creating , installing android work profile. in airwatch console under profiles have enabled 'sync , storage' options under restrictions section of work profile. is expected behaviour of work apps. primary feature of application access sd card data. please me out, if missing something. after long conversation airwatch support team, have confirmed in work profile enrolled device, not able access sd card data work application, , per design.

xaml - Command Bar in Windows Phone -

Image
i using command bar in windows phone using below code <page.bottomappbar> <commandbar foreground="white"> <commandbar.primarycommands> <appbarbutton x:uid="share"> <appbarbutton.icon> <bitmapicon urisource="/assets/share.png"/> </appbarbutton.icon> </appbarbutton> <appbarbutton icon="favorite"></appbarbutton> <appbarbutton icon="comment"></appbarbutton> </commandbar.primarycommands> </commandbar> </page.bottomappbar> i getting footer icon below out background. icon image showing. but need footer icon rounded background each icon foreground white please guide me achieve expected try follow below: 1) open page in blend want modify. click on actual contro

c# - Do Roles and Profiles in ASP.NET MVC3 need changing when porting to MVC5? -

i've created project using asp.net mvc3 , want port mvc5. uses membership, roles , profiles authenticate users, common in mvc3. however, understand mvc5 uses identity system instead of membership. therefore, need update membership logic when porting mvc5. brings me question: same apply roles , profiles? need make changes them in order make them compatible mvc5? if so, links further information appreciated (unless need know can condensed brief stackoverflow answer :p). roles part of identity system. profiles own responsibility, implement using own user class in identity. so yes, have work do.