Daily Archives

Articles indexed Monday June 14 2010

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

  • What files should be added to SVN in an eclipse Java project?

    - by Jake Petroules
    I have a Java project I'd like to commit to my SVN repository, created with eclipse. Now, what files (aside from the source code, obviously) are necessary? In the workspace root, there is a .settings folder with many files and subfolders, and inside the project folder there are two files - .classpath and .project, and another .settings folder with a single file - org.eclipse.jdt.core.prefs. Which of these files should be committed to SVN and which can be safely excluded?

    Read the article

  • Printing gives unhandled exception. Access Denied

    - by Smoka
    Im newish to coding, currently on a Windows Forms App using CLI in VS10 Everything seems to work, my document shows fine in the Preview dialog but then crash's. Heres only the code that seems relevant private: System::Drawing::Printing::PrintDocument^ docPrint; private: System::Windows::Forms::PrintDialog^ dlgPrint; private: System::Windows::Forms::PrintPreviewDialog^ dlgPrintPreview; this->button2 = (gcnew System::Windows::Forms::Button()); this->docPrint = (gcnew System::Drawing::Printing::PrintDocument()); this->dlgPrint = (gcnew System::Windows::Forms::PrintDialog()); this->dlgPrintPreview = (gcnew System::Windows::Forms::PrintPreviewDialog()); this->button2->Location = System::Drawing::Point(152, 355); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(75, 23); this->button2->TabIndex = 53; this->button2->Text = L"Print"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click_1); // // docPrint // this->docPrint->DocumentName = L"ResultsPage"; this->docPrint->PrintPage += gcnew System::Drawing::Printing::PrintPageEventHandler(this, &Form1::docPrint_PrintPage); // // dlgPrint // this->dlgPrint->Document = this->docPrint; this->dlgPrint->UseEXDialog = true; // // dlgPrintPreview // this->dlgPrintPreview->AutoScrollMargin = System::Drawing::Size(0, 0); this->dlgPrintPreview->AutoScrollMinSize = System::Drawing::Size(0, 0); this->dlgPrintPreview->ClientSize = System::Drawing::Size(400, 300); this->dlgPrintPreview->Document = this->docPrint; this->dlgPrintPreview->Enabled = true; this->dlgPrintPreview->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"dlgPrintPreview.Icon"))); this->dlgPrintPreview->Name = L"dlgPrintPreview"; this->dlgPrintPreview->Visible = false; this->dlgPrintPreview->Load += gcnew System::EventHandler(this, &Form1::dlgPrintPreview_Load); private: System::Void docPrint_PrintPage(System::Object^ sender, System::Drawing::Printing::PrintPageEventArgs^ e) { String ^ strDisplay = L"A Axis Rotations"; String ^ strDisplay2 = L"Centerline of Y" + CL_Y->Text + " + Z" + CL_Z->Text; String ^ strDisplay3 = L"Initial Position Y" + G54_Y->Text + " + Z" + G54_Z->Text; System::Drawing::Font ^ fntString = gcnew System::Drawing::Font(L"Times New Roman", 38, FontStyle::Bold); e->Graphics->DrawString(strDisplay, fntString, Brushes::Black, 200,20); e->Graphics->DrawString(strDisplay2, fntString, Brushes::Black, 80,150); e->Graphics->DrawString(strDisplay3, fntString, Brushes::Black, 80,220); e->Graphics->DrawString(Results->Text, fntString,Brushes::Black, 50,400); } private: System::Void button2_Click_1(System::Object^ sender, System::EventArgs^ e) { // docPrint->Print; dlgPrintPreview->ShowDialog(); } private: System::Void dlgPrintPreview_Load(System::Object^ sender, System::EventArgs^ e) { } Sorry if the formatting is ugly here.

    Read the article

  • Flex DataBinding Drilling Down Through Arrays

    - by Joshua
    The help page on the BindUtils.bindProperty function: http://livedocs.adobe.com/flex/3/langref/mx/binding/utils/BindingUtils.html Has this to say: "For example, to bind the property host.a.b.c, call the method as: bindProperty(host, ["a","b","c"], ...)." But what if I need to bind to host.a.b[2].c? How do I do that?

    Read the article

  • Where might I be having problems with making web server acessable (XAMPP)

    - by Erx
    I've installed XAMPP and it seems to be working - sort of. It will serve pages if I access it via http://localhost or 127.0.0.1 but not if I use the actual IP address I have. I thought it might be a firewall issue, so I turned off the firewall and the issue still remains. I don't have enough experience to know where to look next, so I thought I might get some advice here. Running on Vista. The error I'm actually getting it "Timed Out". I've had XAMPP running on this machine prior, but I've had to reinstall my OS/new hard drive ... and I can't seem to get it working.

    Read the article

  • Active links' color change in IE6 and FireFox

    - by aladine
    Hi, I make link buttons on sidebar of a web page. It will change color if I click the button. It works well in IE6 but not Firefox. Anyone can advise me how to make it on in FF. Million thanks. Here are parts in css and html body: .sidenav li a:active { background: #cff; color: blue; } .... <div class="sidenav"> <ul> <li><a href="..." ></a></li> </ul>

    Read the article

  • Inheritance inside a template - public members become invisible?

    - by Juliano
    I'm trying to use inheritance among classes defined inside a class template (inner classes). However, the compiler (GCC) is refusing to give me access to public members in the base class. Example code: template <int D> struct Space { struct Plane { Plane(Space& b); virtual int& at(int y, int z) = 0; Space& space; /* <= this member is public */ }; struct PlaneX: public Plane { /* using Plane::space; */ PlaneX(Space& b, int x); int& at(int y, int z); const int cx; }; int& at(int x, int y, int z); }; template <int D> int& Space<D>::PlaneX::at(int y, int z) { return space.at(cx, y, z); /* <= but it fails here */ }; Space<4> sp4; The compiler says: file.cpp: In member function ‘int& Space::PlaneX::at(int, int)’: file.cpp:21: error: ‘space’ was not declared in this scope If using Plane::space; is added to the definition of class PlaneX, or if the base class member is accessed through the this pointer, or if class Space is changed to a non-template class, then the compiler is fine with it. I don't know if this is either some obscure restriction of C++, or a bug in GCC (GCC versions 4.4.1 and 4.4.3 tested). Does anyone have an idea?

    Read the article

  • Flex profiling - what is [enterFrameEvent] doing?

    - by Herms
    I've been tasked with finding (and potentially fixing) some serious performance problems with a Flex application that was delivered to us. The application will consistently take up 50 to 100% of the CPU at times when it is simply idling and shouldn't be doing anything. My first step was to run the profiler that comes with FlexBuilder. I expected to find some method that was taking up most of the time, showing me where the bottleneck was. However, I got something unexpected. The top 4 methods were: [enterFrameEvent] - 84% cumulative, 32% self time [reap] - 20% cumulative and self time [tincan] - 8% cumulative and self time global.isNaN - 4% cumulative and self time All other methods had less than 1% for both cumulative and self time. From what I've found online, the [bracketed methods] are what the profiler lists when it doesn't have an actual Flex method to show. I saw someone claim that [tincan] is the processing of RTMP requests, and I assume [reap] is the garbage collector. Does anyone know what [enterFrameEvent] is actually doing? I assume it's essentially the "main" function for the event loop, so the high cumulative time is expected. But why is the self time so high? What's actually going on? I didn't expect the player internals to be taking up so much time, especially since nothing is actually happening in the app (and there are no UI updates going on). Is there any good way to find dig into what's happening? I know something is going on that shouldn't be (it looks like there must be some kind of busy wait or other runaway loop), but the profiler isn't giving me any results that I was expecting. My next step is going to be to start adding debug trace statements in various places to try and track down what's actually happening, but I feel like there has to be a better way.

    Read the article

  • asp.net mvc2 ajax.actionlink is not working refresh problem

    - by mazhar kaunain baig
    has someone make ajax.actionlink for delete to work properly.After deleting the record successfully at the end it is not refreshing the page properly. the page refresh is my problem. i have defined the updatetarget id and returning view(model) from my controller but it is returning the master page with it. So the thing is that i am having a page with a page.I have used redirect as well which is not refreshing, <%= Ajax.ActionLink("Delete", "Delete", new { id = item.int_OrganizationGroupId }, new AjaxOptions { UpdateTargetId = "abc", HttpMethod = "Post", Confirm = "Delete Group with Organization Group ID:" + item.int_OrganizationGroupId + " Organization Group Name:" + item.vcr_OrganizationGroupName, OnSuccess = "handleSuccess" })%>| abc is the id of the table From controller View("ManageGroup,Model);

    Read the article

  • image not loading

    - by Delirium tremens
    trying to run the code // Create a label with an image Image image = new Image(display, "interspatial.gif"); Label imageLabel = new Label(shell, SWT.NONE); imageLabel.setImage(image); is giving me the error message Exception in thread "main" org.eclipse.swt.SWTException: i/o error (java.io.FileNotFoundException: interspatial.gif (O sistema não pode encontrar o arquivo especificado)) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.SWT.error(Unknown Source) at org.eclipse.swt.graphics.ImageLoader.load(Unknown Source) at org.eclipse.swt.graphics.ImageDataLoader.load(Unknown Source) at org.eclipse.swt.graphics.ImageData.<init>(Unknown Source) at org.eclipse.swt.graphics.Image.<init>(Unknown Source) at examples.ch5.LabelExample.main(LabelExample.java:31) Caused by: java.io.FileNotFoundException: interspatial.gif (O sistema não pode encontrar o arquivo especificado) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) at java.io.FileInputStream.<init>(FileInputStream.java:66) at org.eclipse.swt.internal.Compatibility.newFileInputStream(Unknown Source) ... 5 more Additional information: In Eclipse, I had expanded Chapter05, then examples.ch5, then right-clicked LabelExample.java, then chose Run As, then 1 Java Application. I tried placing interspatial.gif in the Chapter05 dir, the examples dir, the ch5 dir and the images dir (probably related to an other source code from the same chapter). There is "a package examples.ch5;" line in the beginning of the file. Why is the image not loading?

    Read the article

  • Premature-Optimization and Performance Anxiety

    - by James Michael Hare
    While writing my post analyzing the new .NET 4 ConcurrentDictionary class (here), I fell into one of the classic blunders that I myself always love to warn about.  After analyzing the differences of time between a Dictionary with locking versus the new ConcurrentDictionary class, I noted that the ConcurrentDictionary was faster with read-heavy multi-threaded operations.  Then, I made the classic blunder of thinking that because the original Dictionary with locking was faster for those write-heavy uses, it was the best choice for those types of tasks.  In short, I fell into the premature-optimization anti-pattern. Basically, the premature-optimization anti-pattern is when a developer is coding very early for a perceived (whether rightly-or-wrongly) performance gain and sacrificing good design and maintainability in the process.  At best, the performance gains are usually negligible and at worst, can either negatively impact performance, or can degrade maintainability so much that time to market suffers or the code becomes very fragile due to the complexity. Keep in mind the distinction above.  I'm not talking about valid performance decisions.  There are decisions one should make when designing and writing an application that are valid performance decisions.  Examples of this are knowing the best data structures for a given situation (Dictionary versus List, for example) and choosing performance algorithms (linear search vs. binary search).  But these in my mind are macro optimizations.  The error is not in deciding to use a better data structure or algorithm, the anti-pattern as stated above is when you attempt to over-optimize early on in such a way that it sacrifices maintainability. In my case, I was actually considering trading the safety and maintainability gains of the ConcurrentDictionary (no locking required) for a slight performance gain by using the Dictionary with locking.  This would have been a mistake as I would be trading maintainability (ConcurrentDictionary requires no locking which helps readability) and safety (ConcurrentDictionary is safe for iteration even while being modified and you don't risk the developer locking incorrectly) -- and I fell for it even when I knew to watch out for it.  I think in my case, and it may be true for others as well, a large part of it was due to the time I was trained as a developer.  I began college in in the 90s when C and C++ was king and hardware speed and memory were still relatively priceless commodities and not to be squandered.  In those days, using a long instead of a short could waste precious resources, and as such, we were taught to try to minimize space and favor performance.  This is why in many cases such early code-bases were very hard to maintain.  I don't know how many times I heard back then to avoid too many function calls because of the overhead -- and in fact just last year I heard a new hire in the company where I work declare that she didn't want to refactor a long method because of function call overhead.  Now back then, that may have been a valid concern, but with today's modern hardware even if you're calling a trivial method in an extremely tight loop (which chances are the JIT compiler would optimize anyway) the results of removing method calls to speed up performance are negligible for the great majority of applications.  Now, obviously, there are those coding applications where speed is absolutely king (for example drivers, computer games, operating systems) where such sacrifices may be made.  But I would strongly advice against such optimization because of it's cost.  Many folks that are performing an optimization think it's always a win-win.  That they're simply adding speed to the application, what could possibly be wrong with that?  What they don't realize is the cost of their choice.  For every piece of straight-forward code that you obfuscate with performance enhancements, you risk the introduction of bugs in the long term technical debt of the application.  It will become so fragile over time that maintenance will become a nightmare.  I've seen such applications in places I have worked.  There are times I've seen applications where the designer was so obsessed with performance that they even designed their own memory management system for their application to try to squeeze out every ounce of performance.  Unfortunately, the application stability often suffers as a result and it is very difficult for anyone other than the original designer to maintain. I've even seen this recently where I heard a C++ developer bemoaning that in VS2010 the iterators are about twice as slow as they used to be because Microsoft added range checking (probably as part of the 0x standard implementation).  To me this was almost a joke.  Twice as slow sounds bad, but it almost never as bad as you think -- especially if you're gaining safety.  The only time twice is really that much slower is when once was too slow to begin with.  Think about it.  2 minutes is slow as a response time because 1 minute is slow.  But if an iterator takes 1 microsecond to move one position and a new, safer iterator takes 2 microseconds, this is trivial!  The only way you'd ever really notice this would be in iterating a collection just for the sake of iterating (i.e. no other operations).  To my mind, the added safety makes the extra time worth it. Always favor safety and maintainability when you can.  I know it can be a hard habit to break, especially if you started out your career early or in a language such as C where they are very performance conscious.  But in reality, these type of micro-optimizations only end up hurting you in the long run. Remember the two laws of optimization.  I'm not sure where I first heard these, but they are so true: For beginners: Do not optimize. For experts: Do not optimize yet. This is so true.  If you're a beginner, resist the urge to optimize at all costs.  And if you are an expert, delay that decision.  As long as you have chosen the right data structures and algorithms for your task, your performance will probably be more than sufficient.  Chances are it will be network, database, or disk hits that will be your slow-down, not your code.  As they say, 98% of your code's bottleneck is in 2% of your code so premature-optimization may add maintenance and safety debt that won't have any measurable impact.  Instead, code for maintainability and safety, and then, and only then, when you find a true bottleneck, then you should go back and optimize further.

    Read the article

  • WPF debug freezes computer with windows 7 64bit

    - by tcables
    Hello, I am using visual studio 2010 on Windows 7 64bit. I compiled and ran a simple application basically a thing a child could make. Well the second it started to run, it froze my computer and rendered it unresponsive. It continues to do this every time and for every application. Any ideas why this is happening?

    Read the article

  • how to put array of user control in the columns of Grid.

    - by jolly
    Hi I have array of Employee data which includes photo,description, title name,salary. I have to show each employee data in separate panel control structure that means if I have 10 employees there will be 10 panels. and I have to show these panels in a grid which has two columns. Also width of the panel in each column will vary according to main page size.

    Read the article

  • does the order a composite key is defined matter?

    I have a table with (col1,col2) as a composite primary key. create table twokeytable(col1 int,col2 int,constraint twokeytable_pk primary key (col1,col2)); and another table with col3,col4 collumns witha composite foreign key(col3,col4) which references the(col1,col2) primary key. For some processing I need to drop the foreign key and primary constraints .While restoring the constraints does order of the keys matter?. are these same? create table fktwokeytable(col3 int,col4 int,constraint fkaddfaa_fk foreign key(col4,col3) references twokeytable(col1,col2)) and create table fktwokeytable(col3 int,col4 int,constraint fkaddfaa_fk foreign key(col3,col4) references twokeytable(col1,col2))

    Read the article

  • Ria Services - Delay load images (or any heavy binary data)

    - by vidalsasoon
    I have an RIA Service that returns image data (Byte[]) and caption of image (String) from SQL Server. The data part can sometimes be a few MB's so it can take quite a while to load. I would like to load the bytes independently of the caption (which loads very fast). Is there a way to do this without having to create a second image context?

    Read the article

  • WPF layout calls MeasureOverride repeatedly in increments of 2?

    - by Scott Whitlock
    I've run into a case where I have a custom Panel (inherits from Panel) and I'm using it as an ItemsPanel in a ListView. When I resize the container that it's in, if I resize it smaller, my panel's MeasureOverride function gets called once, but if I resize it larger (let's say from 100 to 300), it calls MeasureOverride and ArrangeOverride for every value between 100 and 300, in increments of 2 (so 102, 104, etc.). The weird thing is that the container resizes right away (its size gets to 300 immediately). It doesn't seem to matter what I return from MeasureOverride - it just does this. I wish I could make it happen in a really small application and post it here, but I haven't been able to reproduce it like that yet. I can reproduce it all day in my app though. Does anyone know what could cause this?

    Read the article

  • Better way to catch trouble points

    - by mac
    User submits a CSV file which is consumed by a program. Values which are used throughout the program come from the CSV, natually if values are missed it is a problem. Below is my solution. Ip on top private List<String> currentFieldName = new ArrayList<String>(); As part of the method: try { setCurrentFieldName("Trim Space"); p.setTrimSpace(currentLineArray[dc.getTRIM_POSITION()].equals("yes") ? true : false); setCurrentFieldName("Ignore Case"); p.setIgnoreCase(currentLineArray[dc.getIGNORE_CASE_POSITION()].equals("yes") ? true : false); } catch (NullPointerException e) { throw new InputSpreadsheetValueUnassignedException("\"Type\" field not set: " + currentFieldName); } And the method which keeps track of a current field being looked at: private void setCurrentFieldName(String fieldName) { currentFieldName.clear(); currentFieldName.add(fieldName); } The idea there is that if user fails to submit value and i will end up getting null, before throwing an exception, i will know what value was not assigned. So, this being said, specific questions: Is what i have shown below an acceptable solution? Can you suggest something more elegant?

    Read the article

  • Is it advisable to have an interface as the return type?

    - by wb
    I have a set of classes with the same functions but with different logic. However, each class function can return a number of objects. It is safe to set the return type as the interface? Each class (all using the same interface) is doing this with different business logic. protected IMessage validateReturnType; <-- This is in an abstract class public bool IsValid() <-- This is in an abstract class { return (validateReturnType.GetType() == typeof(Success)); } public IMessage Validate() { if (name.Length < 5) { validateReturnType = new Error("Name must be 5 characters or greater."); } else { validateReturnType = new Success("Name is valid."); } return validateReturnType; } Are there any pitfalls with unit testing the return type of an function? Also, is it considered bad design to have functions needing to be run in order for them to succeed? In this example, Validate() would have to be run before IsValid() or else IsValid() would always return false. Thank you.

    Read the article

  • iPhone: Core Data save Class object

    - by Nic Hubbard
    I have an entity in core data called Location. Inside this I have a few fields, such as date. But, I would also like to save a class object in it that I created called Annotation. What type of attribute would I use for this, since it is a custom class object that I created? Location (object) |__ Date |__ Annotation (MKAnnotation protocol)

    Read the article

  • What is the "official" place for community support for the Mere Mortals .NET framework?

    - by Ryan Hayes
    My team is using the Mere Mortals .NET framework from Oak Leaf. Being used to working with primarily open source software, I found it excruciatingly painful to find ANY community support for MM.NET. When I asked if there was any, the only place I was given to look for support was Universal Thread, which is a site which requires a membership for search and archived questions. It seems like a third party, pay-for site should not be the primary source of support for anything like this, especially MM.NET which costs $700 per developer. It doesn' to me like an entire community around MM.NET would choose to all pay on top of the license just to use a forum. If not Universal Thread, then what is the "official" place to find support for the Mere Mortals .NET framework?

    Read the article

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