Search Results

Search found 784 results on 32 pages for 'cody gray'.

Page 23/32 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • UISearchBar in a UITableView

    - by petert
    I'm trying to mimic the behaviour of a table view like one in the iPod app for Artists - it's a sectioned table view with a section index on the right and with a search bar at the top, but initially hidden when view shown. I am using sdk 3.1.2 and IB, so simply dragged a UISearchDisplayController in to my NIB - it does wire everything up ready for searching. The problem starts because I'm adding the UISearchBar in to the first section of the UITableView, because if I understand correctly I must do this so I can jump to the search bar by touching the search icon in the section index directly? When the table view appears I see the search bar but it has resized and I now have a white block behind the section index at the top. It does'nt take the color of the UISearchBar's surround which interestingly is different to that shown in Interface Builder. Searching around, I did find a tip to add a small navigation bar and a UISearchBar in a UIView, then add this to the table view cell - this works.. BUT the color of the navigation bar's background is what you'd expect normally (gray), not the different color as noted above?! More interesting, if I click the search bar to start a search, then click Cancel, all is fixed!!! The background along the whole tableview cell when the search bar is, is the same!!?! Thanks for any tips.

    Read the article

  • jQuery modal Dialog over iFrame

    - by Ram
    I am using jQuery UI dialog for modal popups. I have some iframes in my page as well. The iFrame (z-Index = 1500) sits on top of the parent page (z-index =1000). I open the modal dialog from the parent page. I am trying to set the z-index using $('modal').dialog('option','zIndex',3000); but this is not working. I also tried stack:true (to stack it on top), and .dialog( 'moveToTop' ) as well, but they don't seem to work. Here is the code: Parent page: using style sheet : from "css/ui-darkness/jquery-ui-1.7.2.custom.css" using scripts: jquery-1.3.2.min.js && jquery-ui-1.7.2.custom.min.js <script type="text/javascript" language="javascript"> function TestModal() { var modal = "<div id='modal'>Hello popup world</div>"; $(modal).dialog({ modal: true, title: 'Modal Popup', zIndex: 12000, // settin it here works, but I want to set it at runtime instead of setting it at design time close: function() { setTimeout(TestModal, 5000); $(this).remove(); } }); $('modal').dialog('option', 'zIndex', 11000); // these dont work $('modal').dialog('moveToTop'); // these dont work $('modal').dialog('option', 'stack', true); // these dont work } /** Run with defaults **/ $(document).ready(function() { TestModal(); }); </script> <div> Hello World <br /> </div> <iframe src="blocker.htm" width="100%" height="100%" frameborder="0" scrolling="no" name="myInlineFrame" style="z-index:10000;background-color:Gray;position:absolute;top:0px;left:0px" ALLOWTRANSPARENCY="false"> </iframe> iframe : blocker.htm .wrap{width:100%;height:100%} I am an iframe and I am evil

    Read the article

  • JPEG artifacts removal in C#

    - by Arcturus
    Hi all I am building a website for a club that is part of a mother organisation. I am downloading (leeching ;) ) the images that where put on profile pages of the mother organisation to show on my own page. But their website has a nice white background, and my website has a nice gray gradient on the background. This does not match nicely. So my idea was to edit the images before saving them to my server. I am using GDI+ to enhance my images, and when I use the method MakeTransparent of Bitmap, it does work, and it does do what its supposed to do, but I still have these white jpeg artifacts all over the place. The artifacts makes the image so bad, I am better off not making the image transparent and just leaving it white, but thats really ugly on my own website. I can always at a nice border with a white background of course, but I rather change the background to transparent. So I was wondering if and how I can remove some simple JPEG artifacts in C#. Has anyone ever done this before? Thanks for your time. Example image: Transformed image:

    Read the article

  • Hyphen vs Dash : Replace Dash with Hyphen

    - by soldieraman
    Alright so we had a problem recently In reporting services some of the String Columns were appearing as gibberish Chinese characters. On further investigation we found it is the hyphen. Well that's what we though first. On further investigation we found it a dash (or en dash) . Basically the reason this has happened is people copy pasting values into this column from word which converts hyphens into dashes automatically. But if you look at the database they both look the same. Though on the application side you can see the difference. How do I replace the dash with a normal hyphen. If you copy the value in put it in SQL server. A hyphen is gray while a dash is black but they both look exactly the same (i.e not bigger or smaller). Problem is I can't write a REPLACE script then (they are the freakin same) REPLACE ('-' with '-') is there a way special characters like the dash can be identified in SQL server? SQL Server v 2005

    Read the article

  • Median Filter a bi-level image with JAI

    - by Mark
    I'd like to apply a Median Filter to a bi-level image and output a bi-level image. The JAI median filter seems to output an RGB image, which I'm having trouble downconverting back to bi-level. Currently I can't even get the image back into gray color-space, my code looks like this: BufferedImage src; // contains a bi-level image ParameterBlock pb = new ParameterBlock(); pb.addSource(src); pb.add(MedianFilterDescriptor.MEDIAN_MASK_SQUARE); pb.add(3); RenderedOp result = JAI.create("MedianFilter", pb); ParameterBlock pb2 = new ParameterBlock(); pb2.addSource(result); pb2.add(new double[][]{{0.33, 0.34, 0.33, 0}}); RenderedOp grayResult = JAI.create("BandCombine", pb2); BufferedImage foo = grayResult.getAsBufferedImage(); This code hangs on the grayResult line and appears not to return. I assume that I'll eventually need to call the "Binarize" operation in JAI. Edit: Actually, the code appears to be stalling once I call getAsBufferedImage(), but returns nearly instantly when the second operation ("BandCombine") is removed. Is there a better way to keep the Median Filtering in the source color domain? If not, how do I downconvert back to binary?

    Read the article

  • Updating CoreData xcdatamodel file troubles - attribute type change

    - by San
    I noticed several questions related to this topic go unanswered. Is this such a gray area that nobody really understands it? Here is my problem: I am a midway in the development of my app and the app has never been used ouside of my iphone simulator.One of the attributes in my core data structure requires a type change.Since my app has never been used outside of my iPhone Simulator, I first deleted the sqlite file. Doubling the effort of this step, I also went into iPhone Simulator menu and selected "Reset Content and Settings...". Than, I edited the xcdatamodel file and changed the type of my attribute. I saved the file and exited. Without any other changes, I compiled. I expected it to fail because of my type change. It did not! After this, I assigned a value with new type to my attribute and it fails to compile?! Is there something else that I need to do for the change to take an effect? I would really, really appreciate an answer to my question. Thank you!

    Read the article

  • QT- QImage and multi-threading problem.

    - by umanga
    Greetings all, Please refer to image at : http://i48.tinypic.com/316qb78.jpg We are developing an application to extract cell edges from MRC images from electron microscope. MRC file format stores volumetric pixel data (http://en.wikipedia.org/wiki/Voxel) and we simply use 3D char array(char***) to load and store data (gray scale values) from a MRC file. As shown in the image,there are 3 viewers to display XY,YZ and ZX planes respectively. Scrollbars on the top of the viewers use to change the image slice along an axis. Here is the steps we do when user changes the scrollbar position. 1) get the new scrollbar value.(this is the selected slice) 2) for the relavant plane (YZ,XY or ZX), generate (char* slice;) array for the selected slice by reading 3D char array (char***) 3) Create a new QImage* (Format_RGB888) and set pixel values by reading 'slice' (using img-setPixel(x,y,c);) 4) This new QImage* is painted in the paintEvent() method. We are going to execute "edge-detection" process in a seperate thread since it is an intensive process.During this process we need to draw detected curve (set of pixels) on top of above QImage*.(as a layer).This means we need to call drawPoint() methods outside the QT thread. Is it the best wayto use QImage for this case? What is the best way to execute QT drawing methods from another thread? thanks in advance,

    Read the article

  • add JButton into frame with JTable

    - by Edan
    hello, I would like to know how to put a button inside a frame that contain JTable inside. (The button should not be inside a cell, but after the table ends) Here is the example code I wrote so far: class SimpleTableExample extends JFrame { // Instance attributes used in this example private JPanel topPanel; private JTable table; private JScrollPane scrollPane; private JButton update_Button; // Constructor of main frame public SimpleTableExample() { // Set the frame characteristics setTitle("Add new item" ); setSize(300, 200); setBackground( Color.gray ); // Create a panel to hold all other components topPanel = new JPanel(); topPanel.setLayout( new BorderLayout() ); getContentPane().add( topPanel ); // Create columns names String columnNames[] = {"Item Description", "Item Type", "Item Price"}; // Create some data String dataValues[][] = {{ "0", "Entree", "0" }}; // Create a new table instance table = new JTable( dataValues, columnNames ); //////////////////////////// JComboBox item_Type_Combobox = new JComboBox(); item_Type_Combobox = new JComboBox(item_Type.values()); TableColumn column = table.getColumnModel().getColumn(1); column.setCellEditor(new DefaultCellEditor(item_Type_Combobox)); //////////////////////////// // Add the table to a scrolling pane scrollPane = new JScrollPane( table ); topPanel.add( scrollPane, BorderLayout.CENTER ); } } How do I add button after the table I created? thanks in advance

    Read the article

  • EmguCV: Can't find ColorType abstract class

    - by roverred
    EmguCV ColorType wiki I'm trying to create a ColorType abstract class variable but it says the type or namespace does not exist. However I have access to the classes that extend it. I also tried adding all Emgu.CV libraries and have all the references and .dll files in the bin folder. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Drawing; using Emgu.CV; using Emgu.CV.Util; using Emgu.CV.GPU; using Emgu.CV.ML; using Emgu.CV.OCR; using Emgu.CV.OpenCL; using Emgu.CV.Stitching; using Emgu.CV.VideoStab; using Emgu.CV.Structure; using Emgu.CV.UI; using Emgu.CV.CvEnum; namespace mySpace { class foo { private ColorType the color; //invalid can't find ColorType private ColorType myColor = new Gray(); //invalid } } Any ideas? Thanks for any help.

    Read the article

  • Draw an Inset NSShadow and Inset Stroke

    - by Alexsander Akers
    I have an NSBezierPath and I want to draw in inset shadow (similar to Photoshop) inside the path. Is there anyway to do this? Also, I know you can -stroke paths, but can you stroke inside a path (similar to Stroke Inside in Photoshop)? Update This is the code I'm using. The first part makes a white shadow downwards. The second part draws the gray gradient. The third part draws the black inset shadow. Assume path is an NSBezierPath instance and that clr(...) returns an NSColor from a hex string. NSShadow * shadow = [NSShadow new]; [shadow setShadowColor: [NSColor colorWithDeviceWhite: 1.0f alpha: 0.5f]]; [shadow setShadowBlurRadius: 0.0f]; [shadow setShadowOffset: NSMakeSize(0, 1)]; [shadow set]; [shadow release]; NSGradient * gradient = [[NSGradient alloc] initWithColorsAndLocations: clr(@"#262729"), 0.0f, clr(@"#37383a"), 0.43f, clr(@"#37383a"), 1.0f, nil]; [gradient drawInBezierPath: path angle: 90.0f]; [gradient release]; [NSGraphicsContext saveGraphicsState]; [path setClip]; shadow = [NSShadow new]; [shadow setShadowColor: [NSColor redColor]]; [shadow setShadowBlurRadius: 0.0f]; [shadow setShadowOffset: NSMakeSize(0, -1)]; [shadow set]; [shadow release]; [path stroke]; [NSGraphicsContext restoreGraphicsState]; Here you can see a gradient fill, a white drop shadow downwards, and a black inner shadow downwards.

    Read the article

  • Seam:token tag not being respected

    - by JBristow
    When I click a command button, and then hit the browser back button to the form and click it again, it submits a second time without throwing the proper exception... Even stranger, the form id itself is DIFFERENT when I come back, which implies it has regenerated a "valid" form id at some point. Here's the relevant code: Any ideas? <h:form id="accountActivationForm"> <s:token/> <a4j:commandButton id="cancelActivateAccountButton" action="#{controller[cancelAction]}" image="/images/button-Cancel-gray.gif" reRender="#{reRenderList}" oncomplete="#{onCancelComplete}" /> &#160; <a4j:commandButton id="activateAccountButton" action="#{controller[agreeAction]}" image="/images/button-i-agree-continue.gif" styleClass="activate-account-button" reRender="#{reRenderList}" oncomplete="#{onActivationComplete}"/> </h:form> Clarifications: I inherited this, so I'm trying to change it as little as possible. (It's used in a couple places.) Each action returns a view, not null. I have confirmed this by stepping through line-by-line. The reRenderList is empty in my current test-case. onActivationComplete is also empty. I'm going to be going template-by-template to see if someone made it with nested forms, because my coworkers have had unrelated problems due to that, so it couldn't hurt to eliminate that as a possible problem.

    Read the article

  • In Firefox 2, usage of overflow:hidden makes other divs overlap current div

    - by Shankar
    Hi, When I use overflow:hidden for div which is positioned absolute (for menu), other div overlaps. Here is the code. It works fine in FF3. Any help appreciated. Please note that html should be as it is. Also if you can provide solution, just by changing styles of menu div (the div which contains menu text) it is more helpful for me. Thanks in advance Here is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Title of the document</title> </head> <body> <div style="position:relative"> <div> <div style="height:20px;overflow:hidden"> <div style="position:absolute;width:200px;height:100px;top:0px;background-color:black;z-index:1">menu</div> </div> </div> <div style="position:relative;height:200px;background-color:gray;"></div> </div> </body> </html>

    Read the article

  • Windows Phone 7 ListBox uncustomizable?

    - by Roy
    I've just recently started development using Visual Studio 2010 Express for Windows Phone and I put in a ListBox. I can't seem to manipulate the formatting. No matter what I do, the background is black/gray, the selected items have a blue border, and there is padding between the items in the listbox (i'm using images). Here is my code: Xaml: <Grid x:Name="ContentGrid" Grid.Row="1"> <Grid Name="gallery"> <Grid.RowDefinitions> <RowDefinition Height="370" /> <RowDefinition Height="150" /> </Grid.RowDefinitions> <Border BorderBrush="Red" Width="450" CornerRadius="4" BorderThickness="2" Background="Red" Margin="10,30,20,10" Padding="6,6,6,6"> <Image Grid.Row="0" Grid.Column="0" Height="360" x:Name="imgPreview"/> </Border> <ListBox x:Name="lbScrollGallery" Grid.Row="1" Grid.Column="0" Padding="0" VerticalAlignment="Top" Width="450" SelectionChanged="ScrollerSelectionChanged" d:LayoutOverrides="HorizontalAlignment" ScrollViewer.HorizontalScrollBarVisibility="Hidden"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <Image Width="100" Height="100" Stretch="Fill" Name="imgSource" VerticalAlignment="Center" Source="{Binding Path=Url}" /> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </Grid> </Grid> Is there some way I can customize the listbox? Like change the background to red or make the padding between different items 0?

    Read the article

  • Umbraco template issues

    - by bomortensen
    Hi fellow Umbraco users, I'm currently building my first umbraco website and since I'm completely new to umbraco I've already ran into a problem which I'm sure is pretty straight-forward to do. That said, I'm by no means a beginner when it comes to building sites that run on a (open source) CMS as I've been using Joomla! since it was called Mambo. Anyway, the site I'm building is here: my site What I want to do is to have some content in the white box that changes when you mouseover/hover one of the menu items. Also that content has to stay "active" when you've clicked on a link (i.e. if you click on "Profile" I need to highlight the Profile menu item with the gray color and the white boxs content needs to be what would be related to the Profile menu item. How do I go about this? What would be the best practice when it comes to showing multiple content on a site? I've watched the video about multiple Content Place Holders, but I never really got it to work. I can't get a page to display in the NavigationPlaceHolder (the placeholder I put in the white box), but thats because the actual page is Frontpage.aspx and not WhateverIsInThenavigationPlaceHolder.aspx. If I go to the mysite.dk/WhateverIsInTheNavigationPlaceHolder.aspx it shows up fine. What have I missed here? :) Thanks in advance! If my question is not clear in some ways, please tell me and I will try to explain it better. All the best, Bo

    Read the article

  • TranslateTransform for drag and drop in Silverlight

    - by fuzzyman
    We're trying to implement drag and drop in Silverlight (3). We want users to be able to drag elements from a treeview onto another part of a UI. The parent element is a Grid, and we've been trying to use a TranslateTransform along with the MouseLeftButtonDown, MouseMove (etc) events, as recommended by various online examples. For example: http://www.85turns.com/2008/08/13/drag-and-drop-silverlight-example/ We're doing this in IronPython, but that should be more or less irrelevant. The drag start is correctly initiated, but the item we are dragging appears in the 'wrong' location (offset a few hundred pixels to the right and down from the cursor) and I can't for the life of me work out why. Basic xaml: <Grid x:Name="layout_root"> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition Height="120"/> </Grid.RowDefinitions> <Border x:Name="drag" Background="LightGray" Width="40" Height="15" Visibility="Collapsed" Canvas.ZIndex="10"> <Border.RenderTransform> <TranslateTransform x:Name="transform" X="0" Y="0" /> </Border.RenderTransform> <TextBlock x:Name="dragText" TextAlignment="Center" Foreground="Gray" Text="foo" /> </Border> ... </Grid> The startDrag method is triggered by the MouseLeftButtonDown event (on a TextBlock in a TreeViewItem.Header). onDrag is triggered by MouseMove. In the following code self.root is Application.Current.RootVisual (top level UI element from app.xaml): def startDrag(self, sender, event): self.root.drag.Visibility = Visibility.Visible self.root.dragText.Text = sender.Text position = event.GetPosition(self.root.drag.Parent) self.root.drag.transform.X = position.X self.root.drag.transform.Y = position.Y self.root.CaptureMouse() self._captured = True def onDrag(self, sender, event): if self._captured: position = event.GetPosition(self.root.drag.Parent) self.root.drag.transform.X = position.X self.root.drag.transform.Y = position.Y The dragged item follows the mouse move, but is offset considerably. Any idea what I am doing wrong and how to correct it?

    Read the article

  • Layering Cocoa WebView - Drawing on top?

    - by Josh
    http://stackoverflow.com/questions/1618498/webview-in-core-animation-layer The only other thread I can find is the above which doesn't necessarily fit my needs. Is there a reliable way to simply draw a view on top of a webview? I've tried to layer a regular NSView on top of WebView, and it draws right at first, but any movement in the webview (scrolling the page etc) appears to invalidate the view and produces visual artifacts. I've tried: [[[NSApp mainWindow] contentView] addSubview:view positioned:NSWindowAbove relativeTo:webView]; No luck there, same problems -- z-ordering doesn't seem to work unless I'm missing something. Is this just a limitation of webviews? I also tried implementing the view above as a window, which worked much better (just controlled the location of the window programmatically). However, the desired behavior is for the user to enter some text into this window, but for it not to steal "focus" -- ie the main window goes inactive (the x - + go gray) when the user clicks on the text field in the new window. Any way to avoid that? I've tried subclassing NSWindow and overriding canBecomeKey (return YES) and canBecomeMain (return NO) but the window still steals focus. Josh

    Read the article

  • Prevent empty tooltips at a wpf datagrid

    - by TheCalendarProgrammer
    I am working on a calendar program, which consists mainly of a WPF DataGrid. As there is not always enough space to display all the entries of a day (which is a DataGridCell), a tooltip with all the entries of the day shell appear at mouse over. This works so far with the code snippet shown below. And now the (little) problem: If there are no entries for a day, no tooltip shell pop up. With the code below an empty tooltip pops up. <DataGridTemplateColumn x:Name="Entry" IsReadOnly="True"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Grid> <TextBlock Text="{Binding EntryText}" Foreground="{Binding EntryForeground}" FontWeight="{Binding EntryFontWeight}"> </TextBlock> <TextBlock Text="{Binding RightAlignedText}" Foreground="Gray" Background="Transparent"> <TextBlock.ToolTip> <TextBlock Text="{Binding AllEntriesText}"/> </TextBlock.ToolTip> </TextBlock> </Grid> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> The Databinding is made via myCalDataGrid.Itemssource = _listOfDays; in code behind, where a 'Day' is the view model for a single calendar row.

    Read the article

  • Algorithm for finding the best routes for food distribution in game

    - by Tautrimas
    Hello, I'm designing a city building game and got into a problem. Imagine Sierra's Caesar III game mechanics: you have many city districts with one market each. There are several granaries over the distance connected with a directed weighted graph. The difference: people (here cars) are units that form traffic jams (here goes the graph weights). Note: in Ceasar game series, people harvested food and stockpiled it in several big granaries, whereas many markets (small shops) took food from the granaries and delivered it to the citizens. The task: tell each district where they should be getting their food from while taking least time and minimizing congestions on the city's roads. Map example Sample diagram Suppose that yellow districts need 7, 7 and 4 apples accordingly. Bluish granaries have 7 and 11 apples accordingly. Suppose edges weights to be proportional to their length. Then, the solution should be something like the gray numbers indicated on the edges. Eg, first district gets 4 apples from the 1st and 3 apples from the 2nd granary, while the last district gets 4 apples from only the 2nd granary. Here, vertical roads are first occupied to the max, and then the remaining workers are sent to the diagonal paths. Question What practical and very fast algorithm should I use? I was looking at some papers (Congestion Games: Optimization in Competition etc.) describing congestion games, but could not get the big picture. Any help is very appreciated! P. S. I can post very little links and no images because of new user restriction.

    Read the article

  • HTML/CSS issue with a:hover and spans

    - by Tribalcomm
    Any way I can get this working? I have a block of code: <p><a href="http://foo.com"><span class="title">Title</span><br /><br /> Some text no greater than a couple of lines...</a></p> My styles are: p {color:#FFF;} a {color:#999;} .title {color:#FFF; font-weight:bold;} a:hover {color:#FF0;} My problem is as follows: I want the title to be white and bold and the body to be gray, but when you hover over any part, I want the title AND text to become yellow. However, in the above scenario, only the text becomes yellow because the span color (white) overrides the a:hover. If I add: .title:hover {color:#FF0;} then the title color only changes if I specifically hover over the title. It also doesn't change the text to yellow, as it is now a span hover... Any way I can resolve this, even if it requires a little JS? Thanks!

    Read the article

  • Why does the Chrome spacing work in one JS file and not the other?

    - by Matrym
    If you highlight and copy the text in the first paragraph on this page, then paste it into a rich text editor (dreamweaver or gmail in rich text mode), you will see that some of the text is automagically linked. Basically, it works: http://seox.org/link-building-pro.html -- http://seox.org/lbp/old-pretty.js I'm trying to build a second version, but somewhere along the way I broke it. If you go along with the same process on this new url, spacing before and after the link are removed in Chrome: http://seox.org/test.html -- http://seox.org/lbp/lb-core.js Why does the spacing work correctly in the first one, but not in the second? More importantly, how do I fix the second one so that it doesn't bug out? I asked a variation of this question before, and got a helpful and interesting answer, but hopefully I've asked the question with full detail this time around. Thanks in advance for your time! Edit: I've added a bounty to this post, and would greatly appreciate precise instructions on how to fix the bug (rather than general suggestions. To better illustrate the bug, I've copied the gray box (from the second page) below. Note how the spacing is removed before and after the a tags: Link Building 2 is an amazing tool that helps your website visitors share your content, with proper attribution. It connects to email, social sharing sites, eCommerce sites, and is the<a href="http://seox.org/test.html#seo">SEO</a>'s best friend. Think of it as the sneeze in the viral marketing metaphor. <div> <p id="credit"><br /> Read more about<a href="http://seox.org/test.html">Text Citations</a>by<a href="http://seox.org">seox.org</a></p> </div>

    Read the article

  • Help with animating an element in jQuery

    - by alex
    I have an unordered list with a few list elements. #tags { width: 300px; height: 300px; position: relative; border: 1px solid red; list-style: none none; } #tags li { position: absolute; background: gray; } I have also started writing a jQuery plugin to animate the list elements. So far, I place the list elements randomly in the parent container, and choose a random font size for the text. My next step (which I am a bit stuck on) is to animate the list elements... essentially, I want the list elements to do something like this Slide from left to right whilst getting slightly larger up to the middle and then dropping in size back to normal when it hits the right border. Then, it should do the same in reverse, however it should also set a negative 'z-index' and maybe fade in opacity a bit. The first bit I'm really stuck on, is how to determine if the element is near the middle, in a way that I can have a value that starts at 0.1 on the far left hand size and is 1 in the middle and then back to 0.1 on the far right hand size. Basically, I want them to appear as if they are going around in a faux 3D circle into the page. Then I could do something like this $(this).css({ fontSize: percentageTowardsMiddle * 14, }); Do you know how I could do this? Thanks

    Read the article

  • How to perform spatial partitioning in n-dimensions?

    - by kevin42
    I'm trying to design an implementation of Vector Quantization as a c++ template class that can handle different types and dimensions of vectors (e.g. 16 dimension vectors of bytes, or 4d vectors of doubles, etc). I've been reading up on the algorithms, and I understand most of it: here and here I want to implement the Linde-Buzo-Gray (LBG) Algorithm, but I'm having difficulty figuring out the general algorithm for partitioning the clusters. I think I need to define a plane (hyperplane?) that splits the vectors in a cluster so there is an equal number on each side of the plane. [edit to add more info] This is an iterative process, but I think I start by finding the centroid of all the vectors, then use that centroid to define the splitting plane, get the centroid of each of the sides of the plane, continuing until I have the number of clusters needed for the VQ algorithm (iterating to optimize for less distortion along the way). The animation in the first link above shows it nicely. My questions are: What is an algorithm to find the plane once I have the centroid? How can I test a vector to see if it is on either side of that plane?

    Read the article

  • I can't set a border around my StackPanel. Any help?

    - by Sergio Tapia
    Here's my XAML code: <Window x:Class="CarFinder.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Search for cars in TuMomo" Height="480" Width="600"> <DockPanel Margin="8"> <Border CornerRadius="6" BorderBrush="Gray" Background="LightGray" BorderThickness="2" Padding="8"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Height="25"> <TextBlock FontSize="14" Padding="0 0 8 0"> Search: </TextBlock> <TextBox x:Name="txtSearchTerm" Width="400" /> <Image Source="/CarFinder;component/Images/Chrysanthemum.jpg" /> </StackPanel> </Border> <StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Height="25"> </StackPanel> </DockPanel> </Window> The border is set around the entire window. And also, when I create another StackPanel it's added to the right of my previous StackPanel instead of being added under it. What's the reason for this?

    Read the article

  • Webpage data scraping using Java

    - by Gemma
    I am now trying to implement a simple HTML webpage scraper using Java.Now I have a small problem. Suppose I have the following HTML fragment. <div id="sr-h-left" class="sr-comp"> <a class="link-gray-underline" id="compare_header" rel="nofollow" href="javascript:i18nCompareProd('/serv/main/buyer/ProductCompare.jsp?nxtg=41980a1c051f-0942A6ADCF43B802');"> <span style="cursor: pointer;" class="sr-h-o">Compare</span> </a> </div> <div id="sr-h-right" class="sr-summary"> <div id="sr-num-results"> <div class="sr-h-o-r">Showing 1 - 30 of 1,439 matches, The data I am interested is the integer 1.439 shown at the bottom.I am just wondering how can I get that integer out of the HTML. I am now considering using a regular expression,and then use the java.util.Pattern to help get the data out,but still not very clear about the process. I would be grateful if you guys could give me some hint or idea on this data scraping. Thanks a lot.

    Read the article

  • Misalignement in the output Bitmap created from a byte array

    - by Daniel
    I am trying to understand why I have troubles creating a Bitmap from a byte array. I post this after a careful scrutiny of the existing posts about Bitmap creation from byte arrays, like the followings: Creating a bitmap from a byte[], Working with Image and Bitmap in c#?, C#: Bitmap Creation using bytes array My code is aimed to execute a filter on a digital image 8bppIndexed writing the pixel value on a byte [] buffer to be converted again (after some processing to manage gray levels) in a 8BppIndexed Bitmap My input image is a trivial image created by means of specific perl code: https://www.box.com/shared/zqt46c4pcvmxhc92i7ct Of course, after executing the filter the output image has lost the first and last rows and the first and last columns, due to the way the filter manage borders, so from the original 256 x 256 image i get a 254 x 254 image. Just to stay focused on the issue I have commented the code responsible for executing the filter so that the operation really performed is an obvious: ComputedPixel = InputImage.GetPixel(myColumn, myRow).R; I know, i should use lock and unlock but I prefer one headache one by one. Anyway this code should be a sort of identity transform, and at last i use: private unsafe void FillOutputImage() { OutputImage = new Bitmap (OutputImageCols, OutputImageRows , PixelFormat .Format8bppIndexed); ColorPalette ncp = OutputImage.Palette; for (int i = 0; i < 256; i++) ncp.Entries[i] = Color .FromArgb(255, i, i, i); OutputImage.Palette = ncp; Rectangle area = new Rectangle(0, 0, OutputImageCols, OutputImageRows); var data = OutputImage.LockBits(area, ImageLockMode.WriteOnly, OutputImage.PixelFormat); Marshal .Copy (byteBuffer, 0, data.Scan0, byteBuffer.Length); OutputImage.UnlockBits(data); } The output image I get is the following: https://www.box.com/shared/p6tubyi6dsf7cyregg9e It is quite clear that I am losing a pixel per row, but i cannot understand why: I have carefully controlled all the parameters: OutputImageCols, OutputImageRows and the byte [] byteBuffer length and content even writing known values as way to test. The code is nearly identical to other code posted in stackOverflow and elsewhere. Someone maybe could help to identify where the problem is? Thanks a lot

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >