Search Results

Search found 3452 results on 139 pages for 'ur truly friend'.

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

  • Templated << friend not working when in interrelationship with other templated union types

    - by Dwight
    While working on my basic vector library, I've been trying to use a nice syntax for swizzle-based printing. The problem occurs when attempting to print a swizzle of a different dimension than the vector in question. In GCC 4.0, I originally had the friend << overloaded functions (with a body, even though it duplicated code) for every dimension in each vector, which caused the code to work, even if the non-native dimension code never actually was called. This failed in GCC 4.2. I recently realized (silly me) that only the function declaration was needed, not the body of the code, so I did that. Now I get the same warning on both GCC 4.0 and 4.2: LINE 50 warning: friend declaration 'std::ostream& operator<<(std::ostream&, const VECTOR3<TYPE>&)' declares a non-template function Plus the five identical warnings more for the other function declarations. The below example code shows off exactly what's going on and has all code necessary to reproduce the problem. #include <iostream> // cout, endl #include <sstream> // ostream, ostringstream, string using std::cout; using std::endl; using std::string; using std::ostream; // Predefines template <typename TYPE> union VECTOR2; template <typename TYPE> union VECTOR3; template <typename TYPE> union VECTOR4; typedef VECTOR2<float> vec2; typedef VECTOR3<float> vec3; typedef VECTOR4<float> vec4; template <typename TYPE> union VECTOR2 { private: struct { TYPE x, y; } v; struct s1 { protected: TYPE x, y; }; struct s2 { protected: TYPE x, y; }; struct s3 { protected: TYPE x, y; }; struct s4 { protected: TYPE x, y; }; struct X : s1 { operator TYPE() const { return s1::x; } }; struct XX : s2 { operator VECTOR2<TYPE>() const { return VECTOR2<TYPE>(s2::x, s2::x); } }; struct XXX : s3 { operator VECTOR3<TYPE>() const { return VECTOR3<TYPE>(s3::x, s3::x, s3::x); } }; struct XXXX : s4 { operator VECTOR4<TYPE>() const { return VECTOR4<TYPE>(s4::x, s4::x, s4::x, s4::x); } }; public: VECTOR2() {} VECTOR2(const TYPE& x, const TYPE& y) { v.x = x; v.y = y; } X x; XX xx; XXX xxx; XXXX xxxx; // Overload for cout friend ostream& operator<<(ostream& os, const VECTOR2<TYPE>& toString) { os << "(" << toString.v.x << ", " << toString.v.y << ")"; return os; } friend ostream& operator<<(ostream& os, const VECTOR3<TYPE>& toString); friend ostream& operator<<(ostream& os, const VECTOR4<TYPE>& toString); }; template <typename TYPE> union VECTOR3 { private: struct { TYPE x, y, z; } v; struct s1 { protected: TYPE x, y, z; }; struct s2 { protected: TYPE x, y, z; }; struct s3 { protected: TYPE x, y, z; }; struct s4 { protected: TYPE x, y, z; }; struct X : s1 { operator TYPE() const { return s1::x; } }; struct XX : s2 { operator VECTOR2<TYPE>() const { return VECTOR2<TYPE>(s2::x, s2::x); } }; struct XXX : s3 { operator VECTOR3<TYPE>() const { return VECTOR3<TYPE>(s3::x, s3::x, s3::x); } }; struct XXXX : s4 { operator VECTOR4<TYPE>() const { return VECTOR4<TYPE>(s4::x, s4::x, s4::x, s4::x); } }; public: VECTOR3() {} VECTOR3(const TYPE& x, const TYPE& y, const TYPE& z) { v.x = x; v.y = y; v.z = z; } X x; XX xx; XXX xxx; XXXX xxxx; // Overload for cout friend ostream& operator<<(ostream& os, const VECTOR3<TYPE>& toString) { os << "(" << toString.v.x << ", " << toString.v.y << ", " << toString.v.z << ")"; return os; } friend ostream& operator<<(ostream& os, const VECTOR2<TYPE>& toString); friend ostream& operator<<(ostream& os, const VECTOR4<TYPE>& toString); }; template <typename TYPE> union VECTOR4 { private: struct { TYPE x, y, z, w; } v; struct s1 { protected: TYPE x, y, z, w; }; struct s2 { protected: TYPE x, y, z, w; }; struct s3 { protected: TYPE x, y, z, w; }; struct s4 { protected: TYPE x, y, z, w; }; struct X : s1 { operator TYPE() const { return s1::x; } }; struct XX : s2 { operator VECTOR2<TYPE>() const { return VECTOR2<TYPE>(s2::x, s2::x); } }; struct XXX : s3 { operator VECTOR3<TYPE>() const { return VECTOR3<TYPE>(s3::x, s3::x, s3::x); } }; struct XXXX : s4 { operator VECTOR4<TYPE>() const { return VECTOR4<TYPE>(s4::x, s4::x, s4::x, s4::x); } }; public: VECTOR4() {} VECTOR4(const TYPE& x, const TYPE& y, const TYPE& z, const TYPE& w) { v.x = x; v.y = y; v.z = z; v.w = w; } X x; XX xx; XXX xxx; XXXX xxxx; // Overload for cout friend ostream& operator<<(ostream& os, const VECTOR4& toString) { os << "(" << toString.v.x << ", " << toString.v.y << ", " << toString.v.z << ", " << toString.v.w << ")"; return os; } friend ostream& operator<<(ostream& os, const VECTOR2<TYPE>& toString); friend ostream& operator<<(ostream& os, const VECTOR3<TYPE>& toString); }; // Test code int main (int argc, char * const argv[]) { vec2 my2dVector(1, 2); cout << my2dVector.x << endl; cout << my2dVector.xx << endl; cout << my2dVector.xxx << endl; cout << my2dVector.xxxx << endl; vec3 my3dVector(3, 4, 5); cout << my3dVector.x << endl; cout << my3dVector.xx << endl; cout << my3dVector.xxx << endl; cout << my3dVector.xxxx << endl; vec4 my4dVector(6, 7, 8, 9); cout << my4dVector.x << endl; cout << my4dVector.xx << endl; cout << my4dVector.xxx << endl; cout << my4dVector.xxxx << endl; return 0; } The code WORKS and produces the correct output, but I prefer warning free code whenever possible. I followed the advice the compiler gave me (summarized here and described by forums and StackOverflow as the answer to this warning) and added the two things that supposedly tells the compiler what's going on. That is, I added the function definitions as non-friends after the predefinitions of the templated unions: template <typename TYPE> ostream& operator<<(ostream& os, const VECTOR2<TYPE>& toString); template <typename TYPE> ostream& operator<<(ostream& os, const VECTOR3<TYPE>& toString); template <typename TYPE> ostream& operator<<(ostream& os, const VECTOR4<TYPE>& toString); And, to each friend function that causes the issue, I added the <> after the function name, such as for VECTOR2's case: friend ostream& operator<< <> (ostream& os, const VECTOR3<TYPE>& toString); friend ostream& operator<< <> (ostream& os, const VECTOR4<TYPE>& toString); However, doing so leads to errors, such as: LINE 139: error: no match for 'operator<<' in 'std::cout << my2dVector.VECTOR2<float>::xxx' What's going on? Is it something related to how these templated union class-like structures are interrelated, or is it due to the unions themselves? Update After rethinking the issues involved and listening to the various suggestions of Potatoswatter, I found the final solution. Unlike just about every single cout overload example on the internet, I don't need access to the private member information, but can use the public interface to do what I wish. So, I make a non-friend overload functions that are inline for the swizzle parts that call the real friend overload functions. This bypasses the issues the compiler has with templated friend functions. I've added to the latest version of my project. It now works on both versions of GCC I tried with no warnings. The code in question looks like this: template <typename SWIZZLE> inline typename EnableIf< Is2D< typename SWIZZLE::PARENT >, ostream >::type& operator<<(ostream& os, const SWIZZLE& printVector) { os << (typename SWIZZLE::PARENT(printVector)); return os; } template <typename SWIZZLE> inline typename EnableIf< Is3D< typename SWIZZLE::PARENT >, ostream >::type& operator<<(ostream& os, const SWIZZLE& printVector) { os << (typename SWIZZLE::PARENT(printVector)); return os; } template <typename SWIZZLE> inline typename EnableIf< Is4D< typename SWIZZLE::PARENT >, ostream >::type& operator<<(ostream& os, const SWIZZLE& printVector) { os << (typename SWIZZLE::PARENT(printVector)); return os; }

    Read the article

  • Disallow private constructor invocation in friend function

    - by user2907032
    Is there any way to not allow private construction in friend function, In case we do have private constructor with friend function in our class. Only Static method should be responsible for object creation and other than this compiler should flash error message #include <iostream> #include <memory> using namespace std; class a { public: void see () { cout<<"Motimaa"; } static a& getinstance() { static a instance; return instance; } private: a() {}; friend void access(); }; void access () { a obj; obj.see();//still friend function can access } int main() { a::getinstance().see(); access(); return 1; }

    Read the article

  • MySql Friend of my friends and Friend of my of my Friends of my Friends

    - by user1907522
    i have a problem with mysql query, and can't get it done in any way. I already checked the other topics, but can't get any of the solutions to work in my case. I have 2 tables, one is users id, name, email.... and second for friends is named friends :) user1_id, user2_id now i need to get from the database all of the user info for friends of my friends, and next level friends, the Friend of my of my Friends of my Friends, those should be 2 separate queries. Of course the search should exclude me, and be distinct. Please help.

    Read the article

  • A question about friend functions

    - by Als
    I faced a problem recently with a 3rd party library which generates classes from a xml. Here is a gist of it: class B; class A { void doSomething(); friend class B; }; class B { void doSomething(); void doSomethingMore() { doSomething(); } }; The compiler flags call to the function doSomething() as ambiguous and flags it as an compiler error. It is easy to understand why it gives the error.Class B being friend of class A, every member of class B has access to all the members of class A. Renaming of the either of functions resolved my problem but it got me thinking that shouldn't in this case the compiler should give a priority to the class's own member function over the function in another class of which it is a friend?

    Read the article

  • friend declaration in C++

    - by Happy Mittal
    In Thinking in C++ by Bruce eckel, there is an example given regarding friend functions as // Declaration (incomplete type specification): struct X; struct Y { void f(X*); }; struct X { // Definition private: int i; public: friend void Y::f(X*); // Struct member friend }; void Y::f(X* x) { x->i = 47; } Now he explained this: Notice that Y::f(X*) takes the address of an X object. This is critical because the compiler always knows how to pass an address, which is of a fixed size regardless of the object being passed, even if it doesn’t have full information about the size of the type. If you try to pass the whole object, however, the compiler must see the entire structure definition of X, to know the size and how to pass it, before it allows you to declare a function such as Y::g(X). But when I tried void f(X); as declaration in struct Y, it shows no error. Please explain why?

    Read the article

  • overloading friend operator<< for template class

    - by starcorn
    Hello, I have read couple of the question regarding my problem on stackoverflow now, and none of it seems to solve my problem. Or I maybe have done it wrong... The overloaded << if I make it into an inline function. But how do I make it work in my case? warning: friend declaration std::ostream& operator<<(std::ostream&, const D<classT>&)' declares a non-template function warning: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here) -Wno-non-template-friend disables this warning /tmp/cc6VTWdv.o:uppgift4.cc:(.text+0x180): undefined reference to operator<<(std::basic_ostream<char, std::char_traits<char> >&, D<int> const&)' collect2: ld returned 1 exit status template <class T> T my_max(T a, T b) { if(a > b) return a; else return b; } template <class classT> class D { public: D(classT in) : d(in) {}; bool operator>(const D& rhs) const; classT operator=(const D<classT>& rhs); friend ostream& operator<< (ostream & os, const D<classT>& rhs); private: classT d; }; int main() { int i1 = 1; int i2 = 2; D<int> d1(i1); D<int> d2(i2); cout << my_max(d1,d2) << endl; return 0; } template <class classT> ostream& operator<<(ostream &os, const D<classT>& rhs) { os << rhs.d; return os; }

    Read the article

  • Database and query to store and retreive friend list [migrated]

    - by amr Kamboj
    I am developing a module in website to save and retreive friend list. I am using Zend Framework and for DB handling I am using Doctrine(ORM). There are two models: 1) users that stores all the users 2) my_friends that stores the friend list (that is refference table with M:M relation of user) the structure of my_friends is following ...id..........user_id............friend_id........approved.... ...10.........20 ..................25...................1.......... ...10.........21 ..................25...................1.......... ...10.........22 ..................30...................1.......... ...10.........25 ..................30...................1.......... The Doctrine query to retreive friend list id follwing $friends = Doctrine_Query::create()->from('my_friends as mf') ->leftJoin('mf.users as friend') ->where("mf.user_id = 25") ->andWhere("mf.approved = 1"); Suppose I am viewing the user no.- 25. With this query I am only getting the user no.- 30. where as user no.- 25 is also approved friend of user no.- 20 and 21. Please guide me, what should be the query to find all friend and is there any need to change the DB structure.

    Read the article

  • Friend Assemblies in C#

    - by Tim Long
    I'm trying to create some 'friend assemblies' using the [InternalsVisibleTo()] attribute, but I can't seem to get it working. I've followed Microsoft's instructions for creating signed friend assemblies and I can't see where I'm going wrong. So I'll detail my steps here and hopefully someone can spot my deliberate mistake...? Create a strong name key and extract the public key, thus: sn -k StrongNameKey sn -p public.pk sn -tp public.pk Add the strong name key to each project and enable signing. Create a project called Internals and a class with an internal property: namespace Internals { internal class ClassWithInternals { internal string Message { get; set; } public ClassWithInternals(string m) { Message = m; } } } Create another project called TestInternalsVisibleTo: namespace TestInternalsVisibleTo { static class Program { /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { var c = new Internals.ClassWithInternals("Test"); Console.WriteLine(c.Message); } } } Edit the AssemblyInfo.cs file for the Internals project, and add teh necessary attribute: [assembly: AssemblyTitle("AssemblyWithInternals")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Internals")] [assembly: AssemblyCopyright("Copyright © Microsoft 2010")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: Guid("41c590dc-f555-48bc-8a94-10c0e7adfd9b")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: InternalsVisibleTo("TestInternalsVisibleTo PublicKey=002400000480000094000000060200000024000052534131000400000100010087953126637ab27cb375fa917c35b23502c2994bb860cc2582d39912b73740d6b56912c169e4a702bedb471a859a33acbc8b79e1f103667e5075ad17dffda58988ceaf764613bd56fc8f909f43a1b177172bc4143c96cf987274873626abb650550977dcad1bb9bfa255056bb8d0a2ec5d35d6f8cb0a6065ec0639550c2334b9")] And finally... build! I get the following errors: error CS0122: 'Internals.ClassWithInternals' is inaccessible due to its protection level error CS1729: 'Internals.ClassWithInternals' does not contain a constructor that takes 1 arguments error CS1061: 'Internals.ClassWithInternals' does not contain a definition for 'Message' and no extension method 'Message' accepting a first argument of type 'Internals.ClassWithInternals' could be found (are you missing a using directive or an assembly reference?) Basically, it's as if I had not used the InternalsVisibleTo attrbute. Now, I'm not going to fall into the trap of blaming the tools, so what's up here? Anyone?

    Read the article

  • C++ Beginner - 'friend' functions and << operator overloading: What is the proper way to overload an

    - by Francisco P.
    Hello, everyone! In a project I'm working on, I have a Score class, defined below in score.h. I am trying to overload it so, when a << operation is performed on it, _points + " " + _name is returned. Here's what I tried to do: ostream & Score::operator<< (ostream & os, Score right) { os << right.getPoints() << " " << right.scoreGetName(); return os; } Here are the errors returned: 1>c:\users\francisco\documents\feup\1a2s\prog\projecto3\projecto3\score.h(30) : error C2804: binary 'operator <<' has too many parameters (This error appears 4 times, actually) I managed to get it working by declaring the overload as a friend function: friend ostream & operator<< (ostream & os, Score right); And removing the Score:: from the function declaration in score.cpp (effectively not declaring it as a member). Why does this work, yet the code describe above doesn't? Thanks for your time! Below is the full score.h /////////////////////////////////////////////////////////// // Score.h // Implementation of the Class Score // Created on: 10-Mai-2010 11:43:56 // Original author: Francisco /////////////////////////////////////////////////////////// #ifndef SCORE_H_ #define SCORE_H_ #include <string> #include <iostream> #include <iostream> using std::string; using std::ostream; class Score { public: Score(string name); Score(); virtual ~Score(); void addPoints(int n); string scoreGetName() const; int getPoints() const; void scoreSetName(string name); bool operator>(const Score right) const; ostream & operator<< (ostream & os, Score right); private: string _name; int _points; }; #endif

    Read the article

  • Google Friend Connect - Meaning of URLs

    - by shoaibmohammed
    Hello, I would like to know the meaning of the URL's provided by google for its Friend Connect. For example, in the FCAUTH, the user details can be grabbed by sending a request to the following link and a JSON encoded string will be returned http://www.google.com/friendconnect/api/people/@viewer/@self?fcauth=<some-cookie-value> Also for getting user activites, I came across a link as below http://www.google.com/friendconnect/api/activities/@owner/@friends/@app?fcauth=<cookie> What if I change the @owner to @me or @viewer , what would be the meaning and would it be valid? Example, if i change it as http://www.google.com/friendconnect/api/activities/@me/@friends/@app?fcauth=<cookie> http://www.google.com/friendconnect/api/activities/@viewer/@friends/@app?fcauth=<cookie> Also, could some one suggest me where can I get the User Profile URL for the user using the same method as above? Thankx guys

    Read the article

  • PHP: friend classes and ungreedy caller function/class

    - by avetis.kazarian
    Is there any way to get the caller function with something else than debug_backtrace()? I'm looking for a less greedy way to simulate scopes like friend or internal. Let's say I have a class A and a class B. Until now, I've been using debug_backtrace(), which is too greedy (IMHO). I thought of something like this: <?php class A { public function __construct(B $callerObj) {} } class B { public function someMethod() { $obj = new A($this); } } ?> It might be OK if you want to limit it to one specific class, but let's say I have 300 classes, and I want to limit it to 25 of them? One way could be using an interface to aggregate: public function __construct(CallerInterface $callerObj) But it's still an ugly code. Moreover, you can't use that trick with static classes. Have any better idea?

    Read the article

  • friend declaration block an external function access to the private section of a class

    - by MiP
    I'm trying to force function caller from a specific class. For example this code bellow demonstrate my problem. I want to make 'use' function would be called only from class A. I'm using a global namespace all over the project. a.h #include "b.h" namespace GLOBAL{ class A{ public: void doSomething(B); } } a.cpp #include "a.h" using namespace GLOBAL; void A::doSomething(B b){ b.use(); } b.h namespace GLOBAL{ class B{ public: friend void GLOBAL::A::doSomething(B); private: void use(); } Compiler says: ‘GLOBAL::A’ has not been declared ‘void GLOBAL::B::use()’ is private Can anyone help here ? Thanks a lot, Mike.

    Read the article

  • Facebook: Hide Your Status Updates From Your Boss/Ex or Any Specific Friend

    - by Gopinath
    Sometime we want to hide our status updates from specific people who are already accepted as Friends in Facebook. Do you wonder why we need to accept someone as friend and then hide status updates from them? Well, may be you have to accept a friend request from your boss, but certainly love to hide status updates as well as other Facebook activities from him. Something similar goes with few annoying friends whom you cant’ de-friend but like to hide your updates. Thanks to Facebook for providing fine grain privacy options on controlling what we want to share and with whom we want to share. It’s very easy to block one or more specific friends from seeing your status updates. Here are the step by step instructions: 1. Login to Facebook and go to Privacy Settings Page. It shows a page something similar to what is shown in the below image. 2. Click on “Customize settings” link 3. Expand the privacy options available in the section Things I Share -> Posts by me. Choose Customise from the list of available options   4. Type the list of unwanted friend’s names in to input box of the section "Hide this from”. Here is a screen grab of couple of my friends whom I added for writing this post 5. Click the Save Settings button. That’s all. Facebook will ensure that these people will not see your status updates on their news feed. Enjoyed the Facebook Tip? Join Tech Dreams on Facebook to read all our blog posts on your Facebook’s news feed. Join us on Facebook to read all our stories right inside your Facebook news feed.

    Read the article

  • conventions for friend methods in Perl

    - by xenoterracide
    Perl doesn't support a friend relationship between objects, nor does it support private or protected methods. What is usually done for private methods is to prefix the name with an underscore. I occasionally have methods that I think of as friend methods. Meaning that I expect them to be used by a specific object, or an object with a specific responsibility, but I'm not sure if I should make that method public (meaning foo ) or private ( _foo ) or if there's a better convention? is there a convention for friend methods?

    Read the article

  • i need ur help [closed]

    - by aisha khan
    Write a program that prompts the user to enter the size of the array, allocate memory using malloc(), ask the user to enter elements of the array and displays if the puzzle is solvable. As part of this program, write a recursive function int Solvable(int start, int squares[]) that takes a starting position of the marker along with the array of squares. The function should return 1 if it is possible to solve the puzzle from the starting configuration and 0 if it is impossible

    Read the article

  • Why does C# not provide the C++ style 'friend' keyword?

    - by Ash
    The C++ friend keyword allows a class A to designate class B as it's friend. This allows Class B to access the private/protected members of class A. I've never read anything as to why this was left out of C# (and VB.NET). Most answers to this earlier StackOverflow question seem to be saying it is a useful part of C++ and there are good reasons to use it. In my experience I'd have to agree. Another question seems to me to be really asking how to do something similar to friend in a C# application. While the answers generally revolve around nested classes, it doesn't seem quite as elegant as using the friend keyword. The original Design Patterns book uses the friend keyword regularly throughout its examples. So in summary, why is friend missing from C#, and what is the "best practice" way (or ways) of simulating it in C#? (By the way, the "internal" keyword is not the same thing, it allows ALL classes within the entire assembly to access internal members, friend allows you to give access to a class to just one other class.)

    Read the article

  • SQL SERVER – Weekend Project – Visiting Friend’s Company – Koenig Solutions

    - by pinaldave
    I have decided to do some interesting experiments every weekend and share it next week as a weekend project on the blog. Many times our business lives and personal lives are very separate, however this post will talk about one instance where my two lives connect. This weekend I visited my friend’s company. My friend owns Koenig, so of course I am very interested so see that they are doing well.  I have been very impressed this year, as they have expanded into multiple cities and are offering more and more classes about Business Intelligence, Project Management, networking, and much more. Koenig Solutions originally were a company that focused on training IT professionals – from topics like databases and even English language courses.  As the company grew more popular, Koenig began their blog to keep fans updated, and gradually have added more and more courses. I am very happy for my friend’s success, but as a technology enthusiast I am also pleased with Koenig Solutions’ success.  Whenever anyone in our field improves, the field as a whole does better.  Koenig offers high quality classes on a variety of topics at a variety of levels, so anyone can benefit from browsing this blog. I am a big fan of technology (obviously), and I feel blessed to have gotten in on the “ground floor,” even though there are some people out there who think technology has advanced as far as possible – I believe they will be proven wrong.  And that is why I think companies like Koenig Solutions are so important – they are providing training and support in a quickly growing field, and providing job skills in this tough economy. I believe this particular post really highlights how I, and Koenig, feel about the IT industry.  It is quickly expanding, and job opportunities are sure to abound – but how can the average person get started in this exciting field?  This post emphasizes that knowledge is power – know what interests you in the IT field, get an education, and continue your training even after you’ve gotten your foot in the door. Koenig Solutions provides what I feel is one of the most important services in the modern world – in person training.  They obviously offer many online courses, but you can also set up physical, face-to-face training through their website.  As I mentioned before, they offer a wide variety of classes that cater to nearly every IT skill you can think of.  If you have more specific needs, they also offer one of the best English language training courses.  English is turning into the language of technology, so these courses can ensure that you are keeping up the pace. Koenig Solutions and I agree about how important training can be, and even better – they provide some of the best training around.  We share ideals and I am very happy see the success of my friend. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQL Training, SQLAuthority Author Visit, T SQL, Technology Tagged: Developer Training

    Read the article

  • MVC : Does Code to save data in cache or session belongs in controller?

    - by newbie
    I'm a bit confused if saving the information to session code below, belongs in the controller action as shown below or should it be part of my Model? I would add that I have other controller methods that will read this session value later. public ActionResult AddFriend(FriendsContext viewModel) { if (!ModelState.IsValid) { return View(viewModel); } // Start - Confused if the code block below belongs in Controller? Friend friend = new Friend(); friend.FirstName = viewModel.FirstName; friend.LastName = viewModel.LastName; friend.Email = viewModel.UserEmail; httpContext.Session["latest-friend"] = friend; // End Confusion return RedirectToAction("Home"); } I thought about adding a static utility class in my Model which does something like below, but it just seems stupid to add 2 lines of code in another file. public static void SaveLatestFriend(Friend friend, HttpContextBase httpContext) { httpContext.Session["latest-friend"] = friend; } public static Friend GetLatestFriend(HttpContextBase httpContext) { return httpContext.Session["latest-friend"] as Friend; }

    Read the article

  • Ubuntu always freezes on a friend's machine

    - by missingfaktor
    I am posting this on my friend's behalf. I installed Ubuntu 12.04 on my friend's computer but it continuously froze, no desktop effects worked, and it was frankly unusable. I thought this might be an issue with Unity and how it interacts with his hardware, so I tried several other desktop environments on his machine. These include KDE, Xfce, and GNOME. The problems persisted regardless of the desktop environment. I would like to note that he dual boots his system with Windows 7. Even there no desktop effects work but the system is reasonably stable. The following screenshots describe some of his system information (He is running Xfce at this time): 1: 2: Card information: intel corporation 82G33/G31 integrated graphics controller (rev02). What is the issue and how can it be solved? Please let me know if I should add any more information. Thank you.

    Read the article

  • Friend of Red Gate

    - by Nick Harrison
    Friend of Red Gate I recently joined the friend of Red Gate program.   I am very honored to be included in this group.    This program is a big part of Red Gates community outreach.   If you are not familiar with Red Gate, I urge you to check them out.    They have some wonderful tools for the SQL Server community and the DotNet community.    They are also building up some tools for Exchange and Oracle. I was invited to join this program primarliy because of my work with Simple Talk and promoting one of their newest products, Reflector. Reflector is a wonderful tool.   I doubt that anyone who has ever used it would argue that point. Red Gate did a wonderful job taking over the support of Reflector.   I know many people had their doubts.    The initial release under Red Gate should set those fears to rest.   I was very impressed with how their developers interacted with their users during the preview phase! Red Gate is also a good partner for the community.    They activly support the community, sponsoring Code Camps, sponsoring User Groups, supporting the Forums, etc. And their tools are pretty amazing as well.

    Read the article

  • Forums and SEO - A Friendly Best Friend

    Just as the title says it, forums are SEO's best friend. Proper utilization of forums can be a HUGE plus for your SEO, but at the same time, can completely trash and destroy your SEO and company. So forums need to be posted on correctly.

    Read the article

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