Search Results

Search found 887 results on 36 pages for 'grey peak'.

Page 20/36 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • submit a form and get json response

    - by ruhit
    I have made an application to convert text to image formate and its workingout well. Now I want json response when i fill the form of the html page, my html page is given below...Please help me to do this <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en"> <head> <title>kandarpa</title> </head> <div> <form action="img.php" method="get"><b>enter your text here:</b><br/> <textarea id="text" name="text" style=" background-color:inherit" cols="50" rows="10"></textarea><br/><br/> <input type="submit" value="Text to Image" name="submit"> </div><br/> <div> <tr> <td>Font Size</td> <td><select name="size"> <option value="8">8</option> <option value="12">12</option> <option value="18">18</option> <option value="24">24</option> <option value="32" selected="selected">32</option> <option value="48">48</option> <option value="64">64</option> </select></td> </tr> </div><br/> <div> <td>Font </td> <td><select name="font" id="font"> <option value="Fonts/arial.ttf">Arial</option> <option value="Fonts/times.ttf">Times New Roman</option> <option value="Fonts/tahoma.ttf">Tahoma</option> <option value="Fonts/Grand Stylus.ttf">Grand Stylus</option> <option value="Fonts/GARAIT.ttf">G</option> </select></td> </tr> </div><br/> <div> <td>Choose your Color </td> <td><select name="color" id="color"> <option value="white">white</option> <option value="black">black</option> <option value="grey">grey</option> <option value="red">red</option> </select></td> </tr> </div> <br/> <div> <td>Height </td> <input type="text" id="height" name="height"> </td><br/><br/> <td>Width</td> <input type="text" id="width" name="width"> </div> </form> </body> </html>

    Read the article

  • Why isn't the inline element inheriting height from its children?

    - by jbarz
    I'm trying to make a rather complicated grid of images and information (almost like Pinterest). Specifically, I'm trying to inline position one set of <ul>s right after another. I have it working but one aspect is causing issues so I'm trying to ask about this small piece to avoid the complication of the whole problem. In order to horizontally align the images and their information we are using inline <li>s with other inline-block level elements inside of them. Everything works correctly for the most part except that the <li>s have almost no height. HTML and CSS is in JSFiddle here if you want to mess with it in addition to below: HTML: <div> <ul class="Container"> <li> <span class="Item"> <a href="#"><img src="http://jsfiddle.net/img/logo.png"/></a> <span class="Info"> <a href="#">Title One</a> <span class="Details">One Point One</span> </span> </span> </li> <li> <span class="Item"> <a href="#"><img src="http://jsfiddle.net/img/logo.png"/></a> <span class="Info"> <a href="#">Title Two</a> <span class="Details">Two Point One</span> </span> </span> </li> </ul> CSS: .Container { list-style-type:none; } .Container li { background-color:grey; display:inline; text-align:center; } .Container li .Item { border:solid 2px #ccc; display:inline-block; min-height:50px; vertical-align:top; width:170px; } .Container li .Item .Info { display:inline-block; } .Container li .Item .Info a { display:inline-block; width:160px; } If you check out the result in the jsfiddle link you can see that the grey background only encompasses a small strip of the whole <li>. I know that changing the <li> to display:inline-block solves this problem but that isn't feasible for other reasons. So first of all, I'm just looking to see if anyone understands why the inline <li> element doesn't have any height. I can't find anything in the spec that explains this. I know I can't add height to an inline element but any explanation as to why this is happening that might enable me to fix would be great. Secondly, if you inspect the elements using IE's Developer Mode you will see that although the background color is in the correct location, the actual location of the <li>'s bounding box is at the bottom of the container according to hovering over the element. I could deal with this problem if it was at the top in every browser but it apparently varies. NOTE: I don't really care about older browsers in this case but I don't use HTML5 or JavaScript positioning. Thanks.

    Read the article

  • Slow draw on some apps and dynamic clocks not working properly with ATI/AMD proprietary drivers

    - by Rakeka
    I've recently purchased a new computer (around July 2010) and I've been having some problems with proprietary video drivers on Linux. The hardware is: Video: ATI/AMD Radeon HD 5870 (XFX HD-587X-ZNFC); Motherboard: Asus P7P55D-E Deluxe; Processor: Intel i5 750; Memory: Kingston Hyperx KHX1600C8D3K2/4GX (2x - 8GB Total); Power Supply: XFX P1-750B-CAG9; There are no overclocks, not even the memories (they are at 1333mhz due processor memory controller limitation). The operational system is a homebrew Linux distribution with the following software: Architecture: x86_64 (multilib) Kernel: 2.6.35.10 Xorg: 7.5 Window Manager: wmii-3.9.2 Video Driver: ATI/AMD Catalyst 10.12 There are no desktop effects programs like compiz fusion or beryl. The problems: With ATI/AMD proprietary driver, some applications are with slow draw/redraw, and, the same applications make the driver to increase the card clocks to maximum (0% gpu activity, only the clocks are increased). I dunno exactly how to describe the slow draw but I'll list some applications and symptoms. xterm Flickers a lot when drawing continuous output; When I'm in a workspace with fullscreen xterm, The gpu load stays at 12% in idle, and, with smaller xterm, smaller GPU load. "aticonfig --odgc" output: Default Adapter - ATI Radeon HD 5800 Series Core (MHz) Memory (MHz) Current Clocks : 157 300 Current Peak : 850 1200 Configurable Peak Range : [600-900] [900-1300] GPU load : 12% "aticonfig --pplib-cmd 'get activity'" output: Current Activity is Core Clock: 157MHZ Memory Clock: 300MHZ VDDC: 950 Activity: 12 percent Performance Level: 0 Bus Speed: 5000 Bus Lanes: 16 Maximum Bus Lanes: 16 More examples: mplayer time info flickers on terminal; "find /" flickers a lot (It takes some time to stop with control-c. But, If I change the workspace or put some window upon it, just after the control-c, it stops instantly); "cat somefile" if the file is big (Xorg.0.log for example) it takes some time to display; vim and less (ex: find / | less) don't have much problems, just a little flicker when scrolling; mplayer (no gui) Slow reproduction and seek with -vo x11; Tearing with -vo xv; Time info flickers on terminal (xterm consequence); gvim A little slow draw when scrolling with page up/page down; Firefox Slow draw/redraw on some pages like www.boadica.com.br and sometimes on www.youtube.com with flash enable (never noticed on many pages); Corruptions when informative yellow boxes are showing and scroll the page (an gray box appears at the same place of the informative box); "Wallpaper" After minimizing a fullscreen window or changing to an empty workspace it takes some time to redraw wallpaper. "Video Card" The core and memory clocks are increased with the events described above and on other situations like change workspace (even without wallpaper), minimize, maximize or move a window; Idle clocks: Core: 157mhz, Memory: 300mhz Full clocks: Core: 850mhz, Memory: 1200mhz xpdf Painful slow scrolling; display (from ImageMagick) Slow menus and sometimes slow image redraw; Programs that I use and are apparently without problems: gimp; pidgin; mplayer (-vo gl, gl2); blender; unigine heaven (better fps than on Windows); doom3; tibia; penumbra overture; amnesia the dark descent (wine); diablo 2 (wine); No problems on Windows (Windows 7 Ultimate 64bit). And special note to this: Full desktop effects from Debian and Ubuntu gnome appearance cpanel don't cause ANY problems, even the core and memory clocks don't increase when change workspace, minimize, maximize or move a window. What I've tested: Unsuccessful tests: Tested all drivers versions since 10.6 (released approximately when I've installed the first slackware in this PC); Tested other video card - ATI/AMD Radeon HD 5570 (XFX HD-557X-ZHF2); Tested some options on xorg.conf and that I've found googling (some of these options are commented on my xorg.conf. I'll send the links at the end of post); Tested some patches like 107_fedora_dont_fill_bg_none.patch and xserver-xorg-backclear.patch from Arch Linux Catalyst page (https://wiki.archlinux.org/index.php/ATI_Catalyst); Tested other distros and software versions: Tested XORG-7.6 on my own distribution; Tested Debian Squeeze (testing - from 2010-12-20); Tested Ubuntu Marverick (10.10); Tested Slackware 13.1; Distros info: Architecture: i386 Debian and Ubuntu with all default software (kernel, gnome, xorg, drivers); Slackware with Catalyst from AMD page and default window managers like: fvwm, xfce, and my own build of wmii; Successful tests: Tested other video card (only on my homebrew distro) - NVIDIA Geforce 7300GS with driver 260.19.29; That didn't shown the slow draw problems, but that card is a bit obsolete, so, dunno if that lacks features like the dynamic clocks. I don't dispose of other video cards like nvidia g/gt/gts/gtx 200~400~500 or Radeon HD 3000/4000/6000 to make more tests. Tested other hardware: Video: ATI/AMD Radeon HD 5570 (XFX HD-557X-ZHF2); Motherboard: Intel DG31PR; Processor: Core 2 Duo E6750; Software for that hardware: Fresh install of same distros (except for the mine) with same program versions; That video card (HD 5570) were full time at the maximum clocks (something like 500/750, don't remember) in all the operational systems (Windows XP and Windows 7 too), but it didn't shown the same problems that I have here. I've googled a lot about common problems with ATI/AMD proprietary drivers for Linux and didn't find similar problems, except by the Firefox corruptions, that the solutions were to disable ATI Direct2DAccel and use XAA. With XAA the problems persists and the other applications like pidgin and rest of Firefox showed the same problems of slow draw/redraw. Open source Drivers: With open source drivers (xf86-video-ati-6.13.2) I hadn't the same slow draw problems, but, had other problems, that, for now, make it no viable solution. I'll not discuss it here because this is another line of problems and will confuse everything. If it happens to be the only solution, I'll make another thread to discuss it. Logs and Configs: kernel .config dmesg xorg package list xorg.conf Xorg.0.log

    Read the article

  • Alternative to distributed caching

    - by Chen
    Hi, There is a technical requirement to scale a new system easily. This new system consists of three tiered applications (as a batch processors). Each tier will contains at least 2 servers with the same application resides on each server. So, when one of the tier reaches peak performance, we could extend the scalability easily by adding a new server and the same application to off-load some of the processing loads. The problem is that one or two of the three tiers require heavy caching (about 3 million records and increasing). I'm thinking of using distributed caching system to overcome this problem but the new distributed caching system will means an additional point of failure as applications now need to interact with additional caching systems for processing. I'm currently looking at ncache but just wondering if there is an alternatives to this problem? or is there any other comparable distributed caching system that maybe similar or better than ncache and provide enterprise supports too? Thanks, Chen

    Read the article

  • Getting AveragePower and PeakPower for a Channel in AVAudioRecorder

    - by Biranchi
    Hi all, I am annoyed with this piece of code. I am trying to get the averagePowerForChannel and peakPowerForChannel while recording Audio, but every time i am getting it as 0.0 Below is my code for recording audio : NSMutableDictionary *recordSetting =[[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithFloat: 22050.0], AVSampleRateKey, [NSNumber numberWithInt: kAudioFormatLinearPCM], AVFormatIDKey, [NSNumber numberWithInt: 1], AVNumberOfChannelsKey, [NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey, [NSNumber numberWithInt:32],AVLinearPCMBitDepthKey, [NSNumber numberWithBool:NO],AVLinearPCMIsBigEndianKey, [NSNumber numberWithBool:NO],AVLinearPCMIsFloatKey, nil]; recorder1 = [[AVAudioRecorder alloc] initWithURL:[NSURL fileURLWithPath:audioFilePath] settings:recordSetting error:&err]; recorder1.meteringEnabled = YES; recorder1.delegate=self; [recorder1 prepareToRecord]; [recorder1 record]; levelTimer = [NSTimer scheduledTimerWithTimeInterval: 0.3f target: self selector: @selector(levelTimerCallback:) userInfo: nil repeats: YES]; - (void)levelTimerCallback:(NSTimer *)timer { [recorder1 updateMeters]; NSLog(@"Peak Power : %f , %f", [recorder1 peakPowerForChannel:0], [recorder1 peakPowerForChannel:1]); NSLog(@"Average Power : %f , %f", [recorder1 averagePowerForChannel:0], [recorder1 averagePowerForChannel:1]); } What is the error in the code ???

    Read the article

  • Performance analysis strategies

    - by Bernd
    I am assigned to a performance-tuning-debugging-troubleshooting task. Scenario: a multi-application environment running on several networked machines using databases. OS is Unix, DB is Oracle. Business logic is implemented across applications using synchronous/asynchronous communication. Applications are multi-user with several hundred call center users at peak time. User interfaces are web-based. Applications are third party, I can get access to developers and source code. I only have the production system and a functional test environment, no load test environment. Problem: bad performance! I need fast results. Management is going crazy. I got symptom examples like these: user interface actions taking minutes to complete. Seaching for a customer usually takes 6 seconds but an immediate subsequent search with same parameters may take 6 minutes. What would be your strategy for finding root causes?

    Read the article

  • Openfire scalability question XMPP Server

    - by candoyo
    Hello! Do you guys know how well openfire scales? My users will be using the application to do normal chatting like msn no file transfer for now. We will be using Amazon's EC2 server to run the chat server we would like to support over 1 Million users in total and around 30-50K active users during peak times. Since clustering is now opensource, I though Openfire might be the way to go, how much will it cost for the coherence license or can I bipass that somehow? Also, I wanted to develop plugin for Openfire if we go with it. Any pointers on how to set up a dev env and get going would be helpful too! Thanks ya'all! :)

    Read the article

  • Good way to capture/replay sessions from Apache Log?

    - by Mark Harrison
    For performance testing, I would like to capture some traffic from a production server and use that as a basis to replay the request to a test server in order to simulate a realistic load in our development environment. These are all stateless queries, so no issues regarding cookies, sessions, etc. The Apache log timestamps everything down to a 1 second resolution, but that's not fine enough granularity for our peak times. What's the best way to capture more fine-grained timestamps for replay? And is there some ab-like load generating program that can use this data to replicate load?

    Read the article

  • Histogram matching - image processing - c/c++

    - by Raj
    Hello I have two histograms. int Hist1[10] = {1,4,3,5,2,5,4,6,3,2}; int Hist1[10] = {1,4,3,15,12,15,4,6,3,2}; Hist1's distribution is of type multi-modal; Hist2's distribution is of type uni-modal with single prominent peak. My questions are Is there any way that i could determine the type of distribution programmatically? How to quantify whether these two histograms are similar/dissimilar? Thanks

    Read the article

  • mongodb read/write performance and mongo hosting in the cloud

    - by z3cko
    we are currently developing a high traffic rails application with facebooker (facebook game). since amazon simpledb (aws-sdb) is really slow, we are thinking of using a dedicated mongodb server as offered by mongoHQ for example. questions: what is the read/writes peak value for a mongodb server running on a amazon ec2 instance? what would be a recommended setup for a ec2 hosted app with mongodb - a master on amazon EBS and replicas on the ec2 instances? any examples or experiences? is there a company that offers mongodb hosting in the cloud? thanks, mz

    Read the article

  • How to find control points for a BezierSegment given Start, End, and 2 Intersection Pts in C# - AKA

    - by softwarequestioneer
    Hi, I've been struggling looking for an understandable way to do this. I have four points, a StartPt, EndPoint, and Intersection points to represent the peak and valley in the bezier. The BezierSegment in C# requires start, controlPoint 1, controlPoint 2, endpoint - however I don't have any control points I only have these two points that lie along the bezier curves (i'm calling them intersection points above)... how can I calculate the two control points? Thanks in advance, this has been driving me crazy. There's some kind of explanation here: http://www.tinaja.com/glib/nubz4pts1.pdf but it's written in postscript and that language makes no sense to me at all - it's over my head.

    Read the article

  • Triangular bounding volumes

    - by Cheery
    I've come up with an alternative for beziers that might be easier to ray-trace, perhaps even though a plain vertex shader. Though there's missing a piece. I need to find the parametric surface equation from the surface normals I have for edge vertices. I also have to know it's peak and valley so I can constraint the depth of my bounding triangle. Image explains the overall idea: I build a bounding-volume from a control triangle. Then apply a function to each parametric coordinate of the triangle (s+t+u=1 where s,t,u = 0) to get the height coordinate for that certain point. Simply put, it produces a procedurally generated height-map for the triangle's surface. I just need to find a function that generates the height-map so I can make it work.

    Read the article

  • Caffeine and Stimulant Usage

    - by Jon Purdy
    Let's see how many of us fit the old stereotype, shall we? Do you typically use caffeine when programming? During the day or at night? How frequently do you pull all-nighters? Do you use caffeine when you do stay up late? Do you prefer to have a large amount of caffeine all at once, or small amounts over a longer period of time? Do you use energy drinks, 5-hour energy shots, coffee, tea, or caffeine pills? How about other stimulants such as amphetamines? For instance, I've known a programmer who dabbled in speed because they believed it increased their ability to focus on programming, though happily they're clean now and quite honest about the whole experience. Share, discuss, find the Ballmer Peak of caffeine, enjoy. Happy Easter.

    Read the article

  • Unicorn: Which number of worker processes to use?

    - by blackbird07
    I am running a Ruby on Rails app on a virtual Linux server that is capped at 1GB RAM. Currently, I am constantly hitting the limit and would like to optimize memory utilization. One option I am looking at is reducing the number of unicorn workers. So what is the best way to determine the number of unicorn workers to use? The current setting is 10 workers, but the maximum number of requests per second I have seen on Google Analytics Real-Time is 3 (only scored once at a peak time; in 99% of the time not going above 1 request per second). So is it a save assumption that I can - for now - go with 4 workers, leaving room for unexpected amounts of requests? What are the metrics I should have a look at for determining the number of workers and what are the tools I can use for that on my Ubuntu machine?

    Read the article

  • algorithm to find Best 8 minute window in a 1 hour run

    - by Arun
    I have a requirement like, an activity runs for about more than an hour. I need to get the best 8 minute window where some parameters are maximum. say a value x, which is dynamic for every second. if my activity runs for one hr,i get 3600 values for x. I need to find the best continuous 8 minute time interval where x value was the highest among all the others. if i capture say from 0th minute to 8th minute, there may be another time frame like 0.4 to 8.4 where it was maximum. the granularity is one second. every second we need to consider. basically the peak 8 minute window where x was maximum. please help me with the design

    Read the article

  • audio power on AudioQueue

    - by Tomoyuki
    Hi everyone. I'm now creating an Application using speech recognition.To check the Audio Power coming in through the microphone, I wrote a method as follows. -(void)checkPower(AudioqueRef)queue{ UInt32 expectedSize= sizeof(AudioQueueLevelMeterState); AudioQueueGetProperty(queue, kAudioQueueProperty_CurrentLevelMeter, audioLevels, expectedSize); NSLog(@"average:%f peak:%f",audioLevels.mAveragePower,audioLevels.mPeakPower); } I found that sometimes mAveragePower was larger than mPeakPower, and when mAveragePower was 1.0, in other words, averagePower is regarded as max, mPeakPower was lower than 1.0. I think that generally this result is inpossible. please Let me know if you have any information about sound power on CoreAudio. thanks.

    Read the article

  • What data should I use to create an autofill "destination" field like Facebook or the Trip Advisor s

    - by sbar
    In order to create a “destination” auto filter input field on our website, I need a data source that provides a hierarchical data set of Region, Country, County/State, City and Town (plus an area like the Peak District National Park if at all possible) I know sites like Trip Advisor and Facebook seem to have very robust datasets for this. When you type, it brings up a match list with the hierarchy displayed (e.g. if you type Boston you get 6 results as there are multiply places called Boston – the hierarchy allows you to pick the correct option) There are many data sources out there but they either lack hierarchy or do not seem to be easily updatable or complete. I had expected this to be an easy task given the amount of site that have a destination or location autofill field. However, i cannot find a datasource or method that works. any help would be much appreciated. Tks,

    Read the article

  • need for tcp fine-tuning on heavily used proxy server

    - by Vijay Gharge
    Hi all, I am using squid like Internet proxy server on RHEL 4 update 6 & 8 with quite heavy load i.e. 8k established connections during peak hour. Without depending much on application provider's expertise I want to achieve maximum o/p from linux. W.r.t. that I have certain questions as following: How to find out if there is scope for further tcp fine-tuning (without exhausting available resources) as the benchmark values given by vendor looks poor! Is there any parameter value that is available from OS / network stack that will show me the results. If at all there is scope, how shall I identify & configure OS tcp stack parameters i.e. using sysctl or any specific parameter Post tuning how shall I clearly measure performance enhancement / degradation ?

    Read the article

  • Presentation to under privileged students about what programming is. How? Any ideas.

    - by Quigrim
    Next week I have to give a presentation to a group of under privileged college students about the possibilities of a career in software development. These students have no exposure to programming what-so-ever. I have a good idea of how to tackle the non-technical, general portion of the presentation. However, notwithstanding my decade of experience, I am finding myself at somewhat of a loss how to convey the concept of programming in a meaningful way in under 20 minutes. Do I demonstrate actual simple code, or do I stick with concepts? I need to be able to scratch the surface of the vastness of the programming realm, to create just enough of a handle to those students, to peak the interest of those who might have the aptitude for it. Any ideas that are concise and clear would be greatly appreciated. Also, if anybody knows of online resources that addresses this topic, please share. Looking forward to some great input from this community. Thank you.

    Read the article

  • Upgrading IIS web sever framework 2.0 to 3.5 considerations

    - by Grant
    Hi, i will be responcible for upgrading an IIS web server from the Microsoft .NET framework v2.0 to v3.5. I am wondering if there is anything special i need to know or any caveats i should be aware of before proceding? The site gets a fair number of hits per day and I will be taking it down and performing the upgrade at an off-peak time. Aside from double clicking the installer is there anything i need to know? Will the server need to be rebooted afterwards, does the installer handle all of the configuration changes? etc.. Thanks.

    Read the article

  • Histrogram matching - image processing - c/c++

    - by Raj
    Hello I have two histograms. int Hist1[10] = {1,4,3,5,2,5,4,6,3,2}; int Hist1[10] = {1,4,3,15,12,15,4,6,3,2}; Hist1's distribution is of type multi-modal; Hist2's distribution is of type uni-modal with single prominent peak. My questions are Is there any way that i could determine the type of distribution programmatically? How to quantify whether these two histograms are similar/dissimilar? Thanks

    Read the article

  • Android FTP seek Bar issue

    - by Androi Developer
    I am trying to Upload & Download file to server using FTP and Download File using HTTP i am able to do this, my problem is when i am trying to show seek bar with Upload status of file using ftp then it's not showing. In this attached image Using HTTP it's showing seekbar with Network spped like this i need to display seek bar & Network sppeed in FTP. Below code i wrote for FTP to upload file into server. Code:-- // Upload System.out.println("upload test is called"); //Toast.makeText(con, "upload FTP test is called", Toast.LENGTH_SHORT).show(); //ContextWrapper context = null; //assetManager= context.getAssets(); assetManager = getResources().getAssets(); input1 = assetManager.open("hello.txt"); final long started = System.currentTimeMillis(); int size = input1.available(); //byte[] buffer = new byte[size]; byte dataByte[] = new byte[1024]; //input1.read(buffer); //String data = "ZK DATA TESTER TEST DATA1sdfsdf"; String data = input1.toString(); System.out.println("dat value is........"+data); final int lenghtOfFile = data.getBytes().length; //final int lenghtOfFile = input1.getBytes().length; System.out.println("length of file....."+lenghtOfFile); ByteArrayInputStream in = new ByteArrayInputStream( data.getBytes()); //toast("Uploading /test.txt"); //Toast.makeText(con,"File Size : " +data.getBytes().length + " bytes",Toast.LENGTH_SHORT).show(); //byte b[] = new byte[1024]; long total = 0; long sleepingTime= 0; System.out.println("started time --"+started); updateUI(status, "Uploading"); while ((count = in.read(dataByte)) != -1) { System.out.println("read value is...."+in.read(dataByte)); while (sleep1) { Thread.sleep(1000); System.out.println("ftp upload is in sleeping mode"); sleepingTime +=1000; } System.out.println("Total count --"+count); total += count; System.out.println("Only Total --"+total); final int progress = (int) ((total * 100) / lenghtOfFile); final long speed = total; //duration = ((System.currentTimeMillis() - started)-sleepingTime) / 1000; boolean result = ObjFtpCon.storeFile("/test.txt", input1); //boolean result = ObjFtpCon.storeFile(map.get("file_address").toString()+"/test.txt", input1); duration = ((System.currentTimeMillis() - started)-sleepingTime) / 1000; /* runOnUiThread(new Runnable() { public void run() { bar.setProgress(progress); // trans.setText("" + progress); //duration = ((System.currentTimeMillis() - started)-sleepingTime) / 1000; //duration = ((System.currentTimeMillis() - started)-sleepingTime) / 1000; //real_time.setText(duration + " secs"); if (duration != 0) { test_avg.setText((((speed / duration)*1000)*0.0078125) + " kbps"); if (pk <= (speed / duration) / 1024) { pk = (speed / duration) / 1024; } if (pk <= ((speed / duration)*1000)*0.0078125) { pk = (long)(((speed / duration)*1000)*0.0078125); } //peak.setText(pk + " kbps"); } } });*/ //in.close(); if (result) { updateUI(status, "Uploaded"); // toast("Uploading succeeded"); // toast("Uploaded at /test.txt"); //duration = ((System.currentTimeMillis() - started)-sleepingTime) / 1000; System.out.println("curreent time..... "+System.currentTimeMillis()); System.out.println("started time --"+started); System.out.println("sleep tome...."+sleepingTime); System.out.println("duration is....."+duration); runOnUiThread(new Runnable() { public void run() { bar.setProgress(progress); // trans.setText("" + progress); //duration = ((System.currentTimeMillis() - started)-sleepingTime) / 1000; real_time.setText(duration + " secs"); if (duration != 0) { test_avg.setText((speed / duration) / 1024 + " kbps"); if (pk <= (speed / duration) / 1024) { pk = (speed / duration) / 1024; } peak.setText(pk + " kbps"); } } }); } /*while(!result){Thread.sleep(1000);}*/ } in.close();

    Read the article

  • When is a program limited by the memory bandwidth?

    - by hanno
    I want to know if a program that I am using and which requires a lot of memory is limited by the memory bandwidth. When do you expect this to happen? Did it ever happen to you in a real life scenario? I found several articles discussing this issue, including http://www.cs.virginia.edu/~mccalpin/papers/bandwidth/node12.html http://www.cs.virginia.edu/~mccalpin/papers/bandwidth/node13.html http://ispass.org/ucas5/session2_3_ibm.pdf The first link is a bit old, but suggests that you need to perform less than about 1-40 floating point operations per floating point variable in order to see this effect (correct me if I'm wrong). How can I measure the memory bandwidth that a given program is using and how do I measure the (peak) bandwidth that my system can offer? I don't want to discuss any complicated cache issues here. I'm only interested in the communication between the CPU and the memory.

    Read the article

  • Cutting Row with Data and moving to different sheet VBA

    - by user3709645
    I'm trying to cut a row that has the specified cell blank and then paste it into another sheet in the same workbook. My coding works fine to delete the row but everything I've tried to cut and paste keeps giving me errors. Here's the working code that deletes the rows: Sub Remove() 'Remove No Denovo &/or No Peak Seq Dim n As Long Dim nLastRow As Long Dim nFirstRow As Long Dim lastRow As Integer ActiveSheet.UsedRange Set r = ActiveSheet.UsedRange nLastRow = r.rows.Count + r.Row - 1 nFirstRow = r.Row For n = nLastRow To nFirstRow Step -1 If Cells(n, "G") = "" Then Cells(n, "G").EntireRow.Delete Next n End Sub Thanks for any help!

    Read the article

  • Choosing a VS project type (C++)

    - by typoknig
    Hi all, I do not use C++ much (I try to stick to the easier stuff like Java and VB.NET), but the lately I have not had a choice. When I am picking a project type in VS for some C++ source I download, what project type should I pick? I had just been sticking with Win32 Console Applications, but I just downloaded some code (below) that will not work right even when it compiles with out errors. I have tried to use a CLR Console Application and an empty project too, and have changed many variables along the way, but I cannot get this code to work. I noticed that this code does not have "int main()" at its beginning, does that have something to do with it? Anyways, here is the code, got it from here: /* Demo of modified Lucas-Kanade optical flow algorithm. See the printf below */ #ifdef _CH_ #pragma package <opencv> #endif #ifndef _EiC #include "cv.h" #include "highgui.h" #include <stdio.h> #include <ctype.h> #endif #include <windows.h> #define FULL_IMAGE_AS_OUTPUT_FILE #define cvMirror cvFlip //IplImage *image = 0, *grey = 0, *prev_grey = 0, *pyramid = 0, *prev_pyramid = 0, *swap_temp; IplImage **buf = 0; IplImage *image1 = 0; IplImage *imageCopy=0; IplImage *image = 0; int win_size = 10; const int MAX_COUNT = 500; CvPoint2D32f* points[2] = {0,0}, *swap_points; char* status = 0; //int count = 0; //int need_to_init = 0; //int night_mode = 0; int flags = 0; //int add_remove_pt = 0; bool bLButtonDown = false; //bool bstopLoop = false; CvPoint pt, pt1,pt2; //IplImage* img1; FILE* FileDest; char* strImageDir = "E:\\Projects\\TSCreator\\Images"; char* strItemName = "b"; int imageCount=0; int bFirstFace = 1; // flag for first face int mode = 1; // Mode 1 - Haar Traing Sample Creation, 2 - HMM sample creation, Mode = 3 - Both Harr and HMM. //int startImgeNo = 1; bool isEqualRation = false; //Weidth to height ratio is equal //Selected Image data IplImage *selectedImage = 0; int selectedX = 0, selectedY = 0, currentImageNo = 0, selectedWidth = 0, selectedHeight= 0; CvRect selectedROI; void saveFroHarrTraining(IplImage *src, int x, int y, int width, int height, int imageCount); void saveForHMMTraining(IplImage *src, CvRect roi,int imageCount); // Code for draw ROI Cropping Image void on_mouse( int event, int x, int y, int flags, void* param ) { char f[200]; CvRect reg; if( !image ) return; if( event == CV_EVENT_LBUTTONDOWN ) { bLButtonDown = true; pt1.x = x; pt1.y = y; } else if ( event == CV_EVENT_MOUSEMOVE ) //Draw the selected area rectangle { pt2.x = x; pt2.y = y; if(bLButtonDown) { if( !image1 ) { /* allocate all the buffers */ image1 = cvCreateImage( cvGetSize(image), 8, 3 ); image1->origin = image->origin; points[0] = (CvPoint2D32f*)cvAlloc(MAX_COUNT*sizeof(points[0][0])); points[1] = (CvPoint2D32f*)cvAlloc(MAX_COUNT*sizeof(points[0][0])); status = (char*)cvAlloc(MAX_COUNT); flags = 0; } cvCopy( image, image1, 0 ); //Equal Weight-Height Ratio if(isEqualRation) { pt2.y = pt1.y + (pt2.x-pt1.x); } //Max Height and Width is the image width and height if(pt2.x>image->width) { pt2.x = image->width; } if(pt2.y>image->height) { pt2.y = image->height; } CvPoint InnerPt1 = pt1; CvPoint InnerPt2 = pt2; if ( InnerPt1.x > InnerPt2.x) { int tempX = InnerPt1.x; InnerPt1.x = InnerPt2.x; InnerPt2.x = tempX; } if ( pt2.y < InnerPt1.y ) { int tempY = InnerPt1.y; InnerPt1.y = InnerPt2.y; InnerPt2.y = tempY; } InnerPt1.y = image->height - InnerPt1.y; InnerPt2.y = image->height - InnerPt2.y; CvFont font; double hScale=1.0; double vScale=1.0; int lineWidth=1; cvInitFont(&font,CV_FONT_HERSHEY_SIMPLEX|CV_FONT_ITALIC, hScale,vScale,0,lineWidth); char size [200]; reg.x = pt1.x; reg.y = image->height - pt2.y; reg.height = abs (pt2.y - pt1.y); reg.width = InnerPt2.x -InnerPt1.x; //print width and heght of the selected reagion sprintf(size, "(%dx%d)",reg.width, reg.height); cvPutText (image1,size,cvPoint(10,10), &font, cvScalar(255,255,0)); cvRectangle(image1, InnerPt1, InnerPt2, CV_RGB(255,0,0), 1); //Mark Selected Reagion selectedImage = image; selectedX = pt1.x; selectedY = pt1.y; selectedWidth = reg.width; selectedHeight = reg.height; selectedROI = reg; //Show the modified image cvShowImage("HMM-Harr Positive Image Creator",image1); } } else if ( event == CV_EVENT_LBUTTONUP ) { bLButtonDown = false; // pt2.x = x; // pt2.y = y; // // if ( pt1.x > pt2.x) // { // int tempX = pt1.x; // pt1.x = pt2.x; // pt2.x = tempX; // } // // if ( pt2.y < pt1.y ) // { // int tempY = pt1.y; // pt1.y = pt2.y; // pt2.y = tempY; // // } // //reg.x = pt1.x; //reg.y = image->height - pt2.y; // //reg.height = abs (pt2.y - pt1.y); ////reg.width = reg.height/3; //reg.width = pt2.x -pt1.x; ////reg.height = (2 * reg.width)/3; #ifdef FULL_IMAGE_AS_OUTPUT_FILE CvRect FullImageRect; FullImageRect.x = 0; FullImageRect.y = 0; FullImageRect.width = image->width; FullImageRect.height = image->height; IplImage *regionFullImage =0; regionFullImage = cvCreateImage(cvSize (FullImageRect.width, FullImageRect.height), image->depth, image->nChannels); image->roi = NULL; //cvSetImageROI (image, FullImageRect); //cvCopy (image, regionFullImage, 0); #else IplImage *region =0; region = cvCreateImage(cvSize (reg.width, reg.height), image1->depth, image1->nChannels); image->roi = NULL; cvSetImageROI (image1, reg); cvCopy (image1, region, 0); #endif //cvNamedWindow("Result", CV_WINDOW_AUTOSIZE); //selectedImage = image; //selectedX = pt1.x; //selectedY = pt1.y; //selectedWidth = reg.width; //selectedHeight = reg.height; ////currentImageNo = startImgeNo; //selectedROI = reg; /*if(mode == 1) { saveFroHarrTraining(image,pt1.x,pt1.y,reg.width,reg.height,startImgeNo); } else if(mode == 2) { saveForHMMTraining(image,reg,startImgeNo); } else if(mode ==3) { saveFroHarrTraining(image,pt1.x,pt1.y,reg.width,reg.height,startImgeNo); saveForHMMTraining(image,reg,startImgeNo); } else { printf("Invalid mode."); } startImgeNo++;*/ } } /* Save popsitive samples for Harr Training. Also add an entry to the PositiveSample.txt with the location of the item of interest. */ void saveFroHarrTraining(IplImage *src, int x, int y, int width, int height, int imageCount) { char f[255] ; sprintf(f,"%s\\%s\\harr_%s%d%d.jpg",strImageDir,strItemName,strItemName,imageCount/10, imageCount%10); cvNamedWindow("Harr", CV_WINDOW_AUTOSIZE); cvShowImage("Harr", src); cvSaveImage(f, src); printf("output%d%d \t ", imageCount/10, imageCount%10); printf("width %d \t", width); printf("height %d \t", height); printf("x1 %d \t", x); printf("y1 %d \t\n", y); char f1[255]; sprintf(f1,"%s\\PositiveSample.txt",strImageDir); FileDest = fopen(f1, "a"); fprintf(FileDest, "%s\\harr_%s%d.jpg 1 %d %d %d %d \n",strItemName,strItemName, imageCount, x, y, width, height); fclose(FileDest); } /* Create Sample Images for HMM recognition algorythm trai ning. */ void saveForHMMTraining(IplImage *src, CvRect roi,int imageCount) { char f[255] ; printf("x=%d, y=%d, w= %d, h= %d\n",roi.x,roi.y,roi.width,roi.height); //Create the file name sprintf(f,"%s\\%s\\hmm_%s%d.pgm",strImageDir,strItemName,strItemName, imageCount); //Create storage for grayscale image IplImage* gray = cvCreateImage(cvSize(roi.width,roi.height), 8, 1); //Create storage for croped reagon IplImage* regionFullImage = cvCreateImage(cvSize(roi.width,roi.height),8,3); //Croped marked region cvSetImageROI(src,roi); cvCopy(src,regionFullImage); cvResetImageROI(src); //Flip croped image - otherwise it will saved upside down cvConvertImage(regionFullImage, regionFullImage, CV_CVTIMG_FLIP); //Convert croped image to gray scale cvCvtColor(regionFullImage,gray, CV_BGR2GRAY); //Show final grayscale image cvNamedWindow("HMM", CV_WINDOW_AUTOSIZE); cvShowImage("HMM", gray); //Save final grayscale image cvSaveImage(f, gray); } int maina( int argc, char** argv ) { CvCapture* capture = 0; //if( argc == 1 || (argc == 2 && strlen(argv[1]) == 1 && isdigit(argv[1][0]))) // capture = cvCaptureFromCAM( argc == 2 ? argv[1][0] - '0' : 0 ); //else if( argc == 2 ) // capture = cvCaptureFromAVI( argv[1] ); char* video; if(argc ==7) { mode = atoi(argv[1]); strImageDir = argv[2]; strItemName = argv[3]; video = argv[4]; currentImageNo = atoi(argv[5]); int a = atoi(argv[6]); if(a==1) { isEqualRation = true; } else { isEqualRation = false; } } else { printf("\nUsage: TSCreator.exe <Mode> <Sample Image Save Path> <Sample Image Save Directory> <Video File Location> <Start Image No> <Is Equal Ratio>\n"); printf("Mode = 1 - Haar Traing Sample Creation. \nMode = 2 - HMM sample creation.\nMode = 3 - Both Harr and HMM\n"); printf("Is Equal Ratio = 0 or 1. 1 - Equal weidth and height, 0 - custom."); printf("Note: You have to create the image save directory in correct path first.\n"); printf("Eg: TSCreator.exe 1 E:\Projects\TSCreator\Images A 11.avi 1 1\n\n"); return 0; } capture = cvCaptureFromAVI(video); if( !capture ) { fprintf(stderr,"Could not initialize capturing...\n"); return -1; } cvNamedWindow("HMM-Harr Positive Image Creator", CV_WINDOW_AUTOSIZE); cvSetMouseCallback("HMM-Harr Positive Image Creator", on_mouse, 0); //cvShowImage("Test", image1); for(;;) { IplImage* frame = 0; int i, k, c; frame = cvQueryFrame( capture ); if( !frame ) break; if( !image ) { /* allocate all the buffers */ image = cvCreateImage( cvGetSize(frame), 8, 3 ); image->origin = frame->origin; //grey = cvCreateImage( cvGetSize(frame), 8, 1 ); //prev_grey = cvCreateImage( cvGetSize(frame), 8, 1 ); //pyramid = cvCreateImage( cvGetSize(frame), 8, 1 ); // prev_pyramid = cvCreateImage( cvGetSize(frame), 8, 1 ); points[0] = (CvPoint2D32f*)cvAlloc(MAX_COUNT*sizeof(points[0][0])); points[1] = (CvPoint2D32f*)cvAlloc(MAX_COUNT*sizeof(points[0][0])); status = (char*)cvAlloc(MAX_COUNT); flags = 0; } cvCopy( frame, image, 0 ); // cvCvtColor( image, grey, CV_BGR2GRAY ); cvShowImage("HMM-Harr Positive Image Creator", image); cvSetMouseCallback("HMM-Harr Positive Image Creator", on_mouse, 0); c = cvWaitKey(0); if((char)c == 's') { //Save selected reagion as training data if(selectedImage) { printf("Selected Reagion Saved\n"); if(mode == 1) { saveFroHarrTraining(selectedImage,selectedX,selectedY,selectedWidth,selectedHeight,currentImageNo); } else if(mode == 2) { saveForHMMTraining(selectedImage,selectedROI,currentImageNo); } else if(mode ==3) { saveFroHarrTraining(selectedImage,selectedX,selectedY,selectedWidth,selectedHeight,currentImageNo); saveForHMMTraining(selectedImage,selectedROI,currentImageNo); } else { printf("Invalid mode."); } currentImageNo++; } } } cvReleaseCapture( &capture ); //cvDestroyWindow("HMM-Harr Positive Image Creator"); cvDestroyAllWindows(); return 0; } #ifdef _EiC main(1,"lkdemo.c"); #endif If I put... #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { return 0; } ... before the previous code (and link it to the correct OpenCV .lib files) it compiles without errors, but does nothing at the command line. How do I make it work?

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >