Search Results

Search found 390 results on 16 pages for 'user1'.

Page 4/16 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Convert sqlalchemy row object to python dict

    - by Anurag Uniyal
    or a simple way to iterate over columnName, value pairs? My version of sqlalchemy is 0.5.6 Here is the sample code where I tried using dict(row), but it throws exception , TypeError: 'User' object is not iterable import sqlalchemy from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker print "sqlalchemy version:",sqlalchemy.__version__ engine = create_engine('sqlite:///:memory:', echo=False) metadata = MetaData() users_table = Table('users', metadata, Column('id', Integer, primary_key=True), Column('name', String), ) metadata.create_all(engine) class User(declarative_base()): __tablename__ = 'users' id = Column(Integer, primary_key=True) name = Column(String) def __init__(self, name): self.name = name Session = sessionmaker(bind=engine) session = Session() user1 = User("anurag") session.add(user1) session.commit() # uncommenting next line throws exception 'TypeError: 'User' object is not iterable' #print dict(user1) # this one also throws 'TypeError: 'User' object is not iterable' for u in session.query(User).all(): print dict(u) Running this code on my system outputs: sqlalchemy version: 0.5.6 Traceback (most recent call last): File "untitled-1.py", line 37, in <module> print dict(u) TypeError: 'User' object is not iterable

    Read the article

  • how to specify the file path in rails over Mongrel web server

    - by erwin
    hi, I have a request to load a swf file, flaMovie.swf from rails. The swf file is located the directory /home/user1/railsproj/flash. I have the code index.rhtml under view directory to show the .swf file, ID=flaMovie WIDTH=250 HEIGHT=250 When I ran the code, I got the error, ActionController::RoutingError (No route matches "/home/user1/railsproj/flash/flaMovie.swf" with {:method=:get}): /vendor/rails/actionpack/lib/action_controller/routing.rb:1441:in recognize_path' /vendor/rails/actionpack/lib/action_controller/routing.rb:1424:inrecognize' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:170:in handle_request' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:indispatch' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in dispatch_cgi' /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:indispatch' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in process' /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:insynchronize' My rails project is located in /home/user1/railsproj and the web server is Mongrel web server. How to specify the path in the rhtml file so that Mongrel server is able to locate the file? Thanks a lot,

    Read the article

  • Object comparison in JavaScript

    - by spankmaster79
    What is the best way to compare Objects in JavaScript? Example: var user1 = {name : "nerd", org: "dev"}; var user2 = {name : "nerd", org: "dev"}; var eq = user1 == user2; alert(eq); // gives false I know that "Two objects are equal if they refer to the exact same Object", but is there a way to check it another way?? Using this way works for me.....but is it the only possibility? var eq = Object.toJSON(user1) == Object.toJSON(user2); alert(eq); // gives true

    Read the article

  • Rails: unexpected behavior updating a shared instance

    - by Pascal Lindelauf
    I have a User object, that is related to a Post object via two different association paths: Post --(has_many)-- comments --(belongs to)-- writer (of type User) Post --(belongs to)-- writer (of type User) Say the following hold: user1.name == "Bill" post1.comments[1].writer == user1 post1.writer == user1 Now when I retrieve the post1 and its comments from the database and I update post1.comments[1].writer like so: post1.comments[1].writer.name = "John" I would expect post1.writer to equal "John" too. But it doesn't! It still equals "Bill". So there seems to be some caching going on, but the kind I would not expect. I would expect Rails to be clever enough to load exactly one instance of the user with name "Bill"; instead is appears to load two individual ones: one for each association path. Can someone explain how this works exactly and how I am to handle these types of situations the "Rails way"?

    Read the article

  • SubProject OR SubFolder ?

    - by user300435
    I am writing an asp.net application that exposes data in 2 ways: 1 - 1 common section that all users can see 2 - a Section that displays data specific to a registered user. in this case the user can decide how it looks (through themes), and manage the data to be displayed. Of course, the logic behind is the same, appearance would be different for as user1 and user2 The questions are : What would be best using : 'http://www.site.com/User1' or 'http://user1.site.com'. knowing that in both cases i have to make the displayed pages look like a seperate site then the root domain in anycase, the pages that will be displayed and customized on the fly are located in a subfolder of the of the asp.net project (projectrootpath\personalpages). What is the best way to map the personalpages subfolder to a subdomain or a 'http://www.site.com/userX' in the address bar. i also use "~/" in the urls which in this case needs to point to the personalpages rather then the root . Any help is gretaly apreciated.

    Read the article

  • asp.net mvc who is online

    - by niao
    Greetings, can someone give me some advices or links that will help me to implement to following scenario. Page will be written in asp.net mvc. Authorization is going to be implemented by Memberships. The scenario is as follows: User1 has just logged in. After a while, User2 attempts to login with success. Then user1 should be notified that User2 has just logged in. Additionally User2 should be notified that User1 is online. How can I achieve something like that? It should also be possible for these users to write messages to each other. (chat like).

    Read the article

  • MS SQL Query Question

    - by Lp1
    Running MS SQL 2008, and I am definitely a new SQL user. I have a table that has 4 columns: EmpNum, User, Action, Updatetime A user logs into, and out of a system, it is registered in the database. For example, if user1 logs into the system, then out 5 minutes later, a simple query (select * from update) would look like: EmpNum User Action Updatetime 1 User1 I 2010-01-01 23:00:00:000 1 User1 O 2010-01-01 23:05:00:000 I'm trying to query the Empnum, User, Action, I(in time), O(out time), and the total time. Any help or a point in the right direction, and I would be eternally grateful. :)

    Read the article

  • Delete cache when web browser is close.

    - by Edy Cu
    Hi all. I have issue about multiple login in asp.net. Case this happen: User X login as "user1" in web browser. Then user Y also login as "user1" also in another web browser. User Y got error message "Another user log in some account". That is work as expected. If X, close their web browser. Then try again to login in as "user1". X get also get "Another user log in some account". So i trying debug then i found session is remove when web browser is close, but cache still remaining in web browser. Anyone have idea about this how to clear cache when user close their browser, (not tab). Regard.

    Read the article

  • asp.net refresh part of page whit jquery when application state change

    - by Jeson Park
    i use Application property to count number of online users Application["OnlineUsers"] = (int)Application["OnlineUsers"] + 1; and then bind Application property value to HTML tag <div id="OnlineUser" > <span>Number of Online Users is <%=Application["OnlineUsers"].ToString() %></span> </div> when for example "user1" visit page,DIV tag show "Number of Online Users is 1" and "user2" visit page,DIV tag show "Number of Online Users is 2" but user1 still "Number of Online Users is 1" how do i refresh user1 page when user2 change application peroperty?

    Read the article

  • Hibernate + Spring + session + cache

    - by andromeda
    We are using Hibernate with Spring for our Java application. We find out that when a session update something in database other sessions can not see the update. For example user1 get the account balance from database then user2 increase the balance , if user1 get the object another time he see the account balance before updating (seems that session use the value from its cache) but we want to get the updated object with new account balance. User1 use one session during all activity that is different from user2 session. Is any configuration to force to get the updated object from database? or any other help?

    Read the article

  • I'm in a group but can't create or modify files

    - by dac
    I have two user accounts. Let's say one is User1 and the other is User2. Both of these accounts are in the "root" group. I made a folder with some files in it. The owner is User1 and the group is root. The permissions are set so the group "root" can create and delete files. However, when I log in as User2, I can only access files. User2 is in the "root" group for sure, and when I right-click on the folder in Nautilus, and then PropertiesPermissions, it says there that the "root" group can create and delete files. What's going on? edit: Logged out and then back in, and, I don't know why, everything works now...

    Read the article

  • Restrict user to folder (not root) on VSFTPD in Ubuntu

    - by omega1
    I am a new Linux (Ubuntu) user and have a VPS where I am setting up a backup FTP service. I have followed this guide, which I have managed to do correctly and it works. I have two users (user1 and user2) with the same directory /home/users/test. user1 can read/write and user2 can only read. This works OK. When the users log in, they go straight into the correct directory /home/users/test, but they can navigate back down to the home directory, which I do not want to happen. I cannot seem to find out how to not allow this, and have them not be able to navigate back to the /home/ or /home/test/ directories.

    Read the article

  • How To return md5 salted hash? [closed]

    - by user1790627
    Here is the function and this function returns value for sessionGuid. Example, User1 login and join chat then the value of User1 for sessionGuid is. 1 User2 value for sessionGuid is. 2 User3 . value .3 i want this function return md5 salted hash to avoid hacks. function get_current_online_session_login() { $oSrvSec = &App::getModuleService('Account', 'Security'); $login = $oSrvSec->getCurrentUserLogin(); $aReq = getRow(App::getT('online_session'), 'online_session_user = "' . $login . '"'); // return $aReq['online_session_login']; return $aReq['online_session_id']; }

    Read the article

  • SQL 2005 AD Group permission levels

    - by jj.
    I'm trying to give permissions to a (sql 2005) database app based on AD groups. The general idea is to require a user to have a membership to "app_users" to view anything, and membership to other groups gives them write access to that group. "app_customers" gives write access to the customers module, "app_sales" to sales, etc. I've listed an example below: user1: AD member of app_users user2: AD member of app_users, app_customers For dbo.customers table: app_users - Granted: Select permission - Denied: Insert, Update, Delete app_customers - Granted: Select permission - Granted: Insert, Update, Delete I would expect user1 to be able to view the dbo.customers table, but will not be allowed to modify anything (insert/update/delete) - which works. In the same vein, I would expect user2 to be able to view AND modify the dbo.customers table, since they are a member of app_customers. However, this is not the case. Instead, user2 is denied any modifications just like user1. I seem to remember something about deny permissions winning if there was a conflict, but it's honestly been too long since I've dealt with them. Am I going about this the right way? Thanks for your time!

    Read the article

  • Openvpn - stuck on Connecting

    - by user224277
    I've got a problem with openvpn server... every time when I trying to connect to the VPN , I am getting a window with login and password box, so I typed my login and password (login = Common Name (user1) and password is from a challenge password from the client certificate. Logs : Jun 7 17:03:05 test ovpn-openvpn[5618]: Authenticate/Decrypt packet error: packet HMAC authentication failed Jun 7 17:03:05 test ovpn-openvpn[5618]: TLS Error: incoming packet authentication failed from [AF_INET]80.**.**.***:54179 Client.ovpn : client #dev tap dev tun #proto tcp proto udp remote [Server IP] 1194 resolv-retry infinite nobind persist-key persist-tun ca ca.crt cert user1.crt key user1.key <tls-auth> -----BEGIN OpenVPN Static key V1----- d1e0... -----END OpenVPN Static key V1----- </tls-auth> ns-cert-type server cipher AES-256-CBC comp-lzo yes verb 0 mute 20 My openvpn.conf : port 1194 #proto tcp proto udp #dev tap dev tun #dev-node MyTap ca /etc/openvpn/keys/ca.crt cert /etc/openvpn/keys/VPN.crt key /etc/openvpn/keys/VPN.key dh /etc/openvpn/keys/dh2048.pem server 10.8.0.0 255.255.255.0 ifconfig-pool-persist ipp.txt #push „route 192.168.5.0 255.255.255.0? #push „route 192.168.10.0 255.255.255.0? keepalive 10 120 tls-auth /etc/openvpn/keys/ta.key 0 #cipher BF-CBC # Blowfish #cipher AES-128-CBC # AES #cipher DES-EDE3-CBC # Triple-DES comp-lzo #max-clients 100 #user nobody #group nogroup persist-key persist-tun status openvpn-status.log #log openvpn.log #log-append openvpn.log verb 3 sysctl : net.ipv4.ip_forward=1

    Read the article

  • Setting up ssh config file with id_rsa through tunnel

    - by Rubens
    I've been struggling to set up a valid configuration to open a connection with a second machine, passing through another one, and using an id_rsa (which requests me a password) to connect to the third machine. I've asked this question in another forum, but I've received no answer that could be considered very helpful. The problem, better described, goes as follows: Local machine: user1@localhost Intermediary machine: user1@inter Remote target: user2@final I'm able to do the entire connection using pseudo-tty: ssh -t inter ssh user2@final (this will ask me the password for the id_rsa file I have in machine "inter") However, for speeding things up, I'd like to set my .ssh/config file, so that I can simply connect to machine "final" using: ssh final What I've got so far -- which does not work -- is, in my .ssh/config file: Host inter User user1 HostName inter.com IdentityFile ~/.ssh/id_rsa Host final User user2 HostName final.com IdentityFile ~/.ssh/id_rsa_2 ProxyCommand ssh inter nc %h %p The id_rsa file is used to connect to the middle machine (this requires me no password typing), and id_rsa_2 file is used to connect to machine "final" (this one requests a password). I've tried mixing up some LocalForward and/or RemoteForward fields, and putting the id_rsa files in both first and second machines, but I could not seem to succeed with no configuration whatsoever. Hope somebody can help me here! Regards! P.S.: the thread I've tried to get some help from: http://www.linuxquestions.org/questions/linux-general-1/proxycommand-on-ssh-config-file-4175433750/

    Read the article

  • if I define `my_domain`, postfix does not expand mail aliases

    - by Norky
    I have postfix v2.6.6 running on CentOS 6.3, hostname priest.ocsl.local (private, internal domain) with a number of aliases supportpeople: [email protected], [email protected], [email protected] requests: "|/opt/rt4/bin/rt-mailgate --queue 'general' --action correspond --url http://localhost/", supportpeople help: "|/opt/rt4/bin/rt-mailgate --queue 'help' --action correspond --url http://localhost/", supportpeople If I leave postfix with its default configuration, then the aliases are resolved correctly/as I expect, so that incoming mail to, say, [email protected] will be piped through the rt-mailgate mailgate command and also be delivered (via the mail server for ocsl.co.uk (a publicly resolvable domain)) to [email protected], user2, etc. The problem comes when I define mydomain = ocsl.co.uk in /etc/postfix/main.cf (with the intention that outgoing mail come from, for example, [email protected]). When I do this, postfix continues to run the piped command correctly, however it no longer expands the nested aliases as I expect: instead of trying to deliver to [email protected], user2 etc, it tries to send to [email protected], which does not exist on the upstream mail server and generates NDRs. postconf -n for the non-working configuration follows (the working configuration differs only by the "mydomain" line. alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost mydomain = ocsl.co.uk newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop unknown_local_recipient_reject_code = 550 We did have things working as we expected/wanted previously on an older system running Sendmail.

    Read the article

  • Postfix: How to configure Postfix with virtual Dovecot mailboxes?

    - by user75247
    I have configured a Postfix mail server for two domains: domain1.com and domain2.com. In my configuration domain1 has both virtual users with Maildirs and aliases to forward mail to local users (eg. root, webmaster) and some small mailing lists. It also has some virtual mappings to non-local domains. Domain2 on the other hand has only virtual alias mappings, mainly to corresponding 'users' at domain1 (eg. mails to [email protected] should be forwarded to [email protected]). My problem is that currently Postfix accepts mail even for those users that don't exist in the system. Mail to existing users and /etc/aliases works fine. Postfix documentation states that the same domain should never be specified in both mydestination and virtual_mailbox_maps, but If I specify mydestination as blank then postfix validates recipients against virtual_mailbox_maps but rejects mail for local aliases of domain1.com. /etc/postfix/main.cf: myhostname = domain1.com mydomain = domain1.com mydestinations = $myhostname, localhost.$mydomain, localhost virtual_mailbox_domains = domain1.com virtual_mailbox_maps = hash:/etc/postfix/vmailbox virtual_mailbox_base = /home/vmail/domains virtual_alias_domains = domain2.com virtual_alias_maps = hash:/etc/postfix/virtual alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases virtual_transport = dovecot /etc/postfix/virtual: domain1.com right-hand-content-does-not-matter firstname.lastname user1 [more aliases..] domain2.com right-hand-content-does-not-matter @domain2.com @domain1.com /etc/postfix/vmailbox: [email protected] user1/Maildir [email protected] user2/Maildir /etc/aliases: root: :include:/etc/postfix/aliases/root webmaster: :include:/etc/postfix/aliases/webmaster [etc..] Is this approach correct or is there some other way to configure Postfix with Dovecot (virtual) Maildirs and Postfix aliases?

    Read the article

  • Folder Sharing NTFS permissions with Share Permission

    - by Muhammad Adly
    i have a problem on my domain, the history starting from when i had a server with WIN 2008 r2 installed with the following roles installed on it (AD, DNS, DHCP, File). From 1 month i decided to install a new server 2008 r2 server to get (AD, DNS, DHCP) and leave the file server on the old one. i did the following exactly: 1) robocopy all my data on external HDD 2) Install a new server with 2008 r2 3) transfer all 5 roles to transfer the domain to the new server (MainDC) 4) issue (NETLOGON, SYSVOL) not transferred but i decided to reinitialize them again an now they are operating (MainDC) 5) re-create and re-configure a new GPOs and link it to my OUs 6) reinstall Old server operating system with a fresh installation of WIN 2008 R2 (FileServer) 7) join my domain with my domain credentials. the issue when i tried to share folder on \fileserver the permissions that i had set in sharing permissions are applied on the main shared folder and subfolders. the security settings are not applied. i.e. Say i'm sharing \fileserver\MainFolder with sharing permission for Authenticated Users that can read, so every one can read this main shared folder, if i set security permission for \fileserver\MainFolder\User1 that User1 can Read\Write\Modify. User1 can not perform this processes when accessing it from Network Share, i tried alot of steps from topics online get ownership for folder, remove inheritance from parent folder, applying changes for child objects, i tried also to construct a new folder structure but also the same issue, i tried another host PC, also i get the same issue.

    Read the article

  • mplayer dumpstream sometimes fails

    - by User1
    I'm trying to rip the video at http://videolectures.net/ecml07%5Fgetoor%5Fisr/, so I can play it at a faster speed. I paste http://193.2.4.216/2007/pascal/ecml07%5Fwarsaw/getoor%5Flise/ecml07%5Fgetoor%5Fisr%5F01.wmv into a firefox browser in Windows and MediaPlayer plays the thing. However if I try mplayer -dumpstream, it gets stuck into an infinite loop trying to play the file. If I use wget to download the link, I get a small text file which basically points to the same URL. How can I get mplayer to download this stream?

    Read the article

  • maildir in Windows for IMAP

    - by User1
    I'm interested in accessing my IMAP accounts offline. I found that maildirs are a simple way to make it work. I found that [offlineimap] takes care of almost everything in making the IMAP-maildir sync happen. Then, I can open the account in Mutt or Wanderlust client. One major problem, maildirs use colons in their filenames. Windows doesn't allow colons. I tried mount -f -s -b -o managed "d:/tmp/mail" "/home/of/mail" in Cygwin, but doing an echo test > /home/of/mail/test:file didn't work I'm thinking about ext2fs, but I need an ext2 partition somewhere. Can I make a file into a partition somehow? I don't want to start modifying my hard drive's partition table. Besides, does anyone know if ext2fs will support colons in filenames?

    Read the article

  • GNU Screen: Remap mouse-wheel to active scroll back.

    - by User1
    I am using Screen with MinTTY at a bash prompt. Sometimes I want to activate scrollback and copy some stuff that was on the output. My first instinct is to scroll with the mouse, but all that happens is old bash commands start showing up (like when I press the up arrow). Is there a way to re-map the mouse wheel to: Go into scrollback mode, or If already in scrollback mode, start moving up in the scrollback window

    Read the article

  • How to convert ext3 partition to use encrypted file system without loosing data?

    - by User1
    My embedded Linux device have 2 partitions: small root partition containing OS. big data partition which uses ext3 I want to encrypt the data partition by using encrypted file system. I don't want loose any data of the partition. Size of the root partition is too small to hold all data of the data partition. It is not possible to use any external data storage. Is there any tools that can convert filesystem of the data partition from ext3 to encrypted fs without copying all files to other place?

    Read the article

  • mplayer dumpstream sometimes fails

    - by User1
    I'm trying to rip the video at http://videolectures.net/ecml07%5Fgetoor%5Fisr/, so I can play it at a faster speed. I paste http://193.2.4.216/2007/pascal/ecml07%5Fwarsaw/getoor%5Flise/ecml07%5Fgetoor%5Fisr%5F01.wmv into a firefox browser in Windows and MediaPlayer plays the thing. However if I try mplayer -dumpstream, it gets stuck into an infinite loop trying to play the file. If I use wget to download the link, I get a small text file which basically points to the same URL. How can I get mplayer to download this stream?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >