Search Results

Search found 4637 results on 186 pages for 'john deerikio'.

Page 104/186 | < Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >

  • Write problem - lossing the original data

    - by John
    Every time I write to the text file I will lose the original data, how can I read the file and enter the data in the empty line or the next line which is empty? public void writeToFile() { try { output = new Formatter(myFile); } catch(SecurityException securityException) { System.err.println("Error creating file"); System.exit(1); } catch(FileNotFoundException fileNotFoundException) { System.err.println("Error creating file"); System.exit(1); } Scanner scanner = new Scanner (System.in); String number = ""; String name = ""; System.out.println("Please enter number:"); number = scanner.next(); System.out.println("Please enter name:"); name = scanner.next(); output.format("%s,%s \r\n", number, name); output.close(); }

    Read the article

  • Is there an equivalent for the Zip function in Clojure Core or Contrib?

    - by John Kane
    In Clojure, I want to combine two lists to give a list of pairs, > (zip '(1 2 3) '(4 5 6)) ((1 4) (2 5) (3 6)) In Haskell or Ruby the function is called zip. Implementing it is not difficult, but I wanted to make sure I wasn't missing a function in Core or Contrib. There is a zip namespace in Core, but it is described as providing access to the Zipper functional technique, which does not appear to be what I am after. Is there an equivalent function for combining 2 or more lists, in this way, in Core? If there is not, is it because there is an idiomatic approach that renders the function unneeded?

    Read the article

  • Do I have to release modifications made to a GPL v2 CMS?

    - by John McCollum
    If we use a CMS that is covered by the GPL (v2), do we have to re-release the source code of the CMS if we make modifications to the core? The GPL v2 states: The GPL does not require you to release your modified version. You are free to make modifications and use them privately, without ever releasing them. This applies to organizations (including companies), too; an organization can make a modified version and use it internally without ever releasing it outside the organization. But if you release the modified version to the public in some way, the GPL requires you to make the modified source code available to the program's users, under the GPL. The grey area for me here is the part that states "if you release the modified version to the public in some way" - does displaying a website to the public count as "releasing it to the public"? What about if a custom plugin is written which integrates with the CMS - are we required to release the source? Does this count as a modification?

    Read the article

  • Any way to make dialogs appear/disappear with a transition in MFC?

    - by John
    For instance I have a main dialog, when I click a button a smaller dialog appears next to it. But it would be neat if the small one could somehow transition in, rather than simply appear. For instance using transparency, or zooming in, or sliding in from width=0 - full-width. Making an actual dialog do such things isn't too hard, but what about the controls within it? How might we approach this in a way that is reusable on different dialogs?

    Read the article

  • C# method to scale values?

    - by John S
    Hello, I have a value range from 0 to 255. There is a method that returns an array with a min and max values within this range, i.e: 13, 15, 20, 27, 50 ... 240 where 13 is the min and 240 is the max I need to scale these values so that 13 becomes 0 and 240 becomes 255 and scale all the other values between them proportionally. Is there any C# method that does that? thanks!

    Read the article

  • Is there a way to sort by more than one field in Crystal Reports?

    - by John at CashCommons
    I'm using Crystal Report with VB.NET in Visual Studio 2005. I have report that works if I pass in a list of List(Of Stuff). I had been sorting the report by one of the members of Stuff but a need now to sort first by one member, like Stuff.StatusCode and then by another member, like Stuff.ItemNumber. Can I do this just be having more than one SortField member, or do I need to do it some other way? Thanks as always!

    Read the article

  • How to return array of C++ objects from a PHP extension

    - by John Factorial
    I need to have my PHP extension return an array of objects, but I can't seem to figure out how to do this. I have a Graph object written in C++. Graph.getNodes() returns a std::map<int, Node*>. Here's the code I have currently: struct node_object { zend_object std; Node *node; }; zend_class_entry *node_ce; then PHP_METHOD(Graph, getNodes) { Graph *graph; GET_GRAPH(graph, obj) // a macro I wrote to populate graph node_object* n; zval* node_zval; if (obj == NULL) { RETURN_NULL(); } if (object_init_ex(node_zval, node_ce) != SUCCESS) { RETURN_NULL(); } std::map nodes = graph-getNodes(); array_init(return_value); for (std::map::iterator i = nodes.begin(); i != nodes.end(); ++i) { php_printf("X"); n = (node_object*) zend_object_store_get_object(node_zval TSRMLS_CC); n-node = i-second; add_index_zval(return_value, i-first, node_zval); } php_printf("]"); } When i run php -r '$g = new Graph(); $g->getNodes();' I get the output XX]Segmentation fault meaning the getNodes() function loops successfully through my 2-node list, returns, then segfaults. What am I doing wrong?

    Read the article

  • UNIX-style RegExp Replace running extremely slowly under windows. Help?

    - by John Sullivan
    I'm trying to run a unix regEXP on every log file in a 1.12 GB directory, then replace the matched pattern with ''. Test run on a 4 meg file is took about 10 minutes, but worked. Obviously something is murdering performance by several orders of magnitude. Find: ^(?!.*155[0-2][0-9]{4}\s.*).*$ -- NOTE: match any line NOT starting 152[0-2]NNNN where in is a number 0-9. Replace with: ''. Is there some justifiable reason for my regExp to take this long to replace matching text, or is the program I am using (this is windows / a program called "grepWin") most likely poorly optimized? Thanks.

    Read the article

  • fetch only first row from oracle - is it faster?

    - by john
    My main goal with this question is optimization and faster run time. After doing lot of processing in the Stored Proc I finally return a count like below: OPEN cv_1 FOR SELECT COUNT(*) num_of_members FROM HOUSEHOLD_MEMBER a, HOUSEHOLD b WHERE RTRIM(LTRIM(a.mbr_last_name)) LIKE v_MBR_LAST_NAME || '%' AND a.number = '01' AND a.code = v_CODE AND a.ssn_head = v_SSN_HEAD AND TO_CHAR( a.mbr_dob, 'MM/DD/YYYY') = v_DOB; But in my code that is calling the SP does not need the actual count. It just cares that count is greater than 1. Question: How can I change this to return just 1 or 0. 1 when count is 0 and 0 when count 1. Will it be faster to do this rather than returning the whole count?

    Read the article

  • Resque: Slow worker startup and Forking

    - by David John
    I'm currently moving my application from a Linode setup to EC2. Redis is currently installed on a remote instance with various worker instances interacting with the queue. Thats all going fantastic. My problem is with the amount of time it takes for a worker to be 'instantiated' and slow forking. Starting a worker will usually take between 30 seconds and a minute(from god.rb starting the worker rake task and the worker actively starting work on the queue). I could live with that, but I've not experienced such a wait time on my current Linode production box so I believe its one of my symptoms to a bigger problem. Next issue is that jobs that took a second or less in my previous environment now seem to take about 5 to 10 times longer.. I'm assuming this must be some sort of issue with my Ubuntu install on EC2? One notable difference is that I'm running REE 1.8.7-2010.01 in my new setup, and REE 1.8.6 on the old Linode boxes. Anyone else experienced these issues?

    Read the article

  • What is the "task" in twitter Storm parallelism

    - by John Wang
    I'm trying to learn twitter storm by following the great article "Understanding the parallelism of a Storm topology" However I'm a bit confused by the concept of "task". Is a task an running instance of the component(spout or bolt) ? A executor having multiple tasks actually is saying the same component is executed for multiple times by the executor, am I correct ? Moreover in a general parallelism sense, Storm will spawn a dedicated thread(executor) for a spout or bolt, but what is contributed to the parallelism by an executor(thread) having multiple tasks ? I think having multiple tasks in a thread, since a thread executes sequentially, only make the thread a kind of "cached" resource, which avoids spawning new thread for next task run. Am I correct? I may clear those confusion by myself after taking more time to investigate, but you know, we both love stackoverflow ;-) Thanks in advance.

    Read the article

  • drop down list binding

    - by John
    I have a table which has an Id and a name field. I usually bind the name to the dropdownlist but I was told that any dml should be on the Id so how can I use the name in the dropdownlist and at the same time still use the Id?

    Read the article

  • NSString stringWithFormat question

    - by John Smith
    I am trying to build a small table using NSString. I cannot seem to format the strings properly. Here is what I have [NSString stringWithFormat:@"%8@: %.6f",e,v] where e is an NSString from somewhere else, and v is a float. What I want is output something like this: Grapes: 20.3 Pomegranates: 2.5 Oranges: 15.1 What I get is Grapes:20.3 Pomegranates:2.5 Oranges:15.1 How can I fix my format to do something like this?

    Read the article

  • Where do current (not HTML5) browsers stand on clipboard support for non-text data?

    - by John
    I don't really know where the line is between the browser itself and HTML/JS here. But let's say I want to write a web-app where I can copy a chunk of data from MSPaint (select, CTRL+c) and paste it into a web-page in some way... ultimately the point is the data goes to the server without me having to save it as a file first. Where are the problems here - browsers or client-side technologies? For instance if JS can't do it, could Flex/Silverlight? Advice on future technology welcome, but doesn't really answer the question - where are we right now with IE/FF/Chrome and JS/Flex/SL?

    Read the article

  • How to create commandlink programmatically

    - by John
    Hi, We have a system built on seam/richfaces. There's this webpage where the tables are rendered from dynamic context (from multiple different datasources, and each of them uses a different layout to represent essentially the same real world concept). As a result, this table is binded to a bean, and it's columns/layout are generated from this bean. Now I need to add a command link on a specific column, equivalent to <a4j:commandLink value="#{actBean.Ids}" action="#{actBean.genDetails}"> <f:setPropertyActionListener target="#{actBean.Ref}" value="#{cont}"/> </a4j:commandLink> in a JSF page. My question is, how do I do this programmatically? Thanks!

    Read the article

  • Google Suggest - What determines the sort order of suggested queries on google?

    - by John Himmelman
    How is this sort order determined? Is it ranked by popularity, number of results, or a mysterious google algorithm? Does there algorithm take into account the search popularity of a query (using google-trends data or something)? Edit: I found a news article dating back to when google suggest was made public in 2004. Here is an excerpt... How does it work? "Our algorithms use a wide range of information to predict the queries users are most likely to want to see. For example, Google Suggest uses data about the overall popularity of various searches to help rank the refinements it offers." Source: http://www.free-seo-news.com/newsletter138.htm

    Read the article

  • how to refactor user-permission system?

    - by John
    Sorry for lengthy question. I can't tell if this should be a programming question or a project management question. Any advice will help. I inherited a reasonably large web project (1 year old) from a solo freelancer who architected it then abandoned it. The project was a mess, but I cleaned up what I could, and now the system is more maintainable. I need suggestions on how to extend the user-permission system. As it is now, the database has a t_user table with the column t_user.membership_type. Currently, there are 4 membership types with the following properties: 3 of the membership types are almost functionally the same, except for the different monthly fees each must pay 1 of the membership type is a "fake-user" type which has limited access ( different business logic also applies) With regards to the fake-user type, if you look in the system's business logic files, you will see a lot of hard-coded IF statements that do something like if (fake-user) { // do something } else { // a paid member of type 1,2 or 3 // proceed normally } My client asked me to add 3 more membership types to the system, each of them with unique features to be implemented this month, and substantive "to-be-determined" features next month. My first reaction is that I need to refactor the user-permission system. But it concerns me that I don't have enough information on the "to-be-determined" membership type features for next month. Refactoring the user-permission system will take a substantive amount of time. I don't want to refactor something and throw it out the following month. I get substantive feature requests on a monthly basis that come out of the blue. There is no project road map. I've asked my client to provide me with a roadmap of what they intend to do with the new membership types, but their answer is along the lines of "We just want to do [feature here] this month. We'll think of something new next month." So questions that come to mind are: 1) Is it dangerous for me to refactor the user permission system not knowing what membership type features exist beyond a month from now? 2) Should I refactor the user permission system regardless? Or just continue adding IF statements as needed in all my controller files? Or can you recommend a different approach to user permission systems? Maybe role-based ? 3) Should this project have a road map? For a 1 year old project like mine, how far into the future should this roadmap project? 4) Any general advice on the best way to add 3 new membership types?

    Read the article

  • Emacs How to redefine Shift-R for expected use

    - by John Bellone
    I've checked my elisp files to make sure that I do not have any bindings that contain Shift+R (and I have not found any). I expect SHIFT+R to print an uppercase character, but instead I get R R undefined inside of the Emacs command line. This is only in C/C++ major modes. Any suggestions? Update: Describing the key shows that it is undefined. How would I define it for the normal, expected use (capitalizing the letter R)?

    Read the article

  • Mult-line Svg tooltip

    - by John Vaughan
    I have created numerous polygon shapes in SVG format. and grouped them together. When the user hovers over the group a tooltip box appear. I have used ecmascript. What i am looking to do is make the tooltip box a multiline box. Any ideas how to do this? <script type="text/ecmascript"> <![CDATA[ function init(evt) { if ( window.svgDocument == null ) { svgDocument = evt.target.ownerDocument; } tooltip = svgDocument.getElementById('tooltip'); tooltip_bg = svgDocument.getElementById('tooltip_bg'); } function ShowTooltip(evt, mouseovertext) { tooltip.setAttributeNS(null,"x",evt.clientX+17); tooltip.setAttributeNS(null,"y",evt.clientY+14); tooltip.firstChild.data = mouseovertext; tooltip.setAttributeNS(null,"visibility","visible"); length = tooltip.getComputedTextLength(); tooltip_bg.setAttributeNS(null,"width",length+8); tooltip_bg.setAttributeNS(null,"x",evt.clientX+14); tooltip_bg.setAttributeNS(null,"y",evt.clientY+1); tooltip_bg.setAttributeNS(null,"visibility","visibile"); } function HideTooltip(evt) { tooltip.setAttributeNS(null,"visibility","hidden"); tooltip_bg.setAttributeNS(null,"visibility","hidden"); } ]]> </script> <SVG> <g onmousemove="ShowTooltip(evt, 'GHANA 2000')" onmouseout="HideTooltip(evt)"> <path fill="#EEEEEE" d="M250,0c47,0,85.183,10.506,125,33.494L250,250V0z"/> <path id="score" d="M250,57c36.284,0,65.761,8.11,96.5,25.857L250,250V57z"/> <path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" d="M250,0c47,0,85.183,10.506,125,33.494L250,250V0z"/> <text transform="matrix(1 0 0 1 283.9883 92.0024)" fill="#FFFFFF" font-family="'WalkwayBlack'" font-size="16">62</text> </g> <rect class="tooltip_bg" id="tooltip_bg" x="0" y="0" width="55" height="17" visibility="hidden"/> <text class="tooltip" id="tooltip" x="0" y="0" visibility="hidden">Tooltip</text> <SVG>

    Read the article

< Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >