Search Results

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

Page 16/139 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • Understanding Hibernate saveOrUpdate

    - by Stephano
    The books that I've read regarding hibernate are, at best, reference tomes. They very seldom have good code examples, so I tend to use online resources for those needs. However, I've always had a problem understanding the basic idea of hibernate persistence. I've read the books and understand the concepts, but in practice, I often see results that I don't understand. Perhaps you all can help, as you have in the past. Let's look at a simple example of a dog and a cat that are friends. This isn't a rare occurrence. It also has the benefit of being much more interesting than my business case. We want a function called "saveFriends" that takes a dog name and a cat name. We'll save the Dog and then the Cat. For this example to work, the cat is going to have a reference back to the dog. I understand this isn't an ideal example, but it's cute and works for our purposes. FriendService.java public int saveFriends(String dogName, String catName) { Dog fido = new Dog(); Cat felix = new Cat(); fido.name = dogName; fido = animalDao.saveDog(fido); felix.name = catName; [ex.A]felix.friend = fido; [ex.B]felix.friend = animalDao.getDogByName(dogName); animalDao.saveCat(felix); } AnimalDao.java (extends HibernateDaoSupport) public Dog saveDog(Dog dog) { getHibernateTemplate().saveOrUpdate(dog); return dog } public Cat saveCat(Cat cat) { getHibernateTemplate().saveOrUpdate(cat); return cat; } public Dog getDogByName(String name) { return (Dog) getHibernateTemplate().find("from Dog where name=?", name).get(0); } Now, assume for a minute that I would like to use either example A or example B to save my friend. Is one better than the other to use? I'll understand if neither of those examples work, but please explain why.

    Read the article

  • Combining multiple rows into one row, Oracle

    - by Torbjørn
    Hi. I'm working with a database which is created in Oracle and used in a GIS-software through SDE. One of my colleuges is going to make some statistics out of this database and I'm not capable of finding a reasonable SQL-query for getting the data. I have two tables, one with registrations and one with registrationdetails. It's a one to many relationship, so the registration can have one or more details connected to it (no maximum number). table: Registration RegistrationID Date TotLenght 1 01.01.2010 5 2 01.02.2010 15 3 05.02.2009 10 2.table: RegistrationDetail DetailID RegistrationID Owner Type Distance 1 1 TD UB 1,5 2 1 AB US 2 3 1 TD UQ 4 4 2 AB UQ 13 5 2 AB UR 13,1 6 3 TD US 5 I want the resulting selection to be something like this: RegistrationID Date TotLenght DetailID RegistrationID Owner Type Distance DetailID RegistrationID Owner Type Distance DetailID RegistrationID Owner Type Distance 1 01.01.2010 5 1 1 TD UB 1,5 2 1 AB US 2 3 1 TD UQ 4 2 01.02.2010 15 4 2 AB UQ 13 5 2 AB UR 13,1 3 05.02.2009 10 6 3 TD US 5 With a normal join I get one row per each registration and detail. Can anyone help me with this? I don't have administrator-rights for the database, so I can't create any tables or variables. If it's possible, I could copy the tables into Access.

    Read the article

  • Custom types as key for a map - C++

    - by Appu
    I am trying to assign a custom type as a key for std::map. Here is the type which I am using as key. struct Foo { Foo(std::string s) : foo_value(s){} bool operator<(const Foo& foo1) { return foo_value < foo1.foo_value; } bool operator>(const Foo& foo1) { return foo_value > foo1.foo_value; } std::string foo_value; }; When used with std::map, I am getting the following error. error C2678: binary '<' : no operator found which takes a left-hand operand of type 'const Foo' (or there is no acceptable conversion) c:\program files\microsoft visual studio 8\vc\include\functional 143 If I change the struct like the below, everything worked. struct Foo { Foo(std::string s) : foo_value(s) {} friend bool operator<(const Foo& foo,const Foo& foo1) { return foo.foo_value < foo1.foo_value; } friend bool operator>(const Foo& foo,const Foo& foo1) { return foo.foo_value > foo1.foo_value; } std::string foo_value; }; Nothing changed except making the operator overloads as friend. I am wondering why my first code is not working? Any thoughts?

    Read the article

  • Extension methods for encapsulation and reusability

    - by tzaman
    In C++ programming, it's generally considered good practice to "prefer non-member non-friend functions" instead of instance methods. This has been recommended by Scott Meyers in this classic Dr. Dobbs article, and repeated by Herb Sutter and Andrei Alexandrescu in C++ Coding Standards (item 44); the general argument being that if a function can do its job solely by relying on the public interface exposed by the class, it actually increases encapsulation to have it be external. While this confuses the "packaging" of the class to some extent, the benefits are generally considered worth it. Now, ever since I've started programming in C#, I've had a feeling that here is the ultimate expression of the concept that they're trying to achieve with "non-member, non-friend functions that are part of a class interface". C# adds two crucial components to the mix - the first being interfaces, and the second extension methods: Interfaces allow a class to formally specify their public contract, the methods and properties that they're exposing to the world. Any other class can choose to implement the same interface and fulfill that same contract. Extension methods can be defined on an interface, providing any functionality that can be implemented via the interface to all implementers automatically. And best of all, because of the "instance syntax" sugar and IDE support, they can be called the same way as any other instance method, eliminating the cognitive overhead! So you get the encapsulation benefits of "non-member, non-friend" functions with the convenience of members. Seems like the best of both worlds to me; the .NET library itself providing a shining example in LINQ. However, everywhere I look I see people warning against extension method overuse; even the MSDN page itself states: In general, we recommend that you implement extension methods sparingly and only when you have to. So what's the verdict? Are extension methods the acme of encapsulation and code reuse, or am I just deluding myself?

    Read the article

  • Understanding Hibernate saveOrUpdate and the Persistence Life Cycle

    - by Stephano
    The books that I've read regarding hibernate are, at best, reference tomes. They very seldom have good code examples, so I tend to use online resources for those needs. However, I've always had a problem understanding the basic idea of hibernate persistence. I've read the books and understand the concepts, but in practice, I often see results that I don't understand. Perhaps you all can help, as you have in the past. Let's look at a simple example of a dog and a cat that are friends. This isn't a rare occurrence. It also has the benefit of being much more interesting than my business case. We want a function called "saveFriends" that takes a dog name and a cat name. We'll save the Dog and then the Cat. For this example to work, the cat is going to have a reference back to the dog. I understand this isn't an ideal example, but it's cute and works for our purposes. FriendService.java public int saveFriends(String dogName, String catName) { Dog fido = new Dog(); Cat felix = new Cat(); fido.name = dogName; fido = animalDao.saveDog(fido); felix.name = catName; [ex.A]felix.friend = fido; [ex.B]felix.friend = animalDao.getDogByName(dogName); animalDao.saveCat(felix); } AnimalDao.java (extends HibernateDaoSupport) public Dog saveDog(Dog dog) { getHibernateTemplate().saveOrUpdate(dog); return dog } public Cat saveCat(Cat cat) { getHibernateTemplate().saveOrUpdate(cat); return cat; } public Dog getDogByName(String name) { return (Dog) getHibernateTemplate().find("from Dog where name=?", name).get(0); } Now, assume for a minute that I would like to use either example A or example B to save my friend. Is one better than the other to use? I'll understand if neither of those examples work, but please explain why.

    Read the article

  • Visual C++ doesn't operator<< overload

    - by PierreBdR
    I have a vector class that I want to be able to input/output from a QTextStream object. The forward declaration of my vector class is: namespace util { template <size_t dim, typename T> class Vector; } I define the operator<< as: namespace util { template <size_t dim, typename T> QTextStream& operator<<(QTextStream& out, const util::Vector<dim,T>& vec) { ... } template <size_t dim, typename T> QTextStream& operator>>(QTextStream& in,util::Vector<dim,T>& vec) { .. } } However, if I ty to use these operators, Visual C++ returns this error: error C2678: binary '<<' : no operator found which takes a left-hand operand of type 'QTextStream' (or there is no acceptable conversion) A few things I tried: Originaly, the methods were defined as friends of the template, and it is working fine this way with g++. The methods have been moved outside the namespace util I changed the definition of the templates to fit what I found on various Visual C++ websites. The original friend declaration is: friend QTextStream& operator>>(QTextStream& ss, Vector& in) { ... } The "Visual C++ adapted" version is: friend QTextStream& operator>> <dim,T>(QTextStream& ss, Vector<dim,T>& in); with the function pre-declared before the class and implemented after. I checked the file is correctly included using: #pragma message ("Including vector header") And everything seems fine. Doesn anyone has any idea what might be wrong?

    Read the article

  • template warnings and error help, (gcc)

    - by sil3nt
    Hi there, I'm working on an container class template (for int,bool,strings etc), and I've been stuck with this error cont.h:56: error: expected initializer before '&' token for this section template <typename T> const Container & Container<T>::operator=(const Container<T> & rightCont){ what exactly have I done wrong there?. Also not sure what this warning message means. cont.h:13: warning: friend declaration `bool operator==(const Container<T>&, const Container<T>&)' declares a non-template function cont.h:13: 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 at this position template <typename T> class Container{ friend bool operator==(const Container<T> &rhs,const Container<T> &lhs); public:

    Read the article

  • FBML wallpost by clicking on image or button

    - by psaha
    Hello, I'm creating one facebook application with FBML. What I want is: I have several images like, <fb:tag name="img"> <fb:tag-attribute name="src">http://My_Img_Url_1.jpg</fb:tag-attribute> </fb:tag> <fb:tag name="img"> <fb:tag-attribute name="src">http://My_Img_Url_2.jpg</fb:tag-attribute> </fb:tag> While I click on the image it should open one popup "post to wall" or "Post to your Friend's wall" with the corresponding image My_Img_Url_n.jpg. I can use FBML share button like: METHOD-1 <fb:share-button class="meta"> <meta name="title" content="Image_TITLE"/> <meta name="description" content="Image_Descrip"/> <link rel="image_src" href="http://My_Img_Url_1.jpg"/> <link rel="target_url" href="Some_Target_URL"/> </fb:share-button> OR, METHOD-2: I can call fb:ui <script> FB.init({ appId:'111111111111111', cookie:true, status:true, xfbml:true }); FB.ui({ method: 'feed', name: '', link: '', picture: 'http://My_Img_Url_1.jpg' }); </script> Now the questions are: If I click on any image it will call either METHOD-1 or METHOD-2 and it will popup with that image. How can I do that? If I use <fb:multi-friend-input /> for posting to friend's wall, How can I do?

    Read the article

  • Substitute User Controls on Failure

    - by Brian
    Recently, I had a user control I was developing throw an exception. I know what caused the exception, but this issue got me thinking. If I have a user control throw an exception for whatever reason and I wish to replace that usercontrol with something else (e.g. an error saying, "Sorry, this part of the page broke.") and perhaps log the error, what would be a good way to do it that could be done independently of what the user control is or does (i.e. I'm not saying what the user control does/is, because I want an answer where that is irrelevant). Code sample: <asp:TableRow VerticalAlign="Top" HorizontalAlign="Left"> <asp:TableCell> <UR:MyUserControl ID="MyUserControl3" runat="server" FormatString="<%$ AppSettings:RVUC %>" ConnectionString="<%$ ConnectionStrings:WPDBC %>" Title="CO" /> </asp:TableCell> <asp:TableCell> <UR:MyUserControl ID="MyUserControl4" runat="server" FormatString="<%$ AppSettings:RVUA %>" ConnectionString="<%$ ConnectionStrings:WPDBA %>" Title="IEAO" /> </asp:TableCell> </asp:TableRow>

    Read the article

  • dmidecode showing less Memory Capacity than Motherboard spec?

    - by starchx
    We got a supermicro server, http://www.supermicro.com/products/system/1u/5016/sys-5016i-ur.cfm, according spec, the server supports up to 32G memory when using ECC Register Memory. However, when I tried the dmidecode command, it says 24G max memory: [root@c1 ~]# dmidecode | grep Maximum Maximum Size: 256 kB Maximum Size: 1024 kB Maximum Size: 8192 kB Maximum Memory Module Size: 4096 MB Maximum Total Memory Size: 24576 MB Maximum Capacity: 24 GB Maximum Value: Unknown Which one I should trust?

    Read the article

  • Good Linux Distro for Disconnected Netbook

    - by MrWizard54
    I'm deployed to Afghanistan with the Army and I have a friend who's netbook had his hard drive take a dump on him. He ordered a new hard drive and I was able to download and burn a copy of Ubuntu to disk from work. However the default install doesn't support most of the media that he wants to watch (AVI files, probably some DIVX video) without installing extra packages. We don't have internet in the tent and really don't have a vaiable option for downloading additional packages through the package manager anywhere here. The computer is a small HP netbook. All my friend wants is to watch ripped movies. Does anyone know of a good way to do either of the following: Download packages seperately and install them via CD A distro that is going to come preloaded with all of the packages and needed to watch just about any type of video file you can think of? Thanks in advance, Andy

    Read the article

  • Cannot access or open Facebook messages [migrated]

    - by Ehsan Mamakani
    I was up to sending a very long message, about 90,000 characters, to a friend, I tried several times but I got an error sending the message. Finally, I think part of my message was sent because I could see the characters in my message list under my friend's name. When I clicked the name to see my whole message it wouldn't load the message. And now I can't access any of my messages and I get this message from Facebook: Sorry, messages are temporarily unavailable. Please try again in a few minutes. How can I get access to my messages and conversations again?

    Read the article

  • Linux or Windows for a server?

    - by Matt
    I'm a Linux guy when it comes to (web) servers for the following reasons Legally free Fast software updates (Unless you're running Cent OS :) Powerful CLI management of services Easy to secure (in terms of users and groups) Web server software is, well, built for Linux... Apache, PHP, Python, etc, are Linux programs that get ported to Windows - I'm 90% sure of this Unless the web server needed to run ASP, I wouldn't use Windows. My boss' IT friend is a Windows guy, though. He recently got a server setup in the office to run Microsoft Exchange and some other shit. What I'm asking is, if he wanted to start running websites on this thing, what would be good reasoning to convince him otherwise? He's not very bright in terms of IT and the IT friend is all Windows. So it's two against one here... What would you say to running a Windows web server?

    Read the article

  • One network, two macbooks, one is fast and the other is slow

    - by Brendan
    I really need help for my friend. I know next to nothing about computers. My roommate and I both have macbook pros from the same year running OS X, are both connecting wirelessly to the same xfinity wifi, and while mine runs perfectly fine, my roommate complains that his works very slowly and times out every few seconds. I can't seem to figure out why this is. He is trying to get me to switch internet providers because he is convinced that it is their problem, but this cannot possibly be the issue since it works great on mine. He has an xbox hooked up to the wifi that he says also works poorly. I really can't see switching providers given that I am experiencing absolutely zero problems. How can I help my friend?

    Read the article

  • PCMCIA preventing laptop from booting up

    - by Pongus
    My friend has brought his dead laptop over. It is a Sony Vaio with Windows Vista. When booting up, it blue screens and reboots. I have tried to boot up with Knoppix and this will freeze when starting up PCMCIA. If I start Knoppix with knoppix nopcmcia it disables pcmcia and boots up fine. So I presume there is a problem with the PCMCIA controller on the laptop. My friend does not use any PCMCIA cards, so doesnt really need it. Is there anyway I can similarly disable PCMCIA so that Windows will boot up fine?

    Read the article

  • Which wiki satisfies ACL ADI and API ?

    - by goutham
    Hi , is there any wiki that supports ACL , ADI and API ? and my requirement is we need a wiki that does three things 1. Uses ACL (Access Control lists - who can access what pages) 2. Needs AD (active directory integration) 3. Is scriptable via an API (meaning I can create a wiki page through an API in a program instead of logging in and manually typing in the page.) Ur help is appreciated Thanks in Advance Goutham

    Read the article

  • Troubles with MSVC++ redistributable

    - by Karolis Juodele
    A friend of mine is trying to install AutoCAD. In the install log it is written Install Microsoft Visual C++ 2005 Redistributable (x86) Failed Installation aborted, Result=1603 I've found a site which (hopefully) explains how to solve this: here However, my friend has not been able to uninstall the redistributables. The error message says The feature you are trying to use is on a network resource that is unavailable I've already suggested running this but that didn't help much. Only some of the redistributables could be uninstalled. What can be done? Do you think running some other cleanup tool could work? Or will we have to uninstall manually (how exactly would we do that)?

    Read the article

  • Ubuntu 9.10 is not starting on netbook

    - by anonymous
    I installed Ubuntu 9.10 onto my external hard drive cause it's cool to be able to borrow a friend's laptop and be able to have my entire system. It works on the 2 systems i tested it on: my desktop and my mom's laptop. I had to work on something earlier so i borrowed my friend's netbook. I started it up, chose Ubuntu 9.10.20 and it got to the Ubuntu loading screen with the 3 people holding hands right before user selection then it suddenly went black. Naturally, i freaked out because it wasn't my laptop. I held the power button down and reset the netbook but the screen was still black, it didn't even show the BIOS. I repeated the process without my hard drive, and it was still black without the BIOS showing up. I had to remove the battery, plug it to a power source, and power up to start the netbook up again. Can anyone tell me what happened?

    Read the article

  • PC doesn't boot PC-BSD from USB

    - by turlando
    I've got a problem with a friend's PC: I'm installing a FreeBSD server and to make easier the installation for my friend I'm using the PC-BSD DVD. Surprise! The CD reader doesn't read DVDs, so I'm using a USB stick to perform the install. The PC seems supporting USB boot because I can choose it in the boot sequence, but the PC-BSD installation doesn't start, booting the OS installed in the primary HD. I have not physic access to the PC and I can't have at the moment more informations. What do you think about? Thanks and sorry for my terrible English. Tancredi Orlando.

    Read the article

  • Multisession burn in Imgburn

    - by blntechie
    Is Multisession burn available in Imgburn? If not, any idea whether it will be implemented in future? I almost recommended Imgburn instead of Nero or Roxio to one of my friend. He requires multisession burning and I found no options to enable it,if available in Options. Note: Please don't question the question. Like, Why would you want multisession anyway? or Isn't USB stick/RW Disk is what you need instead of a RO CD/DVD? Please keep the answers in context. I know that I can use USB sticks instead of CD/DVD and my friend require mulisession anyway. May be I can ask him to keep Nero as a backup for this purpose if Imgburn don't support this.

    Read the article

  • FTP restrict user access to a specific folder

    - by Mahdi Ghiasi
    I have created a FTP Site inside IIS 7.5 panel. Now I have access to whole site using administrator username and password. Now, I want to let my friend access a specific folder of that FTP site. (for example, this path: \some\folder\accessible\) I can't create a whole new FTP Site for this purpose, since it says the port is being used by another website. How to create an account for my friend to have access to just an specific folder? P.S: I have read about User Isolation feature of IIS 7.5, but I couldn't find how to create a user just for FTP and set it to a custom path.

    Read the article

  • 'DNS server isn't responding' error in windows 7 home premium

    - by pradeeptp
    Hi All, I bought a brand new Dell Studio 1558 just last week. It has windows 7 home premium 64-bit installed on it. My friend who is occupying the adjacent room has a laptop with windows XP. Both of us are connecting to the same wireless router of the hotel. My friend is able to connect to the wireless network without any trouble, but when I try to connect, I get the error "DNS service isn't responding". I get this error when I run the troubleshooting option. I met two more people in the same hotel with win XP laptop and they too dont have any problem. I have gone to possibly all the forums and website but I haven't been able to fix this error :(. I have done all the basic troubleshooting but I have no luck yet. Pls help. Following is one forum where the problem seem to have been trouble shooted but not for all. http://social.technet.microsoft.com/Forums/en/w7itpronetworking/thread/eeb84518-903d-46d1-9398-80cf211878d7

    Read the article

  • remote desktop connection help?

    - by robin agrahari
    sir, i have created a web application in eclipse,db2 database server is running on my pc.so i can access the web application through the address http://localhost:8080/LimsWeb i used team viewer software to establish a remote desktop connection. can my friend somehow connect to my pc so that when he types the above url in his browser he will be able to fetch the pages of the application. i was able to do this by connecting with remote desktop mode.but in that case my friend was able to use the application which i created running on my pc only and in the window provided by team viewer.i want that he can run the application on his own computer calling the given url from his own browser. please help

    Read the article

  • How to troubleshoot problems sharing internet connection via WiFi on Mac OS X

    - by sprugman
    I'm at a hotel, plugged into their network via ethernet on my MacBook. I want to share the connection via wifi to two other computers. I went to Prefs Sharing and set up internet sharing. I know it's working because my friend with a Mac access the net fine. My friend with the PC can see the network, but can't connect to it. In the sharing prefs, airport options, I chose these options: Channel: Automatic Enable encryption: yes WEP Key length 40-bit password length: 5 chars (as specified in the instructional text) Update: I tried it with encryption turned off, and it works. Of course, I'd rather not do that... Any ideas?

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >