Posts

Showing posts from May, 2013

optimization - Optimize SHA256 checking in php -

i have sha256 hash text, , know original text string , consist of 0-9 numbers , letters a-z, a-z in range (000000-zzzzzz) . this code checks possible options, , returns original text code working long time (for example if string length 5 works 30 minutes, case if length 6 works 30*62 minutes ) , think not best solution case. please optimize it. $count=0; $start_date =microtime(true); $s=array(0,1,2,3,4,5,6,7,8,9,"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","a","b","c","d","e","f","g","h","i","j","k","l","m","n",&

ios - Swift unexpectedly found nil while unwrapping an Optional value in TableView -

i know question asked many times,but not getting hint or answer those.actually new in swift.i created viewcontrollerr subclass of uitableviewcontroller .when click on table row or cell in didselectrowatindexpath method getting error fatal error: unexpectedly found nil while unwrapping optional value . trying push viewcontroller. class sidemenucontroller: uitableviewcontroller { override func viewdidload() { super.viewdidload() } override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { print("row \(indexpath.row) selected") switch indexpath.row { case 0: break case 1: let vc = addvaluevc(nibname: "addvaluevc", bundle: nil) //following line giving error self.navigationcontroller!.pushviewcontroller(vc, animated: false) break default: break } } } since not using uinavigationvie

centrifuge - Exchange files through centrifugo -

is possible exchange files through centrifugo messaging server? have read many pages of documentation , didn't find words it. hope should possible. А почему нет то? Делаете загрузку файла, а в загрузке уже передаете в нужный канал ссылку на скачивание файла

algorithm - K-Means for diagonal clusters -

Image
i have 2 clusters lie along 2 lines on 3d surface: i've tried simple kmeans algorithm yielded above separation. (big red dots means) i have tried clustering soft k-means different variances each mean along 3 dimensions. however, failed model this, presumably cannot fit shape of diagonal gaussian. is there algorithm can take account data diagonal? alternatively there way "rotate" data such soft k-means made work? k-means not prepared correlations. but these clusters reasonably gaussian me, should try gaussian mixture modeling instead.

javascript - Issue with video tag . poster is not visible after video call ends -

initially poster visible before video call start after video call ends able see black background in place of poster in video container. below html tag have used purpose. <div id="videosmall"> <video id="videoinput" autoplay width="240px" height="180px" poster="img/webrtc.png"></video> </div> i have tried reset "videoinput" div code var tag = $("#videoinput").clone(); $("#videoinput").replacewith(tag); this code works , brings poster image issue when performing video call again without refreshing page .. poster not vanishing in order show video . you can adding ended eventlistener video element, , call video load() again. here working example: codepen html: <video id="video" width="320" height="240" controls poster="http://www.w3schools.com/images/w3html5.gif"> <source src="http://www.w3school

.net - Entity Framework 6 Command Tree Interceptors for SELECT query -

i implemented base audit class , inherit other classes it. public abstract class audit { public datetime createddate { get; set; } public string createdby { get; set; } ... } public class batch : audit { ... } i want use base ef approach prevent select audit fields database. use audit fields analyse , don't want read application. write context.select in each query bad , not general variant. i found information idbcommandtreeinterceptor. how can exclude createddate , createdby fields select-only queries on interceptor side? how select batches without audit fields without implicit specify on each context query?

c# - .net localization - throw exception in hebrew on englisch operating system -

i have application translated hebrew besides english , german. to check user input, created validation rule throws argumentoutofrangeexception if value exceeds it's limits. public override validationresult validate(object value, cultureinfo cultureinfo) { double validationvalue = 0; validationvalue = double.parse(value.tostring()); if(validationvalue < min) { argumentoutofrangeexception ex = new argumentoutofrangeexception(); return new validationresult(false, ex.message); } else if(validationvalue > max) { argumentoutofrangeexception ex = new argumentoutofrangeexception(); return new validationresult(false, ex.message); } return new validationresult(true, null); } the validation working. however, if set application language hebrew using cultureinfo.defaultthreadcurrentculture , cultureinfo.defaultthreadcurrentuiculture english exception. setting language german or english, correct exception message. operating system windo

Java - sending email via javamail and using SSL -

i trying send email on ssl, have certificate , have imported cacerts file. assumed default, java cacerts file in java_home, or in jdk specified project. not case , set system property keystore , truststore point path cacerts found, did in following way: system.setproperty("javax.net.ssl.keystore", java_home + "\\jre\\lib\\security\\cacerts"); system.setproperty("javax.net.ssl.truststore",java_home + "\\jre\\lib\\security\\cacerts"); system.setproperty("javax.net.ssl.keystorepassword", password); system.setproperty("javax.net.ssl.truststorepassword", password); this doesn't work either, after specifying path keep getting following error: caused by: sun.security.validator.validatorexception: pkix path building failed: sun.security.provider.certpath.suncertpathbuilderexception: unable find valid certification path requested target i have read numerous posts on here (stackoverflow) , other websites , can&

c++ - Fast rounding function with variable precision? -

currently use following macro rounding: my_round(inval,numdig) (((double)(int)((inval)*pow((double)10,numdig)+cnco_sign(inval)*0.5))/pow((double)10,numdig)) here inval input double rounded , numdig number of digits (=accuracy) round for. due divisions , pow()'s function quite slow. so: there better replacement not waste time? thanks! this solution: const double pow_table[] = {1, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9}; const double inv_pow_table[] = {1, 1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6, 1e-7, 1e-8, 1e-9}; #define my_round(inval,numdig) (floor((inval)*pow_table[numdig]+0.5)*inv_pow_table[numdig])

javascript - Group multiple overlapping timeblocks that may not have a direct overlap -

i trying group timeslots overlap can't figure out how exactly. i have pretty simple array in form of [{start_at: date, end_at: date, etc.etc. }] and lay them out in view this <---slot1----><----slot5----><--slot6--> <--slot2-><--slot4---> <--slot7--> <----slot3----> finding directly overlapping slots isn't hard, compare slot next 1 (starta <= endb) , (enda >= startb) from here . now want group overlapping slots (slot 1, 2, 3, 4 , 5) not include slot 6 , 7, , put 2 in own group. [[slot (has 1 through 5)][slot (has 6 , 7)]] i kind of lost problem right , hope here can me. i'd suggest creating slot object holds: an array of items in slot, the earliest start_at date of items, the latest end_at of items. by keeping date slot-range, don't have compare new item each of slot's items. you'll have compare slot itself. now, you'll have sort items start_at . can r

c# - WPF Secondary window snapshots main window -

Image
an wpf project has mainwindow holding multiple books (in case one). the pencil icon in fact button creating new instance of bookedit window , showing it. clicking should show following (and used so). my issue recently, secondary window starts snapshotting mainwindow , showing portion of part of window: and keeps doing when move window: why happen? issue gpu/whatever? cannot test software on device. i removed zindex solution. edit 1: it should noted books mainwindow generated behind using children.add button newbutt = new button(); newbutt.background = null; newbutt.setresourcereference(control.styleproperty, "booktoolbarbutton"); newbutt.click += new routedeventhandler(filehandler.editbook); image pencil = new image(); pencil.source = new bitmapimage(new uri("pack://application:,,,/images/pencil.png")); newbutt.content = pencil;

Modifying a closed excel sheet with VBA -

i trying open 1 spredsheet isn't in view. change column format of 1 of columns date using texttocolumns feature. changes should saved , file closed automatically. when run following says no data selected parse. thoughts? sub test() dim xlapp new excel.application dim xlwb excel.workbook dim xlws excel.worksheet xlapp.visible = false set xlwb = xlapp.workbooks.open("directory of file") set xlws = xlwb.worksheets("sheet 1") xlws.unprotect xlws.columns("f:f").select selection.texttocolumns destination:=range("f1"), datatype:=xldelimited, _ textqualifier:=xldoublequote, consecutivedelimiter:=false, tab:=true, _ semicolon:=false, comma:=false, space:=false, other:=false, fieldinfo _ :=array(1, 4), trailingminusnumbers:=true set xlws = nothing xlapp.displayalerts = false xlwb.close true set xlwb = nothing xlapp.quit set xlapp = nothing end sub a bit of research should have given result, prov

Scraping linkedin public profile with selenium and phantomjs in Python -

i try getting body of https://www.linkedin.com/pub/dir/paul . on local, work under ubuntu 14.04 x86_64 x86_64 x86_64 gnu/linux, phantomjs 2.1.1 , selenium 2.53 , python 2.7 , script works fine. when send script server debian jessie x86_64 gnu/linux (with same version of phantomjs, selenium , python local), there nothing under body tag of document. this code main.py from selenium import webdriver selenium.webdriver.common.by import selenium.webdriver.support import expected_conditions ec selenium.webdriver.support.ui import webdriverwait import sys def initial(nom): #browse linkdin url url = "https://www.linkedin.com" browser = webdriver.phantomjs(service_args=['--ssl-protocol=any', '--load-images=no', '--ignore-ssl-errors=true']) browser.get(url) #set first name input value inpt = webdriverwait(browser, 10).until( ec.visibility_of_element_located((by.name, "first&q

css - Selecting class inside element:first-child -

i'm trying make simple pie, circle divided in 4 pieces: <ul class='pie'> <li class='slice'> <div class='slice-contents'></div> </li> <li class='slice'> <div class='slice-contents'></div> </li> <li class='slice'> <div class='slice-contents'></div> </li> <li class='slice'> <div class='slice-contents'></div> </li> </ul> i have css: .pie { position: relative; margin: 1em auto; border: dashed 1px; padding: 0; width: 32em; height: 32em; border-radius: 50%; list-style: none; } .slice { overflow: hidden; position: absolute; top: 0; right: 0; width: 50%; height: 50%; transform-origin: 0% 100%; } .slice-contents { po

Wordpress: Pre-path mode for a multilanguage solution ("/en/", "/de/") -

i need have pattern in url on whole website control language shown. pattern www.website.com/en/permalink should generate variable $lang="en". i have tried different approaches add_rewrite_rule , add_rewrite_endpoint or adding rewrite rules via add_filter('rewrite_rules_array') , using preg_match to generate actual pattern $_server['request_uri'] . had on plugins qtranslate need sourcecode complex me understand. after all, dont understand how in way, best approach achieve this? the language pattern has stay in url on whole page, in qtranslate , f.e. after clicking menu-link pattern has shown in url again. the solution has seo-friendly. if aren't confident doing this, quickest way wpml (wordpress multi-language) plug-in.

highlight - Solr patternreplacefilterfactory gives unmatching values -

i setup field type configured as <fieldtype name="text" class="solr.textfield" positionincrementgap="100"> <analyzer type="index"> <charfilter class="solr.patternreplacecharfilterfactory" pattern="#(\w+)" replacement="htag.$1 $1"/> <tokenizer class="solr.uax29urlemailtokenizerfactory"/> <filter class="solr.commongramsfilterfactory" words="stopwords.txt" ignorecase="true"/> <filter class="solr.stopfilterfactory" ignorecase="true" words="stopwords.txt" enablepositionincrements="true"/> <filter class="solr.lowercasefilterfactory"/> </analyzer> <analyzer type="query"> <charfilter class="solr.patternreplacecharfilterfactory"

SQLAlchemy Python 3 Ubuntu 16.04 -

i can't seem install newest version of sqlalchemy in python 3. similar questions asked on stackoverflow pre-2016 , talk older distributions of ubuntu, hence again question. system ubuntu 16.04 python 2.7.12 (default if call python in terminal) python 3.5.2 tried if follow instructions documentation ( http://docs.sqlalchemy.org/en/rel_1_0/intro.html#installation ) pip install sqlalchemy , installs python 2.7 ( sqlalchemy.__version__ : 1.0.15). pip install python3-sqlalchemy not exist. sudo apt-get install python3-sqlalchemy installs sqlalchemy in python3, sqlalchemy.__version__ gives 1.0.11 question how latest version of sqlalchemy python3 directory, preferably without building source? pip installing python 2 packages. install pypi package python 3, need use pip3 : pip3 install sqlalchemy

class - Swift. Use extended property type in subclass -

i need extended property in subclass, code doesn't compile. protocol { } protocol b: { } protocol c: { } class base { var presenter: a? } class left: base { override var presenter: b? } class right: base { override var presenter: c? } how implement on swift 2? you can't override or change property type in swift, casting might you. check left class in code example: protocol { } protocol b: { } protocol c: { } class base { var presenter: a? } class left: base { init(persenter : b?) { self.presenter = presenter } func test() { print(presenter as! b) } } class right: base { var presenter: c? //won't compile }

How to assign dynamic value in angularJs Md Tab "ng-disabled"? -

i'm using angularjs md-tab there approx 10 tabs want enable , disable tags per situations, here code snippet i'm using : in view <md-tab label="{{video.name}}" ng-repeat="video in vm.videos" md-on-select="tabclicked()" ng-disabled="data.locked"> in controller $scope.data = { selectedindex: 1, locked: true }; now can see in md-tab "ng-disabled='data.locked'" using controller "locked: true" disabled of md-tabs. what want here enable 4 tabs , disable rest of tabs. what i'm planning here assign dynamic value under ng-disabled="data.locked" e.g. ng-disabled="data.firsttab", ng-disabled="data.secondtab" , on , disable them in controller. how can , if there other way please let me know. thanks the example below demonstrates each tab has own locked setting. angular.module('myapp

css - How to vertically align text when font is calculating height differently? -

Image
i apologize in beforehand if duplicate can't seem find answer. i made resembles progress bar. it's div p elements inside. can't seem center p elements vertically. all did give parent div padding , logically text should in middle seems font counting height differently. , solution change line-height won't work. if change font verdana text aligned not preferred solution. snippet: div { width: 90%; background-color: green; text-align: left; padding: 1.2%; border-radius: 5px; height: 20px; font-family: 'hind guntur', sans-serif; } p { font-size: 90%; display: inline; margin: 0; color: white; } <link href="https://fonts.googleapis.com/css?family=catamaran|hind+guntur" rel="stylesheet"> <div> <p>1</p> </div> this should looking for. problem had fixed height of 20px on div . if change value 28px , text might vertical-a

Post to Node.js Server from Within HTML e-mail -

i writing simple mailing application, not yet aware of full capabilities of html editing within mailing world. i give website administrator choice accept or refuse reservation sending him overview of reservation. below in mail had 2 buttons in mind, accept & refuse. i tried using form within html e-mail every mailing client blocks out. is there method http post command let's myserver.com/accept or myserver.com/refuse within e-mail without having open additional webpage? if not, best way achieve such things? this pretty relevant article: https://www.sitepoint.com/forms-in-email/ basically concludes support not reliable should not use forms in emails agree with. since want give choice website administrator think want sort of authentication. see working this... send admin email containing 2 links mysite.com/reservations/:reservation_id/accept , mysite.com/reservations/:reservation_id/refuse . admin clicks on 1 of links link opens in browser , site(co

amazon web services - AWS Elastic Beanstalk - add load balancer to app retroactively -

i got new domain , want change elastic beanstalk app name domain-name.elasticbeanstalk.com www.domain-name.com . when created eb app, chose single instance. i followed these instructions set domain. selected load balancer, domain seems map app have. seems because created 1 load balancer eb app, , not current app trying map domain to. my questions are: 1) how can use single load balancer (associated different app) point domain correctly? not possible. 2) how can retroactively add load balancer existing eb app? or have recreate eb app , add load balancer @ point? the 2 options described suggest use second option. follow below steps. launch elb in aws console. if eb instance in vpc launch elb in same vpc. when launching elb attach eb instance load balancer. then can point domain www.domain-name.com elb using route 53. or can change environment type single instance load balancing environment. check below user guide. https://docs.aws.amazon.com/elasticbean

"Metadata signature is invalid error" when running Restore-AzureRmApiManagement in Azure Powershell -

i trying restore backup of api management onto newly provisioned instance using restore-azurermapimanagement cmdlet follows: restore-azurermapimanagement -name "apimanagementresource" -resourcegroupname $targetresourcegroup -storagecontext $storageaccountcontext -sourcecontainername $targetstoragecontainername -sourceblobname $apimanagementbackupname after few mins returns following error: restore-azurermapimanagement : restorefailed: verification failed: metadata signature invalid it quite unhelpful error message , yet find mention of in documentation online. the backup restoring taken api management instance on subscription, , trying restore onto newly provisioned resource. could can restore on original resource taken from? failing that, can offer ideas on might causing this?

django - when to use fabric or ansible? -

overview i'd have reliable django deployments , think i'm not following best practices here. till i've been using fabric configuration management tool in order deploy django sites i'm not sure that's best way go. in high performance django book there warning says: fabric not configuration management tool. trying use 1 cause heartache , pain. fabric excellent choice executing scripts in 1 or more remote systems, that's small piece of puzzle. don't reinvent wheel building own configuration management system on top of fabric so, i've decided want learn ansible. questions does make sense using both fabric , ansible tools somehow? is possible use ansible windows development environment deploy production centos(6/7) servers? there nice site https://galaxy.ansible.com/ contains lot of playbooks, recommendation deploy django on centos servers? does make sense using both fabric , ansible tools somehow? yes. logic s

command line - tf.exe checkin does not find any pending changes -

i'm trying simple tfs 2015 checkin automation. have local workspace mapped local folder. in folder, added files , deleted one. want checkin changes i run command tf.exe checkin <folder> /recursive the result (unexpected) "no pending changes" if run following command tx.exe status <folder> i list of changes expected. if in visual studio source code explorer, cannot see changes if try add items in tfs folder, can see new files. can me understand how can automate checkin scenario? edit : based on so thread , seems not possible achieve local workspace. can confirm? you need run "tf add" command add these files pending changes before run "tf checkin" command: tf add * /recursive

Can't reproduce cpu cache-miss -

good day! i'm reading wonderful article: what every programmer should know memory . right i'm trying figure out how cpu caches work , reproduce experiment cache misses. aim reproduce performance degradation when amount of accessed data rises (figure 3.4). wrote little program, should reproduce degradation, doesn't. performance degradation appears after allocate more 4gb of memory, , don't understand why. think should appear when 12 or maybe 100 of mb allocated. maybe program wrong , miss something? use intel core i7-2630qm l1: 256kb l2: 1mb l3: 6mb here go listing. main.go package main import ( "fmt" "math/rand" ) const ( n0 = 1000 n1 = 100000 ) func readint64time(slice []int64, idx int) int64 func main() { ss := make([][]int64, n0) := range ss { ss[i] = make([]int64, n1) j := range ss[i] { ss[i][j] = int64(i + j) } } var t int64 := 0; < n0; i++ { j :

tweetinvi - How to Get users header pictures (or cover picture), also known as banner? -

i'm using tweetinvi api access twitter's api. want cover picture(or header picture or banner) using api. tried var twittercredentials = new twittercredentials(consumerkey, consumersecret, accesstoken, accesstokensecret); tweetinvi.auth.setcredentials(twittercredentials); _userprofile = tweetinvi.user.getauthenticateduser(); the method banner is(so think): _userprofile.profilebannerurl but returning background image used on twitter not header(or cover) picture. any ideas please? to answer question. of countered bug using oldest version 0.9.13 or lower doing. update api version 1.0 or higher.

r - Looping over column names like DF$j -

this question has answer here: dynamically select data frame columns using $ , vector of column names 4 answers i have following data frame: id a1 a2 a3 a4 b1 b2 b3 b4 1 id1 1 2 1 1 1 1 2 2 2 id2 2 2 1 1 2 na 2 1 3 id3 2 2 1 2 1 1 na 2 4 id4 1 1 1 1 1 na na 2 5 id5 2 2 1 1 na na 2 na 6 id6 1 1 1 1 2 2 2 2 i want extract rows data frame meeting specific conditions each combination of , b. these conditions: pp: value 2 present in a-type column + value 2 present in b-type column pa: value 2 present in a-type column + value 1 present in b-type column ap: value 1 present in a-type column + value 2 present in b

firebird2.5 - Code First Migration for Firebird 2.5 -

i have startup project on asp.net mvc 5 . want use code first firebird 2.5 . after enabled migrations , after added first migration, try update database: add-migration test update-database but error: the name ' fk_aspnetuserroles_aspnetroles_roleid ' longer firebird's 31 characters limit object names. how can change name fk_aspnetuserroles_aspnetroles_roleid shorter?

python - TypeError: 'NoneType' object is not subscriptable "channel_id = c.fetchone()[0]" -

i getting above on following code def del_owner(p, i): if i.host == p.config.owner_host: channel = i.sender hostname = i.group(2) conn = sqlite3.connect("aamnews.db") c = conn.cursor() # channel's id c.execute("select id channels name=?", (channel,)) channel_id = c.fetchone()[0] # chanel's owners c.execute("select owners.hostname owners inner join channel_owners on owners.id=channel_owners.owner_id channel_id=?", (channel_id,)) owners = [p.config.owner_host] + [e[0] e in c.fetchall()] if hostname in owners: # owner_id c.execute("select id owners hostname=?", (hostname,)) owner_id = c.fetchone()[0] c.execute("delete channel_owners owner_id=? , channel_id=?", (owner_id, channel_id)) # check if owner has other channels c.execute("select channel_id channel_owners owner_id=?", (owner_id,)) result = c.fetchone()

Responsive css background images -

i have website (g-floors.eu) , want make background (in css have defined bg-image content) responsive. unfortunately don't have idea on how except 1 thing can think of it's quite workaround. creating multiple images , using css screen size change images wanna know if there more practical way in order achieve this. basically wanna achieve image (with watermark 'g') automatically resizes without displaying less of image. if it's possible of course link: g-floors.eu code have far (content part) #content { background-image: url('../images/bg.png'); background-repeat: no-repeat; position: relative; width: 85%; height: 610px; margin-left: auto; margin-right: auto; } if want same image scale based on size of browser window: background-image:url('../images/bg.png'); background-repeat:no-repeat; background-size:contain; background-position:c

plsql - execute immediate error when performing create directory command in pl sql -

execute immediate 'create or replace directory user_dir as' ||'"c:\proc"'; when execute code above, throwing following error: error @ line 1: ora-01780: string literal required ora-06512: @ "databasename.writedata", line 7 ora-06512: @ line 1 use this: declare varchar2(100); begin a:= q'[create or replace directory g_vid_lib '/video/library/g_rated']'; execute immediate a; end; this create directory on server oracle installed not on machine drive. sql> select * dba_directories lower(directory_name) = 'g_vid_lib'; owner directory_name directory_path ------------------------------ ------------------------------ sys g_vid_lib /video/library/g_rated in case goes like: declare varchar2(100); begin a:= q'[create or replace directory g_vid_lib 'c:\procedure']'; execute immediate a; end;

android - Obtaining contacts from content provider without duplicates or invalid contacts, and save to Realm -

i have code (thankfully provided @epicpandaforce) , have problem deletion. when add new contact works charm while when delete contact (or number contact if there 2 of them) stays persisted in realm. how can working properly? realm.executetransaction(new realm.transaction() { @override public void execute(realm realm) { contact realmcontact = new contact(); string filter = "" + contactscontract.contacts.has_phone_number + " > 0 , " + contactscontract.commondatakinds.phone.type +"=" + contactscontract.commondatakinds.phone.type_main; cursor phones = getactivity() .getcontentresolver() .query(contactscontract.commondatakinds.phone.content_uri, null, filter, null, null); while (phones.movetonext()) { string id = phones.getstring(phones.getcolumnindex(contactscontract.commondatakinds.phone._id

ios - How to save user's input in UITextField? -

i wanted know how can save user's input when user enters mobile phone in uitextfield ? if use text field , run app can enter data in text field when close application data gone. how can store data permanently , show again after application closed , reopened. there way save it? at first, should save text when user did editing before user close application(e.g. saved nsuserdefaults): self.yourtextview.delegate = self; - (void)textviewdidchange:(uitextview *)textview { if (textview.markedtextrange == nil) { nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; [defaults setobject:textview.text forkey:@"usertext"]; [defaults synchronize]; } } then, load text user saved before when user open application again: - (void)viewdidload { [super viewdidload]; self.yourtextview.text = [[nsuserdefaults standarduserdefaults]objectforkey:@"usertext"]; }

javascript - how to use browser scroll for x-overflow of internal div? -

i trying implement dynamic page tree structure exceeds width easily. want scroll tree through browser's horizontal scrollbar such separate scroll not appear div. css properties are: body{ overflow-x:auto; background-color: #ffffff;} #campaign { width: 100%; overflow: auto; white-space: nowrap;} here screenshot current output. output the bottom horizontal scroll disappears when scroll vertically up. thanks. you can set overflow visible in container div , cause contents go out of 100% width bounds , add scrollbar on body. here’s simplified example: https://jsbin.com/bejimit/edit?html,css,output and css: body { overflow-x: auto; } #campaign { display: inline-block; width: 100%; overflow: visible; white-space: nowrap; } .content-item { width: 300px; height: 100px; border: 1px solid red; display: inline-block; }

reporting services - MDX SSRS Parameter category chooses all sub category -

i have been looking on stackoverflow , can't figure out. have dataset using ssas cube, , has 2 parameters. has category , subcategory. i created datasets populate these parameters , work fine when select them both. the way report runs is collection of subreports in table , grouped category , sub grouped subcategory. when select category parameter, lists each sub category sub reports. what trying getting total of subcategories within category. tried using default values doesnt work. tried doing total on group within table doesn't work. group g1 , subgroup sg1 , sg2), , sub reports sr1, sr2, goes this g1 -total (sg1+sg2+sg3) ---sr1 ---sr2 -sg1 ---sr1 ---sr2 -sg2 ---sr1 ---sr2 i able pull off sub group reports parts setting category parameter in sub reports parameter passed in category, , sub category parameter value of sub group. need darn total. the mdx category select { } on columns, { ([service].[category].[category].allmembers ) } dimen

android - APKs generated through Eclipse are accepted or not? -

i little new android development. i have hybrid app uses apache cordova plugins. i using eclipse generate apk. but when publish apk, google play store rejects saying: app update rejected your apk has been rejected containing security vulnerabilities, violates malicious behavior policy. alerts page has more information how resolve issue. if submitted update, previous version of app still live on google play. and, when click on alerts page following error shows up: security alert : your app using version of apache cordova containing 1 or more security vulnerabilities. please see google center article details, including deadline fixing app. i have tried followings: update android platform (cordova platform update android), no positive results. i not update cordova plugins getting errors. (wanted know can issue) i building apk using eclipse ide , went through adt plugin release note https://developer.android.com/studio/tools/sdk/eclipse-adt.html says: the eclip

xcode - Parser error While building ionic app in IOS -

i working on hybrid app. here environment details, cordova cli: 5.0.0 ionic app lib version: 2.0.0 ionic cli version: 2.0.0 ionic app lib version: 2.0.0 ios-deploy version: 1.8.2 ios-sim version: 4.1.1 os: mac os x el capitan node version: v0.12.7 xcode version: xcode 7.3 build version 7d175 i getting following error, when trying execute "ionic build ios" 2016-09-07 16:35:40.328 xcodebuild[10169:148374] cfpropertylistcreatefromxmldata(): old-style plist parser: missing semicolon in dictionary on line 48. parsing abandoned. break on _cfpropertylistmissingsemicolon debug. 2016-09-07 16:35:40.329 xcodebuild[10169:148374] cfpropertylistcreatefromxmldata(): old-style plist parser: missing semicolon in dictionary on line 48. parsing abandoned. break on _cfpropertylistmissingsemicolon debug. 2016-09-07 16:35:40.395 xcodebuild[10169:148374] error domain=nscocoaerrordomain code=3840 "unexpected character / @ line 1" userinfo={nsdebugdescription=unexpec

sql - Ordering dates for 4 weeks -

i writing sql query pulls information last 4 weeks. seeing 2 issues results (see below). first problem when 4 weeks, range should august 10 - september 6. when order 'day of month', dates in september moved top of results when should @ end. results should start 10 (august) , end @ 6 (september). second problem i'm missing few random dates (3, 4, 13, 27). day of month number of x 1 125 2 77 5 5 6 23 10 145 11 177 12 116 14 2 15 199 16 154 17 134 18 140 19 154 21 8 22 166 23 145 24 151 25 107 26 79 28 3 29 151 30 163 31 147 here general version of query: declare @start

multithreading - Unexpected output in concurrent file writing in java web -

Image
i wrote simple java web application ,just included basic function register , sign in , changing password , others. i don't use database. create file in app record users' information , database stuff. i used jmeter stressing web application, register interface. jmeter shows result of 1000 thread right when information.txt , stores users' information, it's wrong because stores 700+ record : but should include 1000 record, must somewhere wrong i use singleton class write/read stuff, , add synchronized word class, insert() function used register record register information shown below: (a part of it) public class database { private static database database = null; private static file file = null; public synchronized static database getinstance() { if (database == null) { database = new database(); } return database; } private database() { string path = this.getclass().getclassloader().getresource("/") .ge

javascript - Detect a paste event in a react-native text input -

i want paste react native input, based on pasted content (i.e. if pasted content link, style accordingly). however, in order need know when has been pasted text input. not sure how listen paste event. clipboard not here because set/get content, not tell me if arbitrary content has been pasted.

javascript - PDF.js CORS issue -

i'm having issue pdf.js , cors configuration. from domain i'm loading pdf.js iframe file parameter (full path server, return pdf document). pdf.js create request server @ domain b origin: domain a . server @ domain b returns pdf document header access-control-allow-origin: domain a , far good. in network tab see request server, returning 200 status ok, pdf.js throwing error unexpected server response (0) while retrieving pdf <url> . the question is, what's going on here, cors seems ok, can't more info pdf.js real reason pdf failing load. there encountered same? finally found problem. server not passing access-control-allow-credentials: true header response, needed (xhr request sent xhr.withcredential ). cors working properly. found solution at: https://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/

arrays - Extracting all matrices out of a nested list with varying sublist lengths in R -

i have nested list of matrices. more specifically, have list of matrix lists, each variable number of matrices. extract matrices out of nested lists 1 simple array. example data ('datlist'): set.seed(10) dat <- rnorm(n=3*4*6) datmat <- array(dat, dim = c(3,4,6)) datlist <- list() datlist[[1]] <- list() # datmat[,,1] datlist[[1]][[1]] <- datmat[,,1] datlist[[1]][[2]] <- datmat[,,2] datlist[[1]][[3]] <- datmat[,,3] datlist[[2]] <- list() datlist[[2]][[1]] <- datmat[,,4] datlist[[2]][[2]] <- datmat[,,5] datlist[[3]] <- list() datlist[[3]][[1]] <- datmat[,,6] summary(datlist) # length class mode # [1,] 3 -none- list # [2,] 2 -none- list # [3,] 1 -none- list the ideal output here above 'datmat' array used create example. based on answers similar questions, seems apply functions should helpful here, haven't managed them want. i attempted following loop without success: nmats <- sum(as.numeric(su

reactjs - Why is this bar chart using chart.js not rendering in react.js? -

i'm trying add bar chart app arbitrary data can't render. it's imported correctly , i've used example code chart.js web site no luck. missing? import chart 'chart.js'; import react, { component } 'react'; class chartteamone extends component { setstate(){ const t1chartel= document.getelementbyid("teamonecanvas"); let teamonechart = new chart(t1chartel,{ type: 'bar', data: { labels: ["red", "blue"], datasets: [{ label: '# of votes', data: [12, 19], backgroundcolor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', ], bordercolor: [ 'rgba(255,99,132,1)', 'rgba(54, 162, 235, 1)', ], borderwidth: 1 }] }, options: { scales: { yaxes: [{ ticks: { beginatzero:true } }] } } }); } render(){

angular - Angular2 RC 5. No component factory found for dynamically loaded components -

i'm trying update dynamic component loader rc4 rc5 since componentresolver deprecated. i've updated loader following @component({ selector: 'component-dispatcher', template: `<div #container></div>` // define template here because of brevity }) export class componentdispatchercomponent implements oninit, ondestroy { @input() component:any; // dynamic component render @input() options:any; // component configuration, optional @input() data:any; // data render within component // inject dynamic component onto dom @viewchild("container", {read: viewcontainerref}) container:viewcontainerref; private componentreference:componentref<any>; constructor(private resolver:componentfactoryresolver) { } ngoninit() { // create our component we're initialised let componentfactory = this.resolver.resolvecomponentfactory(this.component); this.componentreference = this.con

angular - Disabled input validation in dynamic form -

i have dynamic form (made example using angular.io dynamic form live example plunkr) , want disable input of form, display readonly information. so decided add disabled attribute question model: export class questionbase<t>{ value: t; key: string; label: string; required: boolean; order: number; controltype: string; disabled?:boolean; constructor(options: { value?: t, key?: string, label?: string, required?: boolean, order?: number, controltype?: string, disabled?:boolean } = {}) { this.value = options.value; this.key = options.key || ''; this.label = options.label || ''; this.required = !!options.required; this.order = options.order === undefined ? 1 : options.order; this.controltype = options.controltype || ''; this.disabled = options.disabled || false; } } and bind disabled input: <input *ngswitchcase="'textbox'" [disabled]=&quo

Python ASCII Reading tables -

i'm sorry asking silly question have spend half day , not find reasonable solution. have ascii file: "x" "z" "y" 285807.2 -1671.056 2405.91 285807.2 -1651.162 2394.932 285807.2 -1631.269 2383.962 285807.2 -1611.375 2372.988 285807.2 -1591.481 2362.01 285807.2 -1571.587 2351.01 ............................................. ~1 000 000 rows and normaly read it: from astropy.io import ascii data =ascii.read('c:\\users\\protoss\\desktop\\ishodnik1.dat') print (data) but how deal columns? instance sum each rows or make average value, etc columns z , y? understand have converts date list of float valuse except headliner , write new ascii file, doesn't it? what did. separated columns , added different lists. have got access different columns: import numpy np open('c:\\users\\protoss\\desktop\\ishodnik

javascript - What is cURL '-F' param doing in terms of node.js -

i'm trying copy curl command in node.js. command this: curl https://search.craftar.net/v1/search -f "token=xxx" -f "image=@someimage.jpg" this fine, how translate node.js? using request library: request({ url: 'https://search.craftar.net/v1/search', method: 'post', form: {token: 'xxx', image: binarybodyofprevrequest}, headers: {'content-type': 'multipart/form-data'} }, function(err, res, body) { console.log(body) // prints out: {"error": {"message": "reference image required", "code": "image_missing"}} }); it seems token being recognised image not. why that? i've looked @ facebook api - " curl -f "? , , see form. don't know how compare idea of html form vs multipart/form-data, or form maybe in terms of data sending. instead of manually setting content-type , using form , use formdata instead of form in request()

Match both of these with regex, not just one of -

i'm looking in sql table through bunch of names , want list of different titles used. e.g. snr, mrs, mr, jnr etc sometimes there entry might have 2 titles, e.g: mr name name jnr. want both of these titles 'mr' & 'jnr' i thought way regex , find names have 2 or 3 characters. title @ front followed space, while title @ end preceded one. have: /(^[a-z]{2,3})\s|\s(^[a-z]{2,3}$)/ a regex101 example here . as can see i've used 'match either or b' thing. if throw @ name title @ either start or finish, end getting want, don't know how tell both. i.e. strings 2 titles give me 1 match. how both? instead of "or", match character in between: (^[a-z]{3})\s.*\s([a-z]{3}$)