Posts

Showing posts from May, 2014

html - Is there a way to make SVG element wrap its content? -

i have svg element translate. when translate partially off left edge, clipped portion rendered on right edge (wrapped horizontally) , vice versa. possible? there no simple way in svg this. if there elements partially off edge, going have add clones of them @ opposite edge. , possibly 3 clones, if hits corner.

sql server - How to get parent value and last replaced value in SQL query -

i have scenario need with. kind of new stack overflow let me know if make mistakes in asking question. welcome feedback. i working table in sql server values follows: oldvalue newvalue date ------------------------------------ 1 2 2016-08-01 2 3 2016-08-03 101 102 2016-08-06 102 103 2016-08-08 103 105 2016-08-14 201 202 2016-08-06 202 203 2016-08-08 203 205 2016-08-14 205 209 2016-08-18 i trying put forward query oldest , newest value old 1 replaced with. looking output looks this. oldvalue newvalue -------------------------- 1 3 101 105 201 209 the query put forward follows: select a.oldcpn, b.newcpn test..testtable inner join testtable b on a.newcpn = b.oldcpn , a.date <= b.date with above quer...

PHP: Separate 2 or more values of 1 key in Array -

i have array came ajax $contestant_name_arr = $_get['contestant_name_arr']; print_r($contestant_name_arr); whenever try value of each in loop got error because instead of this array ( [0] => value1,value2 ) it should this: array ( [0] => value1 [1] => value2 ) how separate in example above. either devise url query string be: http://yourhost.com?contestant_name_arr[0]=value&contestant_name_arr[1]=value2 or explode ; $contestant_name_arr = explode(',', $contestant_name_arr[0]);

python - How to re-generate tables in Django -

i'm new in django. here how do: create app : python manager.py startap test , add serveral model, execute: python manager.py maiemigrations python manager migrate it generate tables automatically. dropped table in database by: drop table table_name execute again: python manager.py makemigrations python manager.py migrate but there no table generated in database, , got message "no changes detected", how should have these table? please me. delete migration file in app's migrations directory. run python makemigrations your_app python miagrate

java - Image not displaying with random -

i coding flappy bird clone inside processing(java). whenever code down below executes nothing shows on screen. void display() { float birdpick = random(0, 1); if (birdpick == 0) { image(yellowbird, x, y, 80, 80); } if (birdpick == 1) { image(bluebird, x, y, 80, 80); } } calling random(0, 1) returns float between 0 , 1 . in other words, these numbers things .01 or .333 . never 0 , , never 1 (the second number not included). if want if statement evaluate true 50% of time, can check if value less .5 , since half values below , half values above that. float birdpick = random(0, 1); if (birdpick < .5){ image(yellowbird, x, y, 80, 80); } else{ image(bluebird, x, y, 80, 80); } more info can found in the reference

c# - I need a thread keeping running forever. which method is best? -

i need background long running thread asp.net application. btw,the method fetches external data source period , maybe exception happens, provide ways fullfill task, please advice way best, please advice if there better way. way1=looping when exception happens. static void longrunningmethod() { { try { //fetch external period , maybe exception happens. thread.sleep(100000); } catch(exception ex) { //log exception.. } } while (true); } way2=running following method period timer, , open new thread when exception happens. static void longrunningmethod() { try { //fetch external period , maybe exception happens. thread.sleep(100000); } catch(exception ex) { //log exception.. thread t2 = new thread(longrunningmetho...

javascript - How can I validate multiply input values at the same time using onkeyup before activating the submit button? -

i want create form submit button disabled until form ready submitted. not form need filled in, parameters need met. passwords must match. email must valid , not in database. radio button must selected. how can send values inputs @ same time on every upkey. here's index.php file <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script type="text/javascript"> function validate_form(value){ $.post("validate_form.php",{first_name:value},function(data){ if (data=="available"){ document.getelementbyid("mysubmit").disabled = false; } else { document.getelementbyid("mysubmit").disabled = true; } }); }; </script> </head> <body> <form action="index.php" method="po...

r - Adding an column for the category of glm coeffients in broom results -

is there way add column result of broom package's tidy function can act relate term column both original names used in formula argument , columns in data argument. for example if run following get: library(ggplot2) library(dplyr) mod <- glm(mpg ~ wt + qsec + as.factor(carb), data = mtcars) tidy(mod) # term estimate std.error statistic p.value # 1 (intercept) 21.132995090 7.5756463 2.78959633 1.017187e-02 # 2 wt -4.916303175 0.6747590 -7.28601380 1.584408e-07 # 3 qsec 0.843355538 0.3930252 2.14580532 4.221188e-02 # 4 as.factor(carb)2 0.004133826 1.5321134 0.00269812 9.978695e-01 # 5 as.factor(carb)3 -0.755346006 2.3451222 -0.32209239 7.501715e-01 # 6 as.factor(carb)4 -0.489721798 2.0628564 -0.23739985 8.143615e-01 # 7 as.factor(carb)6 -0.886846134 3.4443957 -0.25747510 7.990068e-01 # 8 as.factor(carb)8 -0.894783610 3.7496630 -0.23863041 8.134180e-01 what looking this: # term estimate ...

PHP update mysql table, subtract by 1 -

i trying ticketing system. when user has registered successfully, subtract available ticket seats 1. $availseats = $_post['myavailseats']; //3 //once registration info entered, minus available seats $sql = "update tblcourseinfo set availseats = --$availseats courseid = '$courseid'"; however when statement queried, availseats updated 0 instead of 2 . data type int availseats . why happening? edit: thanks helped me. here solution has provided: $availseats = $_post['myavailseats']; // 3 //once registration info entered, minus available seats --$availseats; // decrease seat 1 first $sql = "update tblcourseinfo set availseats = --$availseats courseid = '$courseid'"; if availseats had value, subtract directly mysql may work: $sql = "update tblcourseinfo set availseats = availseats - 1 courseid = '$courseid'"; or subtract $availseats before query.

ios - Best solution for implementing long pages in a walkthrough tutorial screen (UIPageViewController) -

i'm trying implement walkthrough tutorial screens when user launches app first time. have no problem implementing issue walkthrough pages longer (double usual length of normal screen) thought of wrapping uiimageview in uiscrollview. solution? done? done better?

dataframe - R: any function for Cartesian Product of two data frames? -

this question has answer here: how cross join in r? 6 answers i need cartesian product of 2 data frames. example, = id weight type 10 20 10 30 b 25 10 c b = date report 2007 y 2008 n then c after doing cartesian product of , b c = id weight type date report 10 20 2007 y 10 20 2008 n 10 30 b 2007 y 10 30 b 2008 n 25 10 c 2007 y 25 10 c 2008 n as ids same in a, cannot use way c <- merge(a$id,b$date) c <- merge(c,a,by="id") c <- merge(c,b,by="date") this way generate more rows. me out of here? thanks merge(a, b) , provided there no columns linking two, should default, no? from ?merge (emphasis mine): if or both by.x , by.y of length 0 (a lengt...

c++ - How are Qt signals/slots actually coupled to the elements in a .ui file? -

i'm working on qt project , confused signals , slots mechanism. feel have understanding between differences between qobject , user interface form. a user interface form (described .ui file) fed user interface compiler(uic) , produces associated header file. header file doesn't contain interface information, instead contains implementation details on qobject should formatted. qobject on other hand base class in lot of qt framework built upon. signals , slot systems based on qobject. when extending qobject class (or derived class), defining object in can produce signals , slots. format object user interface designed in qt designer, create instance of ui class (via ui header generated uic). call setup method on class , feed new qobject you're creating. this seems make sense. however, doesn't make sense when start defining signals. qt designer, have option right click , select 'signal'. when select signal (whether mouse click on button or change in progr...

meteor-slingshot/S3: How HTTP requests work between slingshot and S3 -

i'm beginner developer trying understand how 'backend' processes work when uploading files web app. i'm using edgee:slingshot in meteor project upload images amazon s3. understanding file upload slingshot makes post request s3 in order upload file bucket. confirm chrome console can see post request (after preflight options request) s3. however post request count in s3 increased 4 after uploading image. did not upload else, , there 1 other file in bucket not being used anywhere. is normal behaviour? not know nuts , bolts of http requests bit mystifying. interested because s3 prices according (amongst other things) number of requests made. bonus question: number of requests increased (by 3, not 4) after uploading image. normal behaviour? slingshot upload function returns download url of image in bucket. did not think making requests. is there kind of behind-the-scenes validation/batch upload going on causing this? thanks help.

mysql escape single quote in string without slash? -

if use mysql_real_escape_string() , add slash in string, when need output, need strip slashes using stripslashes() . how can add string single quote or double quote without adding slashes in mysql eg: $name = mysql_real_escape_string("genelia d'souza"); $result = mysql_query(" insert user (id,name) value ( 1,'$name') "); id | name -------------------- 1 | genelia d\'souza want this id | name -------------------- 1 | genelia d'souza is there way avoid adding slash before inserting , strip slashes before outputting???

can i build and package my ios app separately with xcodebuild? -

i using xcodebuild commandline tool generate ios app(mainly c++ source code). command xcodebuild -project application.xcodeproj i want ask whether can separate build phase , package phase, say, first build binary executable, @ sometime package app later. from apple technical note , xcodebuild supports various build actions such build, analyze, , archive can performed on target or scheme. however, build performed default when no action specified . so, when want package, specify action archive otherwise leave empty shown in apple example in document.

java - Not entering the success part of http response in angularjs using spring mvc -

please me resolve problem. java @requestmapping(value = "/employeelogincheck/{emailid}/{password}", method = requestmethod.get) public @responsebody string employeelogincheck( @pathvariable("emailid") string emailid, @pathvariable("password") string password) { system.out.println("employeelogincheck"); system.out.println(password); system.out.println(emailid); return emailid; } javascript var app = angular.module('signin', []) { app .controller( 'signincontroller', function($scope, $http, $window) { $scope.emailid = ''; $scope.password = ''; $scope.getvalues = function() { var email = $scope.emailid; var pass = $scope.password; return $http .get( 'employeelogincheck/' + email + '/' + pass) .then( function(response) { alert("hai"); ret...

javascript - How to determine whether the content in text frame of in design document changed through java script or action script? -

i got requirement find out if content in text frame got changed or not through action script. till comparing server side data check content indesign document text frame, check if default flag there avoid server side call. track changes seems way go indeed. alternative might use idle events monitor stories changes. josh suggested. #targetengine "storieschanges" main(); function main() { var db = {}; var myidletask = app.idletasks.item("checkstories"); if ( !myidletask.isvalid ) { myidletask = app.idletasks.add({name:"checkstories", sleep:100}); myidletask.addeventlistener(idleevent.on_idle,onidleeventhandler, false); } function onidleeventhandler(myidleevent) { var doc = app.properties.activedocument; if ( !doc ) { db = {} return; } var sts = doc.stories, st, id; var n = sts.length; while ( n-- ) { st = sts[n]; id = st.id; if ( !db[id] ) { $.writeln ("s...

php - Laravel localization problems 5.2+ -

this middleware. class beforemiddleware{ public function handle($request, closure $next) { // perform action app:setlocale(lc_all,session::get('locale')); return $next($request); } if don't place lc_all first parameter in setlocale error. "setlocale() expects @ least 2 parameters, 1 given" if put lc_all first parameter localization doesn't change. version of laravel 5.2+ i've change app::setlocale app()->setlocale(session::get('locale')); , looks works fine.

I have 1 textbox and 1 button (as check). I wanted to validate whether the adhaar number is valid or not using verhoeff algorithm using javascript -

var d = [ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] ]; $('#userform').formvalidation({ message: 'this value not valid', feedbackicons: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: {aadhaar_no: { validators: { digits: { message: 'please use numeric characters only.' ...

How to restrict epoch time in Thingworx -

i creating thing programmatically , setting property filed. if don't provide time while setting properties take epoch time in thingworx. how restrict epoch time? to explain further, if don't set datetime property on thing, making null/undefined, property report now. if keep refreshing thing's property values, keep changing now. this consider thingworx bug in datetimeprimitive. work around by, when making datetime properties, set default date, jan 1 1970, or jan 1 2000 or that. javascipt service code can know null, , whatever needs do. (you return property string, , if it's detected null date, leave blank or "not set" or whatever application might need.

Javascript closures with two instantiation -

i trying understand closure, , playing following code.i expecting value of same across objects,as closure keeps reference variable of outer function. function test(){ var i=10; return{ get:function(){return i;}, inc:function(){i++;} } } var test1= test(); var test2=test(); test1.get(); //outputs 10 test1.inc(); test2.get(); //outputs 10, expecting 11 is understanding of closures correct, creating closure in case? new closures, detailed explanation great. thanks. as others have mentioned, you've created 2 closures. the easiest way understand closures is generalisation of concept of global variables. in fact, global variables in javascript nothing more closure in global scope. a closure mechanism body of function may reference variables in outer scope. said above, global variables nothing more closure: var x; function x_plus_plus () { x++; // variable captured closure } every scope allows create closure. apart global scope can create closure...

php - joomla 1.5 meta info not coming from my website -

my website got hacked. after have cleaned whole code , db. when search website keyword on google result shows hacked page. link shows right meta info , google cached page not right. use webmaster tools , submit request google review again. have make sure website indeed clean. there guide on how clean site here - https://docs.joomla.org/security_checklist/you_have_been_hacked_or_defaced

javascript - Invoking in strict mode -

i have configuration object: jwtoptionsprovider.config({ tokengetter: (store) => { return store.get('token'); }, whitelisteddomains: ['localhost'] }); but, have strict mode enabled , following error: tokengetter not using explicit annotation , cannot invoked in strict mode i know $inject , how use in situation? just try jwtoptionsprovider.config({ tokengetter: ['store', (store) => { return store.get('token'); }], whitelisteddomains: ['localhost'] }); see https://github.com/auth0/angular-jwt#i-have-minification-problems-with-angular-jwt-in-production-whats-going-on

jquery - Why not displaying all pictures in carousel -

i have 6 picture blocks in carousel displaying fist 3 images. think wrong jquery don't understand where. @ impasse these pictures, glad hint. thanks! here blocks images <div id="collection-images" data-current="0"> <div class="photo-box"> <img id="image0" data-photo="1" data-pos="right" class="coll-img right-img" src="https://doplb1ll3c6nn.cloudfront.net/assets/home/1x/festival.jpg"> </div> <div class="photo-box"> <img id="image2" data-photo="0" data-pos="front" class="coll-img front-img" src="https://doplb1ll3c6nn.cloudfront.net/assets/home/1x/beach.jpg"> </div> <div class="photo-box"> <img id="image1" data-photo="2" data-pos="left" class="coll-img left-img" src="https://doplb1ll3c6nn.cloudfront.net/assets/ho...

reading a GML file with networkx (python) without labels for the nodes -

i have long gml file (graph modelling language) trying read networkx in python. in gml file, nodes don't have label, this: graph [ node [ id 1 ] node [ id 2 ] edge [ source 2 target 1 ] ] i error when reading file: g = nx.read_gml('simple_graph.gml') --------------------------------------------------------------------------- networkxerror traceback (most recent call last) <ipython-input-39-b1b319a08668> in <module>() ----> 1 g = nx.read_gml('simple_graph.gml') <decorator-gen-319> in read_gml(path, label, destringizer) /usr/lib/python2.7/dist-packages/networkx/utils/decorators.pyc in _open_file(func, *args, **kwargs) 218 # finally, call original function, making sure close fobj. 219 try: --> 220 result = func(*new_args, **kwargs) 221 finally: 222 if close_fobj: /usr/lib/python2.7/dist-packages/networkx/readwr...

xcode - How to find iOS locale hierarchy -

the ios system automatically picks suitable available localization app. instance, when user's locale en-in app offers en-gb , that'll act fallback (as explained here ). my question is: possible these hierarchies somewhere? the reasoning behind question that, instance, may have translations in es-co , es-cl , es-pe , ... identical , instead of including separate string files of them, i'd provide them 1 common fallback locale. know use es-419 in exemplary case might not obvious in other scenarios. answering myself here: bundle.preferredlocalizations( from: ["es", "es-419", "es-ar", "es-cl", "es-co", "es-mx", "es-pe"], forpreferences: ["es-pe"]) returns ["es-pe", "es-419", "es"] means peruvian spanish fill fall es-419 , es in order.

ocaml - End_of_file exception when creating TAR file with *ocaml_tar* -

when try create tar file using ocaml_tar library, end_of_file exception. my code ... #require "tar";; #require "tar.unix";; let f = unix.openfile "test.tar" [ unix.o_rdwr; unix.o_creat ] 0o600;; tar_unix.archive.create ["write_ex.ml"] f;; unix.close f;; ... produces following stacktrace: $ utop write_ex.ml exception: end_of_file. raised @ file "lib/tar.ml", line 549, characters 36-47 called file "lib/tar.ml", line 460, characters 4-11 called file "stream.ml", line 149, characters 33-38 called file "lib/tar.ml", line 578, characters 6-28 called file "toplevel/toploop.ml", line 180, characters 17-56 does know what's wrong? there nothing wrong code. bug in tar_unix module. output function wasn't robust enough , fails end_of_file exception if write truncated. i've fixed issue , code works fine. see pr more information. update the pr merged , newer (0.5.1) ve...

python - How can I read inputs as integers? -

why code not input integers? on web says use raw_input() , read on stack overflow (on thread did not deal integer input) raw_input() renamed input() in python 3.x. play = true while play: x = input("enter number: ") y = input("enter number: ") print(x + y) print(x - y) print(x * y) print(x / y) print(x % y) if input("play again? ") == "no": play = false python 2.x there 2 functions user input, called input , raw_input . difference between them is, raw_input doesn't evaluate data , returns is, in string form. but, input evaluate whatever entered , result of evaluation returned. example, >>> import sys >>> sys.version '2.7.6 (default, mar 22 2014, 22:59:56) \n[gcc 4.8.2]' >>> data = input("enter number: ") enter number: 5 + 17 >>> data, type(data) (22, <type 'int'>) the data 5 + 17 evaluated , result 22 . w...

python - Pygame - Smoother Movement -

i have added object/image on main_screen , object called cancer_cell . i'm trying here want object move smoothly. have repeatedle press on arrow keys keep moving. how make move while arrow keys pressed ? here's code: exitgame = false cellpos_x = 0 cellpos_y = cancer_cell.get_rect().height*2 while not exitgame: event in pygame.event.get(): if event.type == pygame.quit: exitgame = true quitgame() if event.type == pygame.keydown: if event.key == pygame.k_left: cellpos_x -= 10 if event.key == pygame.k_right: cellpos_x += 10 gameplay_bg = pygame.image.load("/users/wolf/desktop/python/img/gameplay_bg.png").convert() main_screen.fill(white) main_screen.blit(gameplay_bg, [0,0]) main_screen.blit(cancer_cell, [cellpos_x, cellpos_y]) pygame.display.flip() clock.tick(20) someone told me try solution @ how use pygame.keydown : didn't work...

Email notifications in firebase -

i know if knows way can send email when specific node in firebase created, updated or deleted? more specifically, have web service users can book each other period of time. use firebase backend store user information , on want send confirmation users' email address whenever booking has occurred. understand has been possible using zapier, no longer support firebase. anyone has workaround or idea on how send email notifications in firebase? after searching more found there no direct plugin. contacted firebase support team , considering create functionality themselves; however, when , how not yet decided. there different possibilities require kind of end coding, meaning server can watch these changes. landed on node.js similar work on, i.e. javascript. including nodemailer , firebase through npm, sending emails based on firebase event achieved this : var firebase = require("firebase"); var mainapp = firebase.initializeapp({ //firebase authentica...

security - How to setup Identity Server 3 for IOS client using Authorization Code flow -

lately i've bee playing around thinktecture's identity server 3 , more clients , flows. want see how communication happens between native ios application , identity server 3 using authorization code flow . what i've done far consuming sts(identity server 3) asp.net mvc client(hybrid flow) , angularjs client(implicit flow). sts side looks this: implicit flow client setup on sts : new client { clientid = "implicitangularclient", clientname = "angular client (implicit)", flow = flows.implicit, allowaccesstoallscopes = true, identitytokenlifetime = 10, accesstokenlifetime = 120, // if want have sso between angular app , mvc app need have option set // false both flows implement(hybrid , implicit). requireconsent = false, // redirect = uri of angular application ...

How to keep only last 5 build of certain job using Jenkins CLI -

i make jenkins' jobs cleanup more automate, of jobs (like test results) keep last 5 jobs. use jenkins cli deleting, don't know how build numbers of need delete. know? you can try go jenkins master server $jenkins_home/jobs/yourjobname/builds and then, run following script ls -ltr | awk '{print $9}' | grep -e [0-9]+ this script list folder info this 401 400 399 398 397 396 395 394 393 you can try loop them , delete 1 want deleted. br, tim

xamarin.forms - Xamarin Forms ListView ItemsSource -

Image
i'm trying use listview in xamarin forms, have list , have divide depending on day var activitiesservices = new activitiesservices(); var activities = activitiesservices.getactivities(); var datatemplate = new datatemplate(typeof(textcell)); datatemplate.setbinding(textcell.textproperty, "subject"); var list = new observablecollection<activity>(); var list2 = new observablecollection<activity>(); var list3 = new observablecollection<activity>(); var list4 = new observablecollection<activity>(); var list5 = new observablecollection<activity>(); foreach (activity item in activities) { var day = item.starttime.dayofweek; switch ((int)day) { case 1: list.add(item); break; case 2: list2.add(item); break; case 3: ...

scala.js - Writing scala-js frontend framework with server-side rendering. Unable to use scala-js-dom on server -

i'm writing scala-js frontend framework, key feature of server-side rendering. idea there components manipulate dom document.createelement , element.appendchild , others. on server i'd subclass htmldocument , element , others, override methods server dom implementation can converted plain string html. added scalajs-dom_sjs dependency server module , tried that. htmldocument , element , other classes have calls js.native inside constructors throw exceptions saying "use jvm version of library". doesn't exist obviously. use other way , implement own dom library, twice work, cause i'd have implement on server , client, while using first approach i'd implement once on server. so question is: why forbidden use scala-js library versions on server strictly , there work around it? the reason forbidden that, noticed, dom api full of js.native s. these classes not implemented in scala. part of browser's dom api, not have equivalent on jvm. can...

javascript - trying to set focus on the form element by its id using after alert message but the jsp page submitted -

javascript function:- function call on submit buttion. function getformelelemets(obj){ var form = $(obj).closest('form'); // id of form tag related var formid = form.attr('id'); var name='sampledate'; // id of element set focus alert(formid ); document.formid.name.focus(); return false; } problem statement:- function call after alert if press 'ok' focus not move curser form element.servlate called , url shows paramter there value.am generating multiple form dynamically unique id.please provide solution. just use jquery id selector # , .focus() function: function getformelelemets(obj){ var form = $(obj).closest('form'); var formid = form.attr('id'); var name = '#sampledate'; // id's starts '#' alert(formid); $(name).focus(); // select element jquery , set focus return false; }

Android usb bulkTransfer - device doesn't receive whole data -

i try receive data usb scanner. use bulktransfer. code : byte[] receivedtag = connector.receive(312); string tag = null; if (receivedtag != null) { long tagvalue = bytebuffer.wrap(receivedtag).getlong(); tag = long.tohexstring(tagvalue); if (tag.contains("daad046f62ada900")) { toast.maketext(getcontext(), "koniec skanowania" + tag, toast.length_short).show(); } else if (!tag.contains("daad046f62ada900")) { string tag2 = bytestohex(receivedtag); string[]times = tag2.split("da ad 0a 6f 73"); log.e(tag, "onclick: " + times[0]); toast.maketext(getcontext(), "" + tag2, toast.length_short).show(); ...

How to pass arguments to tcl script in Vivado GUI tcl console -

i trying execute tcl script in vivado gui tcl console , script takes argument decide type of run (synth, impl, bitgen etc.) has configured. know that, using -tclargs 1 pass arguments if script executed in vivado command-line mode. like: vivado -mode batch -source <filename> -tclargs <arguments> i tried same in vivado gui mode , got error. error: [common 17-170] unknown option '-tclargs', please type 'source -help' usage info. running 'source -help' : syntax: source [-encoding <arg>] [-notrace] [-quiet] [-verbose] <file> usage: name description ------------------------ [-encoding] specify encoding of data stored in filename [-notrace] disable tracing of sourced commands [-quiet] ignore command errors [-verbose] suspend message limits during command execution <file> script source by looking @ -help getting feeling not possible so. also, can't find documents doing so. know ...

c# - Customized theme for every logged in user -

i have dotnet 3.5 webforms application entity framework used. not able figure out how give customized theme every logged in user, twitter users have ui change(logo, color,etc) please help. according view creating different-different css/theme not possible here. because going deal thousand of users. creating multiple themes or css can work if create 4-5 themes/css . i have solution you, can create many different css . have create column in user table like: usertheme or userstyle varchar(max) and when going register user can create dynamic css on basis of primary key , change css attributes below: body { color: #cc0033; background-color: #996666; } here can create unique color codes or background color codes below: color: #cc0033; breakdown: #(constant) cc(it can first digit of first name , second name) 00(it can random value) 33(it can user primary key) now can create unique color codes , background-color codes body , save table column have cr...

c# - Concise way of checking if one of two values is null while the other isn't -

sometimes need verify out of 2 values, 1 is null while other isn't . works: (a != null && b == null) || (a == null && b != null) but becomes cluttered when variable names longer, nested properties on object. creating helper function option this, there more concise syntax writing inline? try this: (a == null) != (b == null) note if operator == overriden class, can have problem. following not use operator == object.referenceequals(a, null) == object.referenceequals(b, null)

javascript - gulp watch .js file doesn't work -

Image
gulpfile.js 'use strict'; var gulp = require('gulp'); var sass = require('gulp-sass'); var browsersync = require('browser-sync').create(); var reload = browsersync.reload; gulp.task('serve') // static server + watching scss/html files gulp.task('serve', function() { browsersync.init({ server: "./public" }); gulp.watch('./public/**/*.html').on('change', reload); // worked gulp.watch('./public/**/*.js').on('change', reload); // doesn't work }); gulp.task('sass', function () { return gulp.src('./public/sass/**/*.scss') .pipe(sass().on('error', sass.logerror)) .pipe(gulp.dest('./public/css')) .pipe(reload({stream: true})); }); gulp.task('sass:watch', function () { gulp.watch('./public/sass/**/*.scss', ['sass']) }); gulp.task('default', ['serve','sass', 'sas...