Search Results

Search found 9410 results on 377 pages for 'simulator difference'.

Page 281/377 | < Previous Page | 277 278 279 280 281 282 283 284 285 286 287 288  | Next Page >

  • Annotation retention policy: what real benefit is there in declaring `SOURCE` or `CLASS`?

    - by watery
    I know there are three retention policies for Java annotations: CLASS: Annotations are to be recorded in the class file by the compiler but need not be retained by the VM at run time. RUNTIME: Annotations are to be recorded in the class file by the compiler and retained by the VM at run time, so they may be read reflectively. SOURCE: Annotations are to be discarded by the compiler. And although I understand their usage scenarios, I don't get why it is such an important thing to specify the retention policy that retention policies exist at all. I mean, why aren't all the annotations just kept at runtime? Do they generate so much bytecode / occupy so much memory that stripping those undeclared as RUNTIME does make that much difference?

    Read the article

  • Interpreted vs. Compiled Languages for Web Sites (PHP, ASP, Perl, Python, etc.)

    - by Andrew Swift
    I build database-driven web sites. Previously I have used Perl or PHP with MySQL. Now I am starting a big new project, and I want to do it in the way that will result in the most responsive possible site. I have seen several pages here where questions about how to optimize PHP are criticized with various versions of "it's not worth going to great lengths to optimize PHP since it's an interpreted language and it won't make that much difference". I have also heard various discussions (especiallon on the SO podcast) about the benefits of compiled vs. interpreted languages, and it seems as though it would be in my interests to use a compiled language to serve up the site instead of an interpreted language. Is this even possible in a web context? If so, what would be a reasonable language choice? In addition to speed one benefit I forsee is the possiblity of finding bugs at compile time instead of having to debug the web site. Is this reasonable to expect?

    Read the article

  • What are the differences in performance between synchronous and asynchronous JavaScript script loading?

    - by jasdeepkhalsa
    My question is simply: what are the differences in performance between synchronous and asynchronous JavaScript script loading? From what I've gathered synchronous code blocks the loading of a page and/or rest of the code from executing. This happens at two levels. First, at the level of the script actually loading, and secondly, within the JavaScript code itself. For example, on the page: Synchronous: <script src="demo_async.js" type="text/javascript"></script> Asynchronous: <script async src="demo_async.js" type="text/javascript"></script> And within a script: Synchronous: function a() {alert("a"); function b() {alert("b");}} Asynchronous (and self-executing): (function(a, function(b){ alert(b); }) { alert(a); }))(); So what really is the difference in performance from using these different loading methods and JavaScript patterns?

    Read the article

  • Which of these Array Initializations is better in Ruby?

    - by Bragaadeesh
    Hi, Which of these two forms of Array Initialization is better in Ruby? Method 1: DAYS_IN_A_WEEK = (0..6).to_a HOURS_IN_A_DAY = (0..23).to_a @data = Array.new(DAYS_IN_A_WEEK.size).map!{ Array.new(HOURS_IN_A_DAY.size) } DAYS_IN_A_WEEK.each do |day| HOURS_IN_A_DAY.each do |hour| @data[day][hour] = 'something' end end Method 2: DAYS_IN_A_WEEK = (0..6).to_a HOURS_IN_A_DAY = (0..23).to_a @data = {} DAYS_IN_A_WEEK.each do |day| HOURS_IN_A_DAY.each do |hour| @data[day] ||= {} @data[day][hour] = 'something' end end The difference between the first method and the second method is that the second one does not allocate memory initially. I feel the second one is a bit inferior when it comes to performance due to the numerous amount of Array copies that has to happen. However, it is not straight forward in Ruby to find what is happening. So, if someone can explain me which is better, it would be really great! Thanks

    Read the article

  • Navigating sharepoint with a treeview

    - by linqmonkey
    I'm trying to replace the navigation on our sharepoint site with a treeview. It's a large site with up to 4 subsite leves in places. All I need it to do is show a consistent structure from page to page show only sites and pages The default sharepoint treeview seems to do neither of these things (doesn't display items from the parent site, includes document libraries but not pages). Does anyone have any idea how to achieve this? We're using the publishing site template throughout if that makes a difference. I've tried binding the tree to the datasource the quick launch uses but I guess from the error message they expect differently named properties.

    Read the article

  • WCF Rest Service Date issue

    - by Ranish
    I am working on a WCF Rest service for a iPhone application. I have a WebGet method which returns a “date time”. I am using following code [OperationContract] [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "GetDate")] DateTime GetDate(); When I tried to call the method using Mozilla rest client I am able to get following result "/Date(1355116291037+0530)/" But the problem is when this method consume from the iPhone side we are getting another date time value( there is around 5:30 hours difference) . Any one have any idea regarding this issue,Please help me Thanks in advance

    Read the article

  • Django forms: where is POST data received?

    - by Rosarch
    I have a widget that allows user to enter data for a model field. The data in the form can't be directly converted to Python - it requires some coercion. Where do I put this code? Is the widget responsible for translating its post data to a python value? The field itself? I thought that maybe value_from_datadict() would be correct, but now it looks like that serves a different purpose. (I'm using the form in the admin interface, if it makes any difference.)

    Read the article

  • "Method name expected" error when trying add a handler method to a delegate - C#

    - by zakplayyy
    I keep getting the error "Method name expected" when trying add the a method to a delegate. I have a delegate which is invoked when ever my game ends. The function I'm trying to add to the delegate stops a countdown from flashing (the method is in a static class). I've searched about and I'm still unsure why its not working. Here is the line causing the error: LivesManager.gameEnded += new LivesManager.EndGame(CountdownManager.DisableFlashTimer(this)); The this passes the current form to the method so it can disable the timer flash on the form. I have added methods from static classes to the same delegate before and it works fine, the only difference is that I'm passing the form as a paramater and then it doesn't like it. Is there any way to pass the form to the method without the error? Thanks in advance :)

    Read the article

  • Double "!!" in Ruby [closed]

    - by Alex Maslakov
    Possible Duplicate: What does !! mean in ruby? Ruby, !! operator (a/k/a the double-bang) Sometimes I see a Ruby code like this def sent? !!@sent_at end It seems to be not logical. Is it necessary to use here double !? As far as I'm concerned, it might be just def sent? @sent_at end UPDATE: then what is the difference between these def sent? !!@sent_at end def sent? @sent_at.nil? end def sent? @sent_at == nil end

    Read the article

  • Why delegate types are derived from MulticastDelegate class why not it directly derive from Delegate class?

    - by Vijay
    I have a very basic question regarding delegate types. I compared the memebers of Delegate and MulticastDelegate classes in object browser and I couldn't find any new additional member present in MulticastDelegate. I also noticed that the Delegate class has GetInvocationList virtual method. So I assume that the Delegate class should have the capability to hold references to multiple methods. If my assumption is correct I wonder why not custom delegate types directly derive from the Delegate class instead of MulticastDelegate class. Not sure what I am missing here. Please help me understand the difference.

    Read the article

  • Generic arrays of parametrized ArrayLists in java?

    - by athena123
    I am new to Java, so I am not aware of the nitty gritties. Why can't I create generic array of parametrized ArrayList? Instead I have to write, ArrayList<String>[] alist = new ArrayList[10]; or I have to create List of ArrayLists. Aren't arrays supposed to be more efficient than ArrayLists? Then why doesn't Java allow it? Also, what is the difference between following two lines. ArrayList<String>[] alist = new ArrayList[10]; ArrayList<String>[] alist = new ArrayList<?>[10];

    Read the article

  • timing response speed of serial device

    - by dario frongi
    I comunicate with a serial device via bluetooth. i send it pid and it responds to me with a data response. i comunicate with him with serial comunicatione one request-response. i want to measure how many response i receive in one second. i think that i have to know the moment when i do the request and the moment whene i receive the response and do the difference. The result(called delta) is the time-to response of device. in the end i have to do 1000ms/delta. how can calculate it ?

    Read the article

  • Operator & and * at function prototipe in class

    - by Puyover
    I'm having a problem with a class like this: class Sprite { ... bool checkCollision(Sprite &spr); ... }; So, if I have that clase, I can do this: ball.checkCollision(bar1); But if I change the class to this: class Sprite { ... bool checkCollision(Sprite* spr); ... }; I have to do this: ball.checkCollision(&bar1); So, what's the difference?? It's better a way instead other? Thank you.

    Read the article

  • Simplifying CASE WHEN SQL statement

    - by kateroh
    Im trying to improve the following CASE statement to calculate the difference only once. I do it to avoid negative numbers: SELECT (CASE WHEN ((SELECT 100 - (SELECT COUNT(CustomerId) FROM Customers)) > 0) THEN (SELECT 100 - (SELECT COUNT(CustomerId) FROM Customers)) ELSE (0) END) This not only looks stupid, but also is not thread-safe. I tried the following, but I get an error message "Invalid column name 'diff'." SELECT (CASE WHEN ((SELECT 100 - (SELECT COUNT(CustomerId) FROM Customers) as diff) > 0) THEN (diff) ELSE (0) END) How can this be simplified? Is there an in-built SQL function that already does this job? EDIT: Sorry, forgot to mention that the select statement is inside of a view declaration, so I cant declare variables.

    Read the article

  • Removing rows from MySQL table where the timestamp is over one day old?

    - by Rob
    I found the exact same question here. But it isn't working for me. I've modified it a bit, manipulated it, and I can't figure it out. I'm trying to remove rows that are over a day old. Here is my code: if (isset($_POST['prune'])) { $sql = "DELETE FROM logs WHERE time < date('now', '-1 days')"; mysql_query($sql); echo 'Logs older than one day removed.'; } Fairly simple question I suppose, but its bugging the hell out of me. I would appreciate any help. In case it makes a difference, the column is a TIMESTAMP type.

    Read the article

  • onDateSet does not get called from DatePickerDialog on tablet

    - by cit
    I am using a DatePickerDialog to prompt the user for a date. It works fine in the simulator and on my Samsung Galaxy Nexus, but onDateSet does not get called on my Samsung Galaxy Tab 2. I noticed, that the dialog is bigger and shows a calendar besides the normal spin view. Can that be the problem? Here is some code: import java.util.Calendar; import java.util.Date; import android.app.DatePickerDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.support.v4.app.DialogFragment; import android.widget.DatePicker; import com.cbit.gtbetapp.R; import com.cbit.gtbetapp.gui.racedata.MeetingDataActivity; import com.cbit.gtbetapp.gui.racedata.MeetingListFragment; import com.cbit.gtbetapp.logic.Utility; public class DatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener { protected Date date = null; @Override public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the current date as the default date in the picker final Calendar c = Utility.getToday(); int year = c.get(Calendar.YEAR); int month = c.get(Calendar.MONTH); int day = c.get(Calendar.DAY_OF_MONTH); date = c.getTime(); // Create a new instance of DatePickerDialog and return it DatePickerDialog dialog = new DatePickerDialog(getActivity(), this, year, month, day) { @Override public void onDateChanged(DatePicker view, int year, int month, int day) { super.onDateChanged(view, year, month, day); setTitle(getString(R.string.date_picker_title)); } }; dialog.setTitle(getString(R.string.date_picker_title)); dialog.setButton(DatePickerDialog.BUTTON_POSITIVE, getString(android.R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); Intent intent = new Intent(getActivity(), MeetingDataActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); intent.putExtra(MeetingListFragment.EXTRA_DATE, date.getTime()); startActivity(intent); } }); dialog.setButton(DatePickerDialog.BUTTON_NEGATIVE, getString(R.string.button_cancel), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); return dialog; } public void onDateSet(DatePicker view, int year, int month, int day) { Calendar c = Calendar.getInstance(); c.clear(); c.set(Calendar.YEAR, year); c.set(Calendar.MONTH, month); c.set(Calendar.DAY_OF_MONTH, day); date = c.getTime(); } } What could cause this? A bug in the tablet? Am I missing something? Can anyone think of a workaround? Thanks a lot!

    Read the article

  • Windows C++: LPCTSTR vs const TCHAR

    - by mrl33t
    In my application i'm declaring a string variable near the top of my code to define the name of my window class which I use in my calls to RegisterClassEx, CreateWindowEx etc.. Now, I know that an LPCTSTR is a typedef and will eventually follow down to a TCHAR (well a CHAR or WCHAR depending on whether UNICODE is defined), but I was wondering whether it would be better to use this: static LPCTSTR szWindowClass = TEXT("MyApp"); Or this: static const TCHAR szWindowClass[] = TEXT("MyApp"); I personally prefer the use of the LPCTSTR as coming from a JavaScript, PHP, C# background I never really considered declaring a string as an array of chars. But are there actually any advantages of using one over the other, or does it in fact not even make a difference as to which one I choose? Thank you, in advanced, for your answers.

    Read the article

  • Android on Desktop tutorials/resources

    - by Ascension Systems
    I'm aware of the android-x86 project and as far as the end result (bootable live/install iso), I am looking to do the same thing. The difference is, I'm looking to do this with the ice cream sandwich branch from android master repo. Ice cream sandwich adds full support for x86 hardware and even sports a build target specifically for running the OS in virtualbox. So my question is, is anyone aware of any documentation for building and deploying to that target? Just in case it's not clear, I'm not just using the android-x86 project because they haven't yet put up a build for anything later than android 3.

    Read the article

  • [Cakephp] How to use Read()

    - by kwokwai
    Hi all, In a Controller, I got this: $this->Site1->post_id=$id; $this->set('posts', $this->Site1->read()); And when I replaced it by this line of code: $this-set('posts', $this-Site1-read('post_id', $id)); But the returned result is totally different. Is there any difference between them? Is it possible to make this two lines of code neat by re-writing it into one line of code? $this->Site1->post_id=$id; $this->set('posts', $this->Site1->read());

    Read the article

  • Comparing Java enum members: == or equals() ?

    - by Bears will eat you
    I know that Java enums are compiled to classes with private constructors and a bunch of public static members. When comparing two members of a given enum, I've always used .equals(), e.g. public useEnums(SomeEnum a) { if(a.equals(SomeEnum.SOME_ENUM_VALUE)) { ... } ... } However, I just came across come code that uses the equals operator == instead: public useEnums2(SomeEnum a) { if(a == SomeEnum.SOME_ENUM_VALUE) { ... } ... } I've been programming in Java for 5+ years, and I thought I understood difference between the two - but I'm still scratching my head at which one is more correct. Which operator is the one I should be using?

    Read the article

  • What's the proper size of Default png's for iPad?

    - by David John
    I am confused by conflicting information. Most commonly I see these being the sizes quoted for the various Default images: Launch image Portrait Default-Portrait.png 768 x 1004 Launch image Portrait [email protected] 1536 x 2008 Launch image Landscape [email protected] 2048 x 1496 Launch image Landscape Default-Landscape.png 1024 x 748 Seemed like slightly unusual sizes, but I went along with it and dragged the images into the Launch images section in XCode. XCode however promptly puts little yellow triangles over these images and tell me that the sizes should be: 768x1024, 1536x2048, 1024x768 and 2048x1536 Oh and one last important bit. Do I really need to have all these images for submission to the app store? It's really not clear which images are required and which are just recommended. Mine is a Universal app btw if that makes any difference.

    Read the article

  • Debugging in netbeans (java)

    - by Daen
    I have been asking this myself for a while. Debugging in visual studio goes smooth. But when i debugg in Netbeans(java) i find myself more then half of the time browsing trough the system code itself. This makes it almost unpossible for me to detect hard to find bugs, cause debugging simply is to tedious and unmanageable. How can this be avoided? Stepping out all the time takes a insane amount of time, and i only wish to debug the code i have written down. I usally add all the controls myself without using any drag and drop for forms if that makes any difference in the total picture. Regards.

    Read the article

  • Similar Sub-Classes

    - by praks5432
    Lets say I have a class A that is fairly simple like this - public class A{ private int randomField = 0; protected int key; protected double dmg; } Now I want to write a number of sub-classes that inherit the protected fields and only differ based on the initial values that are assigned to those fields - for example, if I wrote two subclasses B and C, the only difference between those two sub-classes would be that the values key and dmg would have different values. They would share a method, set, which would be exactly the same, in that it would affect the same variable. I find when I'm writing these sub-classes I'm repeating myself, as I just change the constructor to set different initial values to key and dmg, and simply copy and paste the set method. Is there a 'good' way to do this?

    Read the article

  • Qt drag/drop: cannot move when copy is enabled (Ubuntu Gnome)

    - by Scott
    I'm implementing a view and a model where I want to support both moving items internally (by dragging), and copying items (by pressing Ctrl while dragging). I've done everything I need to do according to the instructions. I've set up the mime functions, I've implemented removeRows(), and flags(). The problem is when I drag, it defaults to a copy operation (I get the arrow cursor with a plus sign, and it indeed copies the item by creating a new one in the model). The only difference I can see is this: If I return only Qt::MoveAction in supportedDropActions(), it only moves. If I return (Qt::CopyAction | Qt::MoveAction), it only copies. Any ideas? I want it to work like files in Nautilus (Gnome) or Windows file Explorer: drag moves icons around, ctrl+drag copies them.

    Read the article

  • Numeric literals in sql server 2008

    - by costa
    What is the type that sql server assigns to the numeric literal: 2. , i.e. 2 followed by a dot? I was curious because: select convert(varchar(50), 2.) union all select convert(varchar(50), 2.0) returns: 2 2.0 which made me ask what's the difference between 2. and 2.0 type wise? Sql server seems to assign types to numeric literals depending on the number itself by finding the minimal storage type that can hold the number. A value of 1222333 is stored as int while 1152921504606846975 is stored as big int. thanks

    Read the article

< Previous Page | 277 278 279 280 281 282 283 284 285 286 287 288  | Next Page >