Posts

Showing posts from May, 2013

oauth 2.0 - Invalid redirect URI Linkedin API on iOS App -

i'm using linkedin signin ios app. after switching oauth2, call uri no longer accepted keep getting error 'invalid redirect uri'. app url scheme called 'paper' , url identifier 'com.paper'. understand have set url begins 'http://' or 'https://' on linkedin developer page , address has match callback uri. authorized redirect urls linkedin developer setting? use official linkedin sdk ios https://developer.linkedin.com/docs/ios-sdk

class - C++ Classes: errors with identifiers -

Image
i've project in c++ 2 classes. main.cpp: #include <iostream> #include <conio.h> #include "player.h" #include "enemy.h" using namespace std; int main() { const int starthealth = 100, startarmor = 50, startenemyhealth = 70, startweapon = 1; player *mick = new player(starthealth, startarmor, startweapon); enemy *mon = new enemy(startenemyhealth); cout << "start!" << endl; cout << mick->health << " : " << mick->armor << endl; cout << "enemy attacks!" << endl; mon->attack(mick); cout << "damage taken!" << endl; cout << mick->health << " : " << mick->armor << endl; cout << "you attack!" << endl; mick->attack(mon); cout << "enemy's health!" << endl; cout << mon->health << endl; _getch(); return 0; } player.h #pragma once #in...

debugging - Make gdb search for symbol files again -

my distribution (debian) ships debug files in separate packages. happens run program in gdb until crashes, in order obtain usable backtrace bug report. bt rather useless, missing symbol information – because did not install corresponding -dbg package. if install package now, there way make gdb search symbol files again, without losing current backtrace? there trick can use make gdb try read symbol files again: (gdb) nosharedlibrary (gdb) sharedlibrary the first command tells forget symbol information has, , second command tells re-read it.

spring integration - jpa inbound-channel-adapter doesn't support parameter source -

i trying use parameter-source provide parameter query in inbound-channel-adapter doesn't seem work. have looked through parser code , don't think processing parameter-source. <int-jpa:inbound-channel-adapter delete-after-poll="true" delete-in-batch="true" auto-startup="true" flush-after-delete="true" max-results="2000" entity-manager-factory="entitymanagerfactory" entity-class="auditmessage" channel="processmessage" jpa-query="select auditmessage a.updatets &lt; :purgedate" parameter-source="parametersource"> <int:poller cron="*/5 * * * * *" > <int:transactional transaction-manager="transactionmanager"/> </int:poller> </int-jpa:inbound-channel-adapter> <bean id="parametersource" factory-bean="spelsource" factory-method="createparameter...

python - video streaming using flask with raspi-camera -

sorry english skill. want make web page streams video , runs several functions. using python , flask server. but, there problems can't solve alone. have source code. it's perfect. source code. import time flask import flask, render_template, response camera import camera app = flask(__name__) @app.route('/') def index(): return render_template('index.html') def gen(camera): while true: frame = camera.get_frame() yield (b'--frame\r\n' b'content-type: image/jpeg\r\n\r\n' + frame + b'\r\n') @app.route('/video_feed') def video_feed(): return response(gen(camera()), mimetype='multipart/x-mixed-replace; boundary=frame') @app.route('/test') def test(): return time.time() if __name__ == '__main__': app.run(host='0.0.0.0', debug=true and template <html> <head> <title>video streaming demonstration...

Mixed Bootstrap form -

tried create bootstrap form has 2 input fields horizontal & multiple select. region 1 & region 2 along select should next input text field.. can please help, me region 1 & 2 coming below input field. <div class="container"> <h2>bootstrap form</h2> <form role="form" class="form-horizontal"> <div class="form-group"> <div class="col-sm-5"><input type="text" class="form-control" id="inputid" placeholder="enter name"></div> </div> <div class="form-group"> <div class="col-sm-5"><input type="text" class="form-control" id="inputad" placeholder="ip address"></div> </div> <div class="form-group"> <div class="col-sm-5"> <label class="col-sm-12" for="s...

node.js - Uniquely identify HTTPS certificate -

in nodejs, can client certificate https connection req.connection.getpeercertificate() . produces structure below (self-signed cert generated via this code ): { subject: { c: 'us', st: 'utah', l: 'provo', o: 'acme app client', cn: 'client.example.net' }, issuer: { c: 'us', st: 'utah', l: 'provo', o: 'acme signing authority inc', cn: 'example.com' }, modulus: 'a1e576a9017a839a8986664fe3159a8e2199d35afcd0d55f27e1169c8d2c9e90e634f353c143eb05c03c297390070f9af0752727aa7f5212cace5b2b503418584392f4cf3d2669ee394ee310572e0c26eaf1d9ff4ab14b7f1cf155af4dba48263357fdc99778e568f39f8d68aa34496f2d10a66cc1ed99eb17cde8d10fbe850b386d593cc3ad42a8af0fc25efabb14018418ee7e56111e073d81447ee14d0d242f242b4507b2325f06d5abf0ffcd986958d4e843d700fa97e88c6bbcb91958fca142efe4d85d6a0fbe8a0c74bbed001c6b9f4452c926ad77858c71057096a07e056be33f8568b84373930cfd489c4e7fa1b09f63413114f2ac...

php - Using forms from a tabbed index page -

so i'm new php , i'm having trouble getting of forms function. think may way site set that's causing me problems. i have index.php set such: <div class="pagecontent"> <div id="main" style="width:1000px; margin:0 auto;"> <!-- create tabs --> <div id="tabs" > <ul> <li><a href="#tabs-0">overview</a></li> <li><a href="#tabs-1">ranked</a></li> <li><a href="#tabs-2">arena</a></li> <li><a href="#tabs-3">decks</a></li> <li><a href="#tabs-4">new game</a></li> <li><a href="#tabs-5">admin</a></li> </ul> <div id="tabs-0"></div> <div id="tabs-1"...

ajax - Dynamically change search container results in liferay -

i think question similar how search inside of search container in liferay . so page onload has jsp variable sets <liferay-ui:search-container-results> <% results = listutil.sublist(mylist, searchcontainer.getstart(), searchcontainer.getend()); total = mylist.size(); pagecontext.setattribute("results", results); pagecontext.setattribute("total", total); %> </liferay-ui:search-container-results> is there way dynamically change mylist through ajax? in backend filtering , returning json object replace mylist variable. would appreciate assistance in how replace mylist variable , hence refresh searchcontainer table even though questions seem related, want different him. so answer question, implementation thinking of can not done. reason: the mylist variable variable exists server side. javascript code runs on client side. have no way of manipulate content of java variable javascript. wh...

Python: list vs. np.array: switching to use certain attributes -

i know, there plenty of threads list vs. array i've got different problem. using python, find myself converting between np.array , list quite want use attributes like remove, append, extend, sort, index, … lists and on other hand modify content things like *, /, +, -, np.exp(), np.sqrt(), … works arrays. it must pretty messy switch between data types list(array) , np.asarray(list), assume. can't think of proper solution. don't want write loop every time want find , remove array. any suggestions? a numpy array: >>> a=np.array([1,4,9,2,7]) delete: >>> a=np.delete(a, [2,3]) >>> array([1, 4, 7]) append: >>> a=np.append(a, [5,0]) >>> array([1, 4, 7, 5, 0]) sort: >>> np.sort(a) array([0, 1, 4, 5, 7]) index: >>> array([1, 4, 7, 5, 0]) >>> np.where(a==7) (array([2]),)

html5 - Replace picture background with video background -

what quickest way replace picture background have video background, while retaining of properties? this code far: <div id="hero"> <div id="bg"></div> <table id="outerdiv" cellpadding="0" cellspacing="0" border="0"> <tr> <td valign="middle" id="innerdiv"> <div class="post-header"><img src="http://www.makemeapro.org/wp-content/uploads/2015/07/logo.png" style="max-width:100%;height:auto;"></div> <div class="post-header"><h1 style="color: #383838;">helping young professionals navigate world of work.</h1></div> <div align="center"><button class="btn">join revolution</button></div> </td> </tr> </table> </div> jsfiddle here: http://jsfiddle.net/zxqz7oe0/ one quick way replace pic...

Chrome extension: Using Inline Installation does not give success/failure callbacks -

i able install chrome extension using 'inline installation method', webpage. not getting success/ failure callbacks. page has link extension in head section of page , code follows chrome.webstore.install('url extension', function () { // success! console.log('success!'); }, function (err) { // error :( console.log('failed!'); });

logging - Log reader w. save option -

i'm missing simple log file reader has possibility of "remembering" log-files of various websites. i'd possibility of opening 5-10 log-files relating website in 1 click, making easy switch between log-files of different sites. nothing fancy, being able save & load bunch of files log-file-viewer cheers ask

servlets - Where do I place my property file in java web project? -

Image
this question has answer here: where place , how read configuration resource files in servlet based application? 5 answers i working on web project. want know should put property file. use filters. attached screenshot of project too. thanks! it depends entirely on how load (or intend load) properties file in first place. if load using classloader, place in sources, java files. if load webapp resource, using servletcontext, place under webcontent/web-inf. if want avdownloadable browser, put anywhere under webcontent, except in web-inf. – jb nizet https://stackoverflow.com/users/571407/jb-nizet

web applications - Iscroll - Infinite - with random cell sizes -

hi there know that's not neccessarily functionality of iscroll-infinite seem scrolling cells of equal sizes. maybe of resolved issue having - need work different cell sizes not set size. whilst library works perfect set size cell random sizing proves difficult implement. i'm not hooked on iscroll anyway - if of know of angular extension works same or point me in right direction on how achieve else. i'd appreciate help. ok answer above - absolutely possible not using iscroll-infinite (at least @ moment) own solution iscroll. on scroll event there 2 properties available you can actively change whilst scrolling , achieve never-ending scroll effect (iscroll.scrollerheight , iscroll.maxscrolly) keep initial scrollerheight , keep updating maxscrolly each cell reappend @ end of feed. require caching/server communication achieve full "infinite scroll" functionality. i can confirm absolutely works brilliantly.

scala - Remote SBT Debugging -

i using sbt container:start shell start scala application , i'm wondering how specify debug port write to, can set remote debugging in intellij. i've tried specifying along lines of jvm-debug 5005 suggested here , caused process not start. thanks! export sbt_opts: sbt_opts="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" then setup remote debuging configuration in intellij connecting localhost 5005

ios - How to architect 'State Controller' objects being delegates of shared services -

i have uiviewcontroller conforms 'massive view controller' anti-pattern. trying break functionality out 'state controller' objects act controllers each state viewcontroller might in. question regarding services multiple states might need listen to. example 1 state might 'videorecordingstate' , has reference 'filesystem' object owned uiviewcontroller. when recording stops 'videorecordingstate' replaced 'videoreviewstate'. both states interested in listening 'filewritecompleted' event 'filesystem', , file write started 1 state might complete after has been replaced state. so, each state become delegate of 'service' object , swaps out when state changes, or make more sense uiviewcontroller delegate of service , pass notification on current state? or whole design plain wrong begin with?

python - Find all local Maxima and Minima when x and y values are given as numpy arrays -

Image
i have 2 arrays x , y : x = np.array([6, 3, 5, 2, 1, 4, 9, 7, 8]) y = np.array([2, 1, 3, 5, 3, 9, 8, 10, 7]) i finding index of local minima , maxima follows: sortid = np.argsort(x) x = x[sortid] y = y[sortid] minm = np.array([]) maxm = np.array([]) while < y.size-1: while(y[i+1] >= y[i]): = + 1 maxm = np.insert(maxm, 0, i) i++ while(y[i+1] <= y[i]): = + 1 minm = np.insert(minm, 0, i) i++ what problem in code? answer should index of minima = [2, 5, 7] , of maxima = [1, 3, 6] . you not need while loop @ all. code below give output want; finds local minima , local maxima , stores them in minm , maxm , respectively. please note: when apply large datasets, make sure smooth signals first; otherwise end tons of extrema. import numpy np scipy.signal import argrelextrema import matplotlib.pyplot plt x = np.array([6, 3, 5, 2, 1, 4, 9, 7, 8]) y = np.array([2, 1, 3 ,5 ,3 ,9 ,8, 10, 7]) # sort data in x , rearrange y accordingl...

Regex Javascript. Why are my curly braces not working? -

i confused why curly braces seem ignored in code? if run command in console seems work fine. datetime: function(field) { var regex = /^\d{1,2}$/; if (field.val().length > 0) { // works in console /^\d{1,2}$/.test("22"); console.log(regex) // /^\dundef$/ console.log(typeof regex); // object console.log(typeof field.val()); // string return regex.test(field.val()); } else { return true; } } thanks frédéric hamidi, light bulb went off in head. the reason curly braces coming undef due java backend tagging system. should keep javascript away template in own file!! thanks frédéric hamidi :)

python - ValueError Expected singleton , Odoo8 -

i have been working on module in odoo8 on ubuntu 14.04. have come strange issue when saving form record based on one2many fields. error says valueerror expected singleton: hr.employee.pay.change(84, 85) my python code below class hr_employee_pay_change(models.model): _name='hr.employee.pay.change' hr_payroll_change_ids = fields.many2one("employee.salary.change", "employee", ondelete="cascade") @api.onchange('emp_basic', 'emp_allowance') @api.depends('emp_basic', 'emp_allowance') def _current_total(self): self.emp_current_total = self.emp_basic + self.emp_allowance @api.onchange('emp_propose_allowance', 'emp_propose_basic') @api.depends('emp_propose_allowance', 'emp_propose_basic') def _proposed_total(self): data_val={} self.emp_propose_total = self.emp_propose_basic + self.emp_propose_allowance cr=self._cr...

python - Pandas: cannot filter based on string equality -

using pandas 0.16.2 on python 2.7, osx. i read data-frame csv file this: import pandas pd data = pd.read_csv("my_csv_file.csv",sep='\t', skiprows=(0), header=(0)) the output of data.dtypes is: name object weight float64 ethnicity object dtype: object i expecting string types name, , ethnicity. found reasons here on over why they're "object" in newer pandas versions. now, want select rows based on ethnicity, example: data[data['ethnicity']=='asian'] out[3]: empty dataframe columns: [name, weight, ethnicity] index: [] i same result data[data.ethnicity=='asian'] or data[data['ethnicity']=="asian"] . but when try following: data[data['ethnicity'].str.contains('asian')].head(3) i results want. however, not want use "contains"- check direct equality. please note data[data['ethnicity'].str=='asian'] raises error. am doing wrong...

javascript - JS: prototype event-observer not fireing -

i have magento test-shop onepagecheckout extension. uses onepagecheckout.js. there should added 'click'-event observers payment radio buttons. when clicking on them, nothing happens. the observers added single input elements while each-ing through them: addobservers: function () { $$('input[name="payment[method]"]').each(function (el) { el.observe('click', function () { checkout.update({ 'review': 1, 'payment-changed': 1 }); }); }); } the eached elements are, can seen in chrome debugger , fit input-element ids , names: el = input#p_method_bankpayment.radio el = input#p_method_paypal_express.radio el = input#p_method_cashondelivery.radio el = input#p_method_phoenix_cashondelivery.radio the update function calling new content via ajax when page loaded, not executed , no network-activity can seen, when events should fired. the installation can seen here: http://5.175.9.22/gp_de/onepag...

android - Fragment is not shown on Activity -

in app,one activity has include 3 fragments, 1 of them remains on activity other 2 have change places. fragments not shown on activity. i have read somewhere here should change linearlayout fragmentlayout did not work. public class mainactivity extends actionbaractivity { private final fragment_1to6 f1to6 = new fragment_1to6(); private final fragment_7to12 f7to12 = new fragment_7to12(); private fragmentmanager mfragmentmanager; private framelayout mbuttonslayout, mlayout1to6; private framelayout mlayout7to12; private static final int match_parent = linearlayout.layoutparams.match_parent; private static final int wrap_content = linearlayout.layoutparams.wrap_content; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mbuttonslayout = (framelayout) findviewbyid(r.id.fragment_buttons); mlayout1to6 = (framelayout) findviewbyid(r.id.fragment_1to6); mlayout7to12 = (framel...

regex - Python: Error in re.compile() function for double digits -

this regex needs find "1x" or "x1" must able find double digits such "10x" , "x11" . leverage_match = re.compile(r"\d+x|x\d+", flags=re.ignorecase) according regex101.com above regex should sufficient capture entire numbers for: import pandas pd import re df = pd.dataframe(["bull estox 11x s", "bull estox x12 s"], columns=["name"]) name "bull estox 11x s" "bull estox x12 s" however, code below returns 1 digit, e.g. "11x" becomes "1x" . leverage_match = re.compile(r"\d+x|x\d+", flags=re.ignorecase) #<- same seen above def f(value): f2 = lambda x: leverage_match.findall(x)[0] if len(leverage_match.findall(x)) > 0 else "" leverage = f2(value) if leverage != "": return "{}".format(leverage) if leverage[0].replace("x","x") == "x": leverage =...

c# - database is not updating using select and update command in same try block -

here code calls function update data database...... static void main(string[] args) { //system.io.streamreader file = new system.io.streamreader(@"c:\users\malik\desktop\research_fields.txt"); //var lines = new system.io.file.readlines(@"c:\users\malik\desktop\research_fields.txt"); program p = new program(); var lines = system.io.file.readlines(@"c:\users\malik\desktop\research_fields.txt"); var dd = new list<tuple<string, double, string>>(); //string document = "the trie data structure has many properties make attractive representing large files of data. these properties include fast retrieval time, quick unsuccessful search determination, , finding longest match given identifier. main drawback space requirement. in paper concept of trie compaction formalized. exact algorithm optimal trie compaction , 3 algorithms approximate trie compaction given, , ...

css - Fixed element in transform translate container not working -

i have wrapper box want animate transform translate if can't use fixed element inside. example : <div class="wrapper"> <div class="box-content"> <div class="fixed-element"> </div> </div> </div> <style type="text/css"> .wrapper { transform: translatex(50px); background: pink; } .box-content { height: 1000px; background: green; } .fixed-element{ position: fixed; top: 0; left: 0; width: 50px; height: 50px; background: blue; } </style> https://jsfiddle.net/aobv5azy/ i don't want use javascript, , want use transform translate. animate "left" not performances.

grep exact pattern from a file in bash -

i have following ip addresses in file 3.3.3.1 3.3.3.11 3.3.3.111 i using file input file program. in program grep each ip address. when grep contents getting wrong outputs. like cat testfile | grep -o 3.3.3.1 but getting output like 3.3.3.1 3.3.3.1 3.3.3.1 i want exact output. how can grep ? use following command: grep -owf "3.3.3.1" tesfile -o returns match , not whole line. -w greps whole words, meaning match must enclosed in non word chars <space> , <tab> , , , ; start or end of line etc. prevents grep matching 3.3.3.1 out of 3.3.3.111 . -f greps fixed strings instead of patterns. prevents . in ip address interpreted any char , meaning grep not match 3a3b3c1 (or this).

android - how to sort Arraylist of string having integer values in java -

i having string list consists of integer values. want sort in ascending in descending order. arraylist<string> = new arraylist<string>(); a.add("1435536000000"); a.add("1435622400000"); system.out.println("before : " + a); collections.sort(a, new comparatorofnumericstring()); system.out.println("after : " + a); my comparatorofnumericstring class - public class comparatorofnumericstring implements comparator<string> { @suppresslint("newapi") @override public int compare(string lhs, string rhs) { int i1 = integer.parseint(lhs); int i2 = integer.parseint(rhs); return integer.compare(i1, i2); } } any 1 having idea how sort strings having integer values in java? thanks lot!! in advance!! the better way add integers/long in arraylist , sorting using collections.sort(a) method. if still want using string, need make modifications. please find below code sa...

javascript - Angular UI tree content does not appear properly -

Image
am new angular framework. implemented angular ui tree , works fine have alignment issue. consider following code. <!doctype html> <html> <head> <title></title> <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" /> <link href="angular-ui-tree-master/examples/css/app.css" rel="stylesheet" /> <link href="angular-ui-tree-master/dist/angular-ui-tree.min.css" rel="stylesheet" /> <script src="jquery.min.js"></script> <script src="angular.min.js"></script> <script src="bootstrap/js/bootstrap.js"></script> <script src="angular-ui-tree-master/dist/angular-ui-tree.js"></script> </head> <body> <div ng-app="myapp" ng-controller="myctrl"> <script type="text/ng-template" id="nodes_renderer.htm...

c++ - Lazy Propagation - HORRIBLE spoj -

i attempting problem horrible spoj , here's link: http://www.spoj.com/problems/horrible/ trying teach myself lazy propagation segment tree. following code have written, have tried make concise , clear possible, please let me know if unclear. #include <cstdio> #include <algorithm> using namespace std; typedef long long ll; ll tree[500010]; ll lazy[500010]={}; void buildst(ll a[], ll stidx, ll l, ll r) { if(l==r) { tree[stidx]=a[l]; return; } ll left=2*stidx, right=left+1, mid=(l+r)/2; buildst(a, left, l, mid); buildst(a, right, mid+1, r); tree[stidx]=tree[left]+tree[right]; } void update(ll stidx, ll i, ll j, ll l, ll r, ll val) { //printf("%lld %lld %lld %lld %lld\n", stidx, i, j, l, r); if(lazy[stidx]!=0) { tree[stidx]+=(l-r+1)*lazy[stidx]; if(l!=r) { lazy[2*stidx]+=lazy[stidx]; lazy[2*stidx+1]+=lazy[stidx]; } lazy[stidx]=0; }...

c# - Storing and displaying images on a ASP.NET Webforms website with back end SQL database -

i building website using asp.net. site contains information 571 houses. each house has 10 images associated it, 1 main , 9 others. want able store these images in folder , set path them in sql database. site has on 100 pages of houses 5 results per page when click on house want know house have clicked , display images specific house. using 1 aspx page repeater control way don't have multiple aspx pages , houses displayed , filtered using pagination. main thing want find out how store , display these images using sql database. there on 5000 images, 10 per house. in sql database should have called primary key . probably, integer (it should so). you can create folder (e.g. content/housephotos/ ) , create subfolder each house. for example, house #713 photos stored in: /content/housephotos/713/1.png /content/housephotos/713/2.png /content/housephotos/713/3.png /content/housephotos/713/4.png /content/housephotos/713/5.png /content/housephotos/713/6.png /content/housep...

c# - Retrieve value from datepicker to the application from the cshtml file -

i'm new 'mvc' , have been trying use 'jquery' 'datepicker' date user , retrieve in main application, please give me guidance on retrieving date application (controller). below code: search.cshtml @model dropdowns.models.searchmodel @{ viewbag.title = "search redsea"; } <head> <title>redsea holidays</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <!-- code wire datepicker --> <script type="text/javascript"> $(function () { // make every element class "date-picker" datepicker element $('.date-picker')....

javascript - check if field value has changed with jquery -

i want conastantly check if value changes.. if user selects new value in input form want run js code.. <div class="select2-container country_to_state country_select" id="s2id_billing_country" style="width: 100%;"> <a href="javascript:void(0)" class="select2-choice" tabindex="-1"> <span class="select2-chosen" id="select2-chosen-1">schweiz</span> <abbr class="select2-search-choice-close" /> <span class="select2-arrow" role="presentation"> <b role="presentation"/> </span> </a> <label for="s2id_autogen1" class="select2-offscreen">land *</label> <input class="select2-focusser select2-offscreen" type="text" aria-haspopup="true" role="button" aria-labelledby="select2-chosen-1" id=...

php - CodeIgniter 3 Login Class Throws array_key_exists() expects parameter 2 to be array, null given -

our codeigniter 3 source code has auth class located in applications/libraries following function: public function login($attempt) { $ci = & get_instance(); $ci->load->model("users"); // store password entry $password = $attempt["password"]; // user database $user = $ci->users->get(array("screen_name" => $attempt["screen_name"])); if (!array_key_exists("password", $user)) { return null; } // validate password $valid = crypt($password, $user["password"]) == $user["password"]; if ($valid) { // remove password - user data stored in session unset($user["password"]); // if no photo uploaded, set default if (!isset($user["photo"]) || $user["photo"] == null) { $user["photo"] = "http://oururl/ourroute/assets/images/defaultavatar.png"; } else {...

javascript - comparing two date and creating output -

i have 2 field named creation_date , expiry_date . want create row on table name status, if user has passed expiry date output must expired , if user haven't passed expiry date output must active <th> <div> <?php echo get_phrase('status');?> </div> </th> <td> <div class="badge badge-<?php if ($expiry_date < $creation_date) { echo 'still active'; } else if ($expiration_date == $creation_date) { echo 'still active'; } else { echo 'time expired'; };?>"> </div> <?php echo $row['status'];?> </td> dont create such field incorrect unless run job update status field every few minutes. make staus check dynamic doing data comparison mention whenever need know if status expired.

javascript - switch views from one page to another when the button is clicked in angular JS -

i new angular js.how can redirect page when button clicked. code here var app = angular.module("plunker", []) .config(function ($routeprovider, $locationprovider, $httpprovider) { $routeprovider.when('/home', { templateurl: 'home.html', controller: 'homectrl' }); $routeprovider.when('/about', { templateurl: 'about.html', controller: 'aboutctrl' }); $routeprovider.when('/contact', { templateurl: 'contact.html', controller: 'contactctrl' }); $routeprovider.otherwise( { redirectto: '/home', controller: 'homectrl', } ); }); app.controller('navctrl', ['$scope', '$location', function ($scope, $location) { $scope.navclass = function (page) { var currentroute = $location.path().substring(1) || 'home'; return page === currentroute ? 'active' : ''; }; }]); app.controller('aboutctrl...

asp.net - JQuery AJAX POST Not Working on IIS -

thanks in advance help.. i have web service in visual studio project looks this: [operationcontract] [webinvoke(method = "post", responseformat = webmessageformat.json, bodystyle = webmessagebodystyle.wrapped, requestformat = webmessageformat.json, uritemplate = "/grade")] string gradeprocess(string s0, string s1, string s2, string s3); i have simple vs project simple html page calls web service this: $.ajax({ url: 'http://myremotewebserver/gradeprocess.svc/grade', contenttype: 'application/json; charset=utf-8', data: json.stringify(postdata), datatype: "json", type: 'post', cache: false, async: false, success: function (data) { onsuccess(data, response); }, error: function (data) { onerror(data, response); } }); locally, can run web service first (f5), , change url of post in html page vs project use local web servi...