Posts

sockets - AIR server connections -

i wanting give small gaming community. idea make app acts chat client connect game servers. trying grasp concepts on how connections work through examples i've found on web, since self taught seeing examples. so far examples found connections on same network. need kind of example allow me connect different networks or @ least explanation on need do. need able around router without setting port forwarding on router. in end app connecting game developer's server need working app before permission connect servers. any appreciated. if additional information needed ask , i'll best fill in gaps. that broad question, try give information possible point of view. i'm not yet sure if want have p2p connection (game-application game-application) or standard server model, mentioned different approaches problem. adobe has support p2p since long time. read faq , esspecially "how rtmfp differ rtmp?" (i try choose sources infographics, helped me understan...

sql - Converting MySQL query to PostgreSQL. Order by day()? -

i'm converting code mysql postgresql. postgresql doesn't have day() function order by work. there known solution? i'm wanting group results day. { select to_char(date, 'yyyy-mm-dd') date \"users exercises\" userid = $user->id , (date >= '$begin' , date <= '$end') group day(date) order date ) union ( select to_char(date, 'yyyy-mm-dd') date \"users foods\" userid = $user->id , (date >= '$begin' , date <= '$end') group day(date) order date } mysql's day() returns day of month. postgresql equivalent of is : group extract(day "date")

richfaces - JSF Composite Component with conditional popup panel -

i'm trying render composite component shows popup panel based on outcome of backing bean method. far no success. appreciate help. glassfish 4.1 mojarra 2.2 richfaces 4.5.4 composite component (conditionalactionlink.xhtml): <ui:component xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:composite="http://java.sun.com/jsf/composite"> <composite:interface> <composite:attribute name="value"/> <composite:attribute name="style"/> <composite:attribute name="disabled"/> <composite:attribute name="render"/> <composite:attribute name="message" /> <composite:attribute name="renderedbtn" type=...

Sending Email in Python -

i'm trying send basic email using python 3.3. i'm following first bit of code here: https://docs.python.org/3.3/library/email-examples.html my code follows: def emailcurrentrankings(recipientemail): fp = open('rankings.txt', 'rb') msg = mimetext(fp.read()) fp.close() sender = 'bclayman@gmail.com' msg['subject'] = 'csa rankings' msg['from'] = sender msg['to'] = recipientemail s = smtplib.smtp('localhost') s.sendmail(sender, [recipientemail], msg.as_string()) s.quit() my main function calls method so: emailcurrentrankings('bclayman@gmail.com') the difference can tell use 'rankings.txt' instead of textfile on second line. i've tried both , same error message: traceback (most recent call last): file "helpfulfunctions.py", line 128, in <module> main() file "helpfulfunctions.py", line 120, in main email...

java - Hibernate hql/criteria result contains collection -

i have 2 entities: public class photo { long id; string url; @manytoone @joincolumn(name ="user_id") user user; // other fields , getters/setters } and second: public class user { long id; @onetomany(mappedby = "user") private collection<photo> photos; // other fields , getters/setters } i trying dto: public class userdto { long id; list<string> photosurls; } but can't find right solution. wrote next criteria - find user photos login: getcurrentsession().createcriteria(user.class, "user") .createalias("user.photos", "photos") .setprojection(getuserprojection()) .add(restrictions.eq("user.login",login)) .setresulttransformer(transformers.aliastobean(userdto.class)) .list(); // projection getuserprojection() { return projections.projectionlist() .add(projections.property("user.id"), "id") ...

c# - Unable to set Menu width to 100% in WPF. What's wrong with my code? -

Image
i looking way set menu width 100% in wpf. trying create notepad application, , tried following. <window x:name="notepad" x:class="notepad.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="untitled - notepad" height="350" width="525" windowstate="maximized" sizetocontent="width"> <grid> <richtextbox x:name="maintextbox" horizontalalignment="stretch" verticalalignment="stretch"> <flowdocument> <paragraph> <inlineuicontainer> <menu height="25" horizontalcontentalignment="stretch" > <menuitem header="_file" /> <menuitem ...

php - how symfony2 remember me work without any table for token? -

i configure symfony2 add remember me functionality , how work without table in database save remember me token. mean best practice remember me cookie said in here it stores username , token expiration token class name , signature in single cookie. here it's being processed: https://github.com/symfony/symfony/blob/2.8/src/symfony/component/security/http/rememberme/tokenbasedremembermeservices.php#l39 so whole protection based on using secret token (the 1 specify in parameters) , user's password. answering second part of "question" - pure cookie-based solution not use persistence layer, none of "best practices" applicable here. symfony2 provide built-in persistence layer support storing remember-me tokens, , implement series-based logic it's explained in answer you're referring to.