Posts

Showing posts from May, 2014

jquery - how can i do not send optional params from ajax to c# function? -

i have following function on webservice 3 optional params: [webmethod] [scriptmethod(responseformat = responseformat.json)] public string obtenirpoble(string cp = "", int codi = 0, string nom = "") { list<clspoble> llista = _r.getlistpobles(cp, codi, nom); javascriptserializer jss = new javascriptserializer(); string resultat_json = jss.serialize(llista); return resultat_json; } the problem not make optional params because make on webservice. problem when i'm sending ajax call using json 1 param because trigger error before run webservice code //object send var dataobject = {}; dataobject[config.busqueda] = $(elemid).val(); var json = json.stringify(dataobject); $(elemid).autocomplete({ source: function (request, response) { $.ajax({ url: config.webservice, ...

node.js - MongoDB + node: not authorized to execute command (sometimes works, sometimes doesn't) -

i'm facing problem mongodb environment - setup follows: my node app provides restify api handles user registration (look if user exists in collection based on mail, , if not, insert him (note - insert uses bcrypt hash passwords, bit slower)). uses restify , mongoose orm. a second benchmark script (also written in node, running on same machine) accesses restify api using http put. i'm starting around 20-30 of these requests in benchmark (with random data) , of api requests correctly insert new users. other, mongodb produces errors similar following: not authorized on ... execute command { find: "users", filter: { mail: "rroouksl@hddngrau.de" } } not authorized on ... execute command { insert: "users", documents: [ { ... } ], ordered: false, writeconcern: { w: 1 } } some other users inserted fine. low number of requests @ same time (1-5) no problems occur. shouldn't mongo able handle these "low" amount of request...

php - Codeigniter file path is not stored properly in database -

the file path of file i'm trying upload not stored properly. my problem is, instead of storing path: c:/xampp/htdocs/dev/csbrms/upload/file.xlsx it stores: c:/xampp/htdocs/dev/csbrms/upl this code view.php <input type = "file" name = "userfile" id="userfile"/> controller.php $upload_data = $this->upload->data(); $file_name = $upload_data['file_name']; $data = array(... 'file_path' => $file_name, ); model.php function add_records($data){ try { $sql = "call `sp_add_user_request`(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"; $result = $this->csbrms->query($sql,$data); // $data included 3 param , binding & query db $this->csbrms->close(); } catch (exception $e) { echo $e->getmessage(); } return $result; } you using file_path store file info, whereas want use full_p...

rest - how to generate dummy response from swagger -

as might know, swagger provides test api using 'try out' option in http://petstore.swagger.io/#!/pet/findpetsbystatus . i not know how swagger manages 'try out' option want manually keep response per different request. swagger simulate response without having proper server ? is possible swagger? if yes, how ? thanks in advance. swagger's "try out" function works calling live api. can't use without real api running. not possible simulate responses swagger documentation written.

java - SimpleDateFormat throws parse Exception for +0100 -

i trying 2 sets of date date format : dateformat format = new simpledateformat("eee, dd mmm yyyy hh:mm:ss"); it works fine date : fri, 26 aug 2016 13:55:34 +0000 not date : tue, 06 sep 2016 11:57:14 +0100 throws exception +0100 date. unparseable date: "tue, 06 sep 2016 11:57:14 +0100" (at offset 0) @ java.text.dateformat.parse(dateformat.java:555) it fails @ offset 0 , means problem not related timezone day in letters . you should set locale of simpledateformat . dateformat format = new simpledateformat("eee, dd mmm yyyy hh:mm:ss", locale.english); date d1 = format.parse("fri, 26 aug 2016 13:55:34 +0000"); date d2 = format.parse("tue, 06 sep 2016 11:57:14 +0100"); works without problem. if need retrieve timezone, have add z pattern: dateformat format = new simpledateformat("eee, dd mmm yyyy hh:mm:ss z", locale.english);

`stack install` for library targets -

i'd have similar functionality stack install (e.g. --copy-bins flag) executables, libraries. currently, have stack build , manually find libhs*-<version>-<fingerprint>.a files in .stack-work . problematic/uncomfy 2 reason: i have rely on internal folder structure of stack (reliable enough, though) i have manually rid of fingerprint , version well, work around both, guess, i'd know if might available/sensible implement. some background, may or may not relevant question rather motivation: i playing around https://hackage.haskell.org/package/dynamic-loader-0.0/docs/system-plugins-dynamicloader.html , want provide realistic example can, plan compile package's object code *.a (containing compilation of multiple modules) want link in @ runtime. what want works trivial single module files, need use loadmodule . i'm tinkering around loadpackage .

r - Using lapply to output values between date ranges within different factor levels -

i have 2 dataframes, 1 representing daily sales figures of different stores (df1) , 1 representing when each store has been audited (df2). need create new dataframe displaying sales information each site taken 1 week before each audit (i.e. information in df2). example data, firstly daily sales figures different stores across period: dates <- as.data.frame(seq(as.date("2015/12/30"), as.date("2016/4/7"),"day")) sales <- as.data.frame(matrix(sample(0:50, 30*10, replace=true), ncol=3)) df1 <- cbind(dates,sales) colnames(df1) <- c("dates","site.a","site.b","site.c") and dates of each audit across different stores: store<- c("store.a","store.a","store.b","store.c","store.c") audit_dates <- as.data.frame(as.posixct(c("2016/1/4","2016/3/1","2016/2/1","2016/2/1","2016/3/1"))) df2 <- as.data.fram...

c# - Unable to Use BreakPoints After Trying to Add Command-Line Support -

update 3 this being caused post-build action included uses ilmerge . see here more details update2 it seems not directly caused adding command-line support, still don't know did cause it. see so question more details. update after making below changes allow command-line support, cannot step through program message on breakpoints: the breakpoint not hit. no symbols have been loaded document i checked this answer , found missing file microsoft.visualstudio.debugger.runtime.pdb have no idea has gone .. is there reason why happen because of app.xaml update? i have wpf application need implement command-line arguments. following answer @ this question , amended app.xaml remove startupuri attribute: <application x:class="wpffiledeleter.app" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="...

dependency injection - Custom IServicePovider is not always used -

in startup.cs, want define extended serviceprovider: wraps default iserviceprovider implementation. public iserviceprovider configureservices(iservicecollection services) { [...] var servicesprovider = services.buildextendedserviceprovider(); return servicesprovider; } here core extended service provider implementation /// <summary> /// extends native asp.net service provider /// </summary> public class extendedservicesprovider : iserviceprovider { private readonly iserviceprovider _serviceprovider; /// <summary> /// creates new instance of <see cref="extendedservicesprovider"/> provider based on native mvc <see cref="iserviceprovider"/> /// </summary> /// <param name="serviceprovider"></param> public extendedservicesprovider(iserviceprovider serviceprovider) { _serviceprovider = serviceprovider; } /// <inheritdoc /> public object get...

PHP header() Can not open xlsx file after download -

Image
i use header() download xlsx file given url. file downloaded can't not open it. shows error below code $url = "http://example.com/attachment/file.xlsx" header("content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); header('content-disposition: attachment; filename=test.xlsx'); readfile($url); exit(); randy, question looks weird. url in serve response way different 1 in code. before commencing download - sending headers, is_file() or other check on url , start download if file exists. i suspect trying fopen on url, not local file , url may either incorrect or on server not allowing fopen on urls. sample: $url = "http://example.com/attachment/file.xlsx"; if (!fopen($url,'r')) exit('file/url not accessible'); else fclose($url); header('content-type: application/octet-stream'); header("content-transfer-encoding: binary"); header('content-disposi...

angularjs - unitTest karma-jasmine error -

hi guys have error when lunch start karma karma.conf.js 20%20%20%20at%20object.createinjector%20%5bas%20injector%5d%20(http%3a%2f%2flocalhost%3a9876%2fbase%2fwebcontent%2fassets%2fjs%2fangular1.4.3%2fangular.js%3fbede50a38baeba3db7a4df46069 5d01ecb437273%3a4272%3a11)%0a%20%20%20%20at%20object.workfn%20(http%3a%2f%2flocalhost%3a9876%2fbase%2fwebcontent%2fassets%2fjs%2fangular1.4.3%2fangular-mocks.js%3f8bc8772418adb9b2fa9517 2525c3540d23e140f4%3a2393%3a52)%0a%20%20%20%20at%20attemptsync%20(http%3a%2f%2flocalhost%3a9876%2fc%3a%2fusers%2fzack%2fnode_modules%2fjasmine-core%2flib%2fjasmine-core%2fjasmine.js%3f3 91e45351df9ee35392d2e5cb623221a969fc009%3a1886%3a24) @ webcontent/assets/js/angular1.4.3/angular.js:68:12 @ foreach (webcontent/assets/js/angular1.4.3/angular.js:336:20) @ loadmodules (webcontent/assets/js/angular1.4.3/angular.js:4346:5) @ object.createinjector [as injector] (webcontent/assets/js/angular1.4.3/angul...

javascript - How to add custom gmail recipient from mailto -

i've got link: window.open("https://mail.google.com/mail/u/0/#inbox?compose=150b0f7ffb682642&to=mailto"); it's changeing default mailto link gmail link. let's i've got: <a href="mailto:example@example.com"></a> and after javascript link is window.open("https://mail.google.com/mail/u/0/#inbox?compose=150b0f7ffb682642&to=mailto"); is possible force gmail use recipient mailto?

heroku - Ruby on Rails execute recurring task -

i need perform task every 1 minute on rails application. far have tried delayed job ( scheduling job every minute rails 3.1 on heroku ) no success (runs 1 time , stopped) , right i'm trying sidetiq gem ( https://github.com/endofunky/sidetiq ). i have installed gem , created file /config/initializers/sidetiq_test.rb here's code put inside: class myworker include sidekiq::worker include sidetiq::schedulable recurrence { hourly.minute_of_hour(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60) } def perform p '####################################' p 'clients' end end i perform task in official version insterted couple of prints. have restarted server, no errors nothing happens, know missing? one last note: solution must heroku compatible, because don...

ios - Code Sign Error - Profile not available in XCode -

i trying build/sign update application haven't built on mac before. logged same developer account , have published other apps on machine. when try verification before uploading store following error: code sign error: no matching provisioning profiles found: no provisioning profiles valid signing identity (i.e. certificate , private key pair) matching bundle identifier “com.appname.mobile” found. i tried obvious solution of preferences -> accounts -> details -> download strange part there profile does not show up yet can see while logged apple developer site. it's right there com.appname.mobile , expires 9/29/2017 fact not show in xcode strange me. i hope missing step building existing app on new machine because have never issues process before. insight appreciated! you should go old mac machine & export necessary keychains certificates . once certificates exported. now can install certificates on new mac double clicking on certi...

vsts - How to export Global Workflows with TFS REST Api? -

it possible upload global workflows using updateworkitemtypedefinition(), how can export? exportworkitemtypedefinition() seems work wits thanks! yes, possible. for exportworkitemtypedefinition() method, there 3 parameters it: project: string. optional. project id or project name type: string. optional. exportgloballists: boolean. optional. when specify "project" , "type" "null", method export global workflow. , export global lists when set "exportgloballists" "true".

node.js - Restart current instance using NodeJS -

i'd restart application inside application using nodejs , npm. it doesn't work child_process : var exec = require('child_process').exec; exec('npm restart', function(error, stdout, stderr) { console.log('stdout: ' + stdout); console.log('stderr: ' + stderr); if (error !== null) { console.log('exec error: ' + error); } }); if master process died, there no way reanimate him himself. have @ nodemon restart script.

linux - Simple Docker Concept -

Image
i'm going through getting started docker guide , understood of basics except 1 concept. i how docker/whalesay takes 247 mb . needs download few layers, including base image of ubuntu. hello-world should around same size? it's self-contained image can shipped anywhere. when hello-world executes, there's still linux layer running somewhere, , downloaded hello-world before docker/whalesay couldn't have been using linux layer downloaded docker/whalesay . missing here? it not ubuntu instance. check hub: https://hub.docker.com/_/hello-world/ here if click on latest, can see dockerfile: from scratch copy hello / cmd ["/hello"] the defines operating system based on. scratch "empty" image, described here: https://hub.docker.com/_/scratch/

php - JSON_Encode returns NULL (Array) -

i trying parse jsonresponse in android studio, , realized json_encode returns null. ideas cause this? using php 5.2.x here php: <?php header('content-type: application/json'); $con = mysqli_connect("myhost", "myuser", "mypass", "a5911579_android"); $statement = mysqli_prepare($con, "select * markers order marker_id"); mysqli_stmt_execute($statement); $arrrows = array(); $arryitem = array(); $arrrows["success"] = false; $arryitem["success"] = false; while($arr = mysqli_stmt_fetch($statement)) { $arryitem["marker_id"] = $arr["marker_id"]; $arryitem["lat"] = $arr["lat"]; $arryitem["lng"] = $arr["lng"]; $arryitem["snippet"] = $arr["snippet"]; $arrrows[] = $arryitem; } echo json_encode($arrrows); ?> this response: {"succ...

c# - How to extract the X-XSRF_TOKEN in a web performance test -

Image
i had written web performance test earlier working fine. developers have added csrf token validation (to prevent csrf attack on website). after test has started fail (error, bad request). dug , found server generating xsrf-token on login request has passed in every request there after. extract token need parse response login request. how can it? my coded tests looks this: webtestrequest request4 = new webtestrequest(" https://servertest:8080/webconsole/account/login "); request4.method = "post"; request4.headers.add(new webtestrequestheader("accept", "application/json, text/plain, / ")); request4.headers.add(new webtestrequestheader("referer", " https://servertest:8080/webconsole/index.html#/ ")); stringhttpbody request4body = new stringhttpbody(); request4body.contenttype = "application/json;charset=utf-8"; request4body.insertbyteorderm...

c# - Cannot connect to a local network server in Visual Studio Xamarin Android -

i'm using xamarin in visual studio community ; i'm trying connect remote database without success. tried wcf, rest, httprequest - none can connect remote server/service. in "new console application", however, works fine. made "new android project", cannot connect service/server, either. the following code works in console application cannot connect in xamarin mono (visual studio): httpwebrequest request = httpwebrequest.create(string.format(@"http://192.168.16.100/restservice/restserviceimpl.svc/json/12")); request.contenttype = "application/json"; request.method = "get"; using (httpwebresponse response = request.getresponse() httpwebresponse) { if (response.statuscode != httpstatuscode.ok) { console.out.writeline("error fetching data. server returned status code: {0}", response.statuscode); } using (streamreader reader = new streamreader(response.getresponsestream())) { ...

java - Problems with Changing JTextArea font size -

i trying prompt user input joptionpane change font size of jtextarea, shown below as, "console". issue : however, joptionpane not showing when click on size jmenu item. code : font font = new font("arial", font.plain, 12); panel = new jpanel(); panel.setlayout(new borderlayout()); add(panel, borderlayout.center); jtextarea console = new jtextarea(); console.setlinewrap(true); console.setwrapstyleword(true); console.seteditable(false); console.setfont(font); jscrollpane scroll = new jscrollpane(console); scroll.setverticalscrollbarpolicy(scrollpaneconstants.vertical_scrollbar_always); panel.add(scroll, borderlayout.center); jmenubar bar = new jmenubar(); panel.add(bar, borderlayout.north); jmenu size = new jmenu("size"); size.addactionlistener(new actionlistener() { @override public void actionperformed(actionevent e) { string fontsize = joptionpane.showinputdialog(panel, "new font size, 6 or larger:", "set font s...

java - how to check if a scheduled thread has finished the task? -

i have task executes every 20 seconds . problem task can make delay cause interruption. package client; import java.util.concurrent.scheduledthreadpoolexecutor; import static java.util.concurrent.timeunit.*; import java.util.date; public class bootstrap { public static void main(string[] args) { addthreadstopool(); servicetest service1 = new servicetest(); } public static void addthreadstopool() { scheduledthreadpoolexecutor eventpool = new scheduledthreadpoolexecutor(5); eventpool.scheduleatfixedrate(new updater(), 2, 20, seconds); try { thread.sleep(20000); } catch (interruptedexception ignored) { } } } in example , class updater executes every 20 seconds , problem if updater 's execution takes period of time more 20 seconds . how make updater finishes ites task before next scheduled execution? there no other way code updater completes in less 20 seconds. in strict sense impossible because thread may scheduled...

c# - IsInRole Getting New Security Token -

i'm using windowsprincipal's isinrole method check group memberships in wpf , winforms apps. i'm generating identity token can ad user (not user who's logged computer--depending on i'm doing don't authenticate, use basic informational level token (i think proper name "identity token"). the first time code run on particular computer operating system generates identity token user specified. token used isinrole function validate group memberships. it's fast it. however, subsequent calls create windowsidentity/windowsprincipal reference existing token instead of creating new one. way know how update token log out of computer or reboot (which clears token cache). know better way reset cached identity tokens? example code c#: using system.security.principal; windowsidentity impersonationlevelidentity = new windowsidentity("some_userid_that_isn't_me", null); windowsprincipal identitywindowsprincipal = new windowsprincipal(impersona...

scala - Akka remoting: Remote subscribed event listener custom serialising a Watch message -

i have following remote actor set up. actorsystem.actorselection(remoteconfig.getstring("/myeventlistener")).resolveone().map{ar => actorsystem.eventstream.subscribe(ar, classof[myevent]) } i have own custom serialization. issue gets sent watch message has following signature: private[akka] final case class watch(watchee: internalactorref, watcher: internalactorref) extends systemmessage which not straight forward serialize. suggestions on how proceed on one? sending remote message references internalactorref seems bit of odd one. and note use other remote actors directly (not event listeners), these dont sent watch message: val emailservice = actorsystem.actorselection(remoteconfig.getstring("/emailcommandhandler"))

Entity Framework and migration issue -

this sample class public class contacts { [key] public int contactid { get; set; } public string phone { get; set; } public string fax { get; set; } public bool isdefault { get; set; } public int addressid { get; set; } public virtual addresses customer { get; set; } } in our database ef create table contacts. add 1 new field contact class , public bool isdefault { get; set; } when try migrate way enable-migrations add-migration addisdefault update-database -verbose then vs show new fields added. sql got package manager console like alter table [dbo].[contacts] add [isdefault] [bit] not null default 0 alter table [dbo].[customers] add [address1] [nvarchar](max) alter table [dbo].[customers] add [address2] [nvarchar](max) alter table [dbo].[customers] add [phone] [nvarchar](max) alter table [dbo].[customers] add [fax] [nvarchar](max) insert [dbo].[__migrationhistory]([migrationid], [contextkey], [model], [productversion]) values (n'20...

testng - Failed to get report for ru.yandex.qatools.allure:allure-maven-plugin: Unable to load the mojo 'report' -

could me. try start project https://github.com/allure-examples/allure-testng-example . executed command mvn clean, mvn test , after "mvn site" , error: please refer d:\temp\allure-testng-example\target\surefire-reports individual test results. [info] [info] --- maven-site-plugin:3.0:site (default-site) @ allure-testng-example --- [info] configuring report plugin ru.yandex.qatools.allure:allure-maven-plugin:2.2 сен 07, 2016 5:05:11 pm org.sonatype.guice.bean.reflect.logs$julsink warn warning: error injecting: ru.yandex.qatools.allure.report.allurereportmojo com.google.inject.provisionexception: guice provision errors: 1) no implementation org.eclipse.aether.repositorysystem bound. while locating ru.yandex.qatools.allure.report.allurereportmojo 1 error @ com.google.inject.internal.injectorimpl$3.get(injectorimpl.java:974) @ com.google.inject.internal.injectorimpl.getinstance(injectorimpl.java:1000) @ org.sonatype.guice.bean.reflect.abstractdeferredclass.g...

javascript - "Updating" all state in redux app properly -

i've met trouble assigning new object in reducer of app. state contains 2 arrays : { elements: [], constraints: [] } those elements handled 2 reducers : elementsreducer constraintsreducer and combined this: let reducer = combinereducers({ elements: elementsreducer, constraints: constraintsreducer }); export default reducer so, basically, action triggered, , reducer supposed update state.elements array. i've tried several things , can't update whole elements array, - in best case - first element. my first idea do: return object.assign({}, state, { elements: state.map((e) => { return object.assign({}, e, { text: action.data[e.id][e.text] }) }) }); action.data array containing different text each element. basically, is, on special action, updating element array. syntax not work creates new array inside array "elements" of store. not r...

Python error in Console but not in File: unexpected character after line continuation character -

i've got python script has class defined method: @staticmethod def _sanitized_test_name(orig_name): return re.sub(r'[`‘’\"]*', '', re.sub(r'[\r\n\/\:\?\<\>\|\*\%]*', '', orig_name.encode('utf-8'))) i'm able run script command prompt fine, without issues. when paste code of full class in console, syntaxerror: unexpected character after line continuation character : >>> return re.sub(r'[`‘’\"]*', '', re.sub(r'[\r\n\/\:\?\<\>\|\*\%]*', '', orig_name.encode('utf-8'))) file "<stdin>", line 1 return re.sub(r'[``'\"]*', '', re.sub(r'[\r\n\/\:\?\<\>\|\*\%]*', '', orig_name.encode('utf-8'))) ^ syntaxerror: unexpected character after line continuation character if skip method while pasting...

python - when i made a 3 handshake with ubuntu in VMware return package R -

#!/usr/bin/python scapy.all import * def findweb(): = sr1(ip(dst="8.8.8.8")/udp()/dns(qd=dnsqr(qname="www.google.com")),verbose=0) return a[dnsrr].rdata def sendpacket(dst,src): ip = ip(dst = dst) syn = tcp(sport=1500, dport=80, flags='s') synack = sr1(ip/syn) my_ack = synack.seq + 1 ack = tcp(sport=1050, dport=80, flags='a', ack=my_ack) send(ip/ack) payload = "stuff" push = tcp(sport=1050, dport=80, flags='pa', seq=11, ack=my_ack) send(ip/push/payload) http = sr1(ip/tcp()/'get /index.html http/1.0 \n\n',verbose=0) print http.show() src = '10.0.0.24' dst = findweb() sendpacket(dst,src) i'm trying http packets scapy using ubuntu on vmwaer the problem every time send messages have reset how fix it? thanks sniff package image few things notice wrong. 1. have sequence number set statically (seq=11) wrong. sequence numbers randomly genera...

issue apache kafka connection with arduino client -

i've problem when try connect arduino uno, pubsubclient library, client apache kafka server. when try establish connection, on server have this: [2016-09-07 16:30:59,093] warn unexpected error /192.168.1.104; closing connection (org.apache.kafka.common.network .selector) org.apache.kafka.common.network.invalidreceiveexception: invalid receive (size = 270204932 larger 104857600) @ org.apache.kafka.common.network.networkreceive.readfromreadablechannel(networkreceive.java:91) @ org.apache.kafka.common.network.networkreceive.readfrom(networkreceive.java:71) @ org.apache.kafka.common.network.kafkachannel.receive(kafkachannel.java:154) @ org.apache.kafka.common.network.kafkachannel.read(kafkachannel.java:135) @ org.apache.kafka.common.network.selector.pollselectionkeys(selector.java:323) @ org.apache.kafka.common.network.selector.poll(selector.java:283) @ kafka.network.processor.poll(socketserver.scala...

ruby on rails - undefined method `id' for nil:NilClass on my style tags -

i getting undefined method 'id' nil:nilclass when load rails 4 app error shows on line. <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <script src="https://unpkg.com/flickity@2.0/dist/flickity.pkgd.min.js"></script> <%= csrf_meta_tags %> when remove style tag , javascript tag page loads fine. using rails 4.

How does typescript decorators allow angular 2 to discover type metadata -

i don't understand how typescript decorator @injectable captures type information , how later knows constructor parameter corresponds type when no explicit @inject(...) provided within constructor parameter list? how replicate such behavior , in simple terms create own injector own library. @injectable() export class appservice { } export class appcomponent { public constructor(private appservice: appservice) { } } you may see insight within compiled code on how decorators works, example compiled code looks below, componentclass = __decorate([ core_1.component({ moduleid: module.id, selector: 'component-selector', templateurl: 'component.html', styleurls: ['component.css'], providers: [component_service_1.componentservice] }), __metadata('design:paramtypes', [component_service_1.componentservice]) ], componentclass); when angu...

Three.js resize window not scaling properly -

Image
when resizing window, shape not scale properly. i'm using following code , according documentation, should fine. var camera, controls, scene, renderer, viewsize; scene = new three.scene(); scene.background = new three.color( 0xffffff ); viewsize = 20; var aspectratio = window.innerwidth / window.innerheight camera = new three.orthographiccamera( -aspectratio * viewsize / 2, aspectratio * viewsize / 2, viewsize / 2, -viewsize / 2, 0.1, 1000 ); camera.position.x = 10; camera.position.y = 10; camera.position.z = -10 camera.lookat(scene.position); renderer = window.webglrenderingcontext ? new three.webglrenderer() : new three.canvasrenderer(); renderer.setsize( window.innerwidth, window.innerheight ); document.body.appendchild( renderer.domelement ); controls = new three.orbitcontrols( camera , renderer.domelement); window.addeventlistener( 'resize', onwindowresize, false ); function onwindowresize() { camera.aspect = window.innerwidth / window.innerheig...

How to force Doxygen not to process the text in a code section of a markdown file? -

Image
in main page of documentation, written in markdown, want put examples showing how comment code in project. basically expect have same output on html file here on so, i.e. raw commented code in code sample view : /** @brief brief description of function * * @details section describes in more details purpose * of function , role module. * * @param [in] bar number deal * @retval result of operation */ uint8_t foo(uint8_t bar) { } to achieve put code in markdown file 4 spaces on left of each line. the problem doxygen seems process these lines in standard source file , end : is there way tell doxygen treat these lines plain text still put them in code view ? able numbered code view (\code , \endcode) don't solution since it's harder copy-paste content of view due line numbers being taken in selection. the exact content of file here on pastebin : markdown.md all want : but without line numbers feature.

Can't generate Android APK signed with APK v2 scheme -

i'm trying build apk signed new v2 scheme. i'm using android studio 2.1.3 tried android 2.2 rc, gradle version have been using 2.1.3. changed compiled version api 24 , build tools 24.0.2 still can't generate apk v2. i tried checking app using following command, adb shell pm dump | grep apksigningversion everytim 'apksigningversion=1' , can't find magic “apk sig block 42” in apk itself. all i'm trying generate apk signed v2 scheme. can generate old jar signed v1 apks without problem. i want know what changes should make generate v2 singed apk's other compiler changes. is there tool convert v1 signed old apk's convert v2 scheme. thanks in advance taken https://developer.android.com/about/versions/nougat/android-7.0.html#apk_signature_v2 : android 7.0 introduces apk signature scheme v2, new app-signing scheme offers faster app install times , more protection against unauthorized alterations apk files. default, androi...

java - What is different between writeBinaryMessage() and write() of Vert.x WebSocket? -

i'm working on server project using vert.x , serverwebsocket class. currently, project uses pump#pump() , serverwebsocket#write() methods send large binary data clients , works well. found serverwebsocket has method send binary data, writebinarymessage() . the manual says: writebinarymessage() : data might written multiple frames if exceeds maximum websocket frame size but think serverwebsocket#write() sends data multiple parts pumping stream. what difference between writebinarymessage() , write() ? writebinarymessage() : writes (potentially large) piece of binary data connection. data might written multiple frames if exceeds maximum websocket frame size. write() write data stream. data put on internal write queue, , write happens asynchronously. avoid running out of memory putting on write queue, check writestream.writequeuefull() method before writing. done automatically if using pump. both returns same type of data , takes buffer typ...

css3 - Is it possible to create a sticky vertical column using Bootstrap without having to specify position? -

i'm trying effect of sticky column right of text, in bootstrap web page . here's code: <nav class="col-sm-4 col-md-4" data-spy="affix" data-offset-top="205"> <div class="panel panel-default" > <div class="panel-heading"><h1>table des matières</h1></div> <section class="panel-body"> <p> nullam luctus nisi est, id blandit nunc tristique vel! </p> </section> </div> </nav> (there bar on left takes 8 previous columns) this sort of works: sidebar appears in right place when page loads, , when scroll stays stuck top, but jumps across left , sits on top of left-most column, acquiring width doesn't seem have (5 columns , bit wide). looking @ documentation se...

sql server - SQL Count Types and return all items under those counts -

i using following sql query count of several item types under 20. trying extract rows fall category. there other types have counts on 20 don't particularly care those. select item_type, count(item_number) "count" total_collection group item_type having count(item_type) < 20; result: c15 9 c1srt 1 ca7 7 d4s5m 10 d4s7m 4 d5s7e 2 for example: have 9 counts fall c15. select ltrim(rtrim(item_type)) as item_type, item_status, item_number from total_collection  item_type in ('c15') c15 2 000540176 c15 2 000384552 c15 2 000452976 c15 2 000372632 c15 2 000573561 c15 2 000592110 c15 2 000465054 c15 2 000394784 c15 2 000400305 i trying combine results of first query, give me complete list of types. fields found in 1 table. i tried find answer question, wasn't able locate one. if somehow missed this, apologize duplicate. still pretty new sql. try this: select ltrim(rtrim(item_type)) item_t...

css - Yii2 clearfix.less not populating in production environment -

i designed website using yii2, , while have done many, problem appears on 1 of them due reason cannot determine. the views dektrium\yii2-user extension show fine on development environment, messed in production. when analyse rendered page both using chrome, noticed following css not generated in production environment... //pseudo ::before element .clearfix:before, .clearfix:after, .dl-horizontal dd:before, .dl-horizontal dd:after, .container:before, .container:after, .container-fluid:before, .container-fluid:after, .row:before, .row:after, .form-horizontal .form-group:before, .form-horizontal .form-group:after, .btn-toolbar:before, .btn-toolbar:after, .btn-group-vertical > .btn-group:before, .btn-group-vertical > .btn-group:after, .nav:before, .nav:after, .navbar:before, .navbar:after, .navbar-header:before, .navbar-header:after, .navbar-collapse:before, .navbar-collapse:after, .pager:before, .pager:after, .panel-body:before, .panel-body:after, .modal-header:before, .moda...

I need help search for letters at beginning and ending of a line in unix -

i starting out in unix , have txt file (words.txt) , there 1 word per line , need search , find words start 'com' , end 'ter'. cannot figure out do, can find words starting 'com' using 'grep ^com words.txt' not know how find words meet both conditions. tried 'grep '^com.*ter$' words.txt' did not anything. appreciated! try grep '^com.*ter$' words.txt

Excel not Closing in vba access module -

what's wrong on function below. excel.exe*32 not closing in task manager. function formatexcel() dim filename string filename = "c:\this file\querycentering.xlsx" set xl = new excel.application set wb = xl.workbooks.open(filename) wb.sheets(1) columns("e:e").select selection.numberformat = "m/d/yyyy" columns("c:c").horizontalalignment = xlcenter rows("2:2").select range(selection, selection.end(xldown)).select selection.rowheight = 15 end wb.save wb.close true set wb = nothing xl.quit set xl = nothing end function you have with wb.sheets(1) , don't use it. also, advisable not use selection object. try (note . before columns ) with wb.sheets(1) .columns("e:e").numberformat = "m/d/yyyy" .columns("c:c").horizontalalignment = xlcenter end

c++ - No type named 'VarDictionary' in namespace 'pp' using PNaCl -

can explain me why getting compile error error: no type named 'vardictionary' in namespace 'pp' pp::vardictionary dictionary; ~~~~^ i'm tying set dictionary in function virtual void handlemessage(const pp::var& message) { } i copied example bottom of google page https://developer.chrome.com/native-client/devguide/coding/message-system and tried simple this virtual void handlemessage(const pp::var& message) { pp::vardictionary dictionary; pp::vararray an_array; an_array.set(0, pp::var("string0")); an_array.set(1, pp::var("string1")); dictionary.set(pp::var("param_array"), an_array); postmessage(dictionary); } but when compile code error message pp::vardictionary dictionary; no problem pp::vararray an_array; i'm using makefile google # copyright (c) 2013 native client authors. rights reserved. # use of source code governed bsd-style license can # found in licen...

javascript - YouTube Auto-Like script not working until I refresh -

i not author of code , have no prior experience code, credits go original author, joesimmons. problem having code works fine, works when either refresh youtube video page or go link directly, google search. i'd know if able me out in fixing issue. of course, i'm not experienced @ simplest of scripts. thankyou in advance! apologise if tagging on question wrong, said earlier i'm clueless. // ==userscript== // @name youtube auto-like videos // @namespace http://userscripts.org/users/23652 // @description automatically clicks 'like' button // @include http://*.youtube.com/watch*v=* // @include http://youtube.com/watch*v=* // @include https://*.youtube.com/watch*v=* // @include https://youtube.com/watch*v=* // @copyright joesimmons // @version 1.1.02 // @license gpl version 3 or later version; http://www.gnu.org/copyleft/gpl.html // @require https://greasyfork.org/scripts/1884-gm-config/code/gm...

java - Vaadin widgetset path is changed after updating to 7.7.0 -

in vaadin application, have own widgetset specified below in web.xml <init-param> <param-name>widgetset</param-name> <param-value>com.foo.bar.appwidgetset</param-value> </init-param> and, had placed appwidgetset.gwt.xml file in src/main/java/com/foo/bar/appwidgetset.gwt.xml this setup worked fine until upgraded vaadin 7.7.0 (from 7.6.8). after upgrade, got following error, when try access app through browser. info: requested resource [/vaadin/widgetsets/appwidgetset/appwidgetset.nocache.js] not found filesystem or through class loader. add widgetset and/or theme jar classpath or add files webcontent/vaadin folder. it seems vaadin looking different location widgetset, placed appwidgetset.gwt.xml in root of classpath ( src/main/java/appwidgetset.gwt.xml ) , re-built app. then worked again. is specifying widgetset init param no longer available? have place widgetset xml in root of classpath itself? i ...

python - Fill_in_blank_game. Unable to select level -

whenever type in 1 of level options console prints "c-3po: entry not compute sir." , prmpts again. so in other words unable select level of game. enter in padawan example, 1 of selections , instead of showing paragraph blanks code runs while loop of chosen_level not in choices. padawan_level = "luke skywalker son of \n darth __1__! \n boba fett son of __2__ fett. \nis type in:\n stormtroopers known __3__ troopers\n yoda jedi __4__ \n"padawan_inputs = ['darth vader','jango','clone','master'] jedi_level = "\n han solo owed money jabba __1__ \n princess leia\'s last name __2__.\n han solo's ship called __3__ falcon.\n boba fett's ship called __4__ 1.\n"jedi_inputs = ['hutt','organa','millennium','slave'] master_level = "princess leia's home planet __1__.\n darth vader born on planet__2__.\n senetor palpatine known darth __3__.\n luke skywalker raised unlce...

ios - How to create CollectionView global object Which can be accessible from any controller? -

how create collectionview global object can accessible controller ? want create uicollectionview can accessible view controller, , display collectionview on same controller called. you can use singleton: @interface collectionviewsingleton : uicollectionview + (id)shared; @end @implementation collectionviewsingleton + (id)shared { static collectionviewsingleton *shared = nil; static dispatch_once_t oncetoken; dispatch_once(&oncetoken, ^{ shared = [[self alloc] init]; }); return shared; } @end

html - CSS Floating and inline spans -

Image
i'm trying achieve following: i'm using float:left have span containing user name floating right of big numbers left. this have far: https://jsfiddle.net/d00ck/twcmfzo8/2/ body { font-family: arial; } .container { background-color: white; padding-bottom: 15px width: 360px; } .position { clear: both; margin: 10px 0 10px 0; padding: 0 10px 0 10px; width: 100%; } .ranking-position { font-size: 25px; float: left; } .ranking-tier { display: block; } .ranking-score { clear: both; } <div class="container"> <div class="position"> <span class="ranking-position">1</span> <span class="ranking-name">dorothy bradley</span> <span class="ranking-tier">1rs team all...</span> <span class="ranking-score">1000pts</span> </div> <div class="position"> <span cla...