Posts

Showing posts from February, 2010

c++ - Binary Search Tree delete function not working properly -

i working binary search tree , attempting create function delete single node. reason nodes not delete (most of seem instances have right node not left) node won't delete seems pretty haphazard makes difficult debug. error mov(30071,0x7fff73b1d300) malloc: *** error object 0x7fcb2b404f40: pointer being freed not allocated *** set breakpoint in malloc_error_break debug abort trap: 6 but of time node doesn't delete , program continues run. here delete function: node* tree::deletenode(node *node,string title) { if(node == null){ return node; } else if(node->title.compare(title) > 0){ node->left = deletenode(node->left, title); } else if(node->title.compare(title) < 0){ node->right = deletenode(node->right, title); } else { //no child if(node->left == null && node->right == null){ if(node == node->parent->right) { node->parent->right = null; } else { ...

swift2 - Declaring a variable as Integer in Swift -

Image
so i'm trying learn swift , on button action, want declare variable integer collects value text field, calculates if not nil , prints value. why asking me make variable constant? this i've tried import uikit class viewcontroller: uiviewcontroller { @iboutlet weak var enterage: uitextfield! @iboutlet weak var catage: uilabel! @ibaction func findage(sender: anyobject) { var newage = int(enterage.text!) if newage! == 0 { var catyears = newage! * 7 catage.text = "your cat \(catyears) in age" } else { catage.text = "please enter whole number" } } override func viewdidload() { super.viewdidload() // additional setup after loading view, typically nib. } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } } xcode version 7.1 error: ...

cryptography - Java - Difference between javax.crypto.Mac and javax.crypto.Cipher? -

i understand difference between javax.crypto.mac , javax.crypto.cipher . 2 classes looks similar (they have similar methods 2 classes not inherits each another). what's fundamental difference between 2 classes ? when should use (or not use) mac ? when should use (or not use) cipher ? a message authentication code integrity. computes, on input message, kind of "keyed checksum" depends on message , on key. knowledge of key, mac can verified match given message. alterations reliably detected. a symmetric encryption algorithm confidentiality. transforms message unreadable sequence of bits; encryption reversible provided decryption key known. mac not ensure confidentiality; message kept is, plainly readable. encryption not ensure integrity; alterations may go undetected. in applied cryptography, need both. (but mind "properly" term big.)

ecmascript 6 - ESLint rule error for import -

Image
i getting below error eslint. i have added ecmafeatures: { "modules": true } in .eslintrc file well. because you're getting message, looks you've upgraded eslint 2.0, great! can see 2 changes you'll make configuration, though if else comes up, it's covered under 2.0 migration guide : in 2.0, "ecmafeatures": { "modules": true } has become "parseroptions": { "sourcetype": "module" } . we replaced space-after-keywords new rule, keyword-spacing , introduced in 1 of 2.0 betas. if using "space-after-keywords: 2 , can change "keyword-spacing": 2 now. putting together, .eslintrc eslint 2.0 should include this: { "parseroptions": { "sourcetype": "module" }, "env": { "es6": true }, "rules": { "keyword-spacing": 2 } }

elasticsearch sorting unexpected null returned -

i followed doc https://www.elastic.co/guide/en/elasticsearch/guide/current/multi-fields.html add sorting column name field. unfortunately, not working these steps: add index mapping put /staff { "mappings": { "staff": { "properties": { "id": { "type": "string", "index": "not_analyzed" }, "name": { "type": "string", "fields": { "raw": { "type": "string", "index": "not_analyzed" } } } } } } } add document post /staff/list { "id": 5, "name": ...

c++ - QTreeWidgetItem editable allow entering number only -

i created qtreewidget several qtreewidgetitem . here code: //defined property tree m_ppropertytree = new qtreewidget(); m_ppropertytree->setsizepolicy(qsizepolicy::expanding, qsizepolicy::expanding); m_ppropertytree->setcolumncount(2); m_ppropertytree->setheaderlabels(qstringlist() << "property" << "value"); //update property tree //--geometry qtreewidgetitem *pgeometryitem = new qtreewidgetitem(m_ppropertytree); pgeometryitem->settext(0, "geometry"); //x qtreewidgetitem *pxitem = new qtreewidgetitem(); pxitem->settext(0, "x"); pxitem->settext(1, qstring::number(geometry().x())); pxitem->setflags(pxitem->flags() | qt::itemiseditable); pgeometryitem->addchild(pxitem); //y qtreewidgetitem *pyitem = new qtreewidgetitem(); pyitem->settext(0, "y"); pyitem->settext(1, qstring::number(geometry().y())); pyitem->setflags(pyitem->flags() | qt::itemiseditable); pgeometryitem->addchild(...

android - adjustpan not work in expandablelistview when click second time for the same edittext -

first time,click edittext in expandablelistview,the whole layout scrolled ,and user can see edittext. click softkeyboard finish collapse softkeyboard , click edittext second time ,softkeyboard show, whole layout not scrolled, , user cannot see edittext. find in listview ,too.i searched long time , 1 says anroid bug? there replacement? by many days spent,i found solution. hack. put edittext wrapped in linearlayout. detect softkeyboard show visiable layout change. public final void setkeyboardlistener(final onkeyboardvisibilitylistener listener) { final view activityrootview = getwindow().getdecorview() .findviewbyid(android.r.id.content); activityrootview.getviewtreeobserver() .addongloballayoutlistener(new ongloballayoutlistener() { private final rect r = new rect(); private boolean wasopened; @override public void ongloballayout() { activityrootview.getwindowvisibledisplayframe(r); int heightdiff = activit...

python - Finding prime divisors from a given integer -

i have find divisors of given integer, , divisors have find prime numbers , put them in list lowest highest. this have far: def prime_divisors(n): j = 2 list1 = [] prime_list = [] in range(2,n+1): if n%i == 0: if i==2 or i==3: prime_list.append(i) elif i%j == 0: j in range(2,n+1,2): list1.append(j) elif n%2 == 1 or n%3 == 1: prime_list.append(n) return prime_list return prime_list prime_divisors(12) your test check if divisor prime incorrect. error seems @ elif i%j == 0: section. also, happens list1 ? linked questions regarding prime testing: answer1 answer2 . 1 picked below may not efficient, works. from math import sqrt; itertools import count, islice def is_prime(n): return n > 1 , all(n%i in islice(count(2), int(sqrt(n)-1))) def prime_divisors(n): prime_list = [] ...

java - How to separate negative numbers and positive numbers from an array? -

i want separate negative numbers , positive numbers in array. for example, if array has 10 values , {-8,7,3,-1,0,2,-2,4,-6,7}, want new modified array {-6,-2,-1,-8,7,3,0,2,4,7}. i want in o(n^2) , have written code well. not getting right outputs. code wrong? import java.util.random; public class apples { public static void main(string[] args) { random randominteger=new random(); int[] a=new int[100]; for(int i=0;i<a.length;i++) { a[i]=randominteger.nextint((int)system.currenttimemillis())%20 - 10; } for(int i=0;i<a.length;i++) { if(a[i]<0) { int temp=a[i]; for(int j=i;j>0;j--) { a[j]=a[j-1]; j--; } a[0]=temp; } } for(int i=0;i<a.length;i++) { system.out.print(a[i]+" "); } } } ...

Java String Manipulation ReplaceAll -

i new java not programming in general. i've been trying understand java string replaceall...specifically reading in strings text file...an example "i jump high in air you." 1) want change "i" "a" not beginning of word, , 2) u "o" u @ end of word. appreciated. (also, if can point me tutorial on topic [i learn best looking @ examples] appreciated) try this. string s = "i jump high in air you."; s = s.replaceall("(?!\\b)i", "a") .replaceall("u\\b", "o"); system.out.println(s); // -> jump hagh in aar yoo.

razor - Input placeholder from ViewModel metadata in ASP.NET Core 1.0 -

Image
is possible set built-in asp-for tag helper take input placeholder [display(prompt = "this placeholder")] attribute in view model. [display(name="name", prompt = "this placeholder")] public string name { get; set; } in mvc 5 able achieve adding additional logic in editor templates , checking viewdata.modelmetadata.watermark property. example: @model string @{ dictionary<string, object> htmlattributes = new dictionary<string, object>(); htmlattributes.add("class", "form-control"); if (!string.isnullorwhitespace(viewdata.modelmetadata.watermark)) { htmlattributes.add("placeholder", viewdata.modelmetadata.watermark); } } @html.label("") @html.textbox("", viewdata.templateinfo.formattedmodelvalue, htmlattributes) @html.validationmessage("", "", new { @class = "text-danger" }) but in asp.net core 1.0 start using new tag ...

osx - I can't login mysql server on mac -

i installed mysql on mac. when access mysql. terminal showed 'bash: mysql: command not found' changed setting go /usr/bin directory sudo ln -s /usr/local/mysql/bin/mysql mysql then ls -l mysql => lrwxr-xr-x 1 root wheel 26 3 7 12:23 mysql -> /usr/local/mysql/bin/mysql next access mysql server something wrong error 1045 (28000): access denied user 'kimjaeyeon'@'localhost' (using password: no) how cant solve problem?? after checking if mysql server running, please try using -p option, asks enter password, like $ mysql -h localhost -u kimjaeyeon -p to check if mysql server running: $ ps auxf | grep mysql

asp.net mvc - Why is the session null in a method inside controller -

i creating mvc 5 application. grabs array of objects json deserialize create new object , store object in session. can access session in partial view , working fine when click in link on page direct me method in same controller , try retrieve session null. has idea why happening. store in method in controller , return view , driver object httpcontext.session["allinfo"] = driver; httpcontext.session["loggedin"] = true; then check in partial view , create dynamic links. working fine till here loggedin true , allinfo not null @if (httpcontext.current.session["loggedin"] != null) { <li>@html.actionlink("other links", "index", "home")</li> <li>@html.actionlink("other links", "about", "home")</li> <li>@html.actionlink("other links", "contact", "home")</li> } a link in page navigate user different view. in control...

java - How can I tell if my actionbar's title is going to be truncated? -

Image
in app want display 2 pieces of information in title of actionbar. since title can of various length, devices not able display both pieces of information. if happens can display second string using getsupportactionbar().setsubtitle . however, issue i'm having don't know how check if title going truncated. i've tried using getsupportactionbar().istitletruncated() , returns false. if (getsupportactionbar().istitletruncated()) { getsupportactionbar().settitle(username); getsupportactionbar().setsubtitle("❤" + " " + string.valueof(rating)); } else { getsupportactionbar().settitle(username + " " + "❤" + " " + string.valueof(rating)); } according https://code.google.com/p/android/issues/detail?id=81987 istitletruncated() requires layout pass in order return. sadly don't think istitletruncated() work me. does know how else can ac...

How to prevent user from accessing complete source of angularjs application -

if angularjs application created , hosted user have access source since getting rendered there can @ least part of source prevented user access directly. if how do that. you combination of lazy loading, authentication , server-side rendering... see http://wassimchegham.com/blog/angular-2-universal-isomorphic-server-rendering-ng2-survey-results

php - Not able to retrieve cookie data from a multidimensional array -

this question has answer here: php - setcookie(); not working 4 answers i'm new cookies here how i'm setting , retrieving data if(!isset($_cookie['cart'])){ $_cookie['cart'] = array(); } setcookie("cart[$stk_id]['name']", $name, time()+24*60*60, "/"); setcookie("cart[$stk_id]['quantity']", $qty, time()+24*60*60, "/"); setcookie("cart[$stk_id]['vendor']", $vendor, time()+24*60*60, "/"); foreach ($_cookie['cart'] $stk_id => $product){ $qty = $product['quantity']; $pro_name = $product['name']; } but i'm getting error notice: undefined index: quantity , name. problem? cookies array store commonly used once variable ,you set cookies name in array,but create array first , after set cookie name more convenient.he...

file permissions - Overriding default umask for docker daemon -

i'm trying mount folder on host machine inside container. in cases when host folder not exist, docker daemon automatically creates folder on host machine , assigns permissions based on default umask(which of root). result of this, not possible write folder within container due permission issues(script inside container runs unprivileged user). tried overriding permissions assigned setting umask in startup script docker believe being ignored. there way can override umask docker uses achieve this? i created script problem. here is: https://github.com/coppit/docker-inotify-command/blob/master/runas.sh you call like: runas.sh 99 100 0000 /mycommand.sh 99 user id number, , 100 group id number in host want emulate. 0000 umask.

replace - RegEx match first occurrence before keyword -

i have following string: <ul><li><span>some words here.</span></li><li><span>other words here.</span></li><li><span>code: 55555.</span></li></ul> my goal remove part string, set of li tags contain "code" keyword: <li><span>code: 55555.</span></li> i trying write regex me match , replace substring. text in between <li></li> might vary have keyword "code". have far: <li>(.*)code:(.*?)<\/li> the problem is, matches first <li> tag , want match starting <li> tag right before our keyword "code". thank help! <li>(?:.(?!</li>))+code:(?:.*?)</li> match <li> literally followed number of characters literal </li> doesn't match (this ensures match start @ relevant <li> ) followed literal code: followed number of characters (non-greedy) until literal ...

html - How to call this url using Only javascript -

i have url list of objects xml https://test/ab i want call using javascript try function loadxmldoc() { xhttp.open("get", "https://test/ab", true); } xhttp.send(); } please help it gives status correct , ready state correct give me responsetext empty but when try url on browser works fine if cors problem try this addon in chrome. can go through question know more possible solutions problem.

apache pig - How to fetch one value from list in a column for grouped data in Pig Script -

i have data getting fetched using pig script - generate count(c) kount, group.methodname, group.pool, min(c.time), max(c.time), c.flowid }; here flowid(alphanumeric) list multiple ids corresponding different occurrences of method names need 1 id can list. how can achieve using pig script? so, in above query how single flow id instead of list of flow ids? any pointers appreciated.. i tried max flow id not work since flow id alphanumeric. solved using - e = foreach d { sorted = order c time desc; top = limit sorted 1; generate count(c) kount,flatten(top), min(c.time); }; the flatten top have latest flow id based on time

html - How to start a link when entering page? -

i have link on web page: <a id="demo03" href="#modal-03">demo03</a> how can make link run automatically, when enter page? hope can me! thanks :-) try this <html> <head></head> <body> <a id="demo03" href="#modal-03">demo03</a> <script type="text/javascript"> (function() { var link = document.getelementbyid('demo03'); link.click(); })(); </script> </body> </html>

model view controller - mvc azure ad token expiration -

i'm building mvc5 app hosted on azure in term used throught wpf app. as need check user group membership implemented graph api following guidance in article : https://azure.microsoft.com/fr-fr/documentation/samples/active-directory-dotnet-graphapi-web/ it works quite fine time after user logged in access following controller raise access denied error : public async task<actionresult> index() { string uid = claimsprincipal.current.findfirst("http://schemas.microsoft.com/identity/claims/objectidentifier").value; activedirectoryclient client = authenticationhelper.getactivedirectoryclient(); iuser aduser = client.users.where(u => u.objectid == uid).executeasync().result.currentpage.singleordefault(); ilist<group> groupmembership = new list<group>(); var userfetcher = (iuserfetcher)aduser; ipagedcollection<idirectoryobject> pagedcollection = await userfetcher.memberof.executeasync(); ...

database - Select some checkbox in a select with a SQL request -

i new here , happy here :). sorry bad english. my question simple. <select id="test1" onchange="" multiple="multiple"> <?php foreach (getcategories() $key => $value) { echo "<option id=".$value["id"].">".$value["name"].'</option>'; } ?> </select> this code create category list. use bootstrap multiselect, select made of checkboxes. i want check category if product in category. <select id="test2" onchange="" multiple="multiple"> <?php foreach (getcategoriesparentes(10) $key => $value) { echo "<option id=".$value["id"].">".$value["name"].'</option>'; } ?> </select> this same code create list categories of product id 10. (so, can use function getcategoriesparentes(id) me ) i in first select option, categories...

ansible - Ruby - display backtick output on console -

in ruby i'm using backticks execute (many) shell commands. how shell command output displayed on console? a bit more detail. if run (ansible) command following, lots of scrolling output on console: % ansible-playbook config.yml -e foo=bar -e baz=qux play [base setup] ************************************************************** task [setup] ******************************************************************* ok: [10.99.66.210] ... etc, etc however if execute same command ruby (using backticks) don't see output on console: # cmd = ansible-playbook config.yml -e foo=bar -e baz=qux `#{cmd}` which unfortunate, i'd see output in order debug. redirect output ruby script (tailed) log file, want see output happens. thanks david k-j 's comment, ruby—open3.popen3 the solution me open3#popen2e , example: # cmd = ansible-playbook config.yml -e foo=bar -e baz=qux puts cmd if execute puts "executing..." dir.chdir("..") open3....

ios - Is it posible for a paypalpaymentviewcontroller view to be placed inside a uiview? -

is posible paypalpaymentviewcontroller view placed inside uiview? have been trying out hours , i'm not getting result. there plugin can let me implement paypal payment ui app view? think question straight forward enough.thanks in advance help. no not possible placed inside uiview.

php - count array value with condition -

i have array data contain values. want count particular key value. my array : array ( [0] => stdclass object ( [id] => 3 [product_id] => 42 [user_id] => 69 [order_item_id] => 0 [sku_id] => 78 [rate] => 4 // count [description] => wonderful dress. [is_certifiedbuyer] => 1 [status] => 1 [deleted] => 0 [created_at] => 2016-03-11 16:53:31 [updated_at] => 2016-03-11 16:53:31 [username] => hiral [productname] => aish dress ) [1] => stdclass object ( [id] => 4 [product_id] => 42 [user_id] => 12 [order_item_id] => 0 [sku_id] => 78 [rate] => 2 [description] => greate dress. [is_certifiedbuyer] => 1 [status] =>...

javascript - Undefined service controller using route -

i using angular service route service file separate. , face branchservice undefined error in console.see code in plunker code here branchservice.js: angular.module("myapp").service('branchservice', ['$http', function ($http) { var link = "http://localhost:8008/"; //----get dining tables`enter code here` this.getbranches = function ($scope) { return $http({ method: "get", url: encodeuri(link + "branch/getbranches/"), headers: { 'content-type': 'application/json' } }).success(function (data) { console.log(data); }).error(function (data) { console.log(data); }); }; }]); and mycontroller.js here: var app = angular.module("myapp", ['ngroute']); app.config(function ($routeprovider) { $routeprovider .when('/branches', { templateurl: 'branches.html...

c# - Entity Framework Core: How to add a composite object? -

there following composite object, example: public class parent { [key] public int id { get; set; } [foreignkey("childrefid")] public guid childid { get; set; } public child child { get; set; } } public class child { [key] public guid id { get; set; } [foreignkey("parentrefid")] public int parentid { get; set; } public parent parent { get; set; } } parent , child has one-to-one relation: modelbuilder.entity<parent>() .hasone(parent => parent.child) .withone(child => child.parent) .willcascadeondelete(); i try create new parent child , save in db: var parent = new parent { child = new child() }; dbcontext.parents.add(parent); dbcontext.savechanges(); //<-- exception! ...and following exception: system.data.sqlclient.sqlexception: insert statement conflicted foreign key constraint "fk_parent_child_childid". conflict occurred in database "mydatabase", table ...

openstack - VMs not able to ping Virtual Gateway -

i have set devstack 2 virtual routers. 1 of routers has external ip 172.24.4.4 , internal ip of 10.10.6.1 have private cloud in 10.10.6.0/24 network. have spawned vm in cloud ip 10.10.6.3 have set floating ip: 172.24.4.5 however, unable ping floating ip. also, noticed unable ping vm 10.10.6.3 neutron. output: sudo ip netns exec qrouter-74759db2-9044-46eb-a32a-325995b88cf9 ping 10.10.6.3 ping 10.10.6.3 (10.10.6.3) 56(84) bytes of data. 10.10.6.1 icmp_seq=1 destination host unreachable 10.10.6.1 icmp_seq=2 destination host unreachable 10.10.6.1 icmp_seq=3 destination host unreachable 10.10.6.1 icmp_seq=4 destination host unreachable ^c --- 10.10.6.3 ping statistics --- 5 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3998ms pipe 3 i spawned cirros vm , found not able ping gatway 10.10.6.1 worked last time around , time, not sure changed. icmp security rule in place. please let me know if need other info. please me on this. check if dhcp agent worki...

jquery - Adding a toggleClass on Click function, how to add a new hover with it? -

hope guys have great day far, still learning jquery here, have problem , if feels helping out great, i have list class called "nav" see html below, when click on 5th child on list have added toggleclass list text color changes white black, due new background-color i've added, the problem is , have css hover on list makes text black on hover, see css below, , want hover change temporarily toggleclass text-color change, toggle class on click called "active2" , set hover state on "active2", toggle class works not hover state. how make work, hover changes, anyone? $(".nav li:nth-child(5)").click(function() { $(".nav li").toggleclass("active2"); }); .nav li:hover { color: #000; } .active2 { color: #000; } .active2:hover { color: #fff; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul class="nav"> <li>te...

bash - getopts no argument provided -

how check whether there no required argument provided? found ":" option in switch case should sufficient purpose, never enters case (codeblock). doesn't matter whether put "colon-case" @ beginning or elsewhere. my code: while getopts :a:b: option; case "$option" in a) var1=$optarg ;; b) var2=$optarg ;; ?) exitscript "`echo "invalid option $optarg"`" "5" ;; :) exitscript "`echo "option -$optarg requires argument."`" "5" ;; *) exitscript "`echo "option $optarg unrecognized."`" "5" ;; esac done thx in advance. you must escape ? . next can (partially) works. err() { 1>&2 echo "$0: error $@"; return 1; } while getopts ":a:b:" opt; c...

xsd - XML validation for empty decimal element with precision attribute -

i have issue validating empty element against xsd contains definition below. if total_amt comes out empty, want empty element in xml document, <total_amt/> so have created custom datatype in xsd shown below: <xs:simpletype name="decimal-or-empty"> <xs:union membertypes="xs:decimal empty-string" /> </xs:simpletype> <xs:simpletype name="empty-string"> <xs:restriction base="xs:string"> <xs:enumeration value="" /> </xs:restriction> </xs:simpletype> and xsd definition of element shown below. <xs:element name = "total_amt" nillable="false" minoccurs="0" type="decimal-or-empty"> <xs:complextype> <xs:simplecontent> <xs:extension base="xs:decimal"> <xs:attribute name="precision" type=...

c++ - What's the difference between these two memset? -

int color[1001][1001]; int m,n; m=10; n=10; memset(color,0,sizeof(color)); memset(color,0,sizeof(color[0][0])*m*n ); what's difference between these 2 memset statements? any answer highly appreciated. in advance. what's difference between these 2 memset statements? the memset function takes, destination, value , count. count sizeof(color) sizeof(int) * 1001 * 1001 first call. for second sizeof(int) * 10 * 10 . the former clears complete array zeros, while latter partially, starting color[0][0] color[0][99] , relies on fact arrays laid out in row-major fashion. relevant excerpt c11 standard (draft n1570), §6.5.2.1 array subscripting : […] follows arrays stored in row-major order (last subscript varies fastest). alternatively, if m = n = 1001 i.e. m , n denote array's dimensions, 2 calls same, just 2 different ways of writing it .

c# - stop Listview from capturing mouse scroll inside ScrollViewer in XAML -

hello i'm making uwp app, on 1 of pages want website experience, meaning long scroll on page. i have listview inside pivot on page. it looks this. <scrollviewer x:name="scrollviewer" manipulationmode="all" scrollviewer.isverticalscrollchainingenabled="true" verticalscrollbarvisibility="auto"> <relativepanel> <image /> <pivot> <listview /> </pivot> <other stuff /> </relativepanel> now problem that, mouse scroll works fine when im holding mouse on object except listview, mouse on listview scroll dont work. i have tried creating custom listview style dont work. <style x:key="noscrolllistviewstyle" targettype="listview"> <setter property="istabstop" value="false" /> <setter...

Count number within slabs through excels function / formula -

i want count amount between different value slabs. example **customer amount** 100 b 300 500 c 700 d 900 e 1100 f 1300 g 1500 h 1700 1900 desired result **solutions count** between 100-500 2 between 500-1000 3 between 1000-1500 3 between 1500-2000 2 i tried trough countif formula include lot of efforts when there huge data , lots of amount slabs included if can help, have peace of code generates formula "slabs", , calculate number of occurrences within. say have values in column c (beware c contain numbers; sure can make $c$1:$c$1000$ or so), , plots of slabs start 0 in $d$14 . output in column g (and debug in columns e - f) with function maker1c1: function maker1c1(a1formula string) string maker1c1 = application.convertformula( _ formula:=a1formula, _ fromrefer...

ssl - App push notification production failed (again) -

my problem similar topic apns push notifications not working on production after appstore release notifications did not works. unlike him, generate pem file used https://github.com/fastlane/fastlane/tree/master/pem , have exported app' "ios store deployment" because don't have permission push myself... do have idea? shame on me... in php file sent notifications "url apple developement"...

html - How to design aggregations filter in css for week, month? -

i want design aggregation filter week, month,etc. following image. please see image, want design same-way image : image want design css please see demo demo <style type="text/css"> .tag { /*display: block;*/ border: 1px solid #4f9f4f; padding: 6px 12px; font: 12px/17px 'opensanslight'; color: #4f9f4f; text-decoration: none; } .tag-leftmost { border: 1px solid #4f9f4f; border-bottom-left-radius: 20px; border-top-left-radius: 20px; padding: 6px 12px; font: 12px/17px 'opensanslight'; color: #4f9f4f; text-decoration: none; } .tag-rightmost { border: 1px solid #4f9f4f; border-bottom-right-radius: 20px; border-top-right-radius: 20px; padding: 6px 12px; font: 12px/17px 'opensanslight'; color: #4f9f4f; text-decoration: none; } .tag-center tag{ } </style> <div class="col-md-12 col-sm-12"> <a title="week? category" ng-mo...

c# - ASP.NET async task execution sequence -

i come across concurrency coding on asp.net , found there 2 ways trigger async method @ page_load method registerasynctask(new pageasynctask(dosthasync())); await dosthasync(); however, have different operation result. case 1, code right after registerasynctask run before code in dosthasync(). while code after await run @ completion of dosthasync(). e.g: //protected async void page_load(object sender, eventargs e) protected void page_load(object sender, eventargs e) { response.write("start</br>"); response.flush(); registerasynctask(new pageasynctask(dosthasync())); //await dosthasync(); response.write("end</br>"); response.flush(); } public async task loadsomedata() { await task.delay(1000); response.write("do sth async</br>"); response.flush(); } this code snippet generate following result: start end sth async *(after 1 second delay)* while uncomment await dosthasync() co...

html - List of HTML5 elements that can be nested inside P element? -

i trying figure valid html5 elements can nested inside paragraph elements such w3 validator doesn't show errors. mean trying figure tags can replace dots in following code such w3 validator doesn't show errors: <p>...</p> is there such list available? tried searching on google without luck. even if converse list available, i.e. elements can not nested inside paragraph elements, enough me. the html5 spec tells <p> element's content model phrasing content . phrasing content defined spec: 3.2.5.1.5 phrasing content phrasing content text of document, elements mark text @ intra-paragraph level. runs of phrasing content form paragraphs. a (if contains phrasing content) abbr area (if descendant of map element) audio b bdi bdo br button canvas cite code command datalist del (if contains phrasing content) dfn em embed ...

Does anyone know how to manually mangle names in Visual C++? -

if have function in .c like void foo(int c, char v); ...in .obj, becomes symbol named _foo ...as per c name mangling rules. if have similar function in .cpp file, becomes else entirely, per compiler-specific name mangling rules. msvc 12 give this: ?foo@@yaxhd@z if have function foo in .cpp file , want use c name mangling rules (assuming can without overloading), can declare as extern "c" void foo(int c, char v); ...in case, we're old _foo ...in .obj symbol table. my question is, possible go other way around? if wanted simulate c++ name mangling c function, easy gcc because gcc's name mangling rules make use of identifier-friendly characters, mangled name of foo becomes _zn3fooeic, , write void zn3fooeic(int c, char v); back in microsoft-compiler-land, can't create function name invalid identifier called void ?foo@@yaxhd@z(int c, char v); ...but i'd still function show symbol name in .obj symbol table. any ideas? i've loo...

typescript - TSLint on javascript files -

i spent many hour getting work, still without success... the question is: how use tslint on .js file? why? i'm trying have best possible ide writing many javascript scripts, used in our internal sw. my vision: i have documented typescript definitions of functions , want use them in .js. i want import .js file , see errors on it. tslint capable type control on .ts, according .d.ts files. on .js file, jshint/eslint can see function names , parametres .d.ts files. ok, it's not enough. there no type control in .js, i'm missing. use jshint/eslint tslint in same time. using few functions both, making great combo in end. (tslint types, jshint/eslint rest) do not allow use typescript keywords in javascript. autocomplete in .js .d.ts. ok, working. i can code in vscode, sublime, netbeans. thank ideas! there documentation on topic in vscode docs: https://code.visualstudio.com/docs/languages/javascript you can use https://github.com/typings/typings ins...

xslt - Convert 12 hour format date into 24 hour in XSLT1.0 or XSLT2.0 -

i need convert date 12 hour format 24 hour format. input: 01/27/2016 07:01:36 pm expected output: 201601271901(yyyymmddhhmm) i have used format-datetime() function in code ,i getting error <xsl:value-of select="format-datetime(part_need/promised_dt,'[y0001][m01][d01][h01][m01]')"/> error: description: forg0001: invalid datetime value "01/27/2016 07:01:36 pm" (non-numeric year component) please on issue your input not valid iso 8601 date/time, cannot use built-in date/time functions on it. try instead (xslt 2.0): <xsl:template match="inputdate"> <xsl:copy> <xsl:variable name="dte" select="tokenize(.,'/|\s|:')" /> <xsl:value-of select="$dte[3]" /> <xsl:value-of select="$dte[1]" /> <xsl:value-of select="$dte[2]" /> <xsl:variable name="h24" select="xs:integer($...

i want to pubslish 3 million lines to Queue. Will JMS queue supports it -

i want publish 3 million lines(1 jms message = l line) jms queue. each line 1 jms message. totally publish 3 million message. jms queue supports of large data in queue? you have not mentioned in time frame want publish 3 million messages. 3 million messages published in second or minute or hour or day(s). size of each message? kbs or mbs ? how published messages consumed consumers? so depends on number of such parameters understand if jms provider can handle requirement or not. it's not practice use queue database. messages in queue must consumed possible message build avoided. message build affect throughput.

Java type erasure - why can I see the type when I look at the bytecode? -

i trying understand why writing both methods in class not allowed public bool plus(list<string>) {return true;} public bool plus(list<integer>) {return true;} i try figure how related type erasure when decompile following code public class test<t> { boolean plus2(list<t> ss) {return false;} boolean plus(list<string> ss) {return false;} boolean plus(set<integer> ss) {return false;} } i same when decompile java decompiler (jd) even when print byte code can see types. (looking @ answer declares 'but rest assure types erased in bytecode' ) compiled "test.java" public class com.example.test<t> { public com.example.test(); code: 0: aload_0 1: invokespecial #1 // method java/lang/object."<init>":()v 4: return boolean plus2(java.util.list<t>); code: 0: iconst_0 ...

python - backtracking - solution hint for generating schedule -

i'm trying solve following problem: there 3 hours of math, 2 of phisics , 3 of informatics. need generate possible schedules day must have @ least 1 hour of these subjects , @ maximum 3 of these (it math-math-math or math-physics-informatics) the schedule 5 days. came following solution: let generate(k, o) 'generator' function k-th day o hours, o between 1 , 3 for every day k , hour o pick subject still in our left. keep track of having array counter[i] = takencount , 1, 2, 3 corresponding math, physics , informatics, , takencount means how many hours of subject used. and configuration use matrix v[k][o] gives me configuration day k, hours o this code i've tried far h = ['', 'm', 'f', 'i'] counter = [0, 0, 0, 0] limit = [0, 3, 2, 3] v = [['' x in range(4)] x in range(6)] def generate(k, o): if k == 6: if counter[1] == limit[1] , counter[2] == limit[2] , counter[3] == limit[3]: showconfig() else: ...

actionscript 3 - Continuous object rotation around point -

i want make function similar rotatearoundinternalpoint() . far solution this: import flash.events.event; import flash.geom.matrix; import flash.geom.point; addeventlistener( event.enter_frame, onframe ); function onframe(e:event):void { var m:matrix = item.transform.matrix.clone(); var point:point = new point( 50, 50 ); // object's width , height 100px, 50 center point = m.transformpoint( point ); m.translate( -point.x, -point.y ); m.rotate( 5 * ( math.pi / 180 ) ); m.translate( point.x, point.y ); item.transform.matrix = m; } however there fundamental flaw in code - gets less , less precise each iteration. could point out what's causing , solution be? i've solved problem introducing reference matrix not change, mistake initial iteration non-existent. here's implementation: import flash.events.event; import flash.geom.matrix; import flash.geom.point; var referencematrix:matrix = item.transform.matrix.clone(); adde...