Search Results

Search found 392 results on 16 pages for 'fred larson'.

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

  • C++ -- Is there an implicit cast here from Fred* to auto_ptr<Fred>?

    - by q0987
    Hello all, I saw the following code, #include <new> #include <memory> using namespace std; class Fred; // Forward declaration typedef auto_ptr<Fred> FredPtr; class Fred { public: static FredPtr create(int i) { return new Fred(i); // Is there an implicit casting here? If not, how can we return // a Fred* with return value as FredPtr? } private: Fred(int i=10) : i_(i) { } Fred(const Fred& x) : i_(x.i_) { } int i_; }; Please see the question listed in function create. Thank you // Updated based on comments Yes, the code cannot pass the VC8.0 error C2664: 'std::auto_ptr<_Ty::auto_ptr(std::auto_ptr<_Ty &) throw()' : cannot convert parameter 1 from 'Fred *' to 'std::auto_ptr<_Ty &' The code was copied from the C++ FAQ 12.15. However, after making the following changes, replace return new Fred(i); with return auto_ptr<Fred>(new Fred(i)); This code can pass the VC8.0 compiler. But I am not sure whether or not this is a correct fix.

    Read the article

  • SQLBeat Episode 11 – Ted the Fred Krueger Halloween SQL

    - by SQLBeat
    In this episode of the SQLBeat Podcast I speak conversationally (Ok I will just say I converse) with Ted Krueger about Elm Street, where he works as a DBA who stores nightmares in SQL Server database tables. The joke about it being BLOB storage is only one of several that may scare you away from this Halloween Special. If you like listening to two SQL guys talking about the bands they used to be in, rainbow trout and video games, come on in. Bwaaaa Haaaa Haaa…..Ok I will stop. Download the MP3

    Read the article

  • Interview with Lenz Grimmer about MySQL Connect

    - by Keith Larson
    Keith Larson: Thank you for allowing me to do this interview with you.  I have been talking with a few different Oracle ACEs   about the MySQL Connect Conference. I figured the MySQL community might be missing you as well. You have been very busy with Oracle Linux but I know you still have an eye on the MySQL Community. How have things been?Lenz Grimmer: Thanks for including me in this series of interviews, I feel honored! I've read the other interviews, and really liked them. I still try to follow what's going on over in the MySQL community and it's good to see that many of the familiar faces are still around. Over the course of the 9 years that I was involved with MySQL, many colleagues and contacts turned into good friends and we still maintain close relationships.It's been almost 1.5 years ago that I moved into my new role here in the Linux team at Oracle, and I really enjoy working on a Linux distribution again (I worked for SUSE before I joined MySQL AB in 2002). I'm still learning a lot - Linux in the data center has greatly evolved in so many ways and there are a lot of new and exciting technologies to explore. Keith Larson: What were your thoughts when you heard that Oracle was going to deliver the MySQL Connect conference to the MySQL Community?Lenz Grimmer: I think it's testament to the fact that Oracle deeply cares about MySQL, despite what many skeptics may say. What started as "MySQL Sunday" two years ago has now evolved into a full-blown sub-conference, with 80 sessions at one of the largest corporate IT events in the world. I find this quite telling, not many products at Oracle enjoy this level of exposure! So it certainly makes me feel proud to see how far MySQL has come. Keith Larson: Have you had a chance to look over the sessions? What are your thoughts on them?Lenz Grimmer: I did indeed look at the final schedule.The content committee did a great job with selecting these sessions. I'm glad to see that the content selection was influenced by involving well-known and respected members of the MySQL community. The sessions cover a broad range of topics and technologies, both covering established topics as well as recent developments. Keith Larson: When you get a chance, what sessions do you plan on attending?Lenz Grimmer: I will actually be manning the Oracle booth in the exhibition area on one of these days, so I'm not sure if I'll have a lot of time attending sessions. But if I do, I'd love to see the keynotes and catch some of the sessions that talk about recent developments and new features in MySQL, High Availability and Clustering . Quite a lot has happened and it's hard to keep up with this constant flow of new MySQL releases.In particular, the following sessions caught my attention: MySQL Connect Keynote: The State of the Dolphin Evaluating MySQL High-Availability Alternatives CERN’s MySQL “as a Service” Deployment with Oracle VM: Empowering Users MySQL 5.6 Replication: Taking Scalability and High Availability to the Next Level What’s New in MySQL Server 5.6? MySQL Security: Past and Present MySQL at Twitter: Development and Deployment MySQL Community BOF MySQL Connect Keynote: MySQL Perspectives Keith Larson: So I will ask you just like I have asked the others I have interviewed, any tips that you would give to people for handling the long hours at conferences?Lenz Grimmer: Wear comfortable shoes and make sure to drink a lot! Also prepare a plan of the sessions you would like to attend beforehand and familiarize yourself with the venue, so you can get to the next talk in time without scrambling to find the location. The good thing about piggybacking on such a large conference like Oracle OpenWorld is that you benefit from the whole infrastructure. For example, there is a nice schedule builder that helps you to keep track of your sessions of interest. Other than that, bring enough business cards and talk to people, build up your network among your peers and other MySQL professionals! Keith Larson: What features of the MySQL 5.6 release do you look forward to the most ?Lenz Grimmer: There has been solid progress in so many areas like the InnoDB Storage Engine, the Optimizer, Replication or Performance Schema, it's hard for me to really highlight anything in particular. All in all, MySQL 5.6 sounds like a very promising release. I'm confident it will follow the tradition that Oracle already established with MySQL 5.5, which received a lot of praise even from very critical members of the MySQL community. If I had to name a single feature, I'm particularly and personally happy that the precise GIS functions have finally made it into a GA release - that was long overdue. Keith Larson:  In your opinion what is the best reason for someone to attend this event?Lenz Grimmer: This conference is an excellent opportunity to get in touch with the key people in the MySQL community and ecosystem and to get facts and information from the domain experts and developers that work on MySQL. The broad range of topics should attract people from a variety of roles and relations to MySQL, beginning with Developers and DBAs, to CIOs considering MySQL as a viable solution for their requirements. Keith Larson: You will be attending MySQL Connect and have some Oracle Linux Demos, do you see a growing demand for MySQL on Oracle Linux ?Lenz Grimmer: Yes! Oracle Linux is our recommended Linux distribution and we have a good relationship to the MySQL engineering group. They use Oracle Linux as a base Linux platform for development and QA, so we make sure that MySQL and Oracle Linux are well tested together. Setting up a MySQL server on Oracle Linux can be done very quickly, and many customers recognize the benefits of using them both in combination.Because Oracle Linux is available for free (including free bug fixes and errata), it's an ideal choice for running MySQL in your data center. You can run the same Linux distribution on both your development/staging systems as well as on the production machines, you decide which of these should be covered by a support subscription and at which level of support. This gives you flexibility and provides some really attractive cost-saving opportunities. Keith Larson: Since I am a Linux user and fan, what is on the horizon for  Oracle Linux?Lenz Grimmer: We're working hard on broadening the ecosystem around Oracle Linux, building up partnerships with ISVs and IHVs to certify Oracle Linux as a fully supported platform for their products. We also continue to collaborate closely with the Linux kernel community on various projects, to make sure that Linux scales and performs well on large systems and meets the demands of today's data centers. These improvements and enhancements will then rolled into the Unbreakable Enterprise Kernel, which is the key ingredient that sets Oracle Linux apart from other distributions. We also have a number of ongoing projects which are making good progress, and I'm sure you'll hear more about this at the upcoming OpenWorld conference :) Keith Larson: What is something that more people should be aware of when it comes to Oracle Linux and MySQL ?Lenz Grimmer: Many people assume that Oracle Linux is just tuned for Oracle products, such as the Oracle Database or our Engineered Systems. While it's of course true that we do a lot of testing and optimization for these workloads, Oracle Linux is and will remain a general-purpose Linux distribution that is a very good foundation for setting up a LAMP-Stack, for example. We also provide MySQL RPM packages for Oracle Linux, so you can easily stay up to date if you need something newer than what's included in the stock distribution.One more thing that is really unique to Oracle Linux is Ksplice, which allows you to apply security patches to the running Linux kernel, without having to reboot. This ensures that your MySQL database server keeps up and running and is not affected by any downtime. Keith Larson: What else would you like to add ?Lenz Grimmer: Thanks again for getting in touch with me, I appreciated the opportunity. I'm looking forward to MySQL Connect and Oracle OpenWorld and to meet you and many other people from the MySQL community that I haven't seen for quite some time! Keith Larson:  Thank you Lenz!

    Read the article

  • Unix users and permissions and how they interact with web files.

    - by Columbo
    Hello, When you issue the command ls in Linux you get this sort of thing: drwxr--r-- 1 fred editors 4096 drafts -rw-r--r-- 1 fred editors 30405 file1.php -r-xr-xr-x 1 fred fred 8460 file2.php I know that the rwxrwxrwx are the read, write and execute permissions for the current user. And I think I know that 'fred' is the user who owns the file. So I assume fred can write to file1 but no one else can. But what is the extra bit 'editors' and what is the difference between file1 and file2 with respect to one having an ownership of 'fred editors' and the other 'fred fred'? Also if a web user connects to one of the files, what is their user name and where is this decided? If the server decided that user connecting from the web was going to be fred, does this mean any web user could write to file1? Any information welcomed, I am resaerching this but just getting confused. Thanks

    Read the article

  • Interview with Ronald Bradford about MySQL Connect

    - by Keith Larson
    Ronald Bradford,  an Oracle ACE Director has been busy working with  database consulting, book writing (EffectiveMySQL) while traveling and speaking around the world in support of MySQL. I was able to take some of his time to get an interview on this thoughts about theMySQL Connect conference. Keith Larson: What where your thoughts when you heard that Oracle was going to provide the community the MySQL Conference ?Ronald Bradford: Oracle has already been providing various different local community events including OTN Tech Days and  MySQL community days. These are great for local regions both in the US and abroad.  In previous years there has been an increase of content at Oracle Open World, however that benefits the Oracle community far more then the MySQL community.  It is good to see that Oracle is realizing the benefit in providing a large scale dedicated event for the MySQL community that includes speakers from the MySQL development teams, invested companies in the ecosystem and other community evangelists.I fully expect a successful event and look forward to hopefully seeing MySQL Connect at the upcoming Brazil and Japan OOW conferences and perhaps an event on the East Coast.Keith Larson: Since you are part of the content committee, what did you think of the submissions that were received during call for papers?Ronald Bradford: There was a large number of quality submissions to the number of available presentation sessions. As with the previous years as a committee member for the annual MySQL conference, there is always a large variety of common cornerstone MySQL features as well as new products and upcoming companies sharing their MySQL experiences. All of the usual major players in the ecosystem will in presenting at MySQL Connect including Facebook, Twitter, Yahoo, Continuent, Percona, Tokutek, Sphinx and Amazon to name a few.  This is ensuring the event will have a large number of quality speakers and a difficult time in choosing what to attend. Keith Larson: What sessions do you look forwarding to attending? Ronald Bradford: As with most quality conferences you can only be in one place at one time, so with multiple tracks per session it is always difficult to decide. The continued work and success with MySQL Cluster, and with a number of sessions I am sure will be popular. The features that interest me the most are around the optimizer, where there are several sessions on new features, and on the importance of backups. There are three presentations in this area to choose from.Keith Larson: Are you going to cover any of the content in your books at your MySQL Connect sessions?Ronald Bradford: I will be giving two presentations at MySQL Connect. The first will include the techniques available for creating better indexes where I will be touching on some aspects of the first Effective MySQL book on Optimizing SQL Statements.  In my second presentation from experiences of managing 500+ AWS MySQL instances, I will be touching on areas including SQL tuning, backup and recovery and scale out with replication.   These are the key topics of the initial books in the Effective MySQL series that focus on performance, scalability and business continuity.  The books however cover a far greater amount of detail then can be presented in a 1 hour session. Keith Larson: What features of MySQL 5.6 do you look forward to the most ?Ronald Bradford: I am very impressed with the optimizer trace feature. The ability to see exposed information is invaluable not just for MySQL 5.6, but to also apply information discerned for optimizing SQL statements in earlier versions of MySQL.  Not everybody understands that it is easy to deploy a MySQL 5.6 slave into an existing topology running an older version if MySQL for evaluation of many new features.  You can use the new mysqlbinlog streaming feature for duplicating master binary logs on an older version with a MySQL 5.6 slave.  The improvements in instrumentation in the Performance Schema are exciting.   However, as with my upcoming Replication Techniques in Depth title, that will be available for sale at MySQL Connect, there are numerous replication features, some long overdue with provide significant management benefits. Crash Save Slaves, Global transaction Identifiers (GTID)  and checksums just to mention a few.Keith Larson: You have been to numerous conferences, what would you recommend for people at the conference? Ronald Bradford: Make the time to meet and introduce yourself to the speakers that cover the topics that most interest you. The MySQL ecosystem has a very strong community.  The relationships you build with presenters, developers and architects in MySQL can be invaluable, however they are created over time. Get to know these people, interact with them over time.  This is the opportunity to learn more then just the content from a 1 hour session. Keith Larson: Any additional tips to handling the long hours ? Ronald Bradford: Conferences can be hard, especially with all the post event drinking.  This is a two day event and I am sure will include additional events on Friday and Saturday night so come well prepared, and leave work behind. Take the time to learn something new.   You can always catchup on sleep later. Keith Larson: Thank you so much for taking some time to do this I look forward to seeing you at the MySQL Connect conference.  Please stay tuned here for more updates on MySQL. 

    Read the article

  • Unix users and permissions and how they interact with web files.

    - by Columbo
    Hello, When you issue the command ls in Linux you get this sort of thing: drwxr--r-- 1 fred editors 4096 drafts -rw-r--r-- 1 fred editors 30405 file1.php -r-xr-xr-x 1 fred fred 8460 file2.php I know that the rwxrwxrwx are the read, write and execute permissions for the current user. And I think I know that 'fred' is the user who owns the file. So I assume fred can write to file1 but no one else can. But what is the extra bit 'editors' and what is the difference between file1 and file2 with respect to one having an ownership of 'fred editors' and the other 'fred fred'? Also if a web user connects to one of the files, what is their user name and where is this decided? If the server decided that user connecting from the web was going to be fred, does this mean any web user could write to file1? Any information welcomed, I am resaerching this but just getting confused. Thanks

    Read the article

  • Why isnt the copy constructor of member class called?

    - by sandeep
    class member { public: member() { cout<<"Calling member constr"<<'\n'; } member(const member&) { cout<<"Calling member copy constr"<<'\n'; } }; class fred { public: fred() { cout<<"calling fred constr"<<'\n'; } fred(const fred &) { cout<<"Calling fred copy constr"<<'\n'; } protected: member member_; }; int main() { fred a; fred b=a; } Output: Calling member constr calling fred constr **Calling member constr** Calling fred copy constr

    Read the article

  • If I define a property to prototype appears in the constructor of object, why?

    - by Eduard Florinescu
    I took the example from this question modified a bit: What is the point of the prototype method? function employee(name,jobtitle,born) { this.name=name; this.jobtitle=jobtitle; this.born=born; this.status="single" } employee.prototype.salary=10000000; var fred=new employee("Fred Flintstone","Caveman",1970); console.log(fred.salary); fred.salary=20000; console.log(fred.salary) And the output in console is this: What is the difference salary is in constructor but I still can access it with fred.salary, how can I see if is in constructor from code, status is still employee property how can I tell for example if name is the one of employee or has been touch by initialization? Why is salary in constructor, when name,jobtitle,born where "touched" by employee("Fred Flintstone","Caveman",1970); «constructor»?

    Read the article

  • How to archive data from a table to a local or remote database in SQL 2005 and SQL 2008

    - by simonsabin
    Often you have the need to archive data from a table. This leads to a number of challenges 1. How can you do it without impacting users 2. How can I make it transactionally consistent, i.e. the data I put in the archive is the data I remove from the main table 3. How can I get it to perform well Points 1 is very much tied to point 3. If it doesn't perform well then the delete of data is going to cause lots of locks and thus potentially blocking. For points 1 and 3 refer to my previous posts DELETE-TOP-x-rows-avoiding-a-table-scan and UPDATE-and-DELETE-TOP-and-ORDER-BY---Part2. In essence you need to be removing small chunks of data from your table and you want to do that avoiding a table scan. So that deals with the delete approach but archiving is about inserting that data somewhere else. Well in SQL 2008 they introduced a new feature INSERT over DML (Data Manipulation Language, i.e. SQL statements that change data), or composable DML. The ability to nest DML statements within themselves, so you can past the results of an insert to an update to a merge. I've mentioned this before here SQL-Server-2008---MERGE-and-optimistic-concurrency. This feature is currently limited to being able to consume the results of a DML statement in an INSERT statement. There are many restrictions which you can find here http://msdn.microsoft.com/en-us/library/ms177564.aspx look for the section "Inserting Data Returned From an OUTPUT Clause Into a Table" Even with the restrictions what we can do is consume the OUTPUT from a DELETE and INSERT the results into a table in another database. Note that in BOL it refers to not being able to use a remote table, remote means a table on another SQL instance. To show this working use this SQL to setup two databases foo and fooArchive create database foo go --create the source table fred in database foo select * into foo..fred from sys.objects go create database fooArchive go if object_id('fredarchive',DB_ID('fooArchive')) is null begin     select getdate() ArchiveDate,* into fooArchive..FredArchive from sys.objects where 1=2       end go And then we can use this simple statement to archive the data insert into fooArchive..FredArchive select getdate(),d.* from (delete top (1)         from foo..Fred         output deleted.*) d         go In this statement the delete can be any delete statement you wish so if you are deleting by ids or a range of values then you can do that. Refer to the DELETE-TOP-x-rows-avoiding-a-table-scan post to ensure that your delete is going to perform. The last thing you want to do is to perform 100 deletes each with 5000 records for each of those deletes to do a table scan. For a solution that works for SQL2005 or if you want to archive to a different server then you can use linked servers or SSIS. This example shows how to do it with linked servers. [ONARC-LAP03] is the source server. begin transaction insert into fooArchive..FredArchive select getdate(),d.* from openquery ([ONARC-LAP03],'delete top (1)                     from foo..Fred                     output deleted.*') d commit transaction and to prove the transactions work try, you should get the same number of records before and after. select (select count(1) from foo..Fred) fred        ,(select COUNT(1) from fooArchive..FredArchive ) fredarchive   begin transaction insert into fooArchive..FredArchive select getdate(),d.* from openquery ([ONARC-LAP03],'delete top (1)                     from foo..Fred                     output deleted.*') d rollback transaction   select (select count(1) from foo..Fred) fred        ,(select COUNT(1) from fooArchive..FredArchive ) fredarchive The transactions are very important with this solution. Look what happens when you don't have transactions and an error occurs   select (select count(1) from foo..Fred) fred        ,(select COUNT(1) from fooArchive..FredArchive ) fredarchive   insert into fooArchive..FredArchive select getdate(),d.* from openquery ([ONARC-LAP03],'delete top (1)                     from foo..Fred                     output deleted.*                     raiserror (''Oh doo doo'',15,15)') d                     select (select count(1) from foo..Fred) fred        ,(select COUNT(1) from fooArchive..FredArchive ) fredarchive Before running this think what the result would be. I got it wrong. What seems to happen is that the remote query is executed as a transaction, the error causes that to rollback. However the results have already been sent to the client and so get inserted into the

    Read the article

  • Platform for Efficiency: Boeing Defense, Space & Security integrates supply chain processes using Oracle Business Process Management solutions. by Fred Sandsmark

    - by JuergenKress
    Like most companies, aerospace giant Boeing has its jargon - words and phrases that uniquely define its products and processes. Take the word platform. It is used at Boeing to mean a family of aircraft - the F/A-18 fighter, for example, or the 777 jetliner. Boeing Defense, Space & Security since August 2009, employees in the Global Services & Support (GS&S) division of Boeing Defense, Space & Security have been talking about a different sort of platform: a supply chain technology platform, based on Oracle Business Process Management (Oracle BPM) solutions and Oracle SOA Suite. That platform, built with the assistance of Oracle Diamond Partner Capgemini, is serving as a jumping-off point for Boeing's GS&S staff to deploy radically improved business processes supported by Oracle Fusion Applications to build a high-visibility, end-to-end supply chain. This business process-driven technology platform has ambitious goals: to help GS&S respond more quickly and accurately to its customers' needs, to make business processes at all GS&S sites more consistent and less expensive, and to create a foundation for further improvement and efficiency. Read the full article here. Want to publish your BPM11g success story - request for a partner/customer reference? BPM Center of Excellent & First 100 Days of BPM documents to our SOA Community Workspace MWD_bpm_si_Centre_of_Excellence_0811.pdf First 100 Days of BPM whitepaper.pdf Please visit our SOA Community Workspace (SOA Community membership required). SOA & BPM Partner Community For regular information on Oracle SOA Suite become a member in the SOA & BPM Partner Community for registration please visit  www.oracle.com/goto/emea/soa (OPN account required) If you need support with your account please contact the Oracle Partner Business Center. Blog Twitter LinkedIn Mix Forum Technorati Tags: BPM,BPM reference,BPM Capgemini,BPM first 100 days,BPM center of Excellence,SOA Community,Oracle SOA,Oracle BPM,Community,OPN,Jürgen Kress

    Read the article

  • setting up a shared folder in linux

    - by Chris
    I'm trying to set up a folder in my home directory that will be shared with another user but for some reason it is not working this is what I've done, I have tried two different ways using ACL's and chown/chgrp etc I set up a group called say: sharedgroup and added both my user (john) and fred to it so when I run groups john john wheel sharedgroup groups fred sharedgroup fred mkdir /home/john/shared vim /home/john/shared/hello.txt (typed in some text saved it) chown -R :sharedgroup shared chmod -R o=-rwx shared ll drwxrwx--- 2 john sharedgroup 4096 Sep 9 21:14 shared ll shared -rw-rw-r-- 1 john sharedgroup 7 Sep 9 21:14 hello.txt (I also tried adding in the s permissions but that didn't help either) then when I log out of the server and log back in as fred and try these commands they fail vim /home/john/shared/hello.txt (won't allow me to write opens a blank file) cd /home/john/shared -bash: cd: /home/john/cis: Permission Denied ls /home/john/shared -ls: /home/john/shared: Permission Denied ls -lad /home/john/shared -ls: /home/john/shared: Permission Denied id fred uid=500(fred) gid=502(sharedgroup) groups=502(sharedgroup),500(fred) context=user_u:system_r:unconfined_t Any idea what I'm doing wrong??

    Read the article

  • Antlr question: cannot get Antlr tool to compile simple file from ANTLRWorks

    - by Don Henton
    Here is the grammar file: grammar fred; test : 'fred'; Here is the batch file to launch the tool: SET JAVA_HOME=C:\Program Files\Java\jdk1.6.0_24 SET PATH=%PATH%;%JAVA_HOME%\bin SET ANTLR_HOME=c:/users/don/workspace/antlrAssign/lib/ java -cp %ANTLR_HOME%/antlr-3.3-complete.jar antlr.Tool fred.g Here's the result: ANTLR Parser Generator Version 2.7.7 (20060906) 1989-2005 fred.g:1:1: unexpected token: grammar error: Token stream error reading grammar(s): fred.g:3:19: expecting ''', found 'r' fred.g:1:1: rule grammar trapped: fred.g:1:1: unexpected token: grammar TokenStreamException: expecting ''', found 'r' Prior postings refer to "org.antlr.Tool" but the 3.3 jar has it located as above. The idea was to create a debug version of a tree parser, and according to the documentation, you have to use the command line tool. Has anyone seen this before? Am I nuts? It's two lines long and its dying on the first word in the file. Of course this compiles in antlrworks. Any help appreciated, I can't afford any more adjustments to my medications.

    Read the article

  • xorg, nvidia, log-in all hosed - how can I completely reset graphics set-up/settings?

    - by Fred Hamilton
    I just did a fresh install of Mythbuntu 12.04.1 on my Intel MB with nVidia 9500GT graphics card. Hardware's been working great with 10.10 for about 2 years. Background: (optional - feel free to skip to question) I was trying to get my component video output to generate 720p, messing around with the nvidia drivers, and now the entire display system is hosed. I can SSH in and get a terminal. Depending on which nvidia package I install/remove, I get: Garbage on screen (after I "apt-get remove nvidia*") A low-res graphical log-in screen where I can log in as fred or guest. If I log in as fred, it displays some text mode status line then goes right back to the log-in screen. If I log in as guest, I actually get the full Ubuntu desktop, but I need to be able to log in as fred. Other times I get an error: "API mismatch: the NVIDIA kernel module has version 304.43, but this NVIDIA driver component has version 295.49." I've googled around, including trying this thread with the same error message, but to no effect. Question: How can I just reset x settings, drivers, everything display-related to the exact same way it was after a fresh install?

    Read the article

  • Someone is using the struct name as a variable name too. What does the code really say? (c++)

    - by EvilTeach
    This morning we found an old chunk of code that was causing a library call to crash. struct fred { int a; int b; int c; }; fred fred[MAX_SIZE+1]; memset( fred, 0, sizeof(fred) * MAX_SIZE+1 ); It appears that the sizeof(fred) may have been the full array size, rather than the structure size, as it was overwriting a great deal of memory. The fact that it compiled without warning on several different systems seemed odd. Is there a correct semantic for this case where the type and variable name are colliding? or is this some sort of undefined behavior? or just a defect? I haven't been been clever enough to find anything on Google or our language help. Thanks Evil

    Read the article

  • What is the point of the prototype method?

    - by Mild Fuzz
    I am reading through Javascript: The Good Parts, and struggled to get my head around the section on prototypes. After a little google, I came to the conclusion that it is to add properties to objects after the objects declaration. Using this script gleamed from w3schools, I noticed that removing the line adding the prototype property had no effect. So what is the point? //Prototyping function employee(name,jobtitle,born) { this.name=name; this.jobtitle=jobtitle; this.born=born; } var fred=new employee("Fred Flintstone","Caveman",1970); employee.prototype.salary=null; // <--- try removing this line fred.salary=20000; document.write(fred.salary);

    Read the article

  • Remove duplicates from a list of nested dictionaries

    - by user2924306
    I'm writing my first python program to manage users in Atlassian On Demand using their RESTful API. I call the users/search?username= API to retrieve lists of users, which returns JSON. The results is a list of complex dictionary types that look something like this: [ { "self": "http://www.example.com/jira/rest/api/2/user?username=fred", "name": "fred", "avatarUrls": { "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=fred", "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=fred", "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=fred", "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=fred" }, "displayName": "Fred F. User", "active": false }, { "self": "http://www.example.com/jira/rest/api/2/user?username=andrew", "name": "andrew", "avatarUrls": { "24x24": "http://www.example.com/jira/secure/useravatar?size=small&ownerId=andrew", "16x16": "http://www.example.com/jira/secure/useravatar?size=xsmall&ownerId=andrew", "32x32": "http://www.example.com/jira/secure/useravatar?size=medium&ownerId=andrew", "48x48": "http://www.example.com/jira/secure/useravatar?size=large&ownerId=andrew" }, "displayName": "Andrew Anderson", "active": false } ] I'm calling this multiple times and thus getting duplicate people in my results. I have been searching and reading but cannot figure out how to deduplicate this list. I figured out how to sort this list using a lambda function. I realize I could sort the list, then iterate and delete duplicates. I'm thinking there must be a more elegant solution. Thank you!

    Read the article

  • Using ToArgb() followed by FromArgb() does not result in the original color

    - by hayrob
    This does not work int blueInt = Color.Blue.ToArgb(); Color fred = Color.FromArgb(blueInt); Assert.AreEqual(Color.Blue,fred); Any suggestions? [Edit] I'm using NUnit and the output is failed: Expected: Color [Blue] But was: Color [A=255, R=0, G=0, B=255] [Edit] This works! int blueInt = Color.Blue.ToArgb(); Color fred = Color.FromArgb(blueInt); Assert.AreEqual(Color.Blue.ToArgb(),fred.ToArgb());

    Read the article

  • Copy Selective Data from Database to Invoice, Based on Certain Criteria

    - by Scott
    For starters, here is an example of a microsoft excel database I am working with: Month/Address/Name/Description/Amount January/123 Street/Fred/Painting/100 January/456 Avenue/Scott/Flooring/400 January/789 Road/Scott/Plumbing/100 February/123 Street/Fred/Flooring/600 February/246 Lane/Fred/Electrical/300 March/789 Road/Scott/Drywall/150 What I want to be able to do is selectively copy info from this databse to invoices (also excel). The invoice has three columns: Address/Description/Amount. I want to be able to automatically fill the invoices in as the database is filled in (either automatically, or if I have to actually manually run the macro to do it, that might be fine). Each name (Scott, Fred, etc.) will have their own set of 12 invoices for the year. So, e.g., I want to be able to produce a January invoice for all work done for Scott in January, showing the address, the description and the amount, line by line. So every time work on Scott's address(es) is done, the database is filled in, and i want it to "send" that information to the invoice on the next available line, filling in only the Address/Description/Amount columns from the database. Fred's invoice should fill in as any work is done on Fred's addresses. And once the month changes, the next invoice should start filling in. So first I need to filter the data by the month and the name (and there is actually one more column to filter by, but let's keep this example simpler). Then I need to list the remaining data on the invoice, but only certain cells from the rows that are now left. Help anyone?

    Read the article

  • How to reset the postgres super user password on mac os x

    - by Andrew Barinov
    I installed postgres on my mac running 10.6.8 and I would like to reset the password for the postgres user (I believe this is the super user password) and then restart it. All the directions I found do not work because I think my user name is not recognized by pg as having authority to change the password. (I am on the admin account of my mac) Here is what I tried: Larson-2:~ larson$ psql -U postgres Password for user postgres: psql (9.0.4, server 9.1.2) WARNING: psql version 9.0, server version 9.1. Some psql features might not work. Type "help" for help. postgres=# ALTER USER postgres with password 'mypassword' postgres-# \q and for restart I did: Larson-2:~ larson$ su postgres -c 'pg_ctl -D /opt/local/var/db/postgresql84/defaultdb/ restart > Which didn't work, as the password remained the same as it was before. Can someone provide directions for doing this and for making sure it's recognized by PG? Update I went ahead and edited the pg_hba.conf file located in /Library/PostgreSQL/9.1/data and set the settings as follows: # TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust However, like before, the password stayed the same after I changed it. I am not sure what further steps I can take from here.

    Read the article

  • Objective-C classes, pointers to primitive types, etc.

    - by Toby Wilson
    I'll cut a really long story short and give an example of my problem. Given a class that has a pointer to a primitive type as a property: @interface ClassOne : NSObject { int* aNumber } @property int* aNumber; The class is instantiated, and aNumber is allocated and assigned a value, accordingly: ClassOne* bob = [[ClassOne alloc] init]; bob.aNumber = malloc(sizeof(int)); *bob.aNumber = 5; It is then passed, by reference, to assign the aNumber value of a seperate instance of this type of class, accordingly: ClassOne* fred = [[ClassOne alloc] init]; fred.aNumber = bob.aNumber; Fred's aNumber pointer is then freed, reallocated, and assigned a new value, for example 7. Now, the problem I'm having; Since Fred has been assigned the same pointer that Bob had, I would expect that Bob's aNumber will now have a value of 7. It doesn't, because for some reason it's pointer was freed, but not reassigned (it is still pointing to the same address it was first allocated which is now freed). Fred's pointer, however, has the allocated value 7 in a different memory location. Why is it behaving like this? What am I minsunderstanding? How can I make it work like C++ does?

    Read the article

  • UIView drawRect; class variables out of scope

    - by Toby Wilson
    Short & sweet version of my last question in light of new information. I have a UIVIew with an init and a drawrect method (and another thread and a bunch of other stuff, but I'll keep it short & sweet). All of the class variables that I alloc and init in the -(id)init method are out of scope/nil/0x0 in the drawRect method, and I am unable to access them. For example; In the interface: NSObject* fred; In the implementation: -(id)init { if(self == [super init]) { fred = [[NSObject alloc] init]; } return self; } -(void)drawRect:(CGRect)rect { NSLog(@"Fred is retained %i times",[fred retainCount]); //FAIL NSLog(@"But his variable is actually just pointing at uninitialised 0x0, so you're not reading this in the debugger because the application has crashed before it got here." } Should add that init IS being called before drawRect also. Anyone have any ideas?

    Read the article

  • Getting a RichTextCtrl's default font size in wxPython

    - by Sam
    I have a RichTextCtrl, which I've modified to accept HTML input. The HTML parsing code needs to be able to increase and decrease the font size as it gets tags like <font size="-1">, but I can't work out how to get the control's default font size to adjust. I tried the following (where self is my RichTextCtrl): fred = wx.richtext.RichTextAttr() self.GetStyle(0,fred) print fred.GetFontSize() However, the final instruction fails, because GetStyle turns fred into a TextAttrEx and so I get AttributeError: 'TextAttrEx' object has no attribute 'GetFontSize'. Am I missing a vastly easier way of getting the default font size?

    Read the article

  • Using a member function pointer within a class

    - by neuviemeporte
    Given an example class: class Fred { public: Fred() { func = &Fred::fa; } void run() { int foo, bar; *func(foo,bar); } double fa(int x, int y); double fb(int x, int y); private: double (Fred::*func)(int x, int y); }; I get a compiler error at the line calling the member function through the pointer "*func(foo,bar)", saying: "term does not evaluate to a function taking 2 arguments". What am I doing wrong?

    Read the article

  • a little code to allow word substitution depending on user

    - by Fred Quimby
    Can anyone help? I'm creating a demo web app in html in order for people to physically see and comment on the app prior to committing to a proper build. So whilst the proper app will be database driven, my demo is just standard html with some javascript effects. What I do want to demonstrate is that different user group will see different words. For example, imagine I have an html sentence that says 'This will cost £100 to begin'. What I need to some way of identifying that if the user has deemed themselves to be from the US, the sentence says 'This will cost $100 to begin'. This requirement is peppered throughtout the pages but I'm happy to add each one manually. So I envisage some code along the lines of 'first, remove the [boot US] trunk' where the UK version is 'first remove the boot' but the code is saying that the visitor needs the US version. It then looks up boot (in an Access database perhaps) and sees that the table says for boot for US, display 'trunk'. I'm not a programmer but I can normally cobble together scripts so I'm hoping someone may have a relatively easy solution in javascrip, CSS or asp. To recap; I have a number of words or short sentences that need to appear differently and I'm happy to manually insert each one if necessary (but would be even better if the words were automatically changed). And I need a device which allows me to tell the pages to choose the US version, or for example, the New Zealand version. Thanks in advance. Fred

    Read the article

  • IPv6 tunnel broker setup

    - by fred basset
    I'm working on a solution to allow remote Linux nodes that are behind firewalls to be accessible for SSH and web server. Can anyone suggest an IPv6 tunnel scheme that would work with NAT firewalls? And what software would be needed on the remote nodes and the central server? Also I do not believe the ISP at either side does native IPv6. A solution where we could have static IPv6 addresses on the remote Linux nodes would be ideal. Thank you, Fred

    Read the article

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