Posts

Showing posts from June, 2010

sql - How can I test an IF statement in MySQL? -

how can test if statement in mysql ? i need know, happens when query if statement , returns nothing (0 row selected) ? in other word, select query returns when no row selected? return null ? if yes, throw error? if ( null ) ... ? or in case statement of if won't execute? in reality, have code this: if ( select banned users id=new.user_id ) // stuff note: banned column contains either 0 or 1 . all want know, code safe when query doesn't return row? mean throw error or nothing happens (just if statement doesn't execute) ? noted wanted test myselft, don't know how can test if statement in mysql. example, wanted test code: begin if ( select banned users id=new.user_id ) select 'test'; endif; end but code above doesn't run. that's why i've asked question. an if statement can tested in context of mysql stored program (a procedure, function or trigger.) mysql doesn't support anonymous blocks...

Fill field value while page is loading in HTML Page -

i have third part web address (www.samplespage.com). call page web site. possibe fill field values before page load or after page load? tried vith url parameters did not work. www.samplespage.com?id=fieldid&value=fieldvalue this how looks in codes. (i picked source via f12 development tools in ie) <input name="fieldname" id="fieldid" size="12" maxlength="11" value=""> when it's html page works url parameters otherwise need use selenium or ptyhon ..

go - Serve a file when no route is matched with Gorilla? -

i'm using gorilla mux web server. i define bunch of routes, if no route matched, want serve index.html file. func (mgr *apimgr) instantiaterestrtr() *mux.router { mgr.prestrtr = mux.newrouter().strictslash(true) mgr.prestrtr.pathprefix("/api/").handler(http.stripprefix("/api/", http.fileserver(http.dir(mgr.fullpath+"/docsui")))) _, route := range mgr.restroutes { var handler http.handler handler = logger(route.handlerfunc, route.name) mgr.prestrtr.methods(route.method) .path(route.pattern) .name(route.name) .handler(handler) } // here want catch unmatched routes, , serve '/site/index.html` file. // how can this? return mgr.prestrtr } you don't need override 404 behaviour. use pathprefix catch-all route, adding after other routes. func main() { var entry string var static string var port string flag.stringvar(&en...

node.js - Why is my session expiring every time I close the browser? -

i set session maxage of express documented. here code: app.use(session({ secret: process.env.session_secret, saveuninitialized: true, resave: true, maxage: 1000* 60 * 60 *24 * 365, store: new mongostore({mongooseconnection:mongoose.connection}) })); but every time close browser, find myself logged out. also, note using passport local, facebook, , google authentications. they expire. in console, can see connect.sid in expires/maxage section lists "session" while other cookies have dates... what doing wrong? you need configure express-session, , set maxage on session-cookie app.use(express.session({ cookie : { maxage: 1000* 60 * 60 *24 * 365 }, store : new mongostore({mongooseconnection:mongoose.connection}) }); //..... app.use(passport.session());

php - Package development - auth check doesn't work -

i have made simple fresh laravel 5.3 app purpose of developing package. have followed instructions here , modifications made in comments user named janis. works perfectly. then decided upgrade published view @if(auth::check()) id: {{auth::id()}}. @else not logged in @endif the current state of app uploaded github here . problem the view check doesn't work. have not logged in . how make auth::check() work? in tab of browser logged correclty. a hint i not sure how follow this hint to do please instruct me how make auth::check() work in view. since laravel 5, route in routes.php automatically uses web middleware, not happend packages routes. to use laravel's authentication package controllers , views need enforce web middleware usage in package route.php using like: route::group(['middleware' => 'web'], function () { // package routes here });

html - divider with icon in the center won't span width of div -

this question has answer here: line before , after title on image 2 answers i trying divide part of page , center icon between 2 divider lines. figure have use ::before , ::after , wrote this jsfiddle.net i:after { background-color: #999; content: " "; display: inline-block; height: 3px; margin: 0 0 8px 20px; text-shadow: none; width: 100%; } i:before { background-color: #999; content: " "; display: inline-block; height: 3px; margin: 0 20px 8px 0; text-shadow: none; width: 100%; } in jsfiddle doesn't seem work @ all. when open index file in chrome works point. show line left , right of icon, won't have fill whole body div. ideas great. if u use font-awesome u can add icon in menu this example : <li><i class="fa fa-home"></i>home</li...

Xamarin.Forms Previewer -

it not practical write xamarin.forms application without ui previewer. platforms offer design preview option, if code needs compiled. far know, xamarin released previewer xamarin studio mac in alpha channel, can't use in visual studio. why xamarin still not provide previewer? should not forced use third party tool process. (and third party tools in beta releases.) shouldn't there @ least roadmap or planned date announced since such fundamental part of product? nice if xamarin answer. using latest version of xamarin can use following steps: use view > other windows > xamarin.forms previewer menu in visual studio open preview window.

ruby on rails - undefined method 'map' for :id:Symbol -

actionview::template::error (undefined method `map' :id:symbol): # duels/_user_challenges.html.erb 1: <div id="dropdown-no-2"> 2: <%= collection_select 'challenge_id', challenges, :id, :full_challenge, include_blank: true %>. 3: </div> when user selects user duel challenges respective user should shown. duels/_dueler_fields.html.erb <%= f.collection_select :user_id, user.order(:name),:id, :full_name, include_blank: true, id: "id_of_the_user_id_select_box" %> <%= render :partial => 'user_challenges', locals: {challenges: challenge.order(:deadline)} %> <script> $( "#id_of_the_user_id_select_box" ).change(function() { $.ajax({ type: "get", url: '<%= user_challenges_path %>', data: {name: $('#id_of_the_user_id_select_box').prop('value')} }); }); </script> duels/user_challeng...

c - pipe: Bad file descriptor -

i'm trying implement simpel c shell pipeline arbitrary number of commands. here relevant loop: int status; int i,j,inputfile,outputfile,pid; int pipenum = info->pipenum; struct commandtype *command; int pipes[pipenum * 2]; for(i=0;i<pipenum;i++){ pipe(pipes+2*i); printf("pipe number %d created\n", i+1); } for(j=0;j<=pipenum;j++){ if( ( pid=fork() ) ==0 ){ if(j!=0){ if(dup2(pipes[(j-1)*2],stdin_fileno)<0){ perror("pipe"); exit(2); } } if(j!=pipenum){ if(dup2(pipes[2*j+1],stdout_fileno)<0){ perror("pipe"); exit(2); } } if(j==0 && info->boolinfile==1){ if((inputfile = open(info->infile,o_rdonly))<0){ perror("file"); exit(2); } if(dup2(inputfile,stdin_fileno)<0){ perror("dup2"); exit(2); } } if(j==pipenum && info->booloutfile){ if((outputfile = open(inf...

bash - What does the `l` option mean in GNU sed? -

i have read sed manual -l command. there says: -l --line-length=n specify default line-wrap length l command. length of 0 (zero) means never wrap long lines. if not specified, taken 70. i don't know how useful. can give me example? i think this,but result: [root@kvm ~]# echo 'abcdefg' | sed -l 3 -n '/a/p' abcdefg from sed manual : commands accept address ranges ... l list out current line in ``visually unambiguous'' form. l width list out current line in ``visually unambiguous'' form, breaking @ width characters. gnu extension. the -l n , --line-length= n option allows specify desired line-wrap length ' l ' command (when wrap-width argument not explicitly provided in sed script). $ echo abcdefgh | sed -n 'l 5' abcd\ efgh$ $ echo abcdefgh | sed -n -l 5 'l' abcd\ efgh$ $ echo abcdefgh | sed -n -l 5 'l 3' ab\ cd\ ef\ gh$

java - Android Custom Multidex Application Error -

i'm trying create android application class extends multidexapplication. public class myapplication extends multidexapplication { @override public void oncreate() { super.oncreate(); facebooksdk.sdkinitialize(getapplicationcontext()); appeventslogger.activateapp(this); registerparsesubclasses(); parseinit(); } private void registerparsesubclasses() { //registering subclasses parseobject.registersubclass(userplace.class); parseobject.registersubclass(placeitem.class); parseobject.registersubclass(placeitemrating.class); } private void parseinit() { parse.initialize(new parse.configuration.builder(getbasecontext()) .applicationid("myappid") .server("myurl") //.enablelocaldatastore() .build()); parse.setloglevel(parse.log_level_verbose); parsefacebookutils.initialize(this); } } and andro...

css - How to create Html table tr inside td -

i trying create table in html. have following design create. had added tr inside td somehow table not created per design. enter image description here can suggest me how can achieve this. i unable create rounded area in image aidans tired u suggested getting enter image description here here html code <table> <tr> <th></th> <th>action plan</th> <th>condition</th> </tr> <tr> </tr> <tr> <td>01.</td> <td>advance payment</td> <td>$100</td> </tr> <tr> <td>02.</td> <td>bidding </td> <td>$80</td> </tr> <tr> <td>03.</td> <td>sending price & details of vehicle </td> <td>$80</td> </tr> <tr> <td>04.</td> <td>receiving customer confirmation </td> <td>$80</td...

javascript - child_process exec command is getting executed multiple times -

i using exec() run terminal command show dialog in electron mac application. the code using: var exec = require('child_process').exec; var request = require('request'); request('https://server_url', function (error, response, data) { console.log("inside request"); exec(`osascript -e 'with timeout of 86400 seconds tell app "system events" display dialog "` + data.pop_up_message + `" buttons {"ok", "cancel"} end tell end timeout' `, function(error, stdout, stderr){ console.log("inside exec"); }); }); its showing multiple dialogs in single request. console output: inside request inside exec inside exec inside exec here 'inside request' getting printed once. 'inside exec' getting printed mult...

How to open a file in Lisp and specify both ':if-exists :append' and also ':if-does-not-exist :create' -

i trying make lisp code gracefully handles files both exist or don't exist. so start file exists , has text "this original text not lisp text" (defparameter s (open "s.txt" :direction :io :if-does-not-exist :create :if-exists :append)) =>s (print "first line" s) =>"first line" (print "second line" s) =>"second line" (read s) =>errors end of file reached. "; evaluation aborted on #<end-of-file {10045973c3}>." on cmd window: $cat s.txt original text not lisp text. that full interaction. further more text in s.txt unchanged. this fails append or overwrite text file @ all. as rainer joswig pointed out, opening file not writing in piece of code. moreover, if want append, open file output direction. simple function open file , append this: (defun write-smth-to-file (file-out smth) (with-op...

symmetricds sym_outgoing_batch.node_id=-1 -

Image
there 2 batch message in sym_outgoing_batch , 1 of node_id 000 (corp) -1 (what's -1 means?) when pull many data store corp. part of data successful router timely other delayed. message follows: and configuration file follows: insert sym_channel(channel_id, processing_order, max_batch_size, enabled, description) values('sale_channel', 1, 1000000, 1, 'sale data store corp'); insert sym_trigger(trigger_id, source_table_name, channel_id, last_update_time, create_time) values('sale_pay_triger', 'd_t_bill_pay', 'sale_channel', current_timestamp, current_timestamp); insert sym_router(router_id, source_node_group_id, target_node_group_id, router_type,router_expression, create_time, last_update_time) values('store_2_corp_sheftnotnull', 'store', 'corp', 'bsh', 'cshift_c!=null && !cshift_c.equals("")',current_timestamp, current_timestamp); insert sym_trigger_router(t...

vector - Processing 3 - Cannot insert .svg -

i'm trying enter .svg using loadshape , says "the variable 'head' not exist. files in data folder, i'm not sure what's going on. here's code: // global stuff - variables //setup routine - runs once @ beginning of sketch void setup() { head=loadshape("head.svg"); size(500, 500); background(0); nostroke(); smooth(); } //draw routine - runs on , on again forever void draw() { background(200); shape(head, width/2, height/2, 475, 475); } the error says all: you're never declaring head variable, doesn't exist. see comment @ top says // global stuff - variables ? need declare head variable there. declare variable, give type , name. in case, type pshape , name head : pshape head;

asp.net mvc 4 - How do i enable cache in my RestAPI in c#? -

this employeedetailscontroller.cs namespace empapi.controllers { [routeprefix("")] public class employeedetailscontroller : apicontroller { [httpget] [route("employees")] public ienumerable<employee> employees() { } [httpget] [route("details/{id}")] public ienumerable<details> details(int id) { } [httpget] [route("teaminfo/{id}")] public ienumerable<team> teaminfo(int id) { } [httpget] [route("detailsforteam/{id}")] public ienumerable<details> detailsforteam(int id) { ; } [httppost] [route("postemp")] public void postemp([frombody] employee cs) { } [httpput] [route("putemp/{id}")] public void putemp(int id, [frombody]employee cs) ...

In wxpython, how can I drag a frame while having it play a GIF animation -

i'm using wxpython-phoenix 3.0.3 version this. i make draggable image plays gif animation. function works fine when comment out animation part, doesn't work when animation played. how can make them work together? import wx wx.adv import animationctrl class yukari(wx.frame): def __init__(self, parent, id, title): wx.frame.__init__(self, parent, -1, title) self.bind(wx.evt_motion, self.onmouse) self.bind(wx.evt_char_hook, self.closewindow) self.animation = animationctrl(self) self.animation.loadfile('resized_yuzuki-yukari.gif') self.animation.play() self.setsize((497, 720)) self.setwindowstyle(wx.simple_border | wx.stay_on_top) self.show() def onmouse(self, event): if not event.dragging(): self._dragpos = none pass if not self._dragpos: self._dragpos = event.getposition() else: pos = event.getposition() ...

java - Could not retrieve pre-bound Hibernate session - Could not obtain transaction-synchronized Session for current thread -

i creating web application spring-mvc, spring-security, spring-core, , hibernate. but non-error hibernate session factory. it throwing hibernateexception, see on log in debug level, , application continues execution no problem. but curious understand reason of exception raised. the log shows following lines. 2016-08-29 13:34:55,310 debug [sg.com.diamond.express.base.dao.impl.hibernatedaoimpl].[doexecute]([328]) [http-nio-8888-exec-4] - not retrieve pre-bound hibernate session org.hibernate.hibernateexception: not obtain transaction-synchronized session current thread @ org.springframework.orm.hibernate4.springsessioncontext.currentsession(springsessioncontext.java:134) @ org.hibernate.internal.sessionfactoryimpl.getcurrentsession(sessionfactoryimpl.java:1014) @ org.springframework.orm.hibernate4.hibernatetemplate.doexecute(hibernatetemplate.java:325) @ org.springframework.orm.hibernate4.hibernatetemplate.executewithnativesession(hibernatetemplate.java:308)...

xcode7 - cloned NSArray gets mutated when I change the original array -

in application, have view apply filters. when come , change filters not press apply button , button, want original filters apply ones before changed them now. eg. filters - city - a, b, c - applied - saved a,b,c filters came again filters - city - d,e - button pressed - regain a,b,c filters for doing when viewdidload filterview opened, save filters array clone array clonedfiltersdata = [[nsmutablearray alloc] initwitharray:[[wmgfiltermanager sharedmanager] arrayfortype:type]]; this working fine when change in [[wmgfiltermanager sharedmanager] arrayfortype:type] like remove filters or something, gets removed original array. can tell how initiate array not affected reference. add copyitems:yes option initwitharray. in example; nsarray *deepcopyarray=[[nsarray alloc] initwitharray:somearray copyitems:yes]; you want deep copy, not shallow 1 (which copies pointers).

sql server - SQL generate value between rows -

Image
i have 3 rows of data, , want add value between rows. in excel can use excel formula , create manually, want create in sql. expected result image : in picture, f3 average value between id 1 , 2 , divide 10. after average value, use first value in e3 , add value f3, , 1.271111. e5 use e4 add value f3 , on. i want add 10 row between different id, , base on difference value between id, sum previous value difference value. isn't possible in sql statement? i'm confused average. select (10 - 0.18) / 9 -- 1.091111 -- average? -- select (10 - 0.18) / 10 -- 0.982000000 select (32.11 - 10) / 10 -- 2.211000 you can below: declare @tbl table (id int, value decimal(7, 5)) insert @tbl values (1, 0.18), (2, 10), (3, 32.11) ;with cte ( select id , value, coalesce((lead(value) on (order id) * 1.0 - value * 1.0) / 10, 0) averagevalue @tbl ) --select (10 - 0.18) / 10 -- 0.982000000 --select (32.11 - 10) / 10 -- 2.211000 sele...

ios - OS X ejabberd, New user register by XMPPFramework -

Image
i'm new ejabberd. want add new user on server through ios app. i tried many code find out google no 1 can solve issue. i set module http://localhost:5280/admin/server/localhost/node/ejabberd@localhost/modules/ enable mod_register change ejabberd.yml file etc/ejabberd folder. and listened ports @ ejabberd@localhost and used below code register user. nsxmlelement *query = [nsxmlelement elementwithname:@"query" xmlns:@"jabber:iq:register"]; [query addchild:[nsxmlelement elementwithname:@"username" stringvalue:@"syam"]]; [query addchild:[nsxmlelement elementwithname:@"password" stringvalue:@"vrin@123"]]; nsxmlelement *iq = [nsxmlelement elementwithname:@"iq"]; [iq addattributewithname:@"type" stringvalue:@"set"]; [iq addattributewithname:@"id" stringvalue:@"reg2"]; [iq addchild:query]; [app_delegate....

javascript - OpenLayers3 add Text over Circle -

after searching lot, managed find block of code allows me draw circle on map. html: <div id="mapholder"></div> css: #mapholder{ width: 100%; height: 200px; background-color: #ccc; } javascript: $(document).ready(function(){ var map = new ol.map({ target: 'mapholder', interactions: ol.interaction.defaults({mousewheelzoom:false}), layers: [ new ol.layer.tile({ source: new ol.source.osm() }) ], view: new ol.view({ center: ol.proj.transform([parsefloat(8.680239), parsefloat(50.114034)], 'epsg:4326','epsg:3857'), zoom: 13 }) }); var vectorsource = new ol.source.vector(); var circlelayer = new ol.layer.vector({ source: vectorsource }); map.addlayer(circlelayer); var coordinate = ol.proj.transform([parsefloat(8.680239), parsefloat(50.114034)], 'epsg:4326','epsg:3857'...

java - Glassfish: The thread pool's task queue is full -

in glassfish 4.1 have following error: [2016-08-24t04:00:45.586+0200] [glassfish 4.1] [severe] [] [org.glassfish.grizzly.nio.selectorrunner] [tid: _threadid=34 _threadname=http-listener-1-kernel(1) selectorrunner] [timemillis: 1472004045586] [levelvalue: 1000] [[ doselect exception java.util.concurrent.rejectedexecutionexception: thread pool's task queue full, limit: 4096 @ org.glassfish.grizzly.threadpool.abstractthreadpool.ontaskqueueoverflow(abstractthreadpool.java:490) @ org.glassfish.grizzly.threadpool.queuelimitedthreadpool.execute(queuelimitedthreadpool.java:81) @ org.glassfish.grizzly.threadpool.grizzlyexecutorservice.execute(grizzlyexecutorservice.java:161) @ org.glassfish.grizzly.strategies.workerthreadiostrategy.executeioevent(workerthreadiostrategy.java:100) @ org.glassfish.grizzly.strategies.abstractiostrategy.executeioevent(abstractiostrategy.java:89) @ org.glassfish.grizzly.nio.selectorrunner.iteratekeyevents(selectorrunner.java:415)...

java - how to pass a argument to choose sql statement in spring API? -

now write 2 api, both of process similar,but difference in sql statement. my problems are: can merge 1 process argument, role of argument used select sql statemnt? how design sql statement? how build process? @requestmapping(value="/positions" ,method = requestmethod.get, produces = mediatypes.json_utf_8) public list<weeklyopenposition> getweeklyopenpositions(@requestparam(value="startdate",defaultvalue="20160601") string startdate ,@requestparam(value="enddate", defaultvalue="20160701") string enddate){ return weeklyreportserviceimpl.getweeklyopenpositions(startdate,enddate); } @requestmapping(value="/currentlypos" ,method = requestmethod.get, produces = mediatypes.json_utf_8) public list<weeklyopenposition> getweeklycurrentlyopenpositions(@requestparam(value="startdate",defaultvalue="20160601") string startdate ,@requestparam(value="enddate", ...

android - Any example of SMS Gateway that is able to process the SMS? -

i hope asked correctly. we created mobile app using ionic. can talk servers online. far good. then, requirement - app must able send offline. reason, users in remote area internet not available. with http post not available, thing sms. , plugin, able send sms through telcos of phone. now, problem, there example of sms gateway receives sms our phone + processes them? for example, let's sending json {name:'bob'} sms gateway, there should logic process sms , update database in our own hosting server. any example of kind of product/server? edit my original question kind of confusing thought third-party gateways serving 'sending sms online only'. but @timcastelijns points out 'inbound sms', wanted. basically, buy/rent number gateway. number, upon receiving sms, able post message our own web hosting servers. this solved @timecastelijins. mentions called 'inbound sms'. sms gateway doesn't process sms, post our web hosti...

Github - Google pubsub java samples - Maven test run failure -

i'm trying run google pubsub java samples - appengine push on local development server referring this guide. $ gcloud config set project <provided-my-application-id> $ mvn gcloud:run maven build successful test run failed. below execution. how resolve this? e:\java\cloud-pubsub-samples-java-master\appengine-push>mvn gcloud:run [info] scanning projects... [warning] pom com.google.appengine:appengine-maven-plugin:jar:2.0.9.121.v20160815 missing, no dependency information available [warning] failed retrieve plugin descriptor com.google.appengine:appengine-maven-plugin:2.0.9.121.v20160815: plugin com.google.appengine:appengine-maven-plugin:2.0.9.121.v20160815 or 1 of dependencies not resolved: failure find com.google.appengine:appengine-maven-plugin:jar:2.0.9.121.v20160815 in https://repo.maven.apache.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced [info] [info] ------------------------...

PHP PDO/MySQL query not working properly -

Image
so have website people can report tracks. people can tho they're not member of said website , if they're not members, system assign them random "pseudo member number" (pmn here on) in style of "not_a_member_xxxx". $query_claimed = "select * claims_archive t20pctid=:t20pctid , member_name=:member_name , member_email=:member_email , (member_number=:member_number or member_number '%not_a_member_%')"; $stmt = $con->prepare($query_claimed); $stmt->bindparam(':t20pctid', $t20pctid); $stmt->bindparam(':member_name', $member_name); $stmt->bindparam(':member_number', $member_number); $stmt->bindparam(':member_email', $member_email); $stmt->execute(); in testing period have had songs have been reported same person pseudo-number , member number. problem if make query pmn , song exists same member name , e-mail member number, code insert instead of displaying message in style of "you have ...

android - How to compare Between Image Value and String -

im new on android studio,ihve value data tht intent integer resourceid = (integer)g.getitematposition(item.getitemid()); intent k = new intent(mainactivity.this,imagedetail.class); k.putextra("id",resourceid); startactivity(k); on receiver linearlayout linearlayout = new linearlayout(this); setcontentview(linearlayout); linearlayout.setorientation(linearlayout.vertical); intent k =getintent(); textview textview = new textview(this); textview.settext(k.getextras().getint("id")); linearlayout.addview(textview); (i got value "res/drawable/ikan.jpg") when try compare textview , string fail... if (textview.equals("res/drawable/ikan.jpg")){ //kondisi } you should like: if (textview.gettext().tostring().equals("res/drawable/ikan.jpg")){ //kondisi }

javascript - d3 doughpie/bubble chart combo with animation tweening -

Image
i have created chart in static form - how needs -- i've lost animation , morphing along way --- 1. -- how animate arcs 2. -- how animate bubbles 3. -- adding randomise button test 2 dummy data sets. i need arcs tween did before -- http://jsfiddle.net/nyeax/1452/ latest fiddle. http://jsfiddle.net/nyeax/1506/ this old pie animations , worked well /* ------- animate pie slices -------*/ var slice = doughpie.select(".slices").selectall("path.slice") .data(pie(data), key); slice.enter() .insert("path") .style("fill", function(d) { return color(d.data.label); }) .style("transform", function(d, i){ //return "translate(0, 0)"; }) .attr("class", "slice"); s...

angularjs - Can't inject scope in service (angular 1.5 / es6) -

const taskservicemodule = angular.module('taskservicemodule'); class taskservice { constructor ($scope) { console.log($scope) } } taskservice.$inject = ['$scope']; taskservicemodule.service('tasksservice', taskservice); export default taskservicemodule; const app = angular.module(`app`, [taskservicemodule.name]); i error, why? can explain? error: [$injector:unpr] unknown provider: $scopeprovider <- $scope <- tasksservice

django - Does cokkie path matter for deleting cookie -

i have cookie: name: trace value: true path: / expires: until of browser session end i send response django server cookie set way: response.set_cookie('trace', max_age=0, path=/some/path/) . suppose way make browser delete cookie. the question is: should affect initial cookie path=/ ? or if path different, initial cookie should stay alive? no not affect cookie different path. name , path both checked see if cookie matches. same thing happens when set new value cookie on particular path. not affect other cookies same name , different paths 1 set.

asp.net mvc - Validate required model only -

Image
i'm using 2 models, login & signup model in view. public class login { [required(errormessage ="user id required.")] public string userid { get; set; } [required(errormessage ="password required")] public string password { get; set; } } public class signup { [required (errormessage ="user id required")] public string userid { get; set; } [required (errormessage ="name required")] public string name { get; set; } [required (errormessage ="mail id required")] public string mailid { get; set; } [required(errormessage ="password required")] public string password { get; set; } [required(errormessage ="confirm password required")] [compare (nameof(password), errormessage ="password not match")] public string confirmpassword { get; set; } } when click login button, validates both models. how validate model separately? u...

postgresql - Why SERIAL is not working on this simple table in Postgres? -

i'm using postgres 9.1. , auto_increment (serial) not working. i've found 'serial': https://www.postgresql.org/docs/current/static/datatype-numeric.html#datatype-serial create type family as( id int, name varchar(35), img_address varchar(150)); create table families of family( id serial primary key not null, name not null ); error: syntax error @ or near "serial" line 7: id serial primary key not null, ^ ********** error ********** error: syntax error @ or near "serial" sql state: 42601 when create table using syntax: create table xxx of yyyy you can add default values , constraints, not alter or specify type of columns. the type serial in effect combination of data type, not null constraint , default value specification. equivalent to: integer not null default nextval('tablename_colname_seq') see: documentation serial so, instead have use: create sequence fa...