Search Results

Search found 5942 results on 238 pages for 'total starnger'.

Page 144/238 | < Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >

  • decoding algorithm wanted

    - by Horace Ho
    I receive encoded PDF files regularly. The encoding works like this: the PDFs can be displayed correctly in Acrobat Reader select all and copy the test via Acrobat Reader and paste in a text editor will show that the content are encoded so, examples are: 13579 -> 3579; hello -> jgnnq it's basically an offset (maybe swap) of ASCII characters. The question is how can I find the offset automatically when I have access to only a few samples. I cannot be sure whether the encoding offset is changed. All I know is some text will usually (if not always) show up, e.g. "Name:", "Summary:", "Total:", inside the PDF. Thank you!

    Read the article

  • A good approach to db planing for reporting service

    - by Itay Moav
    The scenario: Big system (~200 tables). 60,000 users. Complex reports that will require me to do multiple queries for each report and even those will be complex queries with inner queries all over the place + some processing in PHP. I have seen an approach, which I am not sure about: Having one centralized, de-normalized, table that registers any activity in the system which is reportable. This table will hold mostly foreign keys, so she should be fairly compact and fast. So, for example (My system is a virtual learning management system), A user enrolls to course, the table stores the user id, date, course id, organization id, activity type (enrollment). Of course I also store this data in a normalized DB, which the actual application uses. Pros I see: easy, maintainable queries and code to process data and fast retrieval. Cons: there is a danger of the de-normalized table to be out of sync with the real DB. Is this approach worth considering, or (preferably from experience) is total $#%#%t?

    Read the article

  • Powershell and some simple string manipulation

    - by Pat
    need some help with building a powershell script to help with some basic string manipulation. I know just enough powershell to get in trouble, but can't figure out the syntax or coding to make this work. I have a text file that looks like this - Here is your list of servers: server1 server2.domain.local server3 Total number of servers: 3 I need to take that text file and drop the first and last lines (Always first and last.) Then I need to take every other line and basically turn it into a CSV file. The final output should be a text file that looks like this - server1,server2.domain.local,server3 Any suggestions on where to start? Thanks!

    Read the article

  • How to sum up values of an array in assembly?

    - by Pablo Fallas
    I have been trying to create a program which can sum up all the values of an "array" in assembly, I have done the following: ORG 1000H TABLE DB DUP(2,4,6,8,10,12,14,16,18,20) FIN DB ? TOTAL DB ? MAX DB 13 ORG 2000H MOV AL, 0 MOV CL, OFFSET FIN-OFFSET TABLE MOV BX, OFFSET TABLE LOOP: ADD AL, [BX] INC BX DEC CL JNZ LOOP HLT END BTW I am using msx88 to compile this code. But I get an error saying that the code 0 has not been recognized. Any advise?

    Read the article

  • problems with extended classes and overwrite with methods

    - by Marco
    I have a .net website written in C# and will make functionalities that other developers can use. So i will make some default implementation and a developer can overwrite some methods Example: i have a class ShoppingCart and a class Product the class product haves a method getProductPrice the shoppingcart will call the method getProductPrice for calculating the total price of cart The Shoppingcart and Product are in the same project and i will give the developers the .dll so they can't change the source code so we can update the assembly later So they need to make a other project and extend the product class and overwrite the method getProductPrice so they can implement there own logic The problem is that the shoppingcart will not call the extended method but the original If we make already a extended project for the developers and the shoppingcart will call the extended method then we have a circular reference because the extended product needs a reference to product and the shopping cart to the extended product partial classes also don't works because we only can use partials within the same assembly anyone a suggestion ? thanks in advance

    Read the article

  • Algorithm Question Maximize Average of Functions

    - by paradoxperfect
    Hello, I have a set of N functions each denoted by Fi(h). Each function returns some value when given an h. I'm trying to figure out a way to maximize the average of all of the functions given some total H value. For example, say each function represents a grade on an assignment. If I spend h hours on assignment i, I will get g = Fi(h) as my grade. I'm given H hours to finish all of the assignments. I want to maximize my average grade for all assignments. Can anyone point me in the right direction to figure this out?

    Read the article

  • C++ Sentinel/Count Controlled Loop beginning programming

    - by Bryan Hendricks
    Hello all this is my first post. I'm working on a homework assignment with the following parameters. Piecework Workers are paid by the piece. Often worker who produce a greater quantity of output are paid at a higher rate. 1 - 199 pieces completed $0.50 each 200 - 399 $0.55 each (for all pieces) 400 - 599 $0.60 each 600 or more $0.65 each Input: For each worker, input the name and number of pieces completed. Name Pieces Johnny Begood 265 Sally Great 650 Sam Klutz 177 Pete Precise 400 Fannie Fantastic 399 Morrie Mellow 200 Output: Print an appropriate title and column headings. There should be one detail line for each worker, which shows the name, number of pieces, and the amount earned. Compute and print totals of the number of pieces and the dollar amount earned. Processing: For each person, compute the pay earned by multiplying the number of pieces by the appropriate price. Accumulate the total number of pieces and the total dollar amount paid. Sample Program Output: Piecework Weekly Report Name Pieces Pay Johnny Begood 265 145.75 Sally Great 650 422.50 Sam Klutz 177 88.5 Pete Precise 400 240.00 Fannie Fantastic 399 219.45 Morrie Mellow 200 110.00 Totals 2091 1226.20 You are required to code, compile, link, and run a sentinel-controlled loop program that transforms the input to the output specifications as shown in the above attachment. The input items should be entered into a text file named piecework1.dat and the ouput file stored in piecework1.out . The program filename is piecework1.cpp. Copies of these three files should be e-mailed to me in their original form. Read the name using a single variable as opposed to two different variables. To accomplish this, you must use the getline(stream, variable) function as discussed in class, except that you will replace the cin with your textfile stream variable name. Do not forget to code the compiler directive #include < string at the top of your program to acknowledge the utilization of the string variable, name . Your nested if-else statement, accumulators, count-controlled loop, should be properly designed to process the data correctly. The code below will run, but does not produce any output. I think it needs something around line 57 like a count control to stop the loop. something like (and this is just an example....which is why it is not in the code.) count = 1; while (count <=4) Can someone review the code and tell me what kind of count I need to introduce, and if there are any other changes that need to be made. Thanks. [code] //COS 502-90 //November 2, 2012 //This program uses a sentinel-controlled loop that transforms input to output. #include <iostream> #include <fstream> #include <iomanip> //output formatting #include <string> //string variables using namespace std; int main() { double pieces; //number of pieces made double rate; //amout paid per amount produced double pay; //amount earned string name; //name of worker ifstream inFile; ofstream outFile; //***********input statements**************************** inFile.open("Piecework1.txt"); //opens the input text file outFile.open("piecework1.out"); //opens the output text file outFile << setprecision(2) << showpoint; outFile << name << setw(6) << "Pieces" << setw(12) << "Pay" << endl; outFile << "_____" << setw(6) << "_____" << setw(12) << "_____" << endl; getline(inFile, name, '*'); //priming read inFile >> pieces >> pay >> rate; // ,, while (name != "End of File") //while condition test { //begining of loop pay = pieces * rate; getline(inFile, name, '*'); //get next name inFile >> pieces; //get next pieces } //end of loop inFile.close(); outFile.close(); return 0; }[/code]

    Read the article

  • Rails - Format number as currency format in the Getter

    - by daemonsy
    I am making a simple retail commerce solution, where there are prices in a few different models. These prices contribute to a total price. Imagine paying $0.30 more for selecting a topping for your yogurt. When I set the price field to t.decimal :price, precision:8, scale:2 The database stores 6.50 as 6.5. I know in the standard rails way, you call number_to_currency(price) to get the formatted value in the Views. I need to programmatically call the price field as well formatted string, i.e. $6.50 a few places that are not directly part of the View. Also, my needs are simple (no currency conversion etc), I prefer to have the price formatted universally in the model without repeated calling number_to_currency in views. Is there a good way I can modify my getter for price such that it always returns two decimal place with a dollar sign, i.e. $6.50 when it's called? Thanks in advance.

    Read the article

  • How to make columns as wide as the widest entry?

    - by Helper Method
    For a gcc cheatsheet I'm writing, I want to create a table which should describe how gcc interprets different file endings. The table I created so far is defined as follows: |====================================================================== |.c |C source code which must be preprocessed. |.i |C source code which should not be preprocessed. |.h |C header file to be turned into a precompiled header. |.s |Assembler code. |other | An object file to be fed straight into linking. Any file name with no recognized suffix is treated this way. |====================================================================== The problem I have is that the table spans the total page width, but what I want is that each column only is as wide as it's widest entry, and that the table will span only as much witdh as it needs.

    Read the article

  • This PHP/Smarty doesn't work in IE

    - by Kyle Sevenoaks
    I'm starting to get sick of IE's random problems. Page link. (Add things to the cart with the kjøp button and handlevogn) I have this little tiny code here, {foreach $cart.taxes.$currency as $tax} <div id="subTotalCaption2"><p style="width:100px;">{$tax.name_lang}:</p></div> <div id="taxAmount2"><p>{$tax.formattedAmount}</p></div> {/foreach} That's meant to display the amount of total tax for each of the items in the basket. (MVA 25%) This works in every other browser but not IE. Why? Why not? Just why? Any help at all would be very much appreciated.

    Read the article

  • How to sum properties of the objects within an array in Ruby

    - by Ernst Fitschen
    I understand that in order to sum array elements in Ruby one can use the inject method, i.e. array = [1,2,3,4,5]; puts array.inject(0, &:+) But how do I sum the properties of objects within an object array e.g. There's an array of objects and each object has a property "cash" for example. So I want to sum their cash balances into one total. Something like... array.cash.inject(0, &:+) (but this doesn't work) I realise I could probably make a new array composed only of the property cash and sum this, but I'm looking for a cleaner method if possible!

    Read the article

  • jquery outerwidth submenu items

    - by Epco
    i'm looking for a way to calculate the total width of de level 2 items and put it in the ul. I have looked at some jquery thinks like outerWidth and .lengt but can't figure it out. thanks in advance $('#menu li:has(ul) ul').each(function() <ul> <li>level 1</li> <li> <ul style="widht:??;"> <li>level 2</li> <li>level 2</li> </ul> </li> <li>level 1</li> </ul>

    Read the article

  • SQL query not taking values more than 2100

    - by user175084
    SELECT MachineID, MachineName, count(ID) as Total, sum(Size) as TotalSize FROM Files join Machines on Files.MachineID = Machines.MachineID Where Files.MachineID In(sql.Append(string.Format("@MachineId{0}", i)); group by Files.MachineID,MachineName now when the machinId count is less than 2100 the query is performed and if it machines go above 2100 an error is thrown Error: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Too many parameters were provided in this RPC request. The maximum is 2100. how do i make increase the limit or just avoid getting this error.. and put values in gridview thanks..

    Read the article

  • ModX: Selecting and outputting specific menu items using Wayfinder

    - by Staffan Estberg
    tI've been trying to output specific menu items, also wanting to change the names of some, without satisfying results. The problem is that I have three different menu setups throughout the site - the header split into two sections and the footer divided into a couple of columns. This is what I've tried so far - [[Wayfinder? &startId=0 &level=1 &limit=5 &excludeDocs=49,61,55]] While it works excluding all the other links isn's the most optimal solution as there are 11 in total plus I want to be able to 1. rearrange the order and 2. change the names of two of them. Is this possible at all using the Wayfinder or do I have to create a snippet? Thanks in advance.

    Read the article

  • How do I set up Scala plugin for NetBeans to copy the Scala runtime library?

    - by Alexey Romanov
    Versions: NetBeans 6.8, Scala Kit 0.16.1 When I compile my project, I get the following output: init: deps-jar: Compiling 2 source files to F:\MyProgramming\NorvigSpellChecker\build\classes compile: Created dir: F:\MyProgramming\NorvigSpellChecker\dist Building jar: F:\MyProgramming\NorvigSpellChecker\dist\NorvigSpellChecker.jar Not copying the libraries. To run this application from the command line without Ant, try: java -jar "F:\MyProgramming\NorvigSpellChecker\dist\NorvigSpellChecker.jar" jar: BUILD SUCCESSFUL (total time: 3 seconds) Of course, the libraries should be copied, so I can't actually run it by using this command line. I don't see any options to copy the library in the project configuration. The plugin uses Ant for building, but I don't have any experience with it; presumably it should be easy enough to tell Ant to copy the libraries. Here is build-impl.xml, what should I do in build.xml?

    Read the article

  • Does this Maven plugin really have an invalid descriptor?

    - by ovr
    COMMAND: mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate -DarchetypeGroupId=org.beardedgeeks -DarchetypeArtifactId =gae-eclipse-maven-archetype -DarchetypeVersion=1.1.2 -DarchetypeRepository=http://beardedgeeks.googlecode.com/svn/repository/release s OUTPUT: [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Internal error in the plugin manager getting plugin 'org.apache.maven.plugins:maven-archetype-plugin': Plugin 'org.apache.maven .plugins:maven-archetype-plugin:2.0-alpha-4' has an invalid descriptor: 1) Plugin's descriptor contains the wrong group ID: net.kindleit 2) Plugin's descriptor contains the wrong artifact ID: maven-gae-plugin 3) Plugin's descriptor contains the wrong version: 0.5.9 [INFO] ------------------------------------------------------------------------ [INFO] For more information, run Maven with the -e switch [INFO] ------------------------------------------------------------------------ [INFO] Total time: < 1 second [INFO] Finished at: Wed Jun 09 20:48:35 CEST 2010 [INFO] Final Memory: 3M/15M [INFO] ------------------------------------------------------------------------ I have a hard time believing this Maven plugin has an invalid descriptor since other people seem to be using it with no problem. Am I doing something wrong?

    Read the article

  • Forbid GridView to load all views at once

    - by efpies
    I have about 700 items to display in the grid view. On a Samsung Galaxy Tab 10.1 this is not a problem: it has enough memory. On a HTC Explorer the heap is overflown. So I want to load data dynamically regarding current scroll position (N rows for screen + 5 rows as a tail). And I want to show a scrollbar which represents the position in total rows. But I don't want to draw items that I don't see. In other words, I want to create something similar to UITableView in iOS. How can I do this?

    Read the article

  • Odd optimization problem under MSVC

    - by Goz
    I've seen this blog: http://igoro.com/archive/gallery-of-processor-cache-effects/ The "weirdness" in part 7 is what caught my interest. My first thought was "Thats just C# being weird". Its not I wrote the following C++ code. volatile int* p = (volatile int*)_aligned_malloc( sizeof( int ) * 8, 64 ); memset( (void*)p, 0, sizeof( int ) * 8 ); double dStart = t.GetTime(); for (int i = 0; i < 200000000; i++) { //p[0]++;p[1]++;p[2]++;p[3]++; // Option 1 //p[0]++;p[2]++;p[4]++;p[6]++; // Option 2 p[0]++;p[2]++; // Option 3 } double dTime = t.GetTime() - dStart; The timing I get on my 2.4 Ghz Core 2 Quad go as follows: Option 1 = ~8 cycles per loop. Option 2 = ~4 cycles per loop. Option 3 = ~6 cycles per loop. Now This is confusing. My reasoning behind the difference comes down to the cache write latency (3 cycles) on my chip and an assumption that the cache has a 128-bit write port (This is pure guess work on my part). On that basis in Option 1: It will increment p[0] (1 cycle) then increment p[2] (1 cycle) then it has to wait 1 cycle (for cache) then p[1] (1 cycle) then wait 1 cycle (for cache) then p[3] (1 cycle). Finally 2 cycles for increment and jump (Though its usually implemented as decrement and jump). This gives a total of 8 cycles. In Option 2: It can increment p[0] and p[4] in one cycle then increment p[2] and p[6] in another cycle. Then 2 cycles for subtract and jump. No waits needed on cache. Total 4 cycles. In option 3: It can increment p[0] then has to wait 2 cycles then increment p[2] then subtract and jump. The problem is if you set case 3 to increment p[0] and p[4] it STILL takes 6 cycles (which kinda blows my 128-bit read/write port out of the water). So ... can anyone tell me what the hell is going on here? Why DOES case 3 take longer? Also I'd love to know what I've got wrong in my thinking above, as i obviously have something wrong! Any ideas would be much appreciated! :) It'd also be interesting to see how GCC or any other compiler copes with it as well! Edit: Jerry Coffin's idea gave me some thoughts. I've done some more tests (on a different machine so forgive the change in timings) with and without nops and with different counts of nops case 2 - 0.46 00401ABD jne (401AB0h) 0 nops - 0.68 00401AB7 jne (401AB0h) 1 nop - 0.61 00401AB8 jne (401AB0h) 2 nops - 0.636 00401AB9 jne (401AB0h) 3 nops - 0.632 00401ABA jne (401AB0h) 4 nops - 0.66 00401ABB jne (401AB0h) 5 nops - 0.52 00401ABC jne (401AB0h) 6 nops - 0.46 00401ABD jne (401AB0h) 7 nops - 0.46 00401ABE jne (401AB0h) 8 nops - 0.46 00401ABF jne (401AB0h) 9 nops - 0.55 00401AC0 jne (401AB0h) I've included the jump statetements so you can see that the source and destination are in one cache line. You can also see that we start to get a difference when we are 13 bytes or more apart. Until we hit 16 ... then it all goes wrong. So Jerry isn't right (though his suggestion DOES help a bit), however something IS going on. I'm more and more intrigued to try and figure out what it is now. It does appear to be more some sort of memory alignment oddity rather than some sort of instruction throughput oddity. Anyone want to explain this for an inquisitive mind? :D Edit 3: Interjay has a point on the unrolling that blows the previous edit out of the water. With an unrolled loop the performance does not improve. You need to add a nop in to make the gap between jump source and destination the same as for my good nop count above. Performance still sucks. Its interesting that I need 6 nops to improve performance though. I wonder how many nops the processor can issue per cycle? If its 3 then that account for the cache write latency ... But, if thats it, why is the latency occurring? Curiouser and curiouser ...

    Read the article

  • Flex 3 multiple upload progress monitoring

    - by Darko Z
    I have a Flex3 application which has to be capable of uploading multiple files and monitoring each files individual progress using a label NOT a progress bar. My problem is that a generic progress handler for the uploads has no way (that I know of) of indicating WHICH upload it is that is progressing. I know that a file name is available to check but in the case of this app the file name might be the same for multiple uploads. My question: With a generic progress handler how does one differentiate between 2 multiple uploads with the same file name? EDIT: answerers may assume that I am a total newb to Flex... because I am.

    Read the article

  • Exception handling in Linq to SQL for customers without orders

    - by stackoverflowuser
    I have the following code to retrieve customer name, total (orders ), sum (order details) for reach customer in Northwind database. The problem with below code is that it raises an exception since a few customers dont have any entry in orders table. I know using the query syntax (join) the exception can be avoided. I want to know if the same can be handled with the extension method syntax. var customerOrders = db.Customers .Select(c => new { CompanyName = c.CompanyName, TotalOrders = c.Orders.Count(), TotalQuantity = c.Orders .SelectMany(o => o.Order_Details).Sum(o=>o.Quantity) });

    Read the article

  • mod_perl memory leak

    - by marghi
    Hello, I recently discovered that one of our sites has a memory leak in it, it's very strange because it happened all of the sudden. I've used GTop to measure the memory size per process and it tells me that the real value is somewhere around 65 MB (on the server) per request and and additional 5 MB shared. I tried preloading the modules in the startup.pl file a indicated in the performance tuning article for mod_perl. Nothing happened if fact the shared memory decreased down to 3.7 MB, in this situation I thought that my application is leaking memory do before any line of code got executed I measured the memory just to find out that the total value is in fact 64 MB, my questions are: Is there a default preallocation of memory for each process? Is there a configuration issue? Is mod_perl leaking memory ? Thank you very much.

    Read the article

  • Using polyfit to predict where the object falls ?

    - by ZaZu
    Hi there, I have information of an object being thrown at a parabolic pattern. There are 30 images in total taken at specific intervals from the start position till the end. Now I have managed to extract the x,y coordinates of the object being thrown in all 30 images... I think that using polyfit (or maybe polyval ? ) may help me predict where the object will fall after the first 15 images ... I just want to know, how can polyfit be used with the 30 x,y coordinates I have ? ( I have a loop to extract each image from a mat file 1 row at a time until 30 .. and then plot that image .. so should I use polyfit in the same loop before/after the plot ??? Any ideas ?? Thanks !

    Read the article

  • How to make the height of two side-by-side elements extend to the remaining browser height?

    - by LedZeppelin
    In this example, http://jsfiddle.net/mnXH9/, the height of the content-display element and the height of the nav-menu-container are fixed. How do I make the height of the content-display and nav-menu-container elements extend to the remaining height of the browser window as the browser height is being adjusted by a user provided the height in the browser window is greater than 400px (The height of the header plus the nav-menu-container)? I would like for the scrollbar to be inside the nav-menu-content element if the total height in the browser is greater than the sum of the height of the header (100px) and the nav-menu-container element (300px). If the browser window's height is less than 400px then a scrollbar would appear in the browser window to allow scrolling throughout the 100px header and the 300px min-height of the below elements. EDIT Attached are photoshopped mockups of what the jsfiddle should look like. tab 1 when the browser height is less than 400px tab 1 when the browser height is greater than 400px tab 2 when the browser height is less than 400px tab 2 when the browser height is greater than 400px

    Read the article

  • Visual Studio 2008 profiler analysis - missing time

    - by Scott Vercuski
    I ran the Visual Studio 2008 profiler against my ASP.NET application and came up with the following result set. CURRENT FUNCTION TIME (msec) ---------------------------------------------------|-------------- Data.GetItem(params) | 10,158.12 ---------------------------------------------------|-------------- Functions that were called by Data.GetItem(params) TIME (msec) ---------------------------------------------------|-------------- Model.GetSubItem(params) | 0.83 Model.GetSubItem2(params) | 0.77 Model.GetSubItem3(params) | 0.76 etc. The issue I'm facing is that the sum of the Functions called by Data.GetItem(params) do not sum up to the 10,158.12 msec total. This would lead me to believe that the bulk of the time is actually spent executing the code within that method. My question is ... does Visual Studio provide a way to analyze the method itself so I can see which sections of code are taking the longest? if it does not are there any recommended tools to do this? or should I start writing my own timing scripts? Thank you

    Read the article

  • use callback function to report stack backtrace

    - by user353394
    Assume I have the following: typedef struct { char *name; char binding; int address; } Fn_Symbol //definition of function symbol static Fn_Symbol *fnSymbols; //array of function symbols in a file statc int total; //number of symbol functions in the array and file static void PrintBacktrace(int sigum, siginfo_t * siginfo, void *context) { printf("\nSignal received %d (%s)\n", signum, strsignal(signum)); const int eip_index = 14; void *eip = (void *)((struct ucontext *)context)->uc_mcontext.gregs[eip_index]; printf("Error at [%p] %s (+0x%x), eip, fnName, offset from start); //????? exit(0); } I have this so far, but what is the best way using the fnSymbols static global pointer to identify the function where the error occured and then back trace through the stack to identify each calling function by address, name, and offset?

    Read the article

< Previous Page | 140 141 142 143 144 145 146 147 148 149 150 151  | Next Page >