Search Results

Search found 464 results on 19 pages for 'segments'.

Page 11/19 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Can someone explain the physical architecture of RAID 10 in complete layman's terms?

    - by Hank
    I am a newbie in the world of storage and I am having a hard time digesting the physical architecture of some of the RAID levels. I am particularly interested in RAID 10, and 50. I asked the question specifically about RAID 10, because I feel if I understand that, I'll understand the other. So, I get the definition of RAID 10 - "minimum 4 disks, a striped array whose segments are mirrored". If I've got 4 disks and Disks 1 and 2 are a mirrored pair, and Disks 3 and 4 are a mirrored pair - where does the data get striped? Thanks.

    Read the article

  • Standard Network Tiers in a Distributed N-Tier System

    Distributed N-Tier client/server architecture allows for segments of an application to be broken up and distributed across multiple locations on a network.  Listed below are standard tiers in a Distributed N-Tier System. End-User Client Tier The End-User Client is responsible for sending and receiving requests from web servers and other applications servers and translating the responses so that the End-User can interpret the data effectively. The primary roles for this tier are to communicate with servers and translate server responses back to the end-user to interpret. Business-Specific Functions Validate Data Display Data Send Data to Webserver Web Server Tier The Web server tier processes new requests for information coming in from the HTTP and HTTPS ports. This primarily handles the generation of user interfaces and calls the application server when needed to access Data and business logic when needed. Business-specific functions Send Data to application server Format Data for Display Validate Data Application Server Tier The application server stores and executes predefined business logic that is applied to various pieces of data as the business determines. The processed data is then returned back to the Webserver. Additionally, this server directly calls the database to obtain and store any data used by the system Business-Specific Functions Validate Data Process Data Send Data to Database Server Database Server Tier The Database Server is responsible for storing and returning all data need by the calling applications. The primary role for this this server is storage. Data is stored as needed and can be recalled at any point later in time. Business-Specific Functions Insert Data Delete Data Return Data to Application Server

    Read the article

  • Why change net.inet.tcp.tcbhashsize in FreeBSD?

    - by sh-beta
    In virtually every FreeBSD network tuning document I can find: # /boot/loader.conf net.inet.tcp.tcbhashsize=4096 This is usually paired with some unhelpful statement like "TCP control-block hash table tuning" or "Set this to a reasonable value." man 4 tcp isn't much help either: tcbhashsize Size of the TCP control-block hash table (read-only). This may be tuned using the kernel option TCBHASHSIZE or by setting net.inet.tcp.tcbhashsize in the loader(8). The only document I can find that touches on this mysterious thing is the Protocol Control Block Lookup subsection beneath Transport Layer in Optimizing the FreeBSD IP and TCP Stack, but its description is more about potential bottlenecks in using it. It seems tied to matching new TCP segments to their listening sockets, but I'm not sure how. What exactly is the TCP Control Block used for? Why would you want to set its hash size to 4096 or any other particular number?

    Read the article

  • Creating a 2D Line Branch

    - by Danran
    I'm looking into creating a 2D line branch, something for a "lightning effect". I did ask this question before on creating a "lightning effect" (mainly though referring to the process of the glow & after effects the lightning has & to whether it was a good method to use or not); Methods of Creating a "Lightning" effect in 2D However i never did get around to getting it working. So i've been trying today to get a seconded attempt going but i'm getting now-were :/. So to be clear on what i'm trying to-do, in this article posted; http://drilian.com/2009/02/25/lightning-bolts/ I'm trying to create the line segments seen in the images on the site. I'm confused mainly by this line in the pseudo code; // Offset the midpoint by a random amount along the normal. midPoint += Perpendicular(Normalize(endPoint-startPoint))*RandomFloat(-offsetAmount,offsetAmount); If someone could explain this to me it would be really grateful :).

    Read the article

  • Estimate angle to launch missile, maths question

    - by Jonathan
    I've been working on this for an hour or two now and my maths really isn't my strong suit which is definitely not a good thing for a game programmer but that shouldn't stop me enjoying a hobby surely? After a few failed attempts I was hoping someone else out there could help so here's the situation. I'm trying to implement a bit of faked intelligence when the A.I fires it's missiles at a target in a 2D game world. By predicting the likely position the target will be in given it's current velocity and the time it will take the missile to reach it's target. I created an image to demonstrate my thinking: http://i.imgur.com/SFmU3.png which also contains the logic I use for accelerating the missile after launch. The ship that fires the missile can fire within a total of 40 degree angle, 20 either side of itself, but this could likely become variable. My current attempt was to break the space between the two lines into segments which match the targets width. Then calculate the time it would take the missile to get to that location using the formula. So for each iteration of this we total up the values and that tells us the distance travelled, ad it would then just need compared to distance to the segment. startVelocity * ((startVelocity * acceleration)^(currentframe-1) So for example. If we start at a velocity of 1f/frame with an acceleration of 0.1f the formula, at frame 4, would be 1 * (1.1^3) = 1.331 But I quickly realized I was getting lost when trying to put this into practice. Does this seem like a correct starting point or am I going completely the wrong way about it? Any pointers would help me greatly. Maths really isn't my strong suit so I get easily lost in these matters and don't even really know a good phrase to search for with this. So I guess in summary my question is more about the correct way to approach this problem and any additional code samples on top of that would be great but I'm not averse to working out the complete code from helpful pointers.

    Read the article

  • How to store bitmaps in memory?

    - by Geotarget
    I'm working with general purpose image rendering, and high-performance image processing, and so I need to know how to store bitmaps in-memory. (24bpp/32bpp, compressed/raw, etc) I'm not working with 3D graphics or DirectX / OpenGL rendering and so I don't need to use graphics card compatible bitmap formats. My questions: What is the "usual" or "normal" way to store bitmaps in memory? (in C++ engines/projects?) How to store bitmaps for high-performance algorithms, such that read/write times are the fastest? (fixed array? with/without padding? 24-bpp or 32-bpp?) How to store bitmaps for applications handling a lot of bitmap data, to minimize memory usage? (JPEG? or a faster [de]compression algorithm?) Some possible methods: Use a fixed packed 24-bpp or 32-bpp int[] array and simply access pixels using pointer access, all pixels are allocated in one continuous memory chunk (could be 1-10 MB) Use a form of "sparse" data storage so each line of the bitmap is allocated separately, reusing more memory and requiring smaller contiguous memory segments Store bitmaps in its compressed form (PNG, JPG, GIF, etc) and unpack only when its needed, reducing the amount of memory used. Delete the unpacked data if its not used for 10 secs.

    Read the article

  • How do I draw a dotted or dashed line?

    - by Gagege
    I'm trying to draw a dashed or dotted line by placing individual segments(dashes) along a path and then separating them. The only algorithm I could come up with for this gave me a dash length that was variable based on the angle of the line. Like this: private function createDashedLine(fromX:Float, fromY:Float, toX:Float, toY:Float):Sprite { var line = new Sprite(); var currentX = fromX; var currentY = fromY; var addX = (toX - fromX) * 0.0075; var addY = (toY - fromY) * 0.0075; line.graphics.lineStyle(1, 0xFFFFFF); var count = 0; // while line is not complete while (!lineAtDestination(fromX, fromY, toX, toY, currentX, currentY)) { /// move line draw cursor to beginning of next dash line.graphics.moveTo(currentX, currentY); // if dash is even if (count % 2 == 0) { // draw the dash line.graphics.lineTo(currentX + addX, currentY + addY); } // add next dash's length to current cursor position currentX += addX; currentY += addY; count++; } return line; } This just happens to be written in Haxe, but the solution should be language neutral. What I would like is for the dash length to be the same no matter what angle the line is. As is, it's just adding 75 thousandths of the line length to the x and y, so if the line is and a 45 degree angle you get pretty much a solid line. If the line is at something shallow like 85 degrees then you get a nice looking dashed line. So, the dash length is variable, and I don't want that. How would I make a function that I can pass a "dash length" into and get that length of dash, no matter what the angle is? If you need to completely disregard my code, be my guest. I'm sure there's a better solution.

    Read the article

  • Reverse DNS for two ADs in the same subnet

    - by SpacemanSpiff
    I currently have two separate AD forests that exist within the same subnet. The two forests have independent copies of the reverse lookup zone for that subnet. Example: Domain A DC1: 10.1.1.1/24 Domain A DC2: 10.1.1.2/24 Domain A AppServer1:10.1.1.3/24 Domain B DC1: 10.1.1.11/24 Domain B DC2: 10.1.1.12/24 Domain B Appserver1:10.1.1.13/24 What I'm after, is a configuration that allows this reverse zone to be shared between them so that both sets of DNS servers can make updates to the zone. This kind of thing is a little far from my everday work, so a kick in the right direction is a welcome suggestion as well. Decoupling one AD into new segments is a possibility I'm open to but would like to avoid if possible. If there is a DNS related solution I'd prefer that.

    Read the article

  • Pathfinding with MicroPather : costs calculations with sectors and portals

    - by Adan
    Hello, I'm considering using micropather to help me with pathfinding. I'm not using a discrete map : I'm working in 2d with sectors and portales. However, I'm just wondering what is the best way to compute costs with this library in this context. Just to be more clear about geometrical shapes I'm using : sectors are basically convex polygons, and portals are segments that lies on sector's edge. Micropather exposes a pure virtual Graph class that you must inherate and overrides 3 functions. I understand how pathfinding works, so there's no problem in overriding those functions. Right now, my implementation give me results, i.e I'm able to find a path in my map, but I'm not sure I'm using an optimal solution. For the AdjacentCost method : I just take the distance between sector's centers as the cost. I think a better solution should be to use the portal between the two sectors, compute its center, and then the cost should be : distance( sector A center, portal center ) + distance ( sector B center, portal center ). I'm pretty sure the approximation I'm using with just sector's center is enough for most cases, but maybe with thin and long sectors that are perpendicular, this approximation could mislead the A* algorithm. For the LeastCostEstimate method : I just take the midpoint of the two sectors. So, as you understand, I'm always working with sectors' centers, and it's working fine. And I'm pretty sure there's a better way to work. Any suggestions or feedbacks? Thanks in advance!

    Read the article

  • In 2011, what are the reasons to stick with plain text mails?

    - by Aaron Digulla
    People entering college today have never known a world without an Internet. HTML was invented 1980, that's more than thirty years ago or 1.5 generations. But plain text mails are still common despite all their problems: Encoding issues Wrapped code segments No links No way to use the "a picture says more than a thousand words" lore Most of the security risks are now handled by the underlying browser engine and smart settings like: Don't allow JavaScript in mails Don't execute attachments Don't download external resources (like web bugs) On top of that, only very few people still read mail only in command line tools like Mutt. Knowing Mutt myself, I'm pretty sure you can configure it to display HTML mail with, say, w3m. On top of that, most HTML mail capable clients send two versions of the mail (pure text with an HTML attachment). I'm not sure if there are any people left on the planet which still use a 56kbit modem to access their mail accounts. So what reasons are left to stick with plain text mails in 2011?

    Read the article

  • Memory management (segmentation and paging) in 80286 and 80386: How does it work?

    - by Andrew J. Brehm
    I found lots of Web sites and books explaining how memory management worked on the 8086 and later x86 CPUs in Real Mode. I understand, I think, how two 16 bit values, segment address and offset are combined to get a linear 20 bit physical address (shift segment four bits to the left, add offset; segments are 64K and start every 16 bytes). But I couldn't find any good Web sites or books that explained how memory management works in Protected Mode, specifically the differences between 80286 and 80386. Can anyone point me to a good Web site or book (or explain it right here)? (For extra credit, i.e. an upvote, how does it work in Long Mode?)

    Read the article

  • ffmpeg error while segmenting

    - by Tommy Ng
    I'm using ffmpeg and segmenter on Ubuntu 10.04 to create the transport stream from flv/h264 video files and then segment the ts segments for ipad streaming. Some ts files show an error with segmenter - Output #0, mpegts, to '29': Stream #0.0: Video: 0x0000, yuv420p, 480x360, q=2-31, 90k tbn, 25 tbc Stream #0.1: Audio: 0x0000, 0 channels, s16 [mpegts @ 0x11f4ac0]sample rate not set Could not write mpegts header to first output file my ffmpeg command for creating the ts file - ffmpeg -i 1.flv -f mpegts -acodec libfaac -ar 48000 -ab 64k -s 480x360 -vcodec libx264 -b 192k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 192k -bufsize 192k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect 480:360 -g 30 -async 2 -y 1.ts my segmenter command - segmenter 1.ts 10 1 1.m3u8 path/to/streams/

    Read the article

  • Recommended formats to store bitmaps in memory?

    - by Geotarget
    I'm working with general purpose image rendering, and high-performance image processing, and so I need to know how to store bitmaps in-memory. (24bpp/32bpp, compressed/raw, etc) I'm not working with 3D graphics or DirectX / OpenGL rendering and so I don't need to use graphics card compatible bitmap formats. My questions: What is the "usual" or "normal" way to store bitmaps in memory? (in C++ engines/projects?) How to store bitmaps for high-performance algorithms, such that read/write times are the fastest? (fixed array? with/without padding? 24-bpp or 32-bpp?) How to store bitmaps for applications handling a lot of bitmap data, to minimize memory usage? (JPEG? or a faster [de]compression algorithm?) Some possible methods: Use a fixed packed 24-bpp or 32-bpp int[] array and simply access pixels using pointer access, all pixels are allocated in one continuous memory chunk (could be 1-10 MB) Use a form of "sparse" data storage so each line of the bitmap is allocated separately, reusing more memory and requiring smaller contiguous memory segments Store bitmaps in its compressed form (PNG, JPG, GIF, etc) and unpack only when its needed, reducing the amount of memory used. Delete the unpacked data if its not used for 10 secs.

    Read the article

  • Volume expanded in Volume Group, old disk reduced but still in use in system

    - by Yurij73
    Tryed to add a new hard sdb (not formated) to my virtualbox Centos. Successfully extended an existing vg_localhost to /dev/sdb/ # lvdisplay --- Logical volume --- LV Path /dev/vg_localhost/lv_root LV Name lv_root VG Name vg_localhost LV UUID DkYX7D-DMud-vLaI-tfnz-xIJJ-VzHz-bRp3tO LV Write Access read/write LV Creation host, time localhost.centos, 2012-12-17 LV Status available # open 1 LV Size 18,03 GiB Current LE 4615 Segments 2 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 20G 0 disk +-vg_localhost-lv_root (dm-0) 253:0 0 18G 0 lvm / +-vg_localhost-lv_swap (dm-1) 253:1 0 2G 0 lvm [SWAP] sda 8:0 0 9G 0 disk +-sda1 8:1 0 500M 0 part /boot +-sda2 8:2 0 8,5G 0 part sr0 11:0 1 1024M 0 rom df -h /dev/mapper/vg_localhost-lv_root 6,5G 6,2G 256M 97% / tmpfs 499M 200K 499M 1% /dev/shm /dev/sda1 485M 78M 382M 17% /boot it still old sda in use, what i have to do further?

    Read the article

  • Error while mounting home directory on different logical volume

    - by RCola
    I created RAID 5 form 3 hard drives. Formatted as ext4 this raid array. Created VG0 group and lv_home logical volume in LVM. Then I tried to mount default /home directory on lv_home, while trying to mount logical volume lv_home to folder containing user profiles /home, getting error: mount: wrong fs type, bad option, bad superblock on /dev/mapper/VG0-lv_home next is seems to be symbolic link: # file -s /dev/VG0/lv_home /dev/VG0/lv_home: symbolic link to `../mapper/VG0-lv_home' then # file -s /dev/mapper/VG0-lv_home /dev/mapper/VG0-lv_home: data and lvm> pvs PV VG Fmt Attr PSize PFree /dev/md0 VG0 lvm2 a- 2.02g 68.00m lvm> lvdisplay --- Logical volume --- LV Name /dev/VG0/lv_home VG Name VG0 LV UUID WzJus7-2yV8-yhog-Ju1b-TpWH-IIAI-LIutwe LV Write Access read/write LV Status available # open 0 LV Size 1.17 GiB Current LE 300 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 251:0

    Read the article

  • Extracting a line section of mysql backup using sed

    - by carpii
    I occasionally need to extract a single record from a mysqlbackup To do this, I first extract the single table I want from the backup... sed -n -e '/CREATE TABLE.*usertext/,/CREATE TABLE/p' 20120930_backup.sql > table.sql In table.sql, the records are batched using extended inserts (with maybe 100 records per insert before it creates a new line starting with INSERT INTO), so they look like... INSERT INTO usertext VALUES (1, field2 etc), (2, field2 etc), INSERT INTO usertext VALUES (101, field2 etc), (102, field2 etc), ... Im trying to extract record 239560 from this, using... sed -n -e '/(239560.*/,/)/p' table.sql > record.sql Ie.. start streaming when it finds 239560, and stop when it hits the closing bracket But this isnt working as I hoped, it just results in the full insert batch being output. Please can someone give me some pointers as to where Im going wrong? Would I be better off using awk for extracting segments of lines, and use sed for extracting lines within a file?

    Read the article

  • Is it possible to view Facebook news feeds page by page rather than loading it all as I scroll?

    - by oscilatingcretin
    If you want to scroll through your Facebook news feed (be it on the main feed, your personal feed, or in groups) to older parts, you have to scroll to the bottom, wait for the ajax load of the next part of the feed, and repeat. The problem with this is that, if you're scrolling down very far, the HTML document just gets bigger and bigger until your browser starts to die due to the overload of resources brought on by added HTML, text, and even images. This pretty much sets a limit to how far back you can scroll. Clicking on months and years on your personal feed has the same effect of cumulatively adding feed segments to the HTML document. I notice that this month/year feature is not available on the main feed and for groups. If there were a way to literally page through the feed so that only a single page's worth of feed data is loaded at a time, that would make scrolling through it much more doable.

    Read the article

  • Hardware specs for web cache

    - by Raj
    I am looking for recommendations for hardware specs for a server that needs to be a web cache for a user population of about 2,000 concurrent connections. The clients are viewing segmented HTTP video in bitrates ranging from 150kbps to 2mbps. Most video is "live" meaning segments of 2-10 secs each, of which 100 or so are maintained at a time. There are also some pre-recorded fixed length videos. How would I go about doing the provisioning calculation for such a server: What kind of HDD (SSD?), how many NICs how much RAM etc? I am thinking of using Varnish on Linux, all the RAM I can get my hands on, 2 CPUs with 6-8 cores each.

    Read the article

  • HDDs randomly falling off raid

    - by michael
    I really need help on this it's Saturday long weekend.No customer service help:( .I recently build new server/light duty desktop.Main purpose is only file sharing.Raid configuration :Adaptec 6805 ,8x 3TB HDD WD Red,Intel RES2SV240 expander,Raid 6,set in Intel mobo DZ 77GA-70K.I upgraded firmwares, but I'm having strange problem. During Build Verify segment 7 got missing.I just reinsert drive into hot swap bay and it started to rebuild Array.After rebuild was done another segments 0 and 5 gone missing while build/verify.I reinserted drives and now I'm praying that raid is going to rebuild successfully from remaining 6 drives,because i already transfer some data on it(I know it was bad idea).I checked S.M.A.R.T on missing drives , it only says link failure and aborted commands on one of them.No Errors on HDDs.Connections and cables are good.I added 2 fans blowing on RAID controller because it was getting too hot, so I guess overheating shouldn't be issue.What can be possibly wrong? Thank you for help.

    Read the article

  • Another Call to a member function get_segment() on a non-object question

    - by hogofwar
    I get the above error when calling this code: <? class Test1 extends Core { function home(){ ?> This is the INDEX of test1 <? } function test2(){ echo $this->uri->get_segment(1); //this is where the error comes from ?> This is the test2 of test1 testing URI <? } } ?> I get the error where commentated. This class extends this class: <?php class Core { public function start() { require("funk/funks/libraries/uri.php"); $this->uri = new uri(); require("funk/core/loader.php"); $this->load = new loader(); if($this->uri->get_segment(1) != "" and file_exists("funk/pages/".$this->uri->get_segment(1).".php")){ include("funk/pages/". $this->uri->get_segment(1).".php"); $var = $this->uri->get_segment(2); if ($var != ""){ $home= $this->uri->get_segment(1); $Index= new $home(); $Index->$var(); }else{ $home= $this->uri->get_segment(1); $Index = new $home(); $Index->home(); } }elseif($this->uri->get_segment(1) and ! file_exists("funk/pages/".$this->uri->get_segment(1).".php")){ echo "404 Error"; }else{ include("funk/pages/index.php"); $Index = new Index(); $Index->home(); //$this->Index->index(); echo "<!--This page was created with FunkyPHP!-->"; } } } ?> And here is the contents of uri.php: <?php class uri { private $server_path_info = ''; private $segment = array(); private $segments = 0; public function __construct() { $segment_temp = array(); $this->server_path_info = preg_replace("/\?/", "", $_SERVER["PATH_INFO"]); $segment_temp = explode("/", $this->server_path_info); foreach ($segment_temp as $key => $seg) { if (!preg_match("/([a-zA-Z0-9\.\_\-]+)/", $seg) || empty($seg)) unset($segment_temp[$key]); } foreach ($segment_temp as $k => $value) { $this->segment[] = $value; } unset($segment_temp); $this->segments = count($this->segment); } public function segment_exists($id = 0) { $id = (int)$id; if (isset($this->segment[$id])) return true; else return false; } public function get_segment($id = 0) { $id--; $id = (int)$id; if ($this->segment_exists($id) === true) return $this->segment[$id]; else return false; } } ?> i have asked a similar question to this before but the answer does not apply here. I have rewritten my code 3 times to KILL and Delimb this godforsaken error! but nooooooo....

    Read the article

  • How to draw complex shape from code behind for custom control in resource dictionary

    - by HopelessCoder
    Hi I am new to wpf and am having a problem which may or may not be trivial. I have defined a custom control as follows in the resource dictionary: <ResourceDictionary x:Class="SyringeSlider.Themes.Generic" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:SyringeSlider"> <Style TargetType="{x:Type local:CustomControl1}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:CustomControl1}"> <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> <Canvas Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Name="syringeCanvas"> </Canvas> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> Unfortunately I cannot go beyond this because I would like to draw a geometry onto the canvas consisting of a set of multiple line geometries whose dimensions are calculated as a function of the space available in the canvas. I believe that I need a code behind method to do this, but have not been able to determine how to link the xaml definition to a code behind method. Note that I have set up a class x:Class="SyringeSlider.Themes.Generic" for specifically this purpose, but can't figure out which Canvas property to link the drawing method to. My drawing method looks like this private void CalculateSyringe() { int adjHeight = (int) Height - 1; int adjWidth = (int) Width - 1; // Calculate some very useful values based on the chart above. int borderOffset = (int)Math.Floor(m_borderWidth / 2.0f); int flangeLength = (int)(adjHeight * .05f); int barrelLeftCol = (int)(adjWidth * .10f); int barrelLength = (int)(adjHeight * .80); int barrelRightCol = adjWidth - barrelLeftCol; int coneLength = (int)(adjHeight * .10); int tipLeftCol = (int)(adjWidth * .45); int tipRightCol = adjWidth - tipLeftCol; int tipBotCol = adjWidth - borderOffset; Path mySyringePath = new Path(); PathGeometry mySyringeGeometry = new PathGeometry(); PathFigure mySyringeFigure = new PathFigure(); mySyringeFigure.StartPoint = new Point(0, 0); Point pointA = new Point(0, flangeLength); mySyringeFigure.Segments.Add(new LineSegment(pointA, true)); Point pointB = new Point(); pointB.Y = pointA.Y + barrelLength; pointB.X = 0; mySyringeFigure.Segments.Add(new LineSegment(pointB, true)); // You get the idea....Add more points in this way mySyringeGeometry.Figures.Add(mySyringeFigure); mySyringePath.Data = mySyringeGeometry; } SO my question is: 1) Does what I am trying to do make any sense? 2) Can a use a canvas for this purpose? If not, what are my other options? Thanks!

    Read the article

  • C Program not running as intended, hangs after input

    - by user41419
    The program I am writing to take a number and display that number as a calculator would display it (shown below) is compiling with no issues, but when I try to run it, I am able to input my number, but nothing happens. It seems like it is "hanging", since no further output is shown as I would have expected. Might anyone know what the problem is? #include <stdio.h> #define MAX_DIGITS 20 char segments[10][7] = /* seven segment array */ {{'1','1','1','1','1','1','0'}, /* zero */ {'0','1','1','0','0','0','0'}, /* one */ {'1','1','0','1','1','0','1'}, /* two */ {'1','1','1','1','0','0','1'}, /* three */ {'0','1','1','0','0','1','1'}, /* four */ {'1','0','1','1','0','1','1'}, /* five */ {'1','0','1','1','1','1','1'}, /* six */ {'1','1','1','0','0','0','0'}, /* seven */ {'1','1','1','1','1','1','1'}, /* eight */ {'1','1','1','0','0','1','1'}};/* nine */ char digits[3][MAX_DIGITS * 4]; /* digits array */ int i, j; /* count variables */ int adjust; /* output formatting */ int main(void) { clear_digits_array(); int digit[20]; for (i = 0; i < 20; i++) { digit[i] = 0; } int count = 20; int position = 0; printf("Enter a number: "); int number = scanf("%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d", &digit[0], &digit[1], &digit[2], &digit[3], &digit[4], &digit[5], &digit[6], &digit[7], &digit[8], &digit[9], &digit[10], &digit[11], &digit[12], &digit[13], &digit[14], &digit[15], &digit[16], &digit[17], &digit[18], &digit[19]); //NOTHING HAPPENS AFTER HERE printf("Got input, number is %d", number); while (count > 0) { printf("Reading digits, count is %d", count); process_digit(digit[20 - count], position); position++; count--; } print_digits_array(); printf("\n"); return 0; } void clear_digits_array(void) { /* fill all positions in digits array with blank spaces */ for (i = 0; i < 3; i++) { for (j = 0; j < (MAX_DIGITS * 4); j++) { digits[i][j] = ' '; } } } void process_digit(int digit, int position) { /* check each segment to see if segment should be filled in for given digit */ for (i = 0; i < 7; i++) { printf("Processing digit %d at position %d, i is %d", digit, position, i); if (segments[digit][i] == 1) { switch (i) { case 0: digits[0][(position * 4) + 1] = '_'; break; case 1: digits[1][(position * 4) + 2] = '|'; break; case 2: digits[2][(position * 4) + 2] = '|'; break; case 3: digits[2][(position * 4) + 1] = '_'; break; case 4: digits[2][(position * 4) + 0] = '|'; break; case 5: digits[1][(position * 4) + 0] = '|'; break; case 6: digits[1][(position * 4) + 1] = '_'; break; } } } } void print_digits_array(void) { /* print each character in digits array */ for (i = 0; i < 3; i++) { for (j = 0; j < (MAX_DIGITS * 4); j++) { printf("%c", digits[i][j]); } printf("/n"); } }

    Read the article

  • AIX Checklist for stable obiee deployment

    - by user554629
    Common AIX configuration issues     ( last updated 27 Aug 2012 ) OBIEE is a complicated system with many moving parts and connection points.The purpose of this article is to provide a checklist to discuss OBIEE deployment with your systems administrators. The information in this article is time sensitive, and updated as I discover new  issues or details. What makes OBIEE different? When Tech Support suggests AIX component upgrades to a stable, locked-down production AIX environment, it is common to get "push back".  "Why is this necessary?  We aren't we seeing issues with other software?"It's a fair question that I have often struggled to answer; here are the talking points: OBIEE is memory intensive.  It is the entire purpose of the software to trade memory for repetitive, more expensive database requests across a network. OBIEE is implemented in C++ and is very dependent on the C++ runtime to behave correctly. OBIEE is aggressively thread efficient;  if atomic operations on a particular architecture do not work correctly, the software crashes. OBIEE dynamically loads third-party database client libraries directly into the nqsserver process.  If the library is not thread-safe, or corrupts process memory the OBIEE crash happens in an unrelated part of the code.  These are extremely difficult bugs to find. OBIEE software uses 99% common source across multiple platforms:  Windows, Linux, AIX, Solaris and HPUX.  If a crash happens on only one platform, we begin to suspect other factors.  load intensity, system differences, configuration choices, hardware failures.  It is rare to have a single product require so many diverse technical skills.   My role in support is to understand system configurations, performance issues, and crashes.   An analyst trained in Business Analytics can't be expected to know AIX internals in the depth required to make configuration choices.  Here are some guidelines. AIX C++ Runtime must be at  version 11.1.0.4$ lslpp -L | grep xlC.aixobiee software will crash if xlC.aix.rte is downlevel;  this is not a "try it" suggestion.Nov 2011 11.1.0.4 version  is appropriate for all AIX versions ( 5, 6, 7 )Download from here:https://www-304.ibm.com/support/docview.wss?uid=swg24031426 No reboot is necessary to install, it can even be installed while applications are using the current version.Restart the apps, and they will pick up the latest version. AIX 5.3 Technology Level 12 is required when running on Power5,6,7 processorsAIX 6.1 was introduced with the newer Power chips, and we have seen no issues with 6.1 or 7.1 versions.Customers with an unstable deployment, dozens of unexplained crashes, became stable after the upgrade.If your AIX system is 5.3, the minimum TL level should be at or higher than this:$ oslevel -s  5300-12-03-1107IBM typically supports only the two latest versions of AIX ( 6.1 and 7.1, for example).  AIX 5.3 is still supported and popular running in an LPAR. obiee userid limits$ ulimit -Ha  ( hard limits )$ ulimit -a   ( default limits )core file size (blocks)     unlimiteddata seg size (kbytes)      unlimitedfile size (blocks)          unlimitedmax memory size (kbytes)    unlimitedopen files                  10240 cpu time (seconds)          unlimitedvirtual memory (kbytes)     unlimitedIt is best to establish the values in /etc/security/limitsroot user is needed to observe and modify this file.If you modify a limit, you will need to relog in to change it again.  For example,$ ulimit -c 0$ ulimit -c 2097151cannot modify limit: Operation not permitted$ ulimit -c unlimited$ ulimit -c0There are only two meaningful values for ulimit -c ; zero or unlimited.Anything else is likely to produce a truncated core file that cannot be analyzed. Deploy 32-bit or 64-bit ?Early versions of OBIEE offered 32-bit or 64-bit choice to AIX customers.The 32-bit choice was needed if a database vendor did not supply a 64-bit client library.That's no longer an issue and beginning with OBIEE 11, 32-bit code is no longer shipped.A common error that leads to "out of memory" conditions to to accept the 32-bit memory configuration choices on 64-bit deployments.  The significant configuration choices are: Maximum process data (heap) size is in an AIX environment variableLDR_CNTRL=IGNOREUNLOAD@LOADPUBLIC@PREREAD_SHLIB@MAXDATA=0x... Two thread stack sizes are made in obiee NQSConfig.INI[ SERVER ]SERVER_THREAD_STACK_SIZE = 0;DB_GATEWAY_THREAD_STACK_SIZE = 0; Sort memory in NQSConfig.INI[ GENERAL ]SORT_MEMORY_SIZE = 4 MB ;SORT_BUFFER_INCREMENT_SIZE = 256 KB ; Choosing a value for MAXDATA:0x080000000  2GB Default maximum 32-bit heap size ( 8 with 7 zeros )0x100000000  4GB 64-bit breaking even with 32-bit ( 1 with 8 zeros )0x200000000  8GB 64-bit double 32-bit max0x400000000 16GB 64-bit safetyUsing 2GB heap size for a 64-bit process will almost certainly lead to an out-of-memory situation.Registers are twice as big ... consume twice as much memory in the heap.Upgrading to a 4GB heap for a 64-bit process is just "breaking even" with 32-bit.A 32-bit process is constrained by the 32-bit virtual addressing limits.  Heap memory is used for dynamic requirements of obiee software, thread stacks for each of the configured threads, and sometimes for shared libraries. 64-bit processes are not constrained in this way;  extra heap space can be configured for safety against a query that might create a sudden requirement for excessive storage.  If the storage is not available, this query might crash the whole server and disrupt existing users.There is no performance penalty on AIX for configuring more memory than required;  extra memory can be configured for safety.  If there are no other considerations, start with 8GB.Choosing a value for Thread Stack size:zero is the value documented to select an appropriate default for thread stack size.  My preference is to change this to an absolute value, even if you intend to use the documented default;  it provides better documentation and removes the "surprise" factor.There are two thread types that can be configured. GATEWAY is used by a thread pool to call a database client library to establish a DB connection.The default size is 256KB;  many customers raise this to 512KB ( no performance penalty for over-configuring ). This value must be set to 1 MB if Teradata connections are used. SERVER threads are used to run queries.  OBIEE uses recursive algorithms during the analysis of query structures which can consume significant thread stack storage.  It's difficult to provide guidance on a value that depends on data and complexity.  The general notion is to provide more space than you think you need,  "double down" and increase the value if you run out, otherwise inspect the query to understand why it is too complex for the thread stack.  There are protections built into the software to abort a single user query that is too complex, but the algorithms don't cover all situations.256 KB  The default 32-bit stack size.  Many customers increased this to 512KB on 32-bit.  A 64-bit server is very likely to crash with this value;  the stack contains mostly register values, which are twice as big.512 KB  The documented 64-bit default.  Some early releases of obiee didn't set this correctly, resulting in 256KB stacks.1 MB  The recommended 64-bit setting.  If your system only ever uses 512KB of stack space, there is no performance penalty for using 1MB stack size.2 MB  Many large customers use this value for safety.  No performance penalty.nqscheduler does not use the NQSConfig.INI file to set thread stack size.If this process crashes because the thread stack is too small, use this to set 2MB:export OBI_BACKGROUND_STACK_SIZE=2048 Shared libraries are not (shared) When application libraries are loaded at run-time, AIX makes a decision on whether to load the libraries in a "public" memory segment.  If the filesystem library permissions do not have the "Read-Other" permission bit, AIX loads the library into private process memory with two significant side-effects:* The libraries reduce the heap storage available.      Might be significant in 32-bit processes;  irrelevant in 64-bit processes.* Library code is loaded into multiple real pages for execution;  one copy for each process.Multiple execution images is a significant issue for both 32- and 64-bit processes.The "real memory pages" saved by using public memory segments is a minor concern.  Today's machines typically have plenty of real memory.The real problem with private copies of libraries is that they consume processor cache blocks, which are limited.   The same library instructions executing in different real pages will cause memory delays as the i-cache ( instruction cache 128KB blocks) are refreshed from real memory.   Performance loss because instructions are delayed is something that is difficult to measure without access to low-level cache fault data.   The machine just appears to be running slowly for no observable reason.This is an easy problem to detect, and an easy problem to correct.Detection:  "genld -l" AIX command produces a list of the libraries used by each process and the AIX memory address where they are loaded.32-bit public segment is 13 ( "dxxxxxxx" ).   private segments are 2-a.64-bit public segment is 9 ( "9xxxxxxxxxxxxxxx") ; private segment is 8.genld -l | grep -v ' d| 9' | sort +2provides a list of privately loaded libraries. Repair: chmod o+r <libname>AIX shared libraries will have a suffix of ".so" or ".a".Another technique is to change all libraries in a selected directory to repair those that might not be currently loaded.   The usual directories that need repair are obiee code, httpd code and plugins, database client libraries and java.chmod o+r /shr/dir/*.a /shr/dir/*.so Configure your system for diagnosticsProduction systems shouldn't crash, and yet bad things happen to good software.If obiee software crashes and produces a core, you should configure your system for reliable transfer of the failing conditions to Oracle Tech Support.  Here's what we need to be able to diagnose a core file from your system.* fullcore enabled. chdev -lsys0 -a fullcore=true* core naming enabled. chcore -n on -d* ulimit must not truncate core. see item 3.* pstack.sh is used to capture core documentation.* obidoc is used to capture current AIX configuration.* snapcore  AIX utility captures core and libraries. Use the proper syntax. $ snapcore -r corename executable-fullpath   /tmp/snapcore will contain the .pax.Z output file.  It is compressed.* If cores are directed to a common directory, ensure obiee userid can write to the directory.  ( chcore -p /cores -d ; chmod 777 /cores )The filesystem must have sufficient space to hold a crashing obiee application.Use:  df -k  Check the "Free" column ( not "% Used" )  8388608 is 8GB. Disable Oracle Client Library signal handlingThe Oracle DB Client Library is frequently distributed with the sqlplus development kit.By default, the library enables a signal handler, which will document a call stack if the application crashes.   The signal handler is not needed, and definitely disruptive to obiee diagnostics.   It needs to be disabled.   sqlnet.ora is typically located at:   $ORACLE_HOME/network/admin/sqlnet.oraAdd this line at the top of the file:   DIAG_SIGHANDLER_ENABLED=FALSE Disable async query in the RPD connection pool.This might be an obiee 10.1.3.4 issue only ( still checking  )."async query" must be disabled in the connection pools.It was designed to enable query cancellation to a database, and turned out to have too many edge conditions in normal communication that produced random corruption of data and crashes.  Please ensure it is turned off in the RPD. Check AIX error report (errpt).Errors external to obiee applications can trigger crashes.  $ /bin/errpt -aHardware errors ( firmware, adapters, disks ) should be reported to IBM support.All application core files are recorded by AIX;  the most recent ones are listed first. Reserved for something important to say.

    Read the article

  • UISegmentedControl selected segment color

    - by Mike
    Is there any way to customize color of selected segment in UISegmentedControl? I've found segmentedController.tintColor property, which lets me customize color of the whole segmented control. The problem is, when I select bright color for tintColor property, selected segment becomes almost unrecognizable (its color is almost the same as the rest of segmented control, so its hard to distinguish selected and unselected segments). So I cannot use any good bright colors for segmented control. The solution would be some separate property for selected segment color but I cannot find it. Did anyone solve this?

    Read the article

  • Drawing a clamped uniform cubic B-spline using Cairo

    - by Tamás
    I have a bunch of coordinates which are the control points of a clamped uniform cubic B-spline on the 2D plane. I would like to draw this curve using Cairo calls (in Python, using Cairo's Python bindings), but as far as I know, Cairo supports Bézier curves only. I also know that the segments of a B-spline between two control points can be drawn using Bézier curves, but I can't find the exact formulae anywhere. Given the coordinates of the control points, how can I derive the control points of the corresponding Bézier curves? Is there any efficient algorithm for that?

    Read the article

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