Posts

Showing posts from April, 2014

c# - CanExecute in DelegateCommand and expression declaration doesn't work -

my question straightforward. why works: public delegatecommand logincommand { get; } func<bool> canexecutelogin = () => !stringservice.isnullorempty(_entries.logintext, _entries.passwordtext); logincommand = new delegatecommand(onlogintapped, canexecutelogin); but doesn't: public delegatecommand logincommand => new delegatecommand(onlogintapped, () => !stringservice.isnullorempty(_entries.logintext, _entries.passwordtext)); i check so: public string loginentrytext { { return _entries.logintext; } set { _entries.logintext = value; logincommand?.raisecanexecutechanged(); } } doesn't work, mean func never executes after initialization. question not entirely clear me, suspect reason follows. this public delegatecommand logincommand => new delegatecommand(...) is equivalent this public delegatecommand logincommand { {return

Python - Installing Pycrypto package -

i using pycharm , need install package called pycrypto . when tried giving error like collecting pycrypto retrying (retry(total=4, connect=none, read=none, redirect=none)) after connection broken 'connecttimeouterror(, 'connection pypi.python.org timed out. (connect timeout=15)')': /simple/pycrypto/ retrying (retry(total=3, connect=none, read=none, redirect=none)) after connection broken 'connecttimeouterror(, 'connection pypi.python.org timed out. (connect timeout=15)')': /simple/pycrypto/ retrying (retry(total=2, connect=none, read=none, redirect=none)) after connection broken 'connecttimeouterror(, 'connection pypi.python.org timed out. (connect timeout=15)')': /simple/pycrypto/ retrying (retry(total=1, connect=none, read=none, redirect=none)) after connection broken 'newconnectionerror(': failed establish new connection: [errno 11004] getaddrinfo failed',)': /simple/pycrypto/ retrying (retry(total=0, co

webgl2 - Explanation for gl.TEXTURE0 ... n -

i spot in debugger number of gl.texture0 .... 31 . 0 + 31 = 32 32 objects textures have 1 textures . i found on mozilla dev site : "gl provides 32 texture registers; first of these gl.texture0" . when bind next (second tex) did use : gl.activetexture(gl.texture0); gl.bindtexture(gl.texture_2d, textures[0]); gl.activetexture(gl.texture1); gl.bindtexture(gl.texture_2d, textures[1]); or : gl.activetexture(gl.texture0); gl.bindtexture(gl.texture_2d, textures[0]); gl.activetexture(gl.texture33); gl.bindtexture(gl.texture_2d, textures[1]); if mozilla's site says "gl provides 32 texture registers the site wrong webgl , webgl2 have many texture units driver/gpu supports. both webgl1 , webgl2 have minimum number though. webgl1's 8 (8 fragment shader textures , 0 vertex shader textures), webgl2's 32 (16 fragment shader textures , 16 vertex shader textures) so, it's best start @ unit 0 , work up. if need use more

Python m3u8 ssl.CertificateError -

i trying load hls m3u8 manifest file unmatched ssl certificate. using m3u8 library python. script following: #!/usr/bin/env python urllib import quote import m3u8 import ssl input_file = quote(raw_input("please enter input file path: "), safe=':''/') #try: manifest = m3u8.load(input_file) #except ssl.certificateerror: #print "warning ssl error!" playlist in manifest.playlists: print playlist.uri print playlist.stream_info.bandwidth so when run link reports ssl.certificateerror because ssl certificate not correct, want skip check , print ssl warning in case , continue execution of script. possible , how can it? i have changed script to: #!/usr/bin/env python urllib import quote import m3u8 import requests input_file = quote(raw_input("please enter input file path: "), safe=':''/') url = requests.get(input_file, verify = false) manifest = m3u8.load(url) playlist in manifest.playlists:

Excel - i need first non-blank value of a column -

this column. need 2.46 in cell b1 how do that? a1 ---- blank a2 ---- blank a3 ---- blank a4 ---- 2.46 a5 ---- blank a6 ---- blank a7 ---- blank a8 ---- blank a9 ---- 2.58 a10 ---- blank a11 ---- blank a12 ---- blank try formula =index(b1:b100,match(true,index(b1:b100<>"",0),0)) extend ranges required

javascript - D3 assigning nodes labels -

i'm trying make d3 force graph, can't manage let labels work. text pops in top of screen. how assign each node label ( the label being id ). jsfiddle this i've tried: var label = svg.selectall(".node") .data(graph.nodes) .enter().append("text") .attr("class", "label") .text("test") and question, how arrowheads on lines? group circle , text inside group element. can use marker-end property add end markers line. there marker-mid , marker-start configs too. var graph = json.parse('{"nodes":[{"id":"0","color":"#4444e5"},{"id":"1","color":"#4444e5"},{"id":"2","color":"#cccccc"},{"id":"3","color":"#cccccc"},{"id":"4","color":"#cccccc"},{"id":"5","color&qu

html - CSS transform rotation on :after not working -

i've styled checkbox , wanted make checkmark :after element. however, can not turn around. same style attached div works fine. used style: content: ''; position: absolute; width:.5em; height:.2em; transition: .2s; border-left: 2px solid red; border-bottom: 2px solid red; top: 0.4em; left: 0.3em; transform: rotate(-45deg); see codepen here: codepen multiple transform overrides previous transform . better write them shorthand transform: rotate(-45deg) scale(1);

Can anyone provide me Magento2 Documents that from where i can learn to develop modules for Magento2 -

i new magento2 have experience in magento. found structure of magento2 completly different. can provide me magento2 document how create module in magento2. thank you at basic, new magento2 module requires 3 files. /etc/module.xml composer.json registration.php i have created modules in /app/code folder, in case create vendor folder (using name of choosing) , within module folder (again, name of choosing). example, full path /app/code/vendorname/modulename . within module folder, add 1 additional folder called /etc . with folder structure created, need add contents of 3 files, replacing vendorname , modulename names set above. /app/code/vendorname/modulename/etc/module.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="urn:magento:framework:module/etc/module.xsd"> <module name="vendorname_modulename" setup_version="0.1.0"

Sampling video and making image cutoffs in python -

i've got videostream (for use video). need 1 frame per every second or more seconds , need cut part of these pictures based on 8 coordinates(leftupper x/y, rightupper x/y, rightlower x/y , leftlower x/y). i thinkg i'm able cutting in java rather in python entire application written in python / django. it's possible both of things directly in python? point me documentation or whatever? you can start video handling in python using opencv python : reading video file , saving video file using opencv it contains basic links reading file , camera , gives initial idea of how process frames . then after each frame in opencv mat , can form bounding box rect extract region or roi close question cropping live video feed cropping single frame can done done in cropping single image in opencv python this can repeated every frame , can write video file taking reference first reference .

angularjs - ngDoc @param {type} - the type is not rendered in documentation output -

i using dgeni document angular 1.5.x project, wherever have used @param {type} name description type not rendered on output. have followed installation steps of dgeni this tutorial. please let me know missing here.

extjs - Bind the values of a grid record to a form and a window -

although there several ways load values of record form within window, in specific case of using binding grid form (for example, display detail of record) how bind same values form within window (for example: edit record)? fiddle: https://fiddle.sencha.com/#view/editor&fiddle/1stv pass record in part of vm data: var janela = ext.create('app.mywindow', { animatetarget: btn.getel(), viewmodel: { data: { users: selectedrow } } }).show();

salt stack - deploy multiple file through saltstack only if all files are valid -

we managing web sites saltstack. these sites run on php-fpm, , have several fpm pools. each pool configured dedicated file in php-fpm.d/ directory. current, have file.managed state check_cmd: php-fpm -ty check if configuration valid. fpm-conf: file.managed: - name: /etc/php-fpm.conf - source: salt://php/template/fpm.jinja - user: someuser - group: somegroup - mode: 644 - template: jinja - check_cmd: /usr/sbin/php-fpm -ty - require: - pkg: php-package fpm-pool-a: file.managed: - name: /etc/php-fpm.d/a.conf - source: salt://php/template/fpm-a.jinja - user: someuser - group: somegroup - file_mode: 644 - template: jinja - require: - pkg: php-package - require_in: - file: fpm-conf fpm-pool-b: file.managed: - name: /etc/php-fpm.d/b.conf - source: salt://php/template/fpm-b.jinja - user: someuser - group: somegroup - file_mode: 644 - template: jinja - require:

routes - Web Api 2 - No HTTP resource was found that matches the request URI -

i have mvc project in solution, has apicontrollers in it. have set project in iis , added hosts file. the route looks this: globalconfiguration.configuration.routes.maphttproute( name: "defaultapi", routetemplate: "api/{controller}/{action}/{id}", defaults: new { id = routeparameter.optional }); i added controller called testcontroller inside folder project.web/controllers , has 1 method, return string this: public class testcontroller : apicontroller { public string get() { return "test"; } } if try reach site via mysite.local/api/test/get following error: { "message": "no http resource found matches request uri ' http://mysite.local/api/test/get '.", "messagedetail": "no type found matches controller named 'test'." } but if start website visual studio 17, able reach localhost:portnr/api/test/get without errors. i have tried add [rou

angularjs - How to get angular init function in JavaScript using angular.element -

my controller name viewpostonthreadcntrl , id of controller div viewpostonthreadcntr . when call ng-init function in javascript following error displayed: uncaught typeerror: cannot read property 'getpostreplybythreadid' of undefined view code <section class="trdsec" ng-controller="viewpostonthreadcntrl" id="viewpostonthreadcntrl" ng-cloak> <div ng-init="getpostreplybythreadid()"> </div> </section> javascript angular.element(document.getelementbyid('#viewpostonthreadcntrl')).scope().getpostreplybythreadid(); controller app.controller("viewpostonthreadcntrl", function ($scope, angularservice) { $scope.getpostreplybythreadid = function () { id = geturlparameter('id'); if (id != '' && id > 0) { var getdata = angularservice.getpostreplybythreadid(id); getdata.then(function (innerdetail) {

bash - du -sk size difference on different environments -

i getting 2 different outputs blank file created in 2 different environments. on centos 7 gnu coreutils 8.22 (du --v optput) $touch tempfile $du -sk tempfile 4 tempfile is output. when try on different centos7 gnu coreutils 8.22 $touch tempfile $du -sk tempfile 0 tempfile please need know making act differently.

python - Optimizing django select queries for Generic model -

i have generic model "emaileditem" referencing model "item". i loop on list of items , print time email sent. for doing: items = item.objects.all() item in items: emaileditem = emaileditem.objects.get(object_id=item.item_id) print emaileditem.created the problem routine needs run pretty , takes lot of time select on database each item. is there better way so? thanks lot, edit answering commenet create list of ids values_list , query __in items = item.objects.all() dict_of_emailteditems = {i.object_id: in emaileditem.objects.filter(object_id__in=items.values_list('item_id', flat=true))} item in items: emaileditem = dict_of_emailteditems[item.id] print emaileditem.created this generate 2 queries db instead of 1 + n, n number of items

c# - Create List of Time Series -

i need create time series 200 observations of 10 measuretypes (1 10) , join in list (using c# 7): var = enumerable.range(1, 200).select(x => new measure { measuretypeid = 1, created = datetime.now.adddays(x), value = (decimal)(80 * random.nextdouble() + 40) }); var b = enumerable.range(1, 200).select(x => new measure { measuretypeid = 2, created = datetime.now.adddays(x), value = (decimal)(20 * random.nextdouble() + 30) }); // other measures var result = a.union(b).union(c). ... what changes measure measure measureid incremental , parameters (80 , 40) (20 , 30) ... is there way simplify code? use for loop array (or list) of tuples or custom type hold parameters, following: var result = set.empty; // or whatever use tuple<int, int>[] params = { new tuple<int, int>(80, 40), new tuple<int, int>(20, 30), // , on } for(int = 0; < n; i++) { result.union(enumerable.range(1, 200).select(x => new measure { measuretypeid =

java - Decimal datatype support in avro schema and generated files -

avro version 1.8.1. we have below field in avro schema "name" : "sale_price", "type" : ["bytes", "null"], "logicaltype": "decimal", "precision": 18, "scale": 17, we have defined logicaltype decimal. but when use avro-maven-plugin, not generate correct data type generated java files. <plugin> <groupid>org.apache.avro</groupid> <artifactid>avro-maven-plugin</artifactid> <version>1.8.1</version> <configuration> <stringtype>string</stringtype> <enabledecimallogicaltype>true</enabledecimallogicaltype> </configuration> </plugin> currently generates, java.nio.bytebuffer . how have correct data type generated java files. as avro docs explain, language implementations must ignore unknown logical types when reading, , should use underlying avro type.

c# - AIML Bot Encoding Issue - Cyrillic Recognition Failure -

problem overview since i've had task create chattering bot i've used aiml library perform simple conversation between user , computer. had configuration files , 1 aiml file called 'bank'. worked extremely well, while querying on english. main purpose make bot speak russian. so, moment i've been facing encoding problem. practically when type in cyrillic format, programm returs null output. tried change xml encoding utf-8, alter console encoding, decompile dll library seeking clue of problem. unfortunately nothing works. code bot class: class acutus { private bot bot; private user user; public acutus() { bot = new bot(); user = new user("userid", bot); } public void initialize() { bot.loadsettings(); bot.isacceptinguserinput = false; bot.loadaimlfromfiles(); bot.isacceptinguserinput = true; } public string getoutput(string input) { request r = new request(input, user, bot); result result = bot.chat(r); retu

Python 3: how to append number appended to a byte array as bytes -

what i'd want in python script have bytearray , append 2 numbers it, send message, , have receiving c application can read number again. the c app reads this: //deserialize srvid end of payload uint16 srvidfrom; uint16 srvidto; srvidfrom = payload[len-4] | payload[len-3] << 8; srvidto = payload[len-2] | payload[len-1] << 8; and made python script tries above this: my_bytes = bytearray() numb = 1 dummysrvid = 1234 srvidfrom = 5678 my_bytes.append(numb) my_bytes.append(dummysrvid & 0xff) my_bytes.append(dummysrvid >> 8) my_bytes.append(srvidfrom & 0xff) my_bytes.append(srvidfrom >> 8) but not work. i.e., following code gives following output: srvidfrom = my_bytes[len(my_bytes)-4] << 8 | my_bytes[len(my_bytes)-3] << 0 srvidto = my_bytes[len(my_bytes)-2] << 8 | my_bytes[len(my_bytes)-1] << 0 print('return packet had srvidfrom {} , srvidto {}'.format(srvidfrom,srvidto)) output return packet had srvidf

asp.net mvc - Render Partial View from Area in MVC -

i have main mvc application wherein have few areas, instance sales , marketing. these 2 areas separated in 2 different mvc applications. possible render partial views these 2 areas main mvc application? you specify full location of view when rendering inside main view can this @html.partial("/areas/user/views/somecontroller/sales.ascx") @html.partial("/areas/user/views/somecontroller/marketing.ascx")

swift - iOS re-launch in background task not accomplished -

i'm facing issue location (clvisit) when app killed. i've requested location, , seems work great when test it. i have coredata objects creation (with magicalrecord) in didvisit delegate method, creation working when debug (app foreground or background), same when add local notification in delegate , test app killed, doesn't work when remove notifications. i tried disable automatictermination , suddentermination doesn't work. here sample of code in didvisit function : func locationmanager(_ manager: cllocationmanager, didvisit visit: clvisit) { let activity = processinfo.processinfo.beginactivity(options: [.suddenterminationdisabled, .automaticterminationdisabled], reason: "saving location data") magicalrecord.save({ (context) inuiapplication.shared.schedulelocalnotification(notification) let newvisit = visit.mr_createentity(in: context) if let newvisit = newvisit { newvisit.accuracy = visit.horizontalaccuracy ns

window.location - javascript fetching and a variable from the url -

i have following url http://www.domain.co.uk/example/#project-471-1747 the end bit #project-471-1747 changes every time project saved. i pretty sure using window.location can pulled struggling find out how pull , display full url when button clicked. i'm sure must pretty simple seems eluding me! your button markup can this: <input type="button" value="display url" onclick="urldisplay()"> what is, on click of button, calls function called urldisplay() . can have in function show full url: console.log(window.location.hostname + window.location.pathname); of course, might not want use console.log. can choose append part of markup.

c# - CollectionViewSource FilterDescriptions with LiveFiltering -

i binding integer value collectionview source filtering properties. possible filter viewsource withing xaml without using code behind. view in continuous refresh order value , sorting <collectionviewsource x:key="items" source="{binding itemsource, elementname=testitems }" islivesortingrequested="true" islivefilteringrequested="true" > <collectionviewsource.sortdescriptions> <scm:sortdescription propertyname= "order" /> </collectionviewsource.sortdescriptions> <collectionviewsource.livesortingproperties> <clr:string>order</clr:string> </collectionviewsource.livesortingproperties> <collectionviewsource.livefilteringproperties> <clr:string>order</clr:string> </collectionviewsource.livefilteringproperties> if order becomes invalid collectionviewsource should hidden or collapsed

javascript - Issue in AngularJS ng-repeat while accessing image -

i'm writing small program "add cart" page using angularjs, part of html code follows: <div id="booklistwrapper" ng-controller="booklistctrl"> <form role="form"> <div class="form-group"> <input type="text" class="form-control" placeholder="search here..."> </div> </form> <div> <ul class="list-unstyled"> <li class="book" style="background: white no-repeat" ng-repeat="book in books"> <div class="cover-image"> <img src={{book.imgurl}}> <!--i've tried src="../img/{{book.imgurl}}" also--> </div> <div class="b

I need a Javascript REGEX for Integers between 18 and 140 inclusive -

i'm still trying find way around javascript regular expressions, , have not been able deduce how write regex need. please need javascript regex age. want allow between ages 18 , 140. 18 being allowed , 140 being allowed. want regex accepts 18,19,20,21,...138,139,140. , this. i'd appreciate help. p.s. hope simple answer without stack overflow closing question down , saying 'duplicate' or or that... if not might last question on stack overflow, because sadly, seems stack overflow making harder ask simple question. point want ton of research...or @ least lot, before ask question. though many times ask questions precisely because don't have the time lot of research. :: sigh :: when answering question, not person ask why need regex this. and regex want /^(1[89]|[2-9][0-9]|1([0-3][0-9]|40))$/ sample var age=/^(1[89]|[2-9][0-9]|1([0-3][0-9]|40))$/; console.log(age.test(18)); console.log(age.test(140)); console.log(age.test(12)); console

reactjs - Meteor Publish/Subscribe with users data -

i'm banging head against brick wall this. cannot seem find example works me. this server side meteor.publish("alluserdata", function () { return meteor.users.find({}, {fields: {'username': 1, 'profile': 1}}); }, {is_auto: true}); and client var alluserdata = meteor.subscribe("alluserdata"); tracker.autorun(function() { if (alluserdata.ready()) { console.log('ready'); } }); i 'ready' logging cannot see how iterate through returned data??? for react, can set props on component createcontainer(). e.g. import react, {component} 'react'; import {createcontainer} 'meteor/react-meteor-data'; class foocomponent extends component { constructor(props) { super(props); } render() { if (this.props.loading) { return ( <div>loading</div> ) } return ( { this.props.users

Unbound variable error when using defmacro in LISP -

i trying use macro 2 forms in lisp, evaluates both forms return result of form 2. below code using - (defmacro testmac (x body) (prog2 x body)) when executing macro following forms, works correctly , return 5 second form. (testmac (- 10 6) (/ 10 2)) however when try execute macro following forms, return error. (testmac (print a) (print b)) below error - debugger invoked on unbound-variable: variable b unbound. type debugger help, or (sb-ext:exit) exit sbcl. restarts (invokable number or possibly-abbreviated name): 0: [abort] exit debugger, returning top level. (sb-int:simple-eval-in-lexenv b #<null-lexenv>) why getting error , how can use macro make work? p.s. cannot use defun need use macro execute (testmac (print a) (print b)) i trying use macro 2 forms in lisp, evaluates both forms return result of form 2. that's not idea - though might not precise wording. macro should not evaluate code - not without reason. macro transforms code. gen

C++ Mingw32 CreateProcess() failed with error code 2: The system cannot find the file specified -

i trying run basic program in notepad++ , mingw32 . have attempted multiple different thing continue get. current directory: \\thebox\users\jacks_000\documents c:\mingw\mingw32\bin\g++.exe -g "testpgrm" createprocess() failed error code 2: system cannot find file specified. ================ ready ================ when run nppexec use following npp_save cd $(current_directory) c:\mingw\mingw32\bin\g++.exe -g "$(file_name)" i have tried: npp_save cd $(current_directory) c:\mingw\bin\g++.exe -g "$(file_name)" i using basic test program: #include <iostream> using namespace std; int main() { cout<<"hi"; return 0; } i don't know if have issue running in command prompt if save way or if have done wrong. running windows 10 if issue. current directory: \thebox\users\jacks_000\documents i think it's because g++ can't access smb share. try compile file locally.

html - Styling a div with ID inside a div with specific class -

i have written css file style div id, inside div classes. looks this div.class1.class2 > div#id1{ styling rules } but nothing happening div id1. appreciate , can't change structure of html or apply other ids or classes elements. <div class="class1 class 2"> <div id="id1"></div> </div> ids should used once, if followed convention target id in selector , not concern parent container it's in... #id1 { // code } but because of you're asking implies have id being used more once, suggest changing class before moving forward; however, if still wanted keep html way is, need this... .class1 #id1 { // code }

c# - nhibernate generate mapping files from existing database -

i'm working nhibernate. we have huge existing database (more 1.000 tables). want map tables nhibernate (with hbm.xml , cs files). i tried job nhibernate mapping generator, unfortunately generated files not able compile. many little errors caused multiple foreign keys related same table or case sensitivity (wrong namespace ,...) , on. so question...is there tool outside still supported , has huge amount of setting-options? entity developer ( https://www.devart.com/entitydeveloper/ )? is common process map existing giant database or doing wrong? thank much.

powerquery - DAX EARLIER() function in Power Query -

is there an equivalent earlier in m/power query? say, have table lots of different dates in column date , smaller number of letters in column letter. want maximum date each letter. in dax, use calculate(max([date]),filter(all(table),[letter]=earlier([letter])). how achieve same in m? thanks 2 solutions in code below. notice each uses "previousstep" basis, these separate solutions. let source = excel.currentworkbook(){[name="table1"]}[content], previousstep = table.transformcolumntypes(source,{{"date", type date}, {"letter", type text}}), // 1. add column original table maxdate each letter // "earlier" name of function parameter; have been "x" or "marcelbeug" addedmaxdate = table.addcolumn(previousstep, "maxdate", (earlier) => list.max(table.selectrows(previousstep, each [letter] = earlier[letter])[date])), // 2. group letter , maxdate each letter g

data structures - Why is the return type of a method, a class name in the below code of scala? -

abstract class intset { def contains(x: int): boolean def incl(x: int): intset } i'm learning scala. why return type of method incl class name intset ? mean? usually logic , functional programming languages declarative (not per se enforced, in cases, declarative style advised). means not alter datastructure : construct new 1 modified original one . in declarative language when have intset , add element, not add intset , construct new intset has elements of original intset , 1 add x . so reason why incl returns intset because original intset not modified, constructs new one. usually when new intset constructed, of course not construct complete new object . since orignal intset not supposed change, can use sub-structures of original intset . therefore declarative languages have own set of dedicated data-structures, instance finger tree . take instance this implementation of intset . see is: object empty extends intset { override def tostrin

In pagerSlidindTabStrip text display incomplete for Moto G 4+ android 7 -

Image
in project have used pagerslidingtabstrip library .now in other device display proper text in pagerslidingtabstrip . in moto g 4+ displays incomplete text in pagerslidingtabstrip. display "entertain” instead "entertainment” . need change, plz me. in advance. <com.astuetz.pagerslidingtabstrip android:id="@+id/videotabs" android:layout_width="match_parent" android:layout_height="50dp" android:background="@color/toolbar_color" android:paddingleft="11dp" android:layout_marginright="0dp" android:paddingright="0dp" android:textsize="15sp" app:pstsactivatetextcolor="@color/white" app:pstsdeactivatetextcolor="@color/white" app:pstsdividercolor="@color/toolbar_color" app:pstsindicatorheight="0dp" app:pststabbackground="@color/toolbar_color"

laravel - Select Box Blade -

i try remove ids select box display name , surname , licence number licence object here controller : $licence_entraineur = licencies::select('lb_nom', 'num_licence', 'lb_prenom', 'id') ->where(['structure_id' => auth::user()->structure->id]) ->where('type_licence_id' , '1') ->get() ->map(function($i) { return [$i->lb_nom.' - '.$i->lb_prenom.' - n°'.$i->num_licence]; }); here blade view : {!! form::select('licence_entraineur_id', $licence_entraineur , null, ['class' => 'form-control select2', 'placeholder' => 'selectionnez un entraineur']) !!} everything works when go view , make dropdown of select box , values display : 0 mourareau - mathieu - 17085696 1 antoine - george - 17209669 2 aurore - alonso - 17856965 i remove 0 , 1 , 2 , ... number

ssl - openssl / ctls trouble with vapor 2 -

Image
how can fix these openssl / tls issues i'm getting vapor 2? preventing me compiling project on command line , in xcode. during spm build: note: may able install ctls using system-packager: brew install ctls note: may able install ctls using system-packager: brew install openssl upon failure of spm build: linking ./.build/debug/run ld: library not found -lcrypto architecture x86_64 <unknown>:0: error: link command failed exit code 1 (use -v see invocation) <unknown>:0: error: build had 1 command failures error: exit(1): /library/developer/toolchains/swift-3.1-development-snapshot-2017-03-07-a.xctoolchain/usr/bin/swift-build-tool -f /users/tanner/desktop/packageconfig/.build/debug.yaml also in spm: <module-includes>:1:9: note: in file included <module-includes>:1: #import "shim.h" ^ /users/tanner/desktop/packageconfigtwo/.build/checkouts/ctls.git-9210868160426949823/shim.h:4:10: error: 'openssl/conf.h' file

vb.net - How to get data from access database where date is selected from a date/time picker? -

the database i'm accessing has columns : (id, orderid, sandwich, price, , orderdate). orderdate column format date , time. here's code: mycon.connectionstring = consl mycon.open() try dim sql string = "select count (*) [hestiasales] [sandwich] = '" & lbldr.text & "' , [orderdate] = #" & orddt.text & "#" dim cmd oledbcommand = new oledbcommand(sql, mycon) dim dr oledbdatareader = cmd.executereader while dr.read qty = dr.item(0) end while cmd.dispose() catch ex exception msgbox(ex.message) end try mycon.close() i've tried using orddt.value didn't work, code working fine before added date lines. every time run code says "data type mismatch in criteria expression". ideas? edit: i've date syntax include "#" , no longer previous error, 0 query result, despite having correct time picked either textbox or

linux - Why do we need kernel space? -

why need separation between kernel space , user space, when every data structure, every memory resource managed kernel if create process in user space? why need such big architecture? all page tables, context switching etc. managed kernel, why user space? can not use 1 space , develop things on it? this question may sound weird, want understand why required? if have design new os , not perform such division between kernel space , user space, problem? thanks if there no protection between kernel space , user space or between different user processes can write code intentionally or accidentally modify either memory in kernel space or memory in space of user process. old ms-dos lacked protection.

c# - Unable to restore a nuget of .net core class lib into another -

Image
i trying create nuget class library want consumed across different applications. class library in .net core (4.5.1 framework). the project.json looks below: { "version": "1.0.0", "dependencies": { "netstandard.library": "1.6.0", "microsoft.aspnetcore.diagnostics.abstractions": "1.0.0", "microsoft.aspnetcore.http": "1.0.0", "log4net": "2.0.8" }, "description": "logging .net core", "frameworks": { "netstandard1.6": { "imports": [ "dnxcore50" ] } } } i build class library , create nuget package , put in internal repository. created nuget package using 2 different ways: create .nuspec file( command : nuget spec ) , pack .nuspec file (command nuget pack projectname.nuspec ) -> results in .nupkg file command : dotnet pack project.json -> results in .nup

antlr4 - Why minus sign cannot be read correctly in my Antlr grammar -

Image
i have written following antlr grammar: grammar hello; file: row+ ; row: karyotype newline ; karyotype: chrnum (',' sexchr const?)? (',' event)* ; event: prefixplus gainchr (const | inh)? # gainchrevent | prefixminus losschr (const | inh)? # losschrevent ; chrnum: numrangetypei ; numrangetypei: int (approx int)? ; gainchr: int | sex ; losschr: int | sex ; prefixplus: plus ques? | ques plus ; prefixminus: minus ques? | ques minus ; sexchr: (sex | ques)+ ; approx: '~' | '-' ; const: 'c' ; inh: 'dn' | 'inh' | 'mat' | 'pat' ; int: [0-9]+ ; minus: '-' ; newline: '\r'? '\n' ; plus: '+' ; ques: '?' ; sex: [xy]+ ; ws : [ \t]+ -> skip ; but when use following parsing: 43-45,xx,-4 the antlr told me "line 1:9 mismatched input '-' expecting {'-', '+', '?'}" do know what's wrong grammar? the

javascript - KOGrid Cell Template $parent is not defined -

a beginner level javascript question... i need define cell template kogrid dependent on values in vm. want text displayed green if associated field true else display in red. i have following cell templates: var accountedittemplate = `<div><input type=\"text\" data-bind=\"visible: $parent.selected(), value: $parent.entity[$data.field]" /> <span data-bind=\"visible: !$parent.selected(), text: $parent.entity[$data.field], css: $parent.entity.accountisvalid() === 'true' ? \'passed-validation\' : \'failed-validation\'"> </span> </div>`; var costcentreedittemplate = `<div><input type=\"text\" data-bind=\"visible: $parent.selected(), value: $parent.entity[$data.field]" />

entity relationship - ER Diagram Design Method -

Image
i have entity: employee. @ top of er diagram (rectangle box) i have entity: crew. second object on er diagram (rectangle box). under above rectangle. i have composite entity, containing foreign keys made of primary key employee_id , crew_id because composite entity contains foreign keys employee , crew table, mean have draw line in er diagram composite entity 2 rectangles, or 1 above it? one many relation of employee , crew above

sql - MySQL: select * from multiple tables where column1 or column2 = query -

let have database 4 tables: pcs, laptops, tablets, smartphones each of tables contains following columns: id, brand, model how can use single query display results, of tables based on brand or model typed user? in psuedo-code, this: select * {all tables} {brand or model} %user_search%; so user able search device typing brand or model. e.g. typing apple display apple smartphones , tablets. typing model number display devices model number, different brands. in mysql, best way run each query independently , use union all : select * t1 brand '%user_search%' or model '%user_search%' union select * t2 brand '%user_search%' or model '%user_search%' union select * t3 brand '%user_search%' or model '%user_search%' union select * t4 brand '%user_search%' or model '%user_search%'; it tempting write as: select * ((select * t1) union (select * t2) union (select * t3) union (

php - Symfony3 create form without entity in type file -

i have created form in controller : $data = array (); $formbuilder = $this->createformbuilder ( $data ); $formbuilder->add( 'field1', numbertype::class, array( 'constraints' => array( new notblank(), ), ) ) ->add ( 'field2', numbertype::class, array( 'constraints' => array( new notblank(), ) ...); $form = $formbuilder->getform (); i trying put form creation in type file. did form not created , can't display form fields in view.i don't understand why. #in controlcontroller $data = array (); $formbuilder= $this->createformbuilder(controltype::class, $data); $form = $formbuilder->getform (); #in controltype public function buildform(formbuilderinterface $builder, array $options) { $builder->add( 'field1', numbertype::class, array(

.NET Core 1.1, xUnit integration with Jenkins Test Result -

i have jenkins job runs unit test step on .net core project (.net core 1.1) using following dotnet cli command: dotnet test -l trx . unit testing framework used xunit. the problem output trx file format not compatible jenkins test results viewer tests table has @ package level 1 row called "(root)" beneath it, @ "class" level there 1 row has no name making impossible navigation actual test methods beneath it. i using xunitpublisher mstestjunithudsontesttype publishing test results: step([$class: 'xunitpublisher', testtimemargin: '3000', thresholdmode: 1, thresholds: [[$class: 'failedthreshold', failurenewthreshold: '', failurethreshold: '', unstablenewthreshold: '', unstablethreshold: ''], [$class: 'skippedthreshold', failurenewthreshold: '', failurethreshold: '', unstablenewthreshold: '', unstablethreshold: '']], tools: [[$class: 'mstestjunithudsontesttype&

python - using django-filer, "Must be a 'image' instance" -

Image
i working filer on project. have big sized documents data in , file images related data. need these on system , how connect them together. i using import-export upload data. thinking of using filer import script mass upload images folder. how relate record image without using filer gui in admin system. if did use that, mean going through every record , adding image 1 one. when try , upload image column got error shown below in image. how can around issue?

sql server - Datetime error querying sqlserver database via django-mssql -

i using django-mssql query sqlserver database: querying datetime value, 'conversion failed when converting date and/or time character string.' results = sales.objects.using('eql').filter(saledate__year=2017) len(results) where 'saledate' datetime value - has else experienced this? (and have workaround?)

activerecord - Rails SQL Injection safe SELECT fields -

i have following ruby on rails code: #the user can ask subset of following columns: authorized_fields= ["id","created_at","updated_at"] #the user sends requested columns comma separated string in fields param fields = (params[:fields].split(',') & authorized_fields).join(","); #build query run: sql = "select json_agg(u) (select #{fields} table_name) u" #run query against database modelname.connection.select_value(sql) my question is, query sql injection safe? understanding since limit available fields, protects me injections. am correct? can give me example of fields parameter sent user not safe? you may use activerecord::base.connection.quote_column_name . code should this: input_fields = params[:fields].split(',').collect |field| activerecord::base.connection.quote_column_name(field) end

NPM Install and Save Local Relative Path -

i'm trying npm install local .tgz package distributing shared angular components. npm install ./../@company/my-package-0.10.0.tgz --save the problem above code saves full pathname in package.json . e.g. "@company/package": "file:///c:\\...\\my-package-0.10.0.tgz" this poses issue source control fellow developers on team, don't have source installed in identical location. how can make npm save relative file path within package.json npm install command? don't want have alter package.json file manually , run full npm install each time update component package. edit: to clarify, end result want: install: npm install ./../@company/my-package-0.10.0.tgz --save package.json: "@company/package": file:./../@company/my-package-0.10.0.tgz

jquery - Parsing Google News RSS with Javascript -

want parse google news rss javascript. managed run code in php code form how parse google news in php : my question how can same thing in javascript code example parse: http://news.google.com/news?pz=1&output=rss&cf=all&topic=topics&q=obama&hl=en&num=10 , data different news there thanks. the data obtained in xml format. you can access items using domparser . see: xml parser example parser = new domparser(); xmldoc = parser.parsefromstring(data,"text/xml"); var items = xmldoc.getelementsbytagname('item') console.log(items); 📝 working example // [1] parse xml feed array of js objects function parsedata(data) { parser = new domparser(); var xmldoc = parser.parsefromstring(data,"text/xml"); // convert collection array // getelementsbytagname returns collection/nodelist instead of array. // more convenient if use array. var items = array.from(xmldoc.getelementsbytagname('item')); var

javascript - Why can't I declare a function before render in React? -

so code works, if move handleclick() render, throw error. same if try declare function var handleclick = () => { this.setstate({reservationvisible: true}) console.log(this.state.reservationvisible)} outside render. also when i'm passing handleclick() prop, need call {this.handleclick.bind(this)} , when i'm using function, declared inside render, {handleclick.bind(this) enough. don't understand why. should declare functions then? outside or inside render? should use functions or methods? here code: import react, { component } 'react'; import room './room' import form './form' class rooms extends component { constructor(props){ super(props); this.state = {reservationvisible: false} } handleclick(e){ this.setstate({reservationvisible: true}) console.log(this.state.reservationvisible) } render(){ let rooms = [ { roomnumber: '1', typ

c# - Auto restart IIS Website from console application -

we have asp.net application used many customers installed on own servers. because installed on end each having different databases , url bindings etc created console application while ago gets zip file , extracts c:\inetpub location append latest application changes. console app added scheduled tasks create automated update. obviously when accesses site first time after have wait little longer whilst site rebuilds. changed console application include process.start(urlofapp) should part of update next morning first user doesn't have wait rebuild. i have tested ok running myself not yet released concern url process kept open. can enlighten me whether case don't want happen or can give me ideas how rebuild site manually part of console app. iis has had auto-start apps feature quite time. have enable it. can find more info the gu , , the iis site .

windows - Use winexe to open windowed application remotely -

i have open application broffice on windows on aws ec2 , write text on it. application windowed , have execute linux server. i'm trying use winexe, think not open windowed apps. possible show windowed applications , performs clicks , writes tests on remotely? please, not worry want after show window. need run windowed applications remotely , show window. you use winexe call tool can handle ui automation you. looks autoit may able need via creating script , compiling aut2exe. https://www.autoitscript.com/site/autoit/

PHP Why does the else-Statment not work properly before the is_numeric function -

that piece of code job long want know bmi. should check if formula filled numbers , else statement should kick in if not case. although seems kick in points out error messages like: ((this not duplicate of question linked to. there talks topic new error messages how have write if-else statement check numeric pulls out else statement.)) warning: non-numeric value encountered in c:\xampp\htdocs\workspace\4.5\aufgabe19.php on line 15 warning: non-numeric value encountered in c:\xampp\htdocs\workspace\4.5\aufgabe19.php on line 15 warning: non-numeric value encountered in c:\xampp\htdocs\workspace\4.5\aufgabe19.php on line 16 which should not do. should say: bitte geben sie zahlen ein, if formular filled other things. <?php // variablen deklararien und werte zuweisen. $gewicht = $_post['gewicht']; $koerpergroesse = $_post['koerpergroesse']; $bmi = 0; $dezimal = 0; $dezimal = ($koerpergroesse /100) * ($koerperg