Search Results

Search found 20242 results on 810 pages for 'faith in unseen things'.

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

  • Firefox and Chrome Display "top: -5px differently"

    - by Kevin
    Using Google Web Toolkit, I have a DIV parent with a DIV and anchor children. <div class="unseen activity"> <div class = "unseen-label"/> <a href .../> </div> With the following CSS, Chrome shows the "unseen label" slightly below the anchor. which is positioned correctly in both Chrome and FireFox. However, FireFox shows the label in line with the anchor. .unseen-activity div.unseen-label { display: inline-block; position: relative; top: -5px; } and .unseen-activity a { background: url('style/images/refreshActivity.png') no-repeat; background-position: 0 2px; height: 20px; overflow: hidden; margin-left: 10px; display: inline-block; margin-top: 2px; padding-left: 20px; padding-right: 10px; position: relative; top: 2px; } Please tell me how to change my CSS so that Chrome render the label centered to the anchor. However, I need to keep FireFox happy and rendered correctly.

    Read the article

  • Key things to learn to be a senior developer under the MS platform

    - by Blankman
    I know the following: asp.net webforms, mvc, sql server 2005/2008, web services, and windows services. I want to expand so I can be a little more versatile. What things should I be focusing on? (this is general guidance, with a web focus) I am thinking: SSIS windows workflow sharepoint What other common skills should I know that seem to be go well with what I know already?

    Read the article

  • Things in .NET Framework 4 that every programmer should know

    - by Faruz
    I recently moved to Visual Studio 2010 and upgraded my website to work with .NET Framework 4. (From VS 2008 - Framework 3.5) What are things I need to know to improve site speed, readability or memory use? For example, I found out that when I use AJAX ScriptManager, one of it's new properties is EnableCDN which enables me to load AJAX .js files from Microsoft CDN.

    Read the article

  • UITableViewCell similar to one in "Things" app

    - by Fiedorowski
    Hi im looking (but cant find) for sample app that will show me how to implement UITableView with custom UITableViewCell that is similar to one in the Things app, with smooth animation from read-only view (that hides empty cells) to editable view that shows only cells that can be edited, and custom cell with multiline input with small image. I would appreciate if someone could point me in the right direction. Im new to Cocoa/Objective-C programming but Im familiar with Object Oriented programing concepts.

    Read the article

  • to count specific things within a c++ code

    - by ace
    i know this connects to my original question but i put it here so it is seen by people afresh. after passing each line of the code into a string, how can i count the following things: --the number of standalone functions and member functions per class --the number of lines per function?

    Read the article

  • Flex SDK missing fundamental things

    - by Bart van Heukelom
    All of a sudden Flash Builder 4 is missing all kinds of fundamental things and is generating incorrect errors. I've had the same issue yesterday, where I fixed it by downloading a new Flex SDK and importing that into FB. I did this again, but this time it fixed nothing. I don't think it's something I did, like removing critical references from the build path. The errors also appeared on projects I was not working on at the time. It occurs for ActionScript, Flex and Flex Library projects alike. Update 3: Well, i've singled the problem down to a single piece of code, though a very simple one. I can make a new workspace in FB and things work ok, then screw the workspace up forever by adding this code to a project. All projects will have errors and closing or even removing the faulty project does not change this. Making another new workspace (without the faulty code) makes my projects compile again. Link: http://www.the3rdage.net/files/2745/Main.as (i've uploaded the file in case an odd character or encoding error causes the error) Update 2: I've tried manual compiling with mxmlc, the same errors occur. It appears to be an SDK problem, not Flash Builder. Update: I find this stack trace in the Flash Builder error log: !ENTRY com.adobe.flexbuilder.project 4 43 2010-05-11 11:55:47.495 !MESSAGE Uncaught exception in compiler !STACK 0 java.lang.NullPointerException at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2592) at macromedia.asc.parser.VariableBindingNode.evaluate(VariableBindingNode.java:64) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2233) at macromedia.asc.parser.ListNode.evaluate(ListNode.java:44) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2578) at macromedia.asc.parser.VariableDefinitionNode.evaluate(VariableDefinitionNode.java:48) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2310) at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2503) at macromedia.asc.parser.WithStatementNode.evaluate(WithStatementNode.java:44) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2310) at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2891) at macromedia.asc.parser.FunctionCommonNode.evaluate(FunctionCommonNode.java:106) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2905) at macromedia.asc.parser.FunctionCommonNode.evaluate(FunctionCommonNode.java:106) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:3643) at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:106) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:3371) at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80) at flex2.compiler.as3.As3Compiler.analyze4(As3Compiler.java:709) at flex2.compiler.CompilerAPI.analyze(CompilerAPI.java:3089) at flex2.compiler.CompilerAPI.analyze(CompilerAPI.java:2977) at flex2.compiler.CompilerAPI.batch2(CompilerAPI.java:528) at flex2.compiler.CompilerAPI.batch(CompilerAPI.java:1274) at flex2.compiler.CompilerAPI.compile(CompilerAPI.java:1496) at flex2.tools.oem.Application.compile(Application.java:1188) at flex2.tools.oem.Application.recompile(Application.java:1133) at flex2.tools.oem.Application.compile(Application.java:819) at flex2.tools.flexbuilder.BuilderApplication.compile(BuilderApplication.java:344) at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder$MyBuilder.mybuild(ASApplicationBuilder.java:276) at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder.build(ASApplicationBuilder.java:127) at com.adobe.flexbuilder.multisdk.compiler.internal.ASBuilder.build(ASBuilder.java:190) at com.adobe.flexbuilder.multisdk.compiler.internal.ASItemBuilder.build(ASItemBuilder.java:74) at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.buildItem(FlexProjectBuilder.java:480) at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.build(FlexProjectBuilder.java:306) at com.adobe.flexbuilder.project.compiler.internal.FlexIncrementalBuilder.build(FlexIncrementalBuilder.java:157) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

    Read the article

  • What useful things could a javaScript library provide?

    - by Delan Azabani
    In many of my answers I repeatedly urge users not to use JavaScript libraries like jQuery. I even wrote a blog post about the problems that using a library create. Some of these problems include holding back native standards development, keeping users comfortably using IE, and abstracting the developer from real JavaScript. If a site doesn't require IE as part of its audience, then how are libraries useful? The other popular browsers share extremely similar implementations and work well with things like JavaScript 1.6 arrays and AJAX. This is not a troll question, I'm truly wondering what they're useful for.

    Read the article

  • Developing FIrebug like web application for CSS things.

    - by vishwanath
    I am developing a web application for web designing. One part of it includes changing CSS styles on the run and saving the same back to server. I see that, first part of my motive is implemented there in firebug, where I can view CSS style rules applied to a particular HTML element and can change them to view the effect. An earlier question at SO lead to me firebug lite source code https://getfirebug.com/firebug-lite-debug.js , which is far less confusing than full version of firebug. My question was that, is there any way I can get documentation of the firebug/firebug lite code which can speed things up for me. After some googling I found out that there is Firebug API http://getfirebug.com/developer/api/firebug1.6/ But don't know how much useful it is for me. Any alternative way to do this is also welcome.

    Read the article

  • Does python have one way of doing things?

    - by gath
    I have always seen in python articles/books that python is simple and it has only one way of doing things. I would like someone to explain to me this concept keeping in mind the example below, if i wanted to get the min and max values of sequence i would do the following; seq=[1,2,3,4,5,6] min(seq) #1 max(seq) #6 but i can also do this; seq[:1] #1 seq[-1] #6 surely this are two ways of doing one simple thing. This confuses me a bit. Gath

    Read the article

  • Are there such things as Email Hooks?

    - by viatropos
    After hearing about git commit hooks, I was thinking maybe there are such things as email hooks... Is it possible for me to build a program that says "hey, you just received an email, now run this ruby script"? Something like a GMail Web Hook. Is there anything out there like that? I mean I could build a cron thing that checked my email all the time, but maybe there's a more formal way. Looking for an online email system to do this with, not say my Mac Mail.

    Read the article

  • What are some things I should watch out for before hiring a freelance programmer

    - by Luke101
    I am looking to hire a freelancer for a big web application. The budget for this project is a little over $20,000. The programmer will develop in asp.net MVC C#. Are there any usual things I should pay attention to or watch out for. i really don't want to hire the freelancer and when he/she is done with the project it is not what i expect. I have heard horror stories where the programmer delivered a fantastic product but the code was not commented and parts of the software was hidden behind DLLs. Is there anyway to avoid situations like this? I am sure I cannot think of every possible scenario when i write the project description. Also, is it advisable to hire a lawyer to write the contract?

    Read the article

  • Multiple things at once (Threads?)

    - by Jonathan
    All, What is a really simple way of having a program do more than one thing at once, even if the computer does not necessarily have multiple 'cores'. Can I do this by creating more than one Thread? My goal is to be able to have two computers networked (through Sockets) to respond to each-other's requests, while my program will at the same time be able to be managing a UI. I want the server to potentially handle more than one client at the same time as well. My understanding is that the communication is done with BufferedReader.readLine() and PrintWriter.println(). My problem is that I want the server to be waiting on multiple readLine() requests, and also be doing other things. How do I handle this? Many thanks, Jonathan

    Read the article

  • what are most important things that i must know in order to jump into silverlight development

    - by Poni
    I have vast programming knowledge; C++/C#/ActionScript/ASM/PHP..... so learning the language of SilverLight itself isn't of an issue. To keep long story short, when asking this question I'm asking it as a developer who's coming from Flash world - great graphics/sounds/media support, fully cross-platform, ability to combine several SWFs within a "movie" (which also implies code reusability). A Flash developer have pretty much freedom. What are most important things that i must know in order to jump into silverlight development? Did you already make the move to SilverLight from Flash yourself? Are you a "guru" at both? Great, let's hear what you have to say - developer to developer! =)

    Read the article

  • Things one needs to know while writing a game engine

    - by Joe Barr
    I have been dabbling in game development as a hobby for a while now, and I cannot seam to quite get my games to sparkle at least a bit with some graphics. I have decided to write a simple test game engine that only focuses on the representation of graphics - shapes, textures and surfaces. While I have a few very simple game engines designed for my own games under my belt, I want to create a game engine that I can use to display and play with graphics. I'm going to do this in C++. Since this is my first time with a major engine, the engine in not going to focus on 3D graphics, it's going to be a mixture of isometric and 2D graphics. My previous engines have incorporated (been able to draw) or focused on simple flat (almost 2D) non impressive graphic designs and representations of: the player NPCs objects walls and surfaces textures Also, I had some basic AI and sometimes even sound. They also saved and loaded games. They didn't have a map editor or a level editor. Is this going to be a problem in the future? At this time I have to point out that some of my games didn't get finished because I was to lazy to write the few last levels. My question at this point would be: What are some things one should know if one wants write (develope) a better graphical game engine with all it's functions.

    Read the article

  • Fun things you can do by mutating Java strings

    - by polygenelubricants
    So I've come around since I asked how to limit setAccessible to only “legitimate” uses and have come to embrace its power for fun. Enabled by its power, of course, is string mutation. import java.lang.reflect.Field; public class Mutator { static void mutate(Object obj, String field, Object newValue) { try { Field f = obj.getClass().getDeclaredField(field); f.setAccessible(true); f.set(obj, newValue); } catch (Exception e) { } } public static void mutate(String from, String to) { mutate(from, "value", to.toCharArray()); mutate(from, "count", to.length()); } public static void main(String args[]) { Mutator.mutate(System.getProperty("line.separator"), "<br/>\n"); System.out.println("Hello world!"); Mutator.mutate(Integer.toString(Integer.MIN_VALUE), "OMG!"); System.out.println(-2147483648); Mutator.mutate(String.valueOf((Object) null), "LOL!"); System.out.println(Arrays.toString(new int[3][])); Mutator.mutate(Arrays.toString(new int[0]), ":("); System.out.println(Arrays.toString(new byte[0])); } } Output (if no exception is thrown): Hello world!<br/> OMG!<br/> [LOL!, LOL!, LOL!]<br/> :(<br/> Let's see what other fun things we can come up with.

    Read the article

  • Domain model: should things like Logging, Audit, Persistence be in it

    - by hom.tanks
    I'm having a hard time convincing our architect that a Domain model should only have the essential elements of the business domain on it. Things like the fact that a class is persistable, that it needs logging and auditing and that it has a RESTful URI should not drive the domain model. They can be added later on, by using interfaces. Ours is a healthcare information management system. At the very coarse level, its a system where users login and access their healthcare information. They can share this information with others and be custodian for others' information (think Roles). But because of a few sound bytes that caught on early like "Everything should be a REST resource" the model now has a top level class called Resource that every other class extends from. I'm trying to make him see that the domain model should have well defined concepts like User Account, HealthDocument, UserRole etc which are distinct entities of the business , with specific associations between them. Clubbing everything under Resource class lets our model be inflexible besides being potentially incorrect. But he wants me to show him why its a bad idea to do it his way. I don't know how to articulate that properly but all my OO instincts tell me that its just not right. Any thoughts?

    Read the article

  • What are the most necessary non-language specific things a programmer needs to know?

    - by Josh
    I've been thinking about this a lot lately. Right now I work at a little web company, am almost done with school, and have written an iPhone app, but I'm not sure what else I need to focus my learning energies on. I've decided I want to do software programming, so I've been actively reading everything I can get my hands on that deals with Objective-C / C++ (Cocoa, OpenGL, etc). But those are not the things I'm talking about. I know I need to "master" a language or two. What I'm talking about are the other "things". Things such as learning and using source control, design patterns, etc. What thing (or things, just one per response), would you say I should concurrently be focusing on? You can consider in your answer that I'm wanting to do the aforementioned career path, but you don't have to. I just want a nice list of things to research, and actually use in my career. Also, can someone help me with tagging this? I'm not sure what exactly would be a good tag for such a question.

    Read the article

  • Flash Builder missing fundamental things

    - by Bart van Heukelom
    All of a sudden Flash Builder 4 is missing all kinds of fundamental things and is generating incorrect errors. I've had the same issue yesterday, where I fixed it by downloading a new Flex SDK and importing that into FB. I did this again, but this time it fixed nothing. I don't think it's something I did, like removing critical references from the build path. The errors also appeared on projects I was not working on at the time. It occurs for ActionScript, Flex and Flex Library projects alike. Update: I find this stack trace in the Flash Builder error log: !ENTRY com.adobe.flexbuilder.project 4 43 2010-05-11 11:55:47.495 !MESSAGE Uncaught exception in compiler !STACK 0 java.lang.NullPointerException at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2592) at macromedia.asc.parser.VariableBindingNode.evaluate(VariableBindingNode.java:64) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2233) at macromedia.asc.parser.ListNode.evaluate(ListNode.java:44) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2578) at macromedia.asc.parser.VariableDefinitionNode.evaluate(VariableDefinitionNode.java:48) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2310) at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2503) at macromedia.asc.parser.WithStatementNode.evaluate(WithStatementNode.java:44) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2310) at macromedia.asc.parser.StatementListNode.evaluate(StatementListNode.java:60) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2891) at macromedia.asc.parser.FunctionCommonNode.evaluate(FunctionCommonNode.java:106) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:2905) at macromedia.asc.parser.FunctionCommonNode.evaluate(FunctionCommonNode.java:106) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:3643) at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:106) at macromedia.asc.semantics.ConstantEvaluator.evaluate(ConstantEvaluator.java:3371) at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:80) at flex2.compiler.as3.As3Compiler.analyze4(As3Compiler.java:709) at flex2.compiler.CompilerAPI.analyze(CompilerAPI.java:3089) at flex2.compiler.CompilerAPI.analyze(CompilerAPI.java:2977) at flex2.compiler.CompilerAPI.batch2(CompilerAPI.java:528) at flex2.compiler.CompilerAPI.batch(CompilerAPI.java:1274) at flex2.compiler.CompilerAPI.compile(CompilerAPI.java:1496) at flex2.tools.oem.Application.compile(Application.java:1188) at flex2.tools.oem.Application.recompile(Application.java:1133) at flex2.tools.oem.Application.compile(Application.java:819) at flex2.tools.flexbuilder.BuilderApplication.compile(BuilderApplication.java:344) at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder$MyBuilder.mybuild(ASApplicationBuilder.java:276) at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder.build(ASApplicationBuilder.java:127) at com.adobe.flexbuilder.multisdk.compiler.internal.ASBuilder.build(ASBuilder.java:190) at com.adobe.flexbuilder.multisdk.compiler.internal.ASItemBuilder.build(ASItemBuilder.java:74) at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.buildItem(FlexProjectBuilder.java:480) at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.build(FlexProjectBuilder.java:306) at com.adobe.flexbuilder.project.compiler.internal.FlexIncrementalBuilder.build(FlexIncrementalBuilder.java:157) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:627) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:309) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:341) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:140) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:238) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

    Read the article

  • Android ProgressDialog Progress Bar doing things in the right order

    - by FauxReal
    I just about got this, but I have a small problem in the order of things going off. Specifically, in my thread() I am setting up an array that is used by a Spinner. Problem is the Spinner is all set and done basically before my thread() is finished, so it sets itself up with a null array. How do I associate the spinners ArrayAdapter with an array that is being loaded by another thread? I've cut the code down to what I think is necessary to understand the problem, but just let me know if more is needed. The problem occurs whether or not refreshData() is called. Along the same lines, sometimes I want to call loadData() from the menu. Directly following loadData() if I try to fire a toast on the next line this causes a forceclose, which is also because of how I'm implementing ProgressDialog. THANK YOU FOR LOOKING public class CMSHome extends Activity { private static List<String> pmList = new ArrayList<String>(); // Instantiate helpers PMListHelper plh = new PMListHelper(); ProjectObjectHelper poc = new ProjectObjectHelper(); // These objects hold lists and methods for dealing with them private Employees employees; private Projects projects; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Loads data from filesystem, or webservice if necessary loadData(); // Capture spinner and associate pmList with it through ArrayAdapter spinner = (Spinner) findViewById(R.id.spinner); ArrayAdapter<String> adapter = new ArrayAdapter<String>( this, android.R.layout.simple_spinner_item, pmList); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); //---the button is wired to an event handler--- Button btn1 = (Button)findViewById(R.id.btnGetProjects); btn1.setOnClickListener(btnListAllProjectsListener); spinner.setOnItemSelectedListener(new MyOnItemSelectedListener()); } private void loadData() { final ProgressDialog pd = ProgressDialog.show(this, "Please wait", "Loading Data...", true, false); new Thread(new Runnable(){ public void run(){ employees = plh.deserializeEmployeeData(); projects = poc.deserializeProjectData(); // Check to see if data actually loaded, if not then refresh if ((employees == null) || (projects == null)) { refreshData(); } // Load up pmList for spinner control pmList = employees.getPMList(); pd.dismiss(); } }).start(); } private void refreshData() { // Refresh data for Projects projects = poc.refreshData(); poc.saveProjectData(mCtx, projects); // Refresh data for PMList employees = plh.refreshData(); plh.savePMData(mCtx, employees); } } <---- EDIT ----- I tried changing loadData() to the following after Jims suggestion. Not sure if I did this right, still doesn't work: private void loadData() { final ProgressDialog pd = ProgressDialog.show(this, "Please wait", "Loading Data...", true, false); new Thread(new Runnable(){ public void run(){ employees = plh.deserializeEmployeeData(); projects = poc.deserializeProjectData(); // Check to see if data actually loaded, if not return false if ((employees == null) || (projects == null)) { refreshData(); } pd.dismiss(); runOnUiThread(new Runnable() { public void run(){ // Load up pmList for spinner control pmList = employees.getPMList(); } }); } }).start(); }

    Read the article

  • Strange things appear on running the program

    - by FILIaS
    Hey! I'm fixing a program but I'm facing a problem and I cant really realize what's the wrong on the code. I would appreciate any help. I didnt post all the code...but i think with this part you can get an idea of it. With the following function enter() I wanna add user commands' datas to a list. eg. user give the command: "enter james bond 007 gun" 'james' is supposed to be the name, 'bond' the surname, 007 the amount and the rest is the description. I use strtok in order to 'cut' the command,then i put each name on a temp array. Then i call InsertSort in order to put the datas on a linked list but in alphabetical order depending on the surname that users give. I wanna keep the list on order and put each time the elements on the right position. /* struct for all the datas that user enters on file*/ typedef struct catalog { char short_name[50]; char surname[50]; signed int amount; char description[1000]; struct catalog *next; }catalog,*catalogPointer; catalogPointer current; catalogPointer head = NULL; void enter(void)//user command: enter <name> <surname> <amount> <description> { int n,j=2,k=0; char temp[1500]; char command[1500]; while (command[j]!=' ' && command[j]!='\0') { temp[k]=command[j]; j++; k++; } temp[k]='\0'; char *curToken = strtok(temp," "); printf("temp is:%s \n",temp); char short_name[50],surname[50],description[1000]; signed int amount; //short_name=(char *)malloc(sizeof (char *)); //surname=(char *)malloc(sizeof (char *)); //description=(char *)malloc(sizeof (char *)); //amount=(int *)malloc(sizeof (int *)); printf("\nWhat you entered for saving:\n"); for (n = 0; curToken !='\0'; ++n) { if (curToken) { strncpy(short_name, curToken, sizeof (char *)); / } printf("Short Name: %s \n",short_name); curToken = strtok(NULL," "); if (curToken) strncpy(surname, curToken, sizeof (char *)); / printf("SurName: %s \n",surname); curToken = strtok(NULL," "); if (curToken) { char *chk; amount = (int) strtol(curToken, &chk, 10); if (!isspace(*chk) && *chk != 0) fprintf(stderr,"Warning: expected integer value for amount, received %s instead\n",curToken); } printf("Amount: %d \n",amount); curToken = strtok(NULL,"\0"); if (curToken) { strncpy(description, curToken, sizeof (char *)); } printf("Description: %s \n",description); break; } if (findEntryExists(head, surname) != NULL) printf("\nAn entry for <%s %s> is already in the catalog!\nNew entry not entered.\n",short_name,surname); else { printf("\nTry to entry <%s %s %d %s> in the catalog list!\n",short_name,surname,amount,description); InsertSort(&head,short_name, surname, amount, description); printf("\n**Entry done!**\n"); } // Maintain the list in alphabetical order by surname. } /********Uses special case code for the head end********/ void SortedInsert(catalog** headRef, catalogPointer newNode,char short_name[],char surname[],signed int amount,char description[]) { strcpy(newNode->short_name, short_name); strcpy(newNode->surname, surname); newNode->amount=amount; strcpy(newNode->description, description); // Special case for the head end if (*headRef == NULL||(*headRef)->surname >= newNode->surname) { newNode->next = *headRef; *headRef = newNode; } else { // Locate the node before the point of insertion catalogPointer current = *headRef; catalogPointer temp=current->next; while ( temp!=NULL ) { if(strcmp(temp->surname,newNode->surname)<0 ) current = temp; } newNode->next = temp; temp = newNode; } } // Given a list, change it to be in sorted order (using SortedInsert()). void InsertSort(catalog** headRef,char short_name[],char surname[],signed int amount,char description[]) { catalogPointer result = NULL; // build the answer here catalogPointer current = *headRef; // iterate over the original list catalogPointer next; while (current!=NULL) { next = current->next; // tricky - note the next pointer before we change it SortedInsert(&result,current,short_name,surname,amount,description); current = next; } *headRef = result; } Running the program I get these strange things (garbage?)... Choose your selection: enter james bond 007 gun Your command is: enter james bond 007 gun temp is:james What you entered for saving: Short Name: james SurName: Amount: 0 Description: 0T?? Try to entry james 0 0T?? in the catalog list! Entry done! Also I'm facing a problem on how to use the 'malloc' on this program. Thanks in advance. . .

    Read the article

  • Language-agnostic term for typed things that need memory

    - by FredOverflow
    Is there an accepted general term that subsumes the concepts of variables, class instances and arrays? Basically "any typed thing that needs memory". In C++, such a thing is called an object, but I'm looking for a more language-agnostic term. § 1.8 The C++ object model 1 The constructs in a C++ program create, destroy, refer to, access, and manipulate objects. An object is a region of storage. [...] An object can have a name (Clause 3). An object has a storage duration (3.7) which influences its lifetime (3.8). An object has a type (3.9).

    Read the article

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