Search Results

Search found 5457 results on 219 pages for 'necessary'.

Page 9/219 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Is automated source translation seen as beneficial and/or necessary?

    - by busybutwantmore
    I have recently spent several years translating legacy FORTRAN into Java. Prior to that, I found myself translating FORTRAN into C (for which I wrote a simple translation tool). After all this work, I find myself wondering how many others are doing similar language-to-language translations and whether an automated way of doing so would be beneficial. I know about F2C, For_C, F2J and others, as well as some of the translation sites, but none seem to be all that successful. Having seen output from For_C, I can see why it just hasn't taken off. While it is technically correct, it is very difficult to maintain. So, I guess what I am wondering is if there were are tool that produced more maintainable, more grok-able code than the code I have seen, would developers use it? Or are developers as jaded as many posts seem to indicate and unwilling to use generated code as it could never be as good as their manually translated code?

    Read the article

  • Which header files are necessary to run this code snippet?

    - by httpinterpret
    It's from here,but fails when compiling: int main(int argc, char **argv) { struct hostent { char *h_name; // main name char **h_aliases; // alternative names (aliases) int h_addrtype; // address type (usually AF_INET) int h_length; // length of address (in octets) char **h_addr_list; // alternate addresses (in Network Byte Order) }; #define h_addr h_addr_list[0] // First address of h_addr_list. struct hostent *info_stackoverflow; int i = 0; info_stackoverflow = gethostbyname( "www.stackoverflow.com" ); printf("The IP address of %s is %s", info_stackoverflow->h_name, inet_ntoa( * ((struct in_addr *)info_stackoverflow->h_addr ))); /* aliases */ while( *(pc_ip->h_aliases + i) != NULL ) { printf("\n\tAlias: %s", *(pc_ip->h_aliases + i) ); i++; } }

    Read the article

  • Support both Standard mode and Quirks mode? Is that possible and necessary?

    - by tshao
    Today I was assigned a bug saying that some page elements don't work on IE8 Quirks mode at all, and I need to fix them. The point is that I believe our pages will always be rendered in Standard mode, because we specify DOCTYPE at the beginning of every page (via master page). I'd think it must be some debugging tools changed that during testing. I managed to convice QA to close it as by design, after a brief explanation to her. Now I start to think the question that whether we should have our page work on both Standard and Quirks mode. Maybe we should try to minimize the problem even if the page is not rendering in a supposed mode? Any standard or best practices on that? Thanks!

    Read the article

  • Are memory barriers necessary for atomic reference counting shared immutable data?

    - by Dietrich Epp
    I have some immutable data structures that I would like to manage using reference counts, sharing them across threads on an SMP system. Here's what the release code looks like: void avocado_release(struct avocado *p) { if (atomic_dec(p->refcount) == 0) { free(p->pit); free(p->juicy_innards); free(p); } } Does atomic_dec need a memory barrier in it? If so, what kind of memory barrier? Additional notes: The application must run on PowerPC and x86, so any processor-specific information is welcomed. I already know about the GCC atomic builtins. As for immutability, the refcount is the only field that changes over the duration of the object.

    Read the article

  • Templates --> How to decipher, decide if necessary and create?

    - by ML
    Hi All, I have a few classes in a project that I inherited that are really old, last I knew they compiled with CodeWarrior 8. I am not in XCode 3.2 Here is an example of what I struggle with: template <class registeredObject> typename std::vector<registeredObject>::iterator FxRegistry<registeredObject>::begin(void) { return mRegistryList.begin(); } The errors are: no 'typename std::vector<registeredObject, std::allocator<_CharT> >::iterator FxRegistry<registeredObject>::begin()' member function declared in class 'FxRegistry<registeredObject>' template definition of non-template 'typename std::vector<registeredObject, std::allocator<_CharT> >::iterator FxRegistry<registeredObject>::begin()' How do I decide how to solve these and where do I start looking?

    Read the article

  • is unicode( codecs.BOM_UTF8, "utf8" ) necessary in Python 2.7/3?

    - by Brian M. Hunt
    In a code review I came across the following code that contains the following: # Python bug that renders the unicode identifier (0xEF 0xBB 0xBF) # as a character. # If untreated, it can prevent the page from validating or rendering # properly. bom = unicode( codecs.BOM_UTF8, "utf8" ) r = r.replace(bom, '') This is in a function that passes a string to Response object (Django or Flask). Is this still a bug that needs this fix in Python 2.7 or 3? Something tells me it isn't, but I thought I'd ask because I don't know this problem very well. Thanks for reading.

    Read the article

  • Why would it be necessary to subclass from object in Python?

    - by rmh
    I've been using Python for quite a while now, and I'm still unsure as to why you would subclass from object. What is the difference between this: class MyClass(): pass And this: class MyClass(object): pass As far as I understand, object is the base class for all classes and the subclassing is implied. Do you get anything from explicitly subclassing from it? What is the most "Pythonic" thing to do?

    Read the article

  • Python: When passing variables between methods, is it necessary to assign it a new name?

    - by Anthony
    I'm thinking that the answer is probably 'no' if the program is small and there are a lot of methods, but what about in a larger program? If I am going to be using one variable in multiple methods throughout the program, is it smarter to: Come up with a different phrasing for each method (to eliminate naming conflicts). Use the same name for each method (to eliminate confusion) Just use a global variable (to eliminate both) This is more of a stylistic question than anything else. What naming convention do YOU use when passing variables?

    Read the article

  • Making bash script to check connectivity and change connection if necessary. Help me improve it?

    - by cypherpunks
    My connection is flaky, however I have a backup one. I made some bash script to check for connectivity and change connection if the present one is dead. Please help me improve them. The scripts almost works, except for not waiting long enough to receive an IP (it cycles to next step in the until loop too quick). Here goes: #!/bin/bash # Invoke this script with paths to your connection specific scripts, for example # ./gotnet.sh ./connection.sh ./connection2.sh until [ -z "$1" ] # Try different connections until we are online... do if eval "ping -c 1 google.com" then echo "we are online!" && break else $1 # Runs (next) connection-script. echo fi shift done echo # Extra line feed. exit 0 And here is an example of the slave scripts: #!/bin/bash ifconfig wlan0 down ifconfig wlan0 up iwconfig wlan0 key 1234567890 iwconfig wlan0 essid example sleep 1 dhclient -1 -nw wlan0 sleep 3 exit 0

    Read the article

  • Is it necessary to write ROLLBACK if queries fail?

    - by Donator
    I write mysql_query("SET AUTOCOMMIT=0"); mysql_query("START TRANSACTION"); before I write all queries. Then check if all of them are true and then write: mysql_query("COMMIT"); But if one of query fails, I just pass COMMIT query. So do I really need ROLLBACK function if one of the queries fail? Because without ROLLBACK it also works. Thanks.

    Read the article

  • What is necessary to run JavaScript files from MS Server 2003?

    - by Daniel
    I have created some JavaScript files and they run well from my Mac OS X Server. Now I have put the same JavaScript files on my MS Server 2003. But they don't work. Do I have to install something on the server in order to get them work? EDIT: (Sorry, I'm new and English is not my native language, so its hard for me to describe the situation well) I have downloaded this free Ajax Chat app. After enabling PHP on my Mac, it worked. But on my MS Windows 2003 Server it doesn't work. I installed PHP and Apache on Windows. PHP and Apache work well. But everything that uses JavaScript (such as drop down menus or pop-up windows) doesn't work. Thanks!

    Read the article

  • To display the images in mobile devices is it necessary that the images should resides on device in

    - by Shailesh Jaiswal
    I am devloping smart device application in C#. In this application I have some images in my application which I used to dispay on emulator from my application. To display the images on emulator I need to create the one folder of images which resides on the emulator. Only after that I am able to display the images in emulator. I am able to create the folder in emulator by using File-Configure-General-Shared Folder. For sharing the folder I am giving the path of the folder which contains the images. Once I share the folder the folder of images which resides in my application will get copied in emulator with the name "Storage Card". Now I need to use the path as Bitmap bmp=new Bitmap(@"/Storage Card/ImageName.jpg"); Now I am able to display the images in emulator. Can we display the images in the emulator without any image folder which resides on emultor (so that we dont need to place the image folder in emulator as in the above case by sharing the folder) ? If the answere is no then to run the application on different mobile devices we need to place the folder which contains the images on different mobile devices. Isnt it? If the answere is yes then how we can display the images on different mobile device from our application without placing any folder of images on mobile devices?

    Read the article

  • In 2011 is it truly necessary to still degrade js?

    - by 0plus1
    Serious question. I tried most of the famous websites (including facebook) and I can say that tons of functionality doesn't degrade at all with js disabled. I've been always told that js should degrade gracefully, but does this still applies in these day and age? ie6 support is being dropped by several sites, and most of the web2.0 relies heavily on js (especially ajax, I even found some sites that doesn't let you login without js enabled). What are your thought about it?

    Read the article

  • Problem enabling OpenGL ES depth test on iPhone. What steps are necessary?

    - by Chris Cooper
    I remember running into this problem when I started using OpenGL in OS X. Eventually I solved it, but I think that was just by using glut and c++ instead of Objective-C... The lines of code I have in init for the ES1Renderer are as follows: glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); Then in the render method, I have this: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); I assume I'm missing something specific to either the iPhone or ES. What other steps are required to enable the depth test? Thanks

    Read the article

  • Is it necessary to declare attribute [DataMember(Order=n)] on public method?

    - by veera
    In my solution, I have created public class to store value and already declare [DataContract/DataMember] attribute. For example, [DataContract] public class MeterSizeInfo { string _meterSizeId; [DataMember(Order = 1)] public string MeterSizeId { get { return this._meterSizeId; } set { this._meterSizeId = value; } } string _meterSizeName; [DataMember(Order = 2)] public string MeterSizeName { get { return this._meterSizeName; } set { this._meterSizeName = value; } } } Then I need to add another public method exposing to entire project. I wonder I have to add [DataMember(Order = 3)] for it or not. [DataMember(Order = 3)] //<--- must declare or not? public string DoSomething() { // do something... } I understand that if I want to use serializer in protobuf-net to serialize my data stored in, I have to declare those attribute. but I'm not sure about that on method. please help. Thank you in advance.

    Read the article

  • C# Dataset usage necessary before passing to GridView datasource?

    - by Goober
    Scenario Lets say for example I have a series of events that fire continually every half second presenting me with an object containing some bits of information. There are always between 10 and 15 objects that are being updated constantly. Since these bits of information are changing continually I want to display them in a GridView. When I do so, I want the user to see the data displayed in the gridview and actually be updated as opposed to just a continually extending list being printed and incrementing (like writeline on the console). Question Is the best way to achieve this to map my objects to a dataset and have the dataset mapped to the gridview? Thoughts Will this allow the gridview to just be "UPDATED" as opposed to being added to? Any implementation suggestions would be greatly appreciated. EDIT: it MUST be windows forms (I use DevExpress too)

    Read the article

  • using arrays to get best memory alignment and cache use, is it necessary?

    - by Alberto Toglia
    I'm all about performance these days cause I'm developing my first game engine. I'm no c++ expert but after some research I discovered the importance of the cache and the memory alignment. Basically what I found is that it is recommended to have memory well aligned specially if you need to access them together, for example in a loop. Now, In my project I'm doing my Game Object Manager, and I was thinking to have an array of GameObjects references. meaning I would have the actual memory of my objects one after the other. static const size_t MaxNumberGameObjects = 20; GameObject mGameObjects[MaxNumberGameObjects]; But, as I will be having a list of components per object -Component based design- (Mesh, RigidBody, Transformation, etc), will I be gaining something with the array at all? Anyway, I have seen some people just using a simple std::map for storing game objects. So what do you guys think? Am I better off using a pure component model?

    Read the article

  • How could my code compliled correctly without necessary headers?

    - by ZhengZhiren
    I use the functions fork(),exec()... But how can this program compiled without including some extra headers(like sys/types.h, sys/wait.h). I use ubuntu 10.04 with gcc version 4.4.3 #include <stdio.h> #include <stdlib.h> int main() { pid_t pid; printf("before fork\n"); pid = fork(); if(pid == 0) { /*child*/ if(execvp("./cpuid", NULL)) { printf("error\n"); exit(0); } } else { if(wait(NULL) != -1) { printf("ok\n"); } } return 0; }

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >