Search Results

Search found 5133 results on 206 pages for 'max krug'.

Page 141/206 | < Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >

  • How to speed this kind of for-loop?

    - by wok
    I would like to compute the maximum of translated images along the direction of a given axis. I know about ordfilt2, however I would like to avoid using the Image Processing Toolbox. So here is the code I have so far: imInput = imread('tire.tif'); n = 10; imMax = imInput(:, n:end); for i = 1:(n-1) imMax = max(imMax, imInput(:, i:end-(n-i))); end Is it possible to avoid using a for-loop in order to speed the computation up, and, if so, how?

    Read the article

  • HTML J2ME Problem

    - by Hesham
    i'm trying to put large amount of data in a java me application for a BlackBerry mobile and i noticed that the max file size to be accepted in BlackBerry is 150 KB, by the way i'm developping the application in arabic language so i'm converting every litter to his corresponding unicode so every char gets to 6 chars so its another big problem, some ppl told me that i can write arabic as arabic letters without the need to write its unicode, by viewing the mobile form as an html page, my problem is that i dont know how to view the page as html page and what is XMLParser ?? can anyone help me to get all this together, cos i really need some serious help thank you alot Hesham

    Read the article

  • Broken count(*) after adding LEFT JOIN

    - by Iain Urquhart
    Since adding the LEFT JOIN to the query below, the count(*) has been returning some strange values, it seems to have added the total rows returned in the query to the 'level': SELECT `n`.*, exp_channel_titles.*, round((`n`.`rgt` - `n`.`lft` - 1) / 2, 0) AS childs, count(*) - 1 + (`n`.`lft` > 1) + 1 AS level, ((min(`p`.`rgt`) - `n`.`rgt` - (`n`.`lft` > 1)) / 2) > 0 AS lower, (((`n`.`lft` - max(`p`.`lft`) > 1))) AS upper FROM `exp_node_tree_6` `n` LEFT JOIN `exp_channel_titles` ON (`n`.`entry_id`=`exp_channel_titles`.`entry_id`), `exp_node_tree_6` `p`, `exp_node_tree_6` WHERE `n`.`lft` BETWEEN `p`.`lft` AND `p`.`rgt` AND ( `p`.`node_id` != `n`.`node_id` OR `n`.`lft` = 1 ) GROUP BY `n`.`node_id` ORDER BY `n`.`lft` I'm totally stumped... Thank you!

    Read the article

  • C/C++ memory usage API in Linux/Windows

    - by minjang
    I'd like to obtain memory usage information for both per process and system wide. In Windows, it's pretty easy. GetProcessMemoryInfo and GlobalMemoryStatusEx do these jobs greatly and very easily. For example, GetProcessMemoryInfo gives "PeakWorkingSetSize" of the given process. GlobalMemoryStatusEx returns system wide available memory. However, I need to do it on Linux. I'm trying to find Linux system APIs that are equivalent GetProcessMemoryInfo and GlobalMemoryStatusEx. I found 'getrusage'. However, max 'ru_maxrss' (resident set size) in struct rusage is just zero, which is not implemented. Also, I have no idea to get system-wide free memory. Current workaround for it, I'm using "system("ps -p %my_pid -o vsz,rsz");". Manually logging to the file. But, it's dirty and not convenient to process the data. I'd like to know some fancy Linux APIs for this purpose.

    Read the article

  • Even lighter than SQLite

    - by Richard Fabian
    I've been looking for a C++ SQL library implementation that is simple to hook in like SQLite, but faster and smaller. My projects are in games development and there's definitely a cutoff point between needing to pass the ACID test and wanting some extreme performance. I'm willing to move away from SQL string style queries, allowing it to be code driven, but I haven't found anything out there that provides SQL like flexibility while also preferring performance over the ACID test. I don't want to go reinventing the wheel, and the idea of implementing an SQL library on my own is quite daunting, even if it's only going to be simple subset of all the calls you could make. I need the basic commands (SELECT, MODIFY, DELETE, INSERT, with JOIN, and WHERE), not data operations (like sorting, min, max, count) and don't need the database to be atomic, or even enforce consistency (I can use a real SQL service while I'm testing and debugging).

    Read the article

  • Two way binding when setter is overriden

    - by Nicolas Goy
    I have an NSTextField bound to some object "zoom" property. In this object's class implementation, I have the following - (void)setZoom:(CGFloat)zoom { _zoom = MAX(0, MIN(10, zoom)); } If I write "-5" in the textfield, setZoom: will be called with "-5" as argument and _zoom will be set to 0. Then problem is that the textfield is not updating itself and it shows "-5" instead of re-reading the property value it has just set. If I do myObject.zoom = -5; in code, the text field will display 0 correctly. I tried to wrap _zoom =... inside willChangeValueForKey/didChangeValueForKey calls but it didn't change anything.

    Read the article

  • Which file types are worth compressing (zipping) for remote storage? For which of them the compresse

    - by user193655
    I am storing documents in sql server in varbinary(max) fileds, I use filestream optionally when a user has: (DB_Size + Docs_Size) ~> 0.8 * ExpressEdition_Max_DB_Size I am currently zipping all the files, anyway this is done because the Document Read/Write work was developed 10 years ago where Storage was more expensive than now. Many files when zipped are almost as big as the original (a zipped pdf is about 95% of original size). And anyway unzipping has some overhead, that becomes twice when I need also to "Check-in"/Update the file because I need to zip it. So I was thinking of giving to the users the option to choose whether the file type will be zipped or not by providing some meaningful default values. For my experience I would impose the following rules: 1) zip by default: txt, bmp, rtf 2) do not zip by default: jpg, jpeg, Microsoft Office files, Open Office files, png, tif, tiff Could you suggest other file types chosen among the most common or comment on the ones I listed here?

    Read the article

  • Mysql Limit column value repetition N times

    - by Paper-bat
    Hi at all, is my first question here, so be patient ^^ I'll go directly to problem, I have two table Customer (idCustomer, ecc.. ecc..) Comment (idCustomer, idComment, ecc.. ecc..) obviosly the two table are joined togheter, for example SELECT * FROM Comment AS co JOIN Customer AS cu ON cu.idCustomer = co.idCustomer With this I select all comment from that table associated with is Customer, but now I wanna limit the number of Comment by 2 max Comment per Customer. The first thing I see is to use 'GROUP BY cu.idCustomer' but it limit only 1 Comment per Customer, but I wanna 2 Comment per Customer.. how now to proceed?

    Read the article

  • Spring 3.0 REST implementation or Jersey?

    - by hnilsen
    Hi, SO! I'm currently trying to figure out which implementation of JSR-311 I'm going to recommend further up the food chain. I've pretty much narrowed it down to two options - Spring 3.0 with it's native support for REST - or use Sun's own Jersey (Restlets might also be an option). To me it doesn't seem to be much of a difference in the actual syntax, but there might be issues with performance that I haven't figured out yet. The service is meant to replace some heavy-duty EJB's and make a RESTful Webservice instead. The load is expected to be rather high, up in the 100k users per day (max) range, but will be seriously load balanced. Thanks for all your insights.

    Read the article

  • How to find the entity with the greatest primary key?

    - by simpatico
    I've an entity LearningUnit that has an int primary key. Actually, it has nothing more. Entity Concept has the following relationship with it: @ManyToOne @Size(min=1,max=7) private LearningUnit learningUnit; In a constructor of Concept I need to retrieve the LearningUnit with the greatest primary key. If no LearningUnit exists yet I instantiate one. I then set this.learningUnit to the retrieved/instantied. Finally, I call the empty constructor of Concept in a try-catch block, to have the entitymanager do the cardinality check. If an exception is thrown (I expect one in the case that already another 7 Concepts are referring to the same LearningUnit. In that case, I case instantiate a new LearningUnit with a new greater primary key. Please, also point out, if any, clear pitfalls in my outlined algorithm above.

    Read the article

  • Magento "File was not uploaded"

    - by John
    I'm currently using the magento admin interface, trying to upload an image in the "manage products" and I get the error "file was not uploaded" after I browse the file and click "upload file". I've looked on other forums and the main solution I saw were to make sure that php.ini has the following lines... magic_quotes_gpc = off short_open_tag = on extension=pdo.so extension=pdo_mysql.so I have Windows/IIS with ISAPI_Rewrite. Is there a max file upload size that I can change somewhere. I'm uploading pictures from my local desktop of size ~100kb. help!

    Read the article

  • Finding number of different paths

    - by peiska
    I have a game that one player X wants to pass a ball to player Y, but he can be playing with more than one player and the others players can pass the ball to Y. I want to know how many different paths can the ball take from X to Y? for example if he is playing with 3 players there are 5 different paths, 4 players 16 paths, if he is playing with 20 players there are 330665665962404000 paths, and 40 players 55447192200369381342665835466328897344361743780 that the ball can take. the number max. of players that he can play with is 500. I was thinking in using Catalan Numbers? do you think is a correct approach to solve this? Can you give me some tips.

    Read the article

  • Microphone input

    - by George
    I'm trying to build a gadget that detects pistol shots using Android. It's a part of a training aid for pistol shooters that tells how the shots are distributed in time and I use a HTC Tattoo for testing. I use the MediaRecorder and its getMaxAmplitude method to get the highest amplitude during the last 1/100 s but it does not work as expected; speech gives me values from getMaxAmplitude in the range from 0 to about 25000 while the pistol shots (or shouting!) only reaches about 15000. With a sampling frequency of 8kHz there should be some samples with considerably high level. Anyone who knows how these things work? Are there filters that are applied before registering the max amplitude. If so, is it hardware or software? Thanks, /George

    Read the article

  • Monitoring Log Shipped Databases

    - by Registered User
    I need a consistent way to monitor databases that are read-only log shipped copies of production databases. In the past I have relied on the following methods: Set the job that restores logs to the database kick off another job as its last step. Set the job that restores logs to the database to insert a record in a control table as its last step. Query the msdb database to check the status of the job that restores logs to the database. Query a control table inside the database itself that gets a value immediately before transaction logs are backed up. Query MAX values from tables inside the database to see if it has recent changes. Although the above methods work, they can't be implemented for every log shipped database that I query for various reasons. What is the best method for monitoring the "data as of" date for a log shipped database?

    Read the article

  • HTML img scaling

    - by rwallace
    I'm trying to display some large images with HTML img tags. At the moment they go off the edge of the screen; how can I scale them to stay within the browser window? Or in the likely event that this is not possible, is it possible to at least say "display this image at 50% of its normal width and height"? The width and height attributes distort the image -- as far as I can tell, this is because they refer to whatever attributes the container may end up with, which will be unrelated to the image. I can't specify pixels because I have to deal with a large collection of images each with a different pixel size. Max-width doesn't work.

    Read the article

  • JSF validateLength question

    - by user337515
    I have a input field with validation to validate the max and min length <h:inputText id="LABEL_ID" styleClass="textboxsmall" value="#{sampleDatatableBean.accessionLabelId}" maxlength="5"> <f:validateLength minimum="4" maximum="5" /> </h:inputText> <br/><h:message id="LABEL_ID_MSG" styleClass="errorMessage" for="LABEL_ID" /> It validates but I get the below message: "Value is less than allowable minimum of {0}" Shouldn't {0} be replaced by value from minimum? Not sure why its not picking up the value. Any ideas? Version info: <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd"> <tlib-version>1.0</tlib-version> <jsp-version>1.2</jsp-version>

    Read the article

  • Display only latest three results from PHP and MySQL

    - by nogggin1
    <?php $result = @mysql_query('SELECT Article FROM news WHERE ID = (SELECT MAX(ID) FROM News)'); if (!$result) { die('<p>Error performing query: ' . mysql_error() . '</p>'); } while ( $row = mysql_fetch_array($result) ) { echo('<p>' . $row['Article'] . '</p>'); } ?> basically i need to tweak this so that it shows the latest 3 results instead of just the latest one, also i need the order to be: newest 2nd newest 3rd newest any help would be greatly appreciated!

    Read the article

  • Question About id and Delegate Usage in Obj-C

    - by Stunner
    Ey guys, I am wondering what the following line of code is doing: @property (assign, nonatomic) id <CoursePlannerDelegate> delegate; Namely I am wondering about this portion of the line: id <CoursePlannerDelegate> delegate; It also shows up in other places: @interface CategoryAddViewController : UIViewController { UITextField *nameField, *weightField; double maxWeight; //The maximum weight that can be allocated to this Category (max value of 100) id <CategoryAddDelegate> delegate; //A Course Planner TVC } Any help appreciated, thanks in advance!

    Read the article

  • facebook login button not rendering

    - by Neha
    Hi I am developing a widget that will be placed on an external website. The entire plugin has to be written in javascript. I haev searched here and there but am unable to make the facebook login button appear on the widget My code is the following var fbroot = document.createElement('div'); fbroot.id = "fb-root"; window.fbAsyncInit = function(){ FB.init('xxxxxxxxxxxxxxxxxx', '/xd_receiver.htm'); }; var contentRightDiv = document.createElement('div'); contentRightDiv.id = "contentrightdiv"; contentRightDiv.innerHTML = "<form><p><label>Sign in using <div id='socialmedialoginbtns'></div></label></p></form>"; var socialmedialoginbtns = document.getElementById('socialmedialoginbtns'); socialmedialoginbtns.innerHTML = '<fb:login-button show-faces="false" width="200" max-rows="1"></fb:login-button>';

    Read the article

  • LIMIT amount of rows fetched by JOIN

    - by user892134
    How do i LIMIT the child rows fetched to only 5? Here is the SQLfiddle http://sqlfiddle.com/#!2/bd96a/2. Right now it fetches all rows with parentid='4' and parentid='14'. It should only fetch 5 of each parentid. Assuming i have hundreds of rows, it should only fetch a max of 5 for each parentid. "SELECT child.* FROM mytable as parent LEFT JOIN mytable as child on child.parentid=parent.id WHERE parent.pageid IN ( 1, 2) AND parent.submittype='1' ORDER BY child.id ASC"; How do i solve this?

    Read the article

  • How to set per-script upload_max_filesize limit?

    - by Ilya Muromets
    I have the following issue: How to set per-script upload_max_filesize limit? I want to set a larger upload max filesize limit for a particular script (action). I know I could use .htaccess, but the problem is that all actions are being dispatched via single index.php file, which likely means for all actions .htaccess rules are the same. So is it possible to set a per-script max_upload_size for a single php script (action)? Hope, you will be able to help me. Thanks in advance.

    Read the article

  • Java Web Server with Jetty - TCP Connections Taking Long

    - by daysleeper
    I have an application with fairly high traffic (20K req/min) running on the JVM with a Jetty servlet container on Ubuntu. Below is my Jetty configuration: 10 20 2000 2 When I analyze the network traffic, I realize that sometimes it is taking long to establish TCP connections on the port that Jetty is running. The long connections are varying between 3.0s and 9.0s. The port is configured to accept MAX number of TCP connections. Do you know what might be causing the delay in accepting connections? Thanks

    Read the article

  • What are good uses for Python3's "Function Annotations"

    - by agscala
    Function Annotations: PEP-3107 I ran across a snippet of code demonstrating Python3's function annotations. The concept is simple but I can't think of why these were implemented in Python3 or any good uses for them. Perhaps SO can enlighten me? How it works: def foo(a: 'x', b: 5 + 6, c: list) -> max(2, 9): ... function body ... Everything following the colon after an argument is an 'annotation', and the information following the -> is an annotation for the function's return value. foo.func_annotations would return a dictionary: {'a': 'x', 'b': 11, 'c': list, 'return': 9} What's the significance of having this available?

    Read the article

  • LINQ to SQL auto-generated type for stored procedure

    - by StuffHappens
    Hello. I have the following stored procedure ALTER PROCEDURE [dbo].Test AS BEGIN CREATE TABLE ##table ( ID1 int, ID2 int ) DECLARE @query varchar(MAX); INSERT INTO ##table VALUES(1, 1); SELECT * FROM ##table; END And I try to use it from C# code. I use LINQ to SQL as an O/RM. When I add the procedure to DataBaseContext it says that it can't figure out the return value of this procedure. How to modify the stored procedure so that I can use it with LINQ to SQL. Note: I need to have global template table!

    Read the article

  • Create a complex SQL query?

    - by mazzzzz
    Hey guys, I have a program that allows me to run queries against a large database. I have two tables that are important right now, Deposits and withdraws. Each contains a history of every user. I need to take each table, add up every deposit and withdraws (per user), then subtract the withdraws from the deposits. I then need to return every user whos result is negative (aka they withdrew more then they deposited). Is this possible in one query? Example: Deposit Table: |ID|UserName|Amount| |1 | Use1 |100.00| |2 | Use1 |50.00 | |3 | Use2 |25.00 | |4 | Use1 | 5.00 | WithDraw Table: |ID|UserName|Amount| |2 | Use2 | 5.00 | |1 | Use1 |100.00| |4 | Use1 | 5.00 | |3 | Use2 |25.00 | So then the result would output: |OverWithdrawers| | Use2 | Is this possible (I sure don't know how to do it)? Thanks for any help, Max

    Read the article

< Previous Page | 137 138 139 140 141 142 143 144 145 146 147 148  | Next Page >