Search Results

Search found 4191 results on 168 pages for 'roaming profile'.

Page 35/168 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • Possible to have multiple Profiles in ASP.NET for different users?

    - by asple
    My application has a few different user types with their own members. For example, I have the student user as well as the teacher user. I authenticate my users through active directory in my custom MembershipProvider's ValidateUser method. While querying AD, I pull out all their relevant information. I'd like to put that information into a Profile, but from what I've read and the examples I've sen, you can only define a single Profile (like so): <profile defaultProvider="CustomProfileProvider" enabled="true"> <properties> <add name="YearLevel" type="String" /> <add name="Name" type="String" /> <add name="Age" type="String" /> </properties> </profile> The above profile would work for a student, but not for a teacher, who does not have a value for "YearLevel" in AD. Is it possible to have multiple profiles to accomplish this? Or is it easier to add all properties from AD spanning all user types, then in my code, just check what user type they are and then access their specific properties?

    Read the article

  • Rails has_many conditions

    - by user305270
    c = "(f.profile_id = #{self.id} OR f.friend_id = #{self.id})" c += AND + "(CASE WHEN f.profile_id=#{self.id} THEN f.friend_id ELSE f.profile_id END = p.id)" c += AND + "(CASE WHEN f.profile_id=#{self.id} THEN f.profile_rejected ELSE f.friend_rejected END = 1)" c += AND + "(p.banned = 0)" I need this to be used in a has_many relationship like this: has_many :removed_friends, :conditions => ??? how do i set there the self.id?, or how do i pass there the id? Then i want to use the will_paginate plugin: @profile.removed_friends.paginate(:page => 1, :per_page => 20) Thanks for your help EDIT: class Profile < ActiveRecord::Base has_many :friendships has_many :removed_friends, :class_name => 'Profile', :through => :friendships, :conditions => "(friendships.profile_id = #{self.id} OR friendships.friend_id = #{self.id})" "AND (CASE WHEN friendships.profile_id=#{self.id} THEN friendships.profile_rejected ELSE friendships.friend_rejected END = 1)" + "AND (p.banned = 0)" end class Friendship < ActiveRecord::Base belongs_to :profile belongs_to :removed_friend, :class_name => 'Profile', :foreign_key => "(CASE WHEN friendships.profile_id = #{self.id} THEN friend_id ELSE profile_id END)" end

    Read the article

  • Linq-to-Sql not detecting change in xml

    - by porum
    I have an xml field (Answers) in Sql Server, but when changing the content via Linq-to-Sql, the record is not flagged for updating. e.g. in Linqpad... var profile = Profiles.FirstOrDefault(p => p.Answers != null); profile.Answers.SetAttributeValue("date", DateTime.Now.ToString()); GetChangeSet().Dump(); // nothing flagged profile.Answers = new XElement(profile.Answers); // ends up with correct xml GetChangeSet().Dump(); // record is flagged as changed Any suggestions apart from assigning a clone of itself to the field or storing the xml as a string to force the update?

    Read the article

  • Rewriting URLs with mod_rewrite

    - by Webby
    Hey guys, I'm currently rewriting urls from http://domain.com/profile/?u=10000017564881 this to this http://domain.com/profile/10000017564881 with the following rewrite RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*?)\/?$ index.php?u=$1 [L] However I'd like to optimize for seo a litte and go with : http://domain.com/profile/10000017564881/Anything-I-want-here Obviously the /Anything-I-want-here is just null ignored ... Any idea's guys? much appreciated

    Read the article

  • Javascript fine grain performance tweaking

    - by thermal7
    I have been writing my first jQuery plugin and struggling to find a means to time how long different pieces of code take to run. I can use firebug and console.time/profile. However, it seems that because my code executes so fast I get no results with profile and with time it spits out 0ms. (http://stackoverflow.com/questions/2690697/firebug-profiling-issue-no-activity-to-profile/2690846#2690846) Is there a way to get the time at a greater level of detail that milliseconds in javascript?

    Read the article

  • Querying Two Tables At Once

    - by John
    Hello, I am trying to do what I believe is called a join query. First, in a MySQL table called "login," I want to look up what "loginid" is in the record where "username" equals $profile. (This will be just one record / row in the MySQL table). Then, I want to take that "loginid" and look up all rows / records in a different MySQL table called "submission," and pull data that have that "loginid." This could possibly be more than one record / row. How do I do this? The code below doesn't seem to work. Thanks in advance, John $profile = mysql_real_escape_string($_GET['profile']); $sqlStr = "SELECT l.username, l.loginid, s.loginid, s.submissionid, s.title, s.url, s.datesubmitted, s.displayurl FROM submission AS s, login AS l WHERE l.username = '$profile', s.loginid = l.loginid ORDER BY s.datesubmitted DESC";

    Read the article

  • XML/RDF to Java Objects with XSD

    - by bmucklow
    So here's the scenario...I have an XSD file describing all the objects that I need. I can create the objects in Java using JAXB no problem. I have an XML/RDF file that I need to parse into those objects. What is the EASIEST way to do this? I have been looking into Jena and have played around with it, but can't see how to easily map the XML/RDF file to the XSD objects that were generated. Here is a snippet of the XSD file as well as the XML/RDF file: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:a="http://langdale.com.au/2005/Message#" xmlns:sawsdl="http://www.w3.org/ns/sawsdl" targetNamespace="http://iec.ch/TC57/2007/profile#" elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns="http://langdale.com.au/2005/Message#" xmlns:m="http://iec.ch/TC57/2007/profile#"> <xs:annotation/> <xs:element name="Profile" type="m:Profile"/> <xs:complexType name="Profile"> <xs:sequence> <xs:element name="Breaker" type="m:Breaker" minOccurs="0" maxOccurs="unbounded"/> And the XML/RDF: <!-- CIM XML Output For switch783:(295854688) --> <cim:Switch rdf:ID="Switch_295854688"> <cim:IdentifiedObject.mRID>Switch_295854688</cim:IdentifiedObject.mRID> <cim:IdentifiedObject.aliasName>Switch_295854688</cim:IdentifiedObject.aliasName> <cim:ConductingEquipment.phases rdf:resource="http://iec.ch/TC57/2009/CIM-schema-cim14#PhaseCode.ABC" /> <cim:Switch.circuit2>0001406</cim:Switch.circuit2> <cim:Equipment.Line rdf:resource="#Line_0001406" />

    Read the article

  • collection_select not working as expected

    - by kgb
    First time I've come to use collection_select in a project and I've hit a wall with it. A Profile has_one Team, Team has_many Profile. In my view for editing profiles I have this. <td><%= f.collection_select(:team_id, @team, :id, :title) %></td> Which populates the drop down with titles of teams as expected. The couple of examples I have read seem to use it in a very similar way. I can't figure out when the profile is saved why it isn't populating the team_id field in my DB. In the development log the team_id is being passed. Processing ProfilesController#update (for 127.0.0.1 at 2010-03-28 22:49:16) [PUT] Parameters: {"commit"=>"Update", "profile"=>{"dob(1i)"=>"2010", "second_name"=>"", "dob(2i)"=>"3", "role"=>"", "dob(3i)"=>"28", "project"=>"", "specialties"=>"", "about"=>"", "team_id"=>"1", "status"=>"", "first_name"=>""}, "authenticity_token"=>"sdTiFPGj9JCO3OEge5EGNGxZbQSsq9ME5LP342EBjyc=", "id"=>"3"} The update controller is the standard scaffold one, this has worked fine for all other additions to the profile model I'd made previously. Am I missing something obvious?

    Read the article

  • ASP.NET LocalResources same filename

    - by Zenuka
    Hi, I have a small question and I think this is asked before but I can't seem to find it... I have 2 pages: /Default.aspx and /Profile/Default.aspx The resource file for the /Default.aspx is in /App_LocalResources/Default.aspx.resx but where do I place the Default.aspx.resx for the /Profile/Default.aspx? When I place it in /App_LocalResources/Profile/Default.aspx.resx it keeps telling me the resource isn't found... I access the resources like this: <%$ Resources:lblHeader.Text %>

    Read the article

  • Active menu tabs with codeigniter

    - by CyberJunkie
    Which method can be used in Codeigniter to achieve active menu tabs? For example I have a user menu Profile Friends Messages Logout When I'm in the profile controller the URL is domain.com/profile/some_function The Profile tab should be active by changing the background color for example. I would usually add php to the tabs to check for their corresponding URL segment and I would change the style of the active tab. In Codeigniter should I implement a helper? What function can I easily use in tabs?

    Read the article

  • Table not Echoing out if another Table has a Zero value

    - by John
    Hello, The table below with mysql_query($sqlStr3) (the one with the word "Joined" in its row) does not echo if the result associated with mysql_query($sqlStr1) has a value of zero. This happens even if mysql_query($sqlStr3) returns a result. In other words, if a given loginid has an entry in the table "login", but not one in the table "submission", then the table associated with mysql_query($sqlStr3) does not echo. I don't understand why the "submission" table would have any effect on mysql_query($sqlStr3), since the $sqlStr3 only deals with another table, called "login", as seen below. Any ideas why this is happening? Thanks in advance, John W. <?php echo '<div class="profilename">User Profile for </div>'; echo '<div class="profilename2">'.$profile.'</div>'; $tzFrom = new DateTimeZone('America/New_York'); $tzTo = new DateTimeZone('America/Phoenix'); $profile = mysql_real_escape_string($_GET['profile']); $sqlStr = "SELECT l.username, l.loginid, s.loginid, s.submissionid, s.title, s.url, s.datesubmitted, s.displayurl FROM submission AS s INNER JOIN login AS l ON s.loginid = l.loginid WHERE l.username = '$profile' ORDER BY s.datesubmitted DESC"; $result = mysql_query($sqlStr); $arr = array(); echo "<table class=\"samplesrec1\">"; while ($row = mysql_fetch_array($result)) { $dt = new DateTime($row["datesubmitted"], $tzFrom); $dt->setTimezone($tzTo); echo '<tr>'; echo '<td class="sitename3">'.$dt->format('F j, Y &\nb\sp &\nb\sp g:i a').'</a></td>'; echo '<td class="sitename1"><a href="http://www.'.$row["url"].'">'.$row["title"].'</a></td>'; echo '</tr>'; } echo "</table>"; $sqlStr1 = "SELECT l.username, l.loginid, s.loginid, s.submissionid, s.title, s.url, s.datesubmitted, s.displayurl, l.created, count(s.submissionid) countSubmissions FROM submission AS s INNER JOIN login AS l ON s.loginid = l.loginid WHERE l.username = '$profile'"; $result1 = mysql_query($sqlStr1); $arr1 = array(); echo "<table class=\"samplesrec2\">"; while ($row1 = mysql_fetch_array($result1)) { echo '<tr>'; echo '<td class="sitename5">Submissions: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$row1["countSubmissions"].'</td>'; echo '</tr>'; } echo "</table>"; $sqlStr2 = "SELECT l.username, l.loginid, c.loginid, c.commentid, c.submissionid, c.comment, c.datecommented, l.created, count(c.commentid) countComments FROM comment AS c INNER JOIN login AS l ON c.loginid = l.loginid WHERE l.username = '$profile'"; $result2 = mysql_query($sqlStr2); $arr2 = array(); echo "<table class=\"samplesrec3\">"; while ($row2 = mysql_fetch_array($result2)) { echo '<tr>'; echo '<td class="sitename5">Comments: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$row2["countComments"].'</td>'; echo '</tr>'; } echo "</table>"; $tzFrom3 = new DateTimeZone('America/New_York'); $tzTo3 = new DateTimeZone('America/Phoenix'); $sqlStr3 = "SELECT created, username FROM login WHERE username = '$profile'"; $result3 = mysql_query($sqlStr3); $arr3 = array(); echo "<table class=\"samplesrec4\">"; while ($row3 = mysql_fetch_array($result3)) { $dt3 = new DateTime($row3["created"], $tzFrom3); $dt3->setTimezone($tzTo3); echo '<tr>'; echo '<td class="sitename5">Joined: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$dt->format('F j, Y').'</td>'; echo '</tr>'; } echo "</table>"; ?> </body> </html>

    Read the article

  • MySQL and INT auto_increment fields

    - by PHPguy
    Hello folks, I'm developing in LAMP (Linux+Apache+MySQL+PHP) since I remember myself. But one question was bugging me for years now. I hope you can help me to find an answer and point me into the right direction. Here is my challenge: Say, we are creating a community website, where we allow our users to register. The MySQL table where we store all users would look then like this: CREATE TABLE `users` ( `uid` int(2) unsigned NOT NULL auto_increment COMMENT 'User ID', `name` varchar(20) NOT NULL, `password` varchar(32) NOT NULL COMMENT 'Password is saved as a 32-bytes hash, never in plain text', `email` varchar(64) NOT NULL, `created` int(11) unsigned NOT NULL default '0' COMMENT 'Timestamp of registration', `updated` int(11) unsigned NOT NULL default '0' COMMENT 'Timestamp of profile update, e.g. change of email', PRIMARY KEY (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; So, from this snippet you can see that we have a unique and automatically incrementing for every new user 'uid' field. As on every good and loyal community website we need to provide users with possibility to completely delete their profile if they want to cancel their participation in our community. Here comes my problem. Let's say we have 3 registered users: Alice (uid = 1), Bob (uid = 2) and Chris (uid = 3). Now Bob want to delete his profile and stop using our community. If we delete Bob's profile from the 'users' table then his missing 'uid' will create a gap which will be never filled again. In my opinion it's a huge waste of uid's. I see 3 possible solutions here: 1) Increase the capacity of the 'uid' field in our table from SMALLINT (int(2)) to, for example, BIGINT (int(8)) and ignore the fact that some of the uid's will be wasted. 2) introduce the new field 'is_deleted', which will be used to mark deleted profiles (but keep them in the table, instead of deleting them) to re-utilize their uid's for newly registered users. The table will look then like this: CREATE TABLE `users` ( `uid` int(2) unsigned NOT NULL auto_increment COMMENT 'User ID', `name` varchar(20) NOT NULL, `password` varchar(32) NOT NULL COMMENT 'Password is saved as a 32-bytes hash, never in plain text', `email` varchar(64) NOT NULL, `is_deleted` int(1) unsigned NOT NULL default '0' COMMENT 'If equal to "1" then the profile has been deleted and will be re-used for new registrations', `created` int(11) unsigned NOT NULL default '0' COMMENT 'Timestamp of registration', `updated` int(11) unsigned NOT NULL default '0' COMMENT 'Timestamp of profile update, e.g. change of email', PRIMARY KEY (`uid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 3) Write a script to shift all following user records once a previous record has been deleted. E.g. in our case when Bob (uid = 2) decides to remove his profile, we would replace his record with the record of Chris (uid = 3), so that uid of Chris becomes qual to 2 and mark (is_deleted = '1') the old record of Chris as vacant for the new users. In this case we keep the chronological order of uid's according to the registration time, so that the older users have lower uid's. Please, advice me now which way is the right way to handle the gaps in the auto_increment fields. This is just one example with users, but such cases occur very often in my programming experience. Thanks in advance!

    Read the article

  • PHP code in Drupal 6

    - by abhishekgupta92
    A very standard example of the problem that I am facing is that of a custom content say blog type. Now there is a view namely "My Blog Posts". In that view i take the argument as User:uid. Now, for the link part i simply write the code below: global $user; and send $user-uid as the argument to User:Uid. This give me link for "My Blog Posts" or the blog posts of the logged-in user What I want is a view like "His Blog Posts". So, if i visit the profile of some other user. There should be a tab in his profile "Blog Posts by Me". So for that i need to have the UID of the user whose profile I am visiting. So, how can I get this parameter from URL of his profile or somevhere else.

    Read the article

  • pyramid traversal resource url no attribute __name__

    - by Santana
    So I have: resources.py: def _add(obj, name, parent): obj.__name__ = name obj.__parent__ = parent return obj class Root(object): __parent__ = __name__ = None def __init__(self, request): super(Root, self).__init__() self.request = request self.collection = request.db.post def __getitem__(self, key): if u'profile' in key: return Profile(self.request) class Profile(dict): def __init__(self, request): super(Profile, self).__init__() self.__name__ = u'profile' self.__parent__ = Root self.collection = request.db.posts def __getitem__(self, name): post = Dummy(self.collection.find_one(dict(username=name))) return _add(post, name, self) and I'm using MongoDB and pyramid_mongodb views.py: @view_config(context = Profile, renderer = 'templates/mytemplate.pt') def test_view(request): return {} and in mytemplate.pt: <p tal:repeat='item request.context'> ${item} </p> I can echo what's in the database (I'm using mongodb), but when I provided a URL for each item using resource_url() <p tal:repeat='item request.context'> <a href='${request.resource_url(item)}'>${item}</a> </p> I got an error: 'dict' object has no attribute '__name__', can someone help me?

    Read the article

  • How is it possible the class inheritance in namespaces using Ruby on Rails 3?

    - by user502052
    In my RoR3 application I have a namespace called NS1 so that I have this filesystem structure: ROOT_RAILS/controllers/ ROOT_RAILS/controllers/application_controller.rb ROOT_RAILS/controllers/ns/ ROOT_RAILS/controllers/ns/ns_controller.rb ROOT_RAILS/controllers/ns/names_controller.rb ROOT_RAILS/controllers/ns/surnames_controller.rb I wuold like that 'ns_controller.rb' inherits from application controller, so in 'ns_controller.rb' file I have: class Ns::NsController < ApplicationController ... end Is this the right approach? Anyway if I have this situation... in 'application_controller.rb' class ApplicationController < ActionController::Base @profile = Profile.find(1) end in 'ns_controller.rb' class Ns::NsController < ApplicationController @name = @profile.name @surname = @profile.surname end ... '@name' and '@surname' variables are not set. Why?

    Read the article

  • in django am facing url problem.....

    - by dpaksp
    am using django.0.97 version i have model called profile in that i have few fields eg like name ,email...ects and it's backend also ready..i.e database . and all users profile is created...i have given all permission to all users. when i login ,click on profile..i able to see list of all user name thr when i click on it ,it's goin to model page where i can edit the user profile..instead of that i want to navigate to a template when i can display the user details ,i have set the URl for it so that when url of that type request comes it should call a view from view it will call my template to display user details,.....the problem is it's not calling my view.... i think my problem is brief....if any information still required ?? pls ask me....and help me

    Read the article

  • Paperclip + ImageMagick on Windows 7: Image display fails when I add styles to attached_file in mode

    - by Brian Roisentul
    I'm working with Ruby on rails 2.3.8, NetBeans IDE. I've installed paperclip and I could show/save images successfully. Now, I've installed ImageMagick-6.6.2-4-Q16(for windows 7, 64bits). Until that moment, my model looked like this(and worked fine): has_attached_file :photo Now, after installing ImageMagick, when I add the :style line it fails: has_attached_file :photo, :styles => {:thumb => "100x100#", :small => "150x150>", :large => "400x400>" } and it throws the following error message when I try to upload an image: TypeError in ProfilesController#update backtrace must be Array of String The only thing I'm doing in the update action of that controller is the following: @profile.update_attributes(params[:profile]) @profile.update_attribute(:photo, params[:profile][:photo]) I've also installed miniMagick gem(because I read somewhere I had to do it). What am I missing?

    Read the article

  • Rails and date: get profiles with related ages

    - by Totty
    Hy, I have a profile x, that has a born_date and then i want to get all the profiles that has more or less 5 years. If profile x has 20 years, i want every profile that has between 15 and 25 years. Here i need some date calculations and i dont really know how to do it. You have some ideas? ;)

    Read the article

  • iPhone app not running on iPhone

    - by Jon
    I have my iPhone setup on my computer at home, with my developer account and provisioning profile. I'm trying to get it setup on my work computer so I can run work apps on it as well. My work has their own dev account. I created an app ID and privisioning profile on my personal account and downloaded it on my work computer but its not letting me compile and run on my iPhone. It says valid provisiong profile not found on executable.

    Read the article

  • django: Selecting questions that was not asked

    - by Oleg Tarasenko
    Hi, I am creating small django application which holds some few questions (and answers for them) What I want to do is to show user random question, but only from those which was not solved by him yet. I wonder how to do this. For now, I defined user profile model this way: class UserProfile(models.Model): rank = models.IntegerField(default = 1) solvedQ = models.ManyToManyField(Question) user = models.ForeignKey(User, unique=True) So solved problems are added this way: if user.is_authenticated(): profile = user.get_profile() profile.rank += 1 profile.solvedQ.add(Question.objects.get(id=id)) Now if the view must show random question, but not from already solved list... Is there a good way to intersect Questions and solvedQuestions.... so question is chosen from the unsolved list?

    Read the article

  • Isuue when uploading new version to app store

    - by user2978997
    Can I use new certificate and provisioning profile to upload new version? We have discovered one or more issues with your recent delivery for "EMTV News". To process your delivery, the following issues must be corrected: Invalid Provisioning Profile - The provisioning profile included in the bundle com.pointabout.C1E322F0 (Payload/EMTV.app) is invalid. (Missing code-signing certificate.) For more information, visit the iOS Developer Portal. Once these issues have been corrected, go to the Version Details page and click "Ready to Upload Binary." Continue through the submission process until the app status is "Waiting for Upload." You can then deliver the corrected binary. Regards, The App Store team Note: I am using new Certificate and provisioning profile but same bundle ID which is being used in old version of the app.

    Read the article

  • Creating subdomain in URL alaising

    - by Jay
    I am creating a social networking site and one of the requirements is to have the subdomain like URL for each user. For example, for the user1 his profile page will be user1.mysitename.com and for the user2 profile page will be user2.mysitename.com. Can it be done using url aliasing? basically user1.mysitename.com should be www.mysitename.com/profile.aspx?username=user1 I will be hosting this in windows 2003 (IIS6), any help is highly appreciated.

    Read the article

  • How to join 2 tables & display them correctly?

    - by steven
    http://img293.imageshack.us/img293/857/tablez.jpg Here is a picture of the 2 tables. The mybb_users table is the table that has the users that signed up for the forum. The mybb_userfields is the table that contain custom profile field data that they are able to customize & change in their profile. Now, all I want to do is display all users in rows with the custom profile field data that they provided in their profile(which is in the mybb_userfields table) How can I display these fields correctly together? For instance, p0gz is a male,lives in AZ,he owns a 360,does not know his bandwidth & Flip Side Phoenix is his team. How can it just be like "p0gz-male-az-360-dont know-flipside phoenix" in a row~???

    Read the article

  • Hyperlinks within a table - '<a href="">'.$row['username'].'</a>'

    - by Taimur
    Hi, I have made a leaderboard table on my site, which returns the users in the MySQL database with the highest scores (score is a separate field). The fields in the leaderboard table are 'rank' 'username' and 'score'. I would like to link each username in the table to it's own profile page. The profile pages are in the format /profile.php?user=$username. How would I go about adding an <a href> within the table (which is echoed in php): echo '<tr><td>' .$a. '</td><td><a href="profile.php?user=' .$row['username']. '">' .$row['username']. '</a></td><td>'.$row['count'].'</td></tr>'; I've tried the above, but it doesn't seem to work. It shows the usernames, but they don't have any hyperlinks. Thanks

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >