Posts

Showing posts from April, 2013

javascript - Select the direct next of a certain element -

i trying add class next p element after item clicked. in function part removes class working selector p element not correct nothing happening that. demo function classchange() { if($(this).hasclass('active')) { //do nothing } else { $('.active').removeclass('active'); $(this).next('p').addclass('active'); } } $('h1').click(function() { classchange(); }); in classchange() function, this refers window object (assuming function in global scope). if want refer clicked h1 element, define click event this: $('h1').click(classchange); if want toggle next p element's display, define classchange() this: function classchange() { $(this).next('p').toggleclass('active'); } fiddle 1 if, instead, want show 1 of p elements, define this: function classchange() { $('.active').removeclass('active'); $(this).next('p').a

How to add 30 minutes to java.sql.Time object? -

i have time object: time mytime = java.sql.time.valueof("15:33:00"); how can add 30 minutes mytime in java? means new time 16:03:00 java.sql.time mytime = java.sql.time.valueof("15:33:00"); localtime localtime = mytime.tolocaltime(); localtime = localtime.plusminutes(30); string output = localtime.tostring(); you can localtime straight away java.sql.time , can use plusminutes in localtime api add 30 minutes. might check this

javascript - what is the right way to compare two fields inside directive realization in angularjs? -

so, problem. have 2 input fields newpassword , oldpassword. want check if these 2 fields equals show error message. form looks like: <form name="passwordform" ng-submit="submitpasswordform()" modelattribute="userpasswordchange" novalidate> <div class="row"> <input path="oldpassword" type="password" id="oldpassword" name="oldpassword" placeholder="old password" ng-model="user.oldpassword" minlength="5" maxlength="128" required/> <br> <span ng-show="passwordform.oldpassword.$dirty && passwordform.oldpassword.$error.required">old password field can not empty. please check , try again.</span> <span ng-show="passwordform.oldpassword.$error.minlength || passwordform.oldpassword.$error.maxlength">old password field size must between 5 , 128<

adal - How to authenticate against an MS CRM 2016 IFD instance with javascript? -

i want authenticate against our crm 2016 ifd instance javascript make web api calls. how can this? according ms documentation , can done adal.js, answer this question on github says, ifd/adfs scenario not supported adal.js. what correct approach? can authentication done adal.js or alternatives?

multithreading - Windows Form UI Thread issue c# -

i have working application, except in one computer. in computer application crashes when savefiledialog opens. no errors, no exceptions. after research found 1 way fix crash make savefiledialog in new thread. static void open(object name) { savefiledialog savefiledialog1 = new savefiledialog(); savefiledialog1.filter = "microsoft word document (.docx)|*.docx"; savefiledialog1.filterindex = 2; savefiledialog1.restoredirectory = true; savefiledialog1.title = "where save " + (string)name + " ? "; try { th.isbackground = false; boule = savefiledialog1.showdialog() == dialogresult.ok; ptth = savefiledialog1.filename; } catch (exception exc) { messagebox.show(exc.message); } } i put in event: thread th = new thread(new parameterizedthreadstart(open)); th.start("quotation"); the problem have error current thread must set single thread apartment (sta) m

c - Based on the function's CPE, how is the lower bound calculated? -

Image
i have come across way of computing lower bound on cpe (determined critical path) data type float. however, not sure numbers have come , need clarification before attempt compute similar bounds. this have come accross: (4+3)/3 = 2.33 i assume divided 3 because of cpe value, confused (4+3) comes from. this function has cpe of 3.00 integer , floating-point data. void inner4(vec_ptr u, vec_ptr v, data t *dest) { long i; long length = vec_length(u); data_t *udata = get_vec_start(u); data_t *udata = get_vec_start(v); data_t sum = (data_t) 0; (i = 0; < length; i++){ sum = sum + udata[i] * vdata[i]' } *dest = sum; } ...i assume divided 3 because of cpe value, confused (4+3) comes from. it appears (4+3)/3 = 2.33 , representing lower bound cpe, (or cpi) float simplification of ratio (perhaps after factoring), derived shown in examples in link provided in comments. i.e. summing count of instructions per type, each 1

python - cx_Freeze error when converting .py to .exe -

so have been looking everywhere ways convert .py .exe, such py2exe , cx_freeze. have gotten cx_freeze close working, have gotten error , don't know how fix , don't see posted anywhere online. know error and, more importantly, easiest way fix it? trying convert simple program called catanimation.py test, has picture involved called cat.png. in folder called "attempt" on desktop. here screenshot of folder, files, , command prompt error: click here . i have code written here: #this setup.py import cx_freeze executables = [cx_freeze.executable("catanimation.py")] cx_freeze.setup( name="cat animation", options={"build_exe": {"packages":["pygame"], "include_files":["cat.png"]}}, executables = executables ) here command prompt information: c:\users\nick\desktop\attempt>setup.py build running build r

php - how to make a scrollable table using css -

my table has many columns resulted over-spanning in width. want make scrollable horizontally fit in screen , more neat , organized. guess css property overflow hidden. dont know put html codes. hope can help. <?php $servername = "kwe-pc\sqlexpress"; $connectioninfo = array("database" => "customerdb", "uid" => "dbadmin", "pwd" => "kwe"); $conn = sqlsrv_connect($servername, $connectioninfo); if ($conn === false) { die(print_r(sqlsrv_errors(), true)); } //declare sql statement query database $query = "select * customer_details"; //execute sql query , return records $result = sqlsrv_query($conn, $query) or die(print_r(sqlsrv_errors(), true)); //show results in table $o = '<table border=1 id="mytable"> <thead> <tr> <th>&nbsp</th> <th>rec number</th> <

scala: not possible to match on value expressions? -

why isn't possible place expressions in case statements? : x match { case <value expr> => {} } for example x match { case (1+2) => {} } is not allowed, but val someval = (1+new java.util.random().nextint()) x match { case someval => {} } is. seems if second case allowed, should first. i'm trying add list of mappings this: val typ:type = symbol.typesignature typ match { case typeof[collection.immutable.list[any]] => { return function handle type } case typeof[...] => {} case typeof[...] => {} ... many } it defies definition of patterns in pattern matching. from scala language specification , chapter 8: a pattern built constants, constructors, variables , type tests "expressions" not in list, , makes sense - think - when expression evaluated? if has side-effects, evaluated if case preceding used return result? a valid workaround using guard , is evaluated

unity3d - Import blender textures on Unity 3D are always black -

Image
i have next simple blender texture: this simple png file, imported blender add added in image texture component (at left of first image), transparent background. exported texture in 2 format, first 1 in .blend , second 1 in .fbx format. but, when export textures blender (both formats) black rectangle , spheres hasn't texture, totally gray. what i'm doing wrong @ moment import textures? you supposed bake material texture . i use maya don't know steps in blender. can google bake materials in blender .when bake maps, texture supported in unity. usually, create simple flat plane, attach material plane , position camera in front of it, bake it. doing, need color map. don't need normal maps , others. here important links learn that. https://renderedsmoothie.wordpress.com/2013/09/05/baking-ambient-occlusion/ https://renderedsmoothie.wordpress.com/2013/08/31/how-to-bake-textures-and-materials/ https://www.blender.org/manual/render/workfl

python - how to find letters that don't occur in either string? -

i need write code prints out letters don't appear in either of 2 strings. have opposite. prints out letters occur in both strings. here code. i'm not sure how change it. s1 = input('enter string:\n') s2 = input('enter second string:\n') s1 = set(s1) s2 = set(s2) def notinother(s1, s2): chars = [] char in (s1,s2): if char not in s2: if char not in s1: chars.append(char) print(chars) here i'm trying write simple , basic answer. a string containing ascii letters can found in string module from string import ascii_letters letters but of course can write directly in code letters = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz' you need 2 strings characters excluded s1, s2 = 'abcdef', 'stuvwxyz' to solve problem, can build list remaining letters using list comprehension (i think code self explanatory) rl = [c c in letters if c not in s1+s2] eventua

viewcontroller - Relationship among window, rootviewcontroller, childviewcontroller, navigationcontroller in iOS -

Image
i haven't seen resource gives , simple explanations on relationship among window, rootviewcontroller, childviewcontroller, navigationcontroller , how piece in ios development. 1 knows how put in easy-to-understand way or online resource or book job in explaining it? per documentation on uiwindow: https://developer.apple.com/library/ios/documentation/uikit/reference/uiwindow_class/ a uiwindow object provides backdrop app’s user interface , provides important event-handling behaviors. windows not have visual appearance of own, crucial presentation of app’s views. xcode typically provides application's main window, can add more if need to. from documentation link can see uiwindow uiview enter first view controller. providing main window, when start new project in xcode project template wires initial view controller, name implies controls view (uiview). you call initial view controller rootviewcontroller if handle on uiwindow swap out current initial

php - Why am I receiving a 'Fatal Error: Class 'Stripe_Customer' not found' when I attempt to create a customer object? -

whenever attempt create customer object, presented error. have tried including file paths stripe library, might pointing incorrect path. portion of script error occurs: function checkout() { error_reporting(e_all); $success = ''; $error = ''; if(isset($_post['stripetoken'])) { error_reporting(e_all); $conn = dbconnection(); $stripetoken = $_post["stripetoken"]; $random_id2 = $_post["random_id2"]; $userid = get_current_user_id(); require_once('stripe/lib/stripe.php'); $customer = stripe_customer::create(array( "source" => $stripetoken, "description" => "customer") );

Android fragments and activities questions -

this sort of extension previous question, more questions , less code ( android starting activity or calling method class (using fragments) ). i'm trying better idea of how fragments , activities work inside android apps while writing sample app of navigation drawer combined location api code. as understand it, navigation drawer has created extending activity ui components properly. i've done far broken down ui panes different fragments different xml , java files each. java file builds ui xml specified in it, , displays content in content pane while keeping nav drawer in tact, similar this: http://manishkpr.webheavens.com/android-navigation-drawer-example-using-fragments/ . each of fragments, exception of "home", needs code location apis/location activity, based on mainactivity: https://developer.android.com/training/location/retrieve-current.html . having 2 problems: my location activity class has code oncreate populate textview variables ui. ui hand

javascript - Log Restangular POST Request Data -

i new restangular. searched several posts did not find content looking for. hybrid mobile app. development. query 1: i have set baseurl http://example.com/api/v1 . assuming make below request data object parameter. how console request data check sending ? tried getrestangularurl() getrequestedurl() both gives url. var servicelocator = restangular.all('servicelocator') return { servicelocator: function (name) { var data= { "name":name } return servicelocator.post(data); } } query 2: i have many requests available in application. now, erquirement enable more security need add 1 more parameter each request being sent.is there global way add ? tried setdefaultrequestparams of restangular unable print logs verify it.

how set Button FontAwesome Icon with string in vaadin -

i want save button icon in db, i'd have like: button button = new button(); string icon = "fontawesome.cogs"; button.seticon(icon); or button button = new button(); string icon = "fonticon://fontawesome/f013"; button.seticon(new themeresource(icon)); what's right way achieve this? store name of icon in db , load name: seticon(fontawesome.valueof("cogs")) this can fail classnotfoundexception .

java - How to convert Int bit pattern to Float in Swift? -

i'm looking equivalent of java's float.intbitstofloat(int) in swift. i've tried: let myint: uint32 = ... let myfloat = float(_bits: myint) but gives me compiler error, "cannot convert value of type 'uint32' expected argument type 'fpieee32'". is there easy way missing? update: in swift 3, can do: float(bitpattern: myint) after doing digging of @martinr, there appear 2 (rather ugly) swift solutions: float._frombitpattern(myint) and unsafebitcast(myint, float.self) the former solution no longer appears documented in public api. therefore, latter seems better approach.

calculate an area based on x and y coordinates and width and height values in javascript -

Image
i have problem i've been trying solve myself without success. i have object represent rectangle, it's position (x,y) , size (width , height). i have 2 lists, both contains object mentioned before, 1 list represents positive areas , other represents negative areas. based in information, need total area results if add elements in both positive , negative lists. i'm interested in result if total area rectangle, otherwise it's irrelevant me. for example: if positive list contains these 2 objects {x:20, y:20, width:100, height:20} {x:20, y:40, width:80, height:80} and negative list contains object {x:100, y:20, width:20, height:20} the result of adding these 3 objects be: {x:20, y:20, width:80, height:100} this image shows graphical representation of 3 objects in 2 lists , result. example http://oi64.tinypic.com/i1wkeo.jpg i appreciate bring. edit: made small correction in 1 of 3 objects, , coordinate system i'm using cartesian

how to access google map in ios environment -

in worklight hybrid sample application want google map in phone (ios) environment.i using worklight 7.1, jquery mobile 1.4.5 i've done in android environment not able seeing map in iphone. my js code: var x=document.getelementbyid("demo"); function getlocation() { if(navigator.geolocation) { navigator.geolocation.getcurrentposition(position); } else{x.innerhtml="geolocation not supported browser.";} } function showposition(position) { x.innerhtml="latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude; } my html: <!doctype html> <html> <head> <meta charset="utf-8"> <title>htmlgeolocation</title> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0"> <link rel="s

angularjs - View/Stream list of images from s3 in ionic -

we want transfer hosting of images uploaded via mobile aws s3(images not publicly viewed) instead of server local storage. challenge that, how view/stream images in efficient way , limiting memory consumption of mobile phone since sending request aws s3 server give file url. in documentation , can view image url via s3.getsignedurl , have response of secured url. var s3 = new aws.s3(); var params = { bucket: 'mybucket', key: 'mypath/image.jpg' }; s3.getsignedurl ('getobject', params, function (err, url) { console.log(url); }); in ionic mobile app, using image-lazy-src efficiently load images without waiting others load. challenge how implement lazy load s3. thinking create directive downloaded/requested image url s3 use image-lazy-src load images. dont know if advisable way since sending consecutive n number of request s3 depends on number of images have in list. we able find temporary solution or alternative. edited direct

mysql - Select data where datetime is less than 30 days -

i have freeradius-mysql query select data acctstarttime more 30 days : below query: select sum(acctinputoctets - greatest((30 - unix_timestamp(acctstarttime)), 0)) + sum(acctoutputoctets - greatest((30 - unix_timestamp(acctstarttime)), 0)) radacct username = 'user2' , unix_timestamp(acctstarttime) + acctsessiontime > 30 i have query of same nature selects data acctstarttime less 30 days , im having hard time. can help? try this: select acctstarttime radacct acctstarttime < adddate(acctstarttime, interval 30 day) for more info , functions: date , time functions

python - Using fabric to run parallel task -

i want use fabric lib run parallel task via ssh , , defined script following(running on windows) : from fabric.api import * env.hosts=[ 'builder@10.0.1.88:22', 'builder@10.0.1.80:22', 'builder@10.0.1.57:22', 'builder@10.0.1.58:22', 'builder@10.0.1.59:22', ] env.password = 'xxxxxx' @parallel(pool_size=5) def test_task(): space_info = run('df -h | grep space') but when run script , return following errors , can body me what's wrong ? many thanks~ [builder@10.0.1.88:22] executing task 'update_setting_remote' [builder@10.0.1.80:22] executing task 'update_setting_remote' [builder@10.0.1.57:22] executing task 'update_setting_remote' [builder@10.0.1.58:22] executing task 'update_setting_remote' [builder@10.0.1.59:22] executing task 'update_setting_remote' traceback (most recent call last): file "c:\python27\lib\site-pack

string - PHP show text up to /*show more text*/ -

i show text before /*show more text*/ unsure how such thing because text this <ul> <li>show this</li> <li>show this</li> /*show more text*/ <li>don't show this</li> </ul> i have tried $texts = explode("/*show more text*/", $text); but issue wont fix </ul> so wondering if has solution small issue? just try jquery toggle functions it's more easier , faster. here find details: http://api.jquery.com/toggle/

ios - How do I format XML files in swift? -

Image
i creating xml file using gdataxmldocument library. creating xml file below image: but create file in proper format below image: how format xml files using swift? ok, solved question myself. edit gdataxmlnode.m make pretty-print xml default open gdataxmlnode.m , , find method - (nsstring *)xmlstring replace: int format = 0 int format = 1; then write code below in swift: let document : gdataxmldocument = gdataxmldocument(rootelement: rootelement) let xmlstring : string = gdataxmldocument.prettyprintxml(nsstring(string:document.rootelement().xmlstring()) string) this working fine.

copy - Cloning data partition to other Android devices -

we have several devices running android in industrial environment. think setting 1 device , copy whole /data directory other devices. expected benefit configure things wireless settings , install required apps , updates once on 1 device , somehow bring onto other devices. idea? i not sure if there device specific information stored in data such device id or else mess our idea. besides 'uid's responsible represent app permissions? expect problems if our apps not installed onto device come copied /data partition? specific established on device after first boot when /data created , filled, should not replaced else? would better copy selected directories or files? more effort ok if there no other way... i appreciate input can go wrong , should consider.

How to get control of outlook email body of newly creating mail dynamically in c# -

i creating addin. want control of email body in c# write on body part can send through server side. this want : outlook.application application = globals.thisaddin.application; outlook.inspector inspector = application.activeinspector(); outlook.mailitem mymailitem = (outlook.mailitem)inspector.currentitem; string subjectemail = mymailitem.subject; string bodyemail = mymailitem.body;

How to multiply values in a list using java 8 streams -

is there sum() equivalent method in stream can perform multiplication of values given in stream? i've list of integers : list<integer> listofintegers = new arraylist<>(); listofintegers.addall(arrays.aslist(1,4,2,7,5)); i'm able sum of integers, unable find api can multiply values , give output. listofintegers.stream().maptoint(a -> a).sum(); if try use foreach it, cannot store result final variables allowed used inside it. is there alternative this? try reduce of streams, should help. like: listofintegers.stream().reduce(1, (a, b) -> * b) this link provides more information on how use reduce.

itextpdf - iText spacing inbetween paragraph -

managerp4.add(chunk.newline); managerp4.add(managervo.getmanageraddress().getroad2()); managerp4.add(chunk.newline); managerp4.add(managervo.getmanageraddress().getroad3()); this generate output in newline this road 2 road 3 but want display in same line space between 2 values you can use method com.itextpdf.text.paragraph.setspacingafter(float) follows: example paragraph p = new paragraph("this string"); p.setspacingafter(10);

range - unable to get currentregion property of the Region Class VBA -

i'm getting error "unable currentregion property of region class" in below piece of code. can help? defects_dump global constant defined sheet name. dim wbktool workbook dim llastrow long set wbktool = thisworkbook wbktool.sheets(defects_dump) .activate llastrow = .range("a1").currentregion.rows.count 'more code after this... end

asp.net mvc - Getting Null Exception at UserManager.GetRoles(Convert.ToInt32(userid)) -

exception: object reference not set instance of object. {system.nullreferenceexception: object reference not set instance of object. @ system.web.httpcontextextensions.getowinenvironment(httpcontext context) @ system.web.httpcontextextensions.getowincontext(httpcontext context) you did not instantiate usermanager , trying use static class not. use new keyword ( how create instance of usermanager ).

Defining Items Based on Text File (C#) -

i'm setting list of items looks this. list<bankinfo> all_branches = new list<bankinfo>(); equipment.set_slot = "mail"; all_branches.add(new bankinfo { name = "west bank", city = "san francisco", owner = new person { name = "jeff bridges", age = 55 } }); all_branches.add(new bankinfo { name = "east bank", city = "concord", owner = new person { name = "upton sinclair", age = 102 } }); writing literally hundreds of these quite cumbersome , i'd prefer if got write this -- name: west bank city: san francisco owner: jeff bridges, 55 -- name: east bank city: concord owner: upton sinclair, 102 is there way such thing? at least there way (in c#) make symbol $item becomes all_branches.add(new bankinfo { $item (like macros in c++)? i understand mean function taking care of property assignation: private list<bankinfo> addtobankinfo(string name, string cit

Selectable in Jquery table with css class -

i tried use selectable on table has css class assigned. removing css class select works fine, assigned class nothing happens. think related css definition cannot find out how. <table id="sel-table" class="stats"> <thead> <tr> <th>id</th> <th>customer</th> <th>servername</th> <th>ip</th> <th>port</th> <th>port2</th> <th>gid</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>cust1</td> <td>testmachine</td> <td>127.0.0.1</td> <td>11970</td> <td>30035</td> <td>2</td> </tr> <tr> <td>2</td>

javascript - What is the difference between client-side and server-side programming? -

i have code: <script type="text/javascript"> var foo = 'bar'; <?php file_put_contents('foo.txt', ' + foo + '); ?> var baz = <?php echo 42; ?>; alert(baz); </script> why not write "bar" text file, alerts "42"? nb: earlier revisions of question explicitly php on server , javascript on client. essential nature of problem , solutions same any pair of languages when 1 running on client , other on server. please take in account when see answers talking specific languages. your code split 2 entirely separate parts, server side , client side . | ----------> http request | +--------------+ | +--------------+ | | | | | | browser | | | web server | | (javascript) | | | (php etc.) | | | | | | +--------------

ios - How memory leak will occur in swift? -

i new ios development , want learn how memory leak occur in swift or in objective-c , can 1 explain small example? thanks small example: class { var b: b! deinit { print("deinit of a") } } class b { var a: a! deinit { print("deinit of b") } } { let = a() let b = b() a.b = b b.a = } if run code (maybe in playground), print nothing. means deinit never called both objects , leaked. but if declare 1 of properties weak : class { weak var b: b! deinit { print("deinit of a") } } then deinit called , you'll see messages in console. edit: add example closures consider example: class c { var f: (void -> void)! deinit { print("deinit c") } } { let c = c() c.f = { print(c) } } c captures f , f captures c . got memory leak. to deal leaks in closures, have 2 options – declare captured object

jquery - Disapear element when off screen -

i'm trying disapear element when of screen , appear new one. problem is, element disapear if it's not off screen on every scroll. here code: $(window).scroll(function () { scrollhide('#zabiegi'); }); function scrollhide(sectionid) { if ($(window).width() < 968) { $(sectionid).each(function () { if (($(sectionid).find('.two').offset().top - $(window).scrolltop()) < 20) { $(sectionid).find('.two').stop().fadeout( "slow", function() { $(sectionid).find('.one').fadein(); updatemargin(sectionid,'.one'); }); } }); } } i've tryied different approach time - nothing happens , if statement give false. $(window).scroll(function () { scrollhide('#zabiegi'); }); function scrollhide(sectionid) { if ($(window).width() < 968) { $(sectionid).each(function () {

html - Difference between input-group and form-group -

Image
what difference in use between tags <input-group> , <form-group> ? input groups extended form controls. using input groups can prepend , append text or buttons text-based inputs. example, can add $ symbol, @ twitter username, or else required. form groups used wrap labels , form controls in div optimum spacing between label , control. therefore, use both form-group , input-group required. wrap label , input in form-group tag. if of input field required prepended / appended text/button, wrap control input-group. below example, combining both of them. hope helps <body> <form class="form-horizontal col-md-8" role="form"> <div class="form-group"> <label for="inputfield1" class="col-sm-2 control-label">input 1</label> <div class="col-sm-10"> <input type="text" class="form-co

javascript - function calling in nodejs -

i have couple of functions wishlist , remove_from_cart . want call 2nd function when cart inserted wishlist collection . tried doing dont know proper way , ending error. function wishlist(req, res, next) { db.cart.findone({ _id: mongoskin.helper.toobjectid(req.params._id) }, function(err, art) { if (err) return next(err); if (!art) { return res.status(404).send({ status: '404 file not found' }); } db.wishlist.insert({ art_id: art._id, user_id: req.session.user._id }, function(err, result) { if (err) return next(err); res.send(result); }) }) } function remove_from_cart(req, res, next) { db.cart.findone({ _id: mongoskin.helper.toobjectid(req.params._id) }, function(err, art) { if (!art) { return res.status(400).send({ status: '404 file not found' }

ruby - Rails-Api limits length of url -

when sending request rails app: http://0.0.0.0:3334/v1/api/notebooks/users/verified/courses/none/files/asset-v1%3aedx%2bdemox%2bdemo_course%2btype%40asset%2bblock%40welcome_r__-_demo.ipynb i notice params rails passes controller are: parameters: {"username"=>"verified", "course"=>"none", "file"=>"asset-v1:edx+demox+demo_course+type@asset+block@welcome_r__-_demo"} it has removed period, or .fileextension. realise because rails seems have set maximum length url. there way around this? the last part of url pulled out params[:format] . can avoid specifying path /*path , putting format parameter on not big deal.

apache - htaccess redirect when directory exists -

this question has answer here: htaccess redirect fails redirect when directory exists 3 answers for making friendly urls, following htaccess code applied: rewriteengine on rewritecond %{the_request} /.+?\.php[\s?] [nc] rewriterule ^ - [f] rewriterule ^([^/\.]+)$ index.php?id1=$1 [nc,l,qsa] rewriterule ^([^/\.]+)/([^/\.]+)$ index.php?id1=$1&id2=$2 [nc,l,qsa] this works for: mydomain.com/pages mydomain.com/index.php?id1=pages mydomain.com/pages/xyz mydomain.com/index.php?id1=pages&id2=xyz also, when enter mydomain.com/index.php?id1=pages&id2=xyz manually in url, redirects mydomain.com . now, when enter mydomain.com/templates templates directory exists, redirects mydomain.com/templates/?id1=templates edit 1: i tried adding line in vain: rewritecond %{request_filename} !-d rewritecond %{document_root}/$1\.php -f [

magento2 - Magento 2 API - Create shipping not updating order status -

i using magento 2 api call creating shipments (/v1/shipment). the shipment gets created in magento successfully, order status not moved complete expect. my json request below: { "entity": { "billingaddressid": 4, "comments": [], "items": [ { "orderitemid": 2, "qty": 2 } ], "orderid": 2, "shippingaddressid": 3, "totalqty": 2, "tracks": [] } } thanks it seems known bug in magento per here

Mule - Send SFTP outbound message after Collection Split -

i using collection-splitter split list. how should set payload sftp outbound-endpoint. <sftp:inbound-endpoint connector-ref="sftp-inbound" host="${sftp_host}" port="${sftp_port}" path="/files/" user="${sftp_user}" password="${sftp_pass}" responsetimeout="10000" pollingfrequency="30000" fileage="20000" sizecheckwaittime="5000" archivedir="/files/archive/" doc:name="sftp" > <file:filename-regex-filter pattern="test(.*).zip" casesensitive="true"/> </sftp:inbound-endpoint> <set-variable variablename="regexval" value="${regex}" doc:name="variable"/> <set-variable variablename="sourcefilename" value="#[flowvars.originalfilename]" doc:name="variable"/> <custom-transformer na

gcc - C simple program doesn't work -

hello everyone! i'm trying learn c language , have trouble: example code book works should work: #include <stdio.h> /* печать таблицы температур по Фаренгейту и Цельсию для fahr = 0, 20, ..., 300 */ main() { int fahr, celsius; int lower, upper, step; lower = 0; /* нижняя граница таблицы температур */ upper = 300; /* верхняя граница */ step = 20; /* шаг */ fahr = lower; while (fahr <= upper) { celsius = 5 * (fahr-32) / 9; printf("%d\t%d\n", fahr, celsius); fahr = fahr + step; } } output: 0 -17 20 -6 40 4 60 15 80 26 100 37 120 48 140 60 160 71 180 82 200 93 220 104 240 115 260 126 280 137 300 148 but code i've written doesn't anything!: #include <stdio.h> main() { int fahr, celsius, lower, upper, step; printf("enter lower temperature:"); scanf("%d", &lower)

python - matplotlib.fill_between not working with mdates -

this question has answer here: pandas , matplotlib - fill_between() vs datetime64 3 answers matplotlib's fill_between doesnt work plot_date, alternatives? 2 answers i want create plot this: sample image but in x_axis want display date. have array of datetime dates generate cycling through different values path_time: times.append(datetime.datetime.strptime(path_time,"%y%m%d_%h%m%s")) i can plot scatter points this: for in range(1,np.size(times)): plt.scatter(times[i],y[i],color='red') to plot errors, generate arrays y1 , y2 standard deviation of data y , want fill area in between. plt.fill_between(times,y1,y2,where=y>0.4,alpha=0.4,color='blue') this works fine if x axis defined integer vales not if it's defined da

angularjs - Token must be defined! error -

when main.ts bootstrap app.ts, looks good. main.ts import {bootstrap} 'angular2/platform/browser'; import {appcomponent} 'app/app'; import {router_providers,router_directives} 'angular2/router'; import {platform_directives,provide} 'angular2/core'; bootstrap(appcomponent, [router_providers, provide(platform_directives, {usevalue: [router_directives], multi:true}), ]); app.ts import {component,view} 'angular2/core'; import {routeconfig} 'angular2/router'; import {playermanagement} './partials/player-management'; import {report} './partials/report'; @component({ selector: 'my-app', templateurl: 'app/appcomponent.html', }) @routeconfig([ {path:'/playermanagement', name: 'playermanagement', component: playermanagement}, {path:'/report', name: 'report', component: report} ]) export class appcomponent { } but when try change boot