Search Results

Search found 3221 results on 129 pages for 'inline styles'.

Page 96/129 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • how do I get a new line, after using float:left?

    - by codeman73
    What I am trying to do is have rows of images, 6 images in each row. Some of these images need to have another image floating on top of them (flush with the lower-right corner). I was able to get that to work from this thread: http://stackoverflow.com/questions/48474/how-do-i-position-one-image-on-top-of-another-in-html However, now I'm unable to get the new row after the 6th image. Neither <BR> or <P> create a new line. They simply push the next image down several pixels, but the image is still in the same line. It seems like the float style is interfering with the <BR> and/or <P>. I tried using different styles for the image that starts a new row, like float:none and display:block, but neither worked. The odd thing is that the new line starts after the 7th image. Here's what I'm using so far: <style type="text/css"> .containerdiv { float: left; position: relative; } .containerdivNewLine { float: none; display: block; position: relative; } .cornerimage { position: absolute; bottom: 0; right: 0; } </style> <div class="containerdiv"> <img border="0" height="188" src="myImg" width="133" /> <img class="cornerimage" height="140" src="imageOnTop" width="105" /> </div> For the 7th image, when I'm trying to start a new row, I'm simply replacing the 'containerdiv' class with 'containerdivNewLine'.

    Read the article

  • ASP.NET enum dropdownlist validation

    - by Arun Kumar
    I have got a enum public enum TypeDesc { [Description("Please Specify")] PleaseSpecify, Auckland, Wellington, [Description("Palmerston North")] PalmerstonNorth, Christchurch } I am binding this enum to drop down list using the following code on page_Load protected void Page_Load(object sender, EventArgs e) { if (TypeDropDownList.Items.Count == 0) { foreach (TypeDesc newPatient in EnumToDropDown.EnumToList<TypeDesc>()) { TypeDropDownList.Items.Add(EnumToDropDown.GetEnumDescription(newPatient)); } } } public static string GetEnumDescription(Enum value) { FieldInfo fi = value.GetType().GetField(value.ToString()); DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); if (attributes != null && attributes.Length > 0) return attributes[0].Description; else return value.ToString(); } public static IEnumerable<T> EnumToList<T>() { Type enumType = typeof(T); // Can't use generic type constraints on value types, // so have to do check like this if (enumType.BaseType != typeof(Enum)) throw new ArgumentException("T must be of type System.Enum"); Array enumValArray = Enum.GetValues(enumType); List<T> enumValList = new List<T>(enumValArray.Length); foreach (int val in enumValArray) { enumValList.Add((T)Enum.Parse(enumType, val.ToString())); } return enumValList; } and my aspx page use the following code to validate <asp:DropDownList ID="TypeDropDownList" runat="server" > </asp:DropDownList> <asp:RequiredFieldValidator ID="TypeRequiredValidator" runat="server" ControlToValidate="TypeDropDownList" ErrorMessage="Please Select a City" Text="<img src='Styles/images/Exclamation.gif' />" ValidationGroup="city"></asp:RequiredFieldValidator> But my validation is accepting "Please Specify" as city name. I want to stop user to submit if the city is not selected.

    Read the article

  • Why is my Scala function returning type Unit and not whatever is the last line?

    - by Andy
    I am trying to figure out the issue, and tried different styles that I have read on Scala, but none of them work. My code is: .... val str = "(and x y)"; def stringParse ( exp: String, pos: Int, expreshHolder: ArrayBuffer[String], follow: Int ) var b = pos; //position of where in the expression String I am currently in val temp = expreshHolder; //holder of expressions without parens var arrayCounter = follow; //just counts to make sure an empty spot in the array is there to put in the strings if(exp(b) == '(') { b = b + 1; while(exp(b) == ' '){b = b + 1} //point of this is to just skip any spaces between paren and start of expression type if(exp(b) == 'a') { temp(arrayCounter) = exp(b).toString; b = b+1; temp(arrayCounter)+exp(b).toString; b = b+1; temp(arrayCounter) + exp(b).toString; arrayCounter+=1} temp; } } val hold: ArrayBuffer[String] = stringParse(str, 0, new ArrayBuffer[String], 0); for(test <- hold) println(test); My error is: Driver.scala:35: error: type mismatch; found : Unit required: scala.collection.mutable.ArrayBuffer[String] ho = stringParse(str, 0, ho, 0); ^one error found When I add an equals sign after the arguments in the method declaration, like so: def stringParse ( exp: String, pos: Int, expreshHolder: ArrayBuffer[String], follow: Int ) ={....} It changes it to "Any". I am confused on how this works. Any ideas? Much appreciated.

    Read the article

  • function not printing out anything

    - by Abdul Latif
    I have the following function below: public function setupHead($title){ $displayHead .='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>'.$title.'</title>'; $displayHead .='<script type="text/javascript" src="'.PATH.'js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="'.PATH.'js/thickbox.js"></script> <script type="text/javascript" src="'.PATH.'js/ui.core.js"></script> <!--<script type="text/javascript" src="'.PATH.'js/js.js"></script>--> <link rel="stylesheet" href="'.PATH.'css/thickbox.css" type="text/css" media="screen" /> <link rel="stylesheet" type="text/css" href="'.PATH.'css/styles.css"> <link rel="stylesheet" type="text/css" href="'.PATH.'css/menu_allbrowsers.css"> <link rel="stylesheet" href="'.PATH.'css/news.css" type="text/css" media="screen" /> <link rel="stylesheet" href="'.PATH.'css/text.css" type="text/css" media="screen" /> <script type="text/javascript" src="'.PATH.'js/swfobject.js"></script> <!--[if IE 7]><link rel="stylesheet" type="text/css" href="'.PATH.'css/IE7menu.css" /><![endif]--> <!--[if IE 6]><link rel="stylesheet" type="text/css" href="'.PATH.'css/ie6.css" /><![endif]--> <!--[if IE 7]><link rel="stylesheet" type="text/css" href="'.PATH.'css/ie7.css" /><![endif]--> </head>'; return $displayHead; } but when it call is using: echo classname->setupHead($title); nothing gets displayed. doesn't php allow html in strings? Thanks in advance

    Read the article

  • position of View on asp.net mvc site master page

    - by ognjenb
    How fix data table to open only in Main Content Frame? Structure of my site.master page is: left content, main content and right content. When open View page in main content she goes to the right content if it is large. Is this CSS problem? My problem is similar to this http://www.inq.me/post/ASPNet-MVC-Extension-method-to-create-a-Security-Aware-HtmlActionLink.aspx This is my CSS(come with template): /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRIMARY LAYOUT STYLES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ .content-container { position:relative; _height:1px; min-height:1px; width:900px; /* background:url(images/bg-column-left.png) repeat-y;*/ } .content-container-inner { /*background:url(images/bg-column-right.png) repeat-y right;*/ _height:1px; min-height:1px; /*padding:0 200px;*/ position:relative; /*width:900px;*/ } .content-main { padding :15px 0% 0px 2%; /*position:relative;*/ min-height:1px; _height:1px; float:left; position:relative; /*width:96%;*/ /*width:900px;*/ } .content-left { padding:20px 10px; float:left; width:180px; margin-top:-1px; position:relative; margin-left:-100%; right:200px; _left:200px; border-top:1px dotted #797979; } .content-right { padding :15px 10px 10px 10px; float:left; width:160px; position:relative; margin-right:-200px; } .ads { text-align:center; margin:20px 0; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Read the article

  • Magento delete some scripts

    - by Patrik van Dendis
    Hi I use a magento for my e-commerce. I have custom design, but when I show my source code I can see some scripts and css styles after my footer. I want edit it but I dont know where. <!--{%FOOTER_LINK}--> </div> </div> <script type='text/javascript' src='//www.beetailer.com/javascripts/beetailer.js'></script> <style type="text/css"> div.share-buttons {margin-top: 5px; margin-bottom: 2px; height: 28px; vertical-align: middle; text-align: justify} div.share-buttons-fb-like {width: 260px;} div.share-custom-container {width: 260px;} .share-buttons-fb-like .share-custom-container span {width: 260px !important;} iframe.fb_ltr {width: 260px !important;} div.top-container {margin-bottom: 0px; text-align: justify} .header-container .top-container {margin-bottom: 0px; text-align: justify} .header-container {margin-bottom: 0px;} div.share-buttons-og { margin-right: 5px !important;} .og-want {margin-top: 2px !important;} .og-own {margin-top: 2px !important;} </style>

    Read the article

  • Paperclip: Stay put on edit

    - by EricR
    When a user edits something in my application, they're forced to re-upload their image via paperclip even if they aren't changing it. Failing to do so will cause an error, since I validate_presence_of :image. This is quite annoying. How can I make it so Paperclip won't update its attributes if a user simply doesn't supply a new image on an edit? The photo controller is fresh out of Rails' scaffold generator. The rest of the source code is provided below. models/accommodation.rb class Accommodation < ActiveRecord::Base attr_accessible :photo validates_presence_of :photo has_one :photo has_many :notifications belongs_to :user accepts_nested_attributes_for :photo, :allow_destroy => true end controllers/accommodation_controller.rb class AccommodationsController < ApplicationController def index @accommodations = Accommodation.all end def show @accommodation = Accommodation.find(params[:id]) rescue ActiveRecord::RecordNotFound flash[:error] = "Accommodation not found." redirect_to :home end def new @accommodation = current_user.accommodations.build @accommodation.build_photo end def create @accommodation = current_user.accommodations.build(params[:accommodation]) if @accommodation.save flash[:notice] = "Successfully created your accommodation." redirect_to @accommodation else @accommodation.build_photo render :new end end def edit @accommodation = Accommodation.find(params[:id]) @accommodation.build_photo rescue ActiveRecord::RecordNotFound flash[:error] = "Accommodation not found." redirect_to :home end def update @accommodation = Accommodation.find(params[:id]) if @accommodation.update_attributes(params[:accommodation]) flash[:notice] = "Successfully updated accommodation." redirect_to @accommodation else @accommodation.build_photo render :edit end end def destroy @accommodation = Accommodation.find(params[:id]) @accommodation.destroy flash[:notice] = "Successfully destroyed accommodation." redirect_to :inkeep end end models/photo.rb class Photo < ActiveRecord::Base attr_accessible :image, :primary belongs_to :accommodation has_attached_file :image, :styles => { :thumb=> "100x100#", :small => "150x150>" } end

    Read the article

  • How do you Bind to a ComboBox in a DataTemplate?

    - by discwiz
    I have a listbox that is bound to an observable collection of Audio (custom class). The Audio class has two properties, DisplayText (string) and a property called TarpIds (Observable Collection of Integer). I need to allow the user to change the TarpID in the combo box for each list item displayed and catch the selection change. I created a DataTemplate that styles the DisplayText property from the Audio object and adds a ComboBox to display the available TarpIDs for this audio (These are dynamic and unique to each Audio). The DisplayText works great, but I can not get the TarpIDs to display in the ComboBox. Here is what I have so far and thanks for any help. FYI I set the ItemSource at run time that binds the ListUploadAudio to the Observable Collection of Audio. <Border BorderBrush="Red" Background="WhiteSmoke" CornerRadius="8"> <Border.Resources> <DataTemplate x:Key="UploadLayout" DataType="Audio"> <StackPanel Orientation="Vertical"> <TextBlock Text="{Binding Path=DisplayText}" FontWeight="Bold" Foreground="Blue"> </TextBlock> <ComboBox x:Name="ListBoxTarpIDs" ItemsSource="{Binding Path=TarpIds}"> </ComboBox> </StackPanel> </DataTemplate> </Border.Resources> <ListBox x:Name="ListUploadAudio" BorderBrush="Transparent" Background="Transparent" Width="230" Margin="10" Height="200" IsSynchronizedWithCurrentItem="True" SelectionMode="Multiple" ItemTemplate="{DynamicResource UploadLayout}"> </ListBox> </Border>

    Read the article

  • Should I use early returns in C#?

    - by Bobby
    I've learned Visual Basic and was always taught to keep the flow of the program without interruptions, like Goto, Exit and Return. Using nested ifs instead of one return statement seems very natural to me. Now that I'm partly migrating towards C#, I wonder what the best practice is for C-like languages. I've been working on a C# project for some time, and of course discover more code of ExampleB and it's hurting my mind somehow. But what is the best practice for this, what is more often used and are there any reasons against one of the styles? public void ExampleA() { if (a != b) { if (a != c) { bool foundIt; for (int i = 0; i < d.Count && !foundIt; i++) { if (element == f) foundIt = true; } } } } public void ExampleB() { if (a == b) return; if (a == c) return; foreach (object element in d) { if (element == f) break; } }

    Read the article

  • Should checkins be small steps or complete features?

    - by Caspin
    Two of version controls uses seem to dictate different checkin styles. distibution centric: changesets will generally reflect a complete feature. In general these checkins will be larger. This style is more user/maintainer friendly. rollback centric: changesets will be individual small steps so the history can function like an incredibly powerful undo. In general these checkins will be smaller. This style is more developer friendly. I like to use my version control as really powerful undo while while I banging away at some stubborn code/bug. In this way I'm not afraid to make drastic changes just to try out a possible solution. However, this seems to give me a fragmented file history with lots of "well that didn't work" checkins. If instead I try to have my changeset reflect complete features I loose the use of my version control software for experimentation. However, it is much easier for user/maintainers to figure out how the code is evolving. Which has great advantages for code reviews, managing multiple branches, etc. So what's a developer to do? checkin small steps or complete features?

    Read the article

  • Creating transparent gridlines

    - by Rob Penridge
    I'm trying to get the chart's gridlines to be transparent but it doesn't seem to be supported: http://support.sas.com/documentation/cdl/en/grstatug/63302/HTML/default/viewer.htm#n1f71f6e9v037an1jy274v66z4r1.htm I'm doing to try and blend the gridlines with the chart background color (which in my code can change between colors) which would make the gridlines subtle rather than jarring when background colors change. Here is my code: ** ** TAKE THE DEFAULT STYLE BEING USED. MODIFY IT SO THAT ** GRAPH GRIDLINES WILL BE GREEN AND MOSTLY TRANSPARENT *; proc template; define style my_style; parent = styles.default; style GraphGridLines from GraphGridLines / contrastcolor=green transparency=.05; end; run; ** ** LAYOUT TEMPLATE FOR A SIMPLE SERIES CHART *; proc template; define statgraph mychart; begingraph; layout overlay / wallcolor=black xaxisopts=(display=(line) griddisplay=on) yaxisopts=(display=(line)) ; seriesplot x=name y=height / lineattrs=(color=white); endlayout; endgraph; end; run; ** ** PLOT SAMPLE DATA USING CUSTOM STYLE AND CHART LAYOUT WE JUST DEFINED *; ods graphics / width=640 height=640 ; ods html style=my_style; proc sgrender data=sashelp.class template=mychart; run; ods html close; Is there another way to achieve this effect by blending the green color with the background color?

    Read the article

  • How to change CSS style of nested list items?

    - by Yasir
    I have a style for styling <a> elements in list items in a #navigation container. This is working fine. #navigation li a { text-decoration:none; background:#bfe5ff; color:#045e9f; width:125px; height:35px; padding-top:11px; display:block; float:left; margin-left:2px; text-align:center; font-size:18px; font-weight:bold; } Now in some <li>s I am inserting <div>s. In these I am again using a list again, but it should be different in style or have no style. When I put in <li>s, their style matches the outer <li> elements, but it should not. I am trying to use this: #newnavigation li a { font-size:12px; margin-left:20px; } but it's not working - it applies the "outer" styles. This is my markup: <ul id="navigation"> <li><a href="index.html">Home</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> <li class="browse"> <a href="#">Browse</a> <div id="browsecontainer"> <h3>Browse By Category</h3> <li><a href="#"></a></li> </div> </li> </ul>

    Read the article

  • URL routing in an MVC framework - PHP

    - by Walderman
    I'm developing an MVC framework in PHP from scratch; mostly for the learning experience but this could easily end up in a live project. I went through this tutorial as a base and I've expanded from there. Requests are made like this: examplesite.com/controller/action/param1/param2/ and so on... And this is my .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA] So all requests go to index.php and they are routed to the correct controller and action from there. If no controller or action is given, then the default 'index' is assumed for both. I have an index controller with an index action, which is supposed to be the home page of my site. I can access it by going to examplesite.com (since the index part is assumed). It has some images, a link to a stylesheet, and some scripts. They are linked with paths relative to index.php. I thought this would be fine since all request go to index.php and all content is simply included in this page using php. This works if I go to examplesite.com. I will see all of the images and styles, and scripts will run. However, if I go to examplesite.com/index, I am routed to the correct part of the site, but all of the links don't work. Does the browser think I am in a different folder? I would like to be able to use relative paths for all of the content in my site, because otherwise I need to use absolute paths everywhere to make sure things will show up. Is this possible?

    Read the article

  • Is there a way to have the equivalent of multiple :before and :after pseudo-elements in CSS?

    - by Sergey Basharov
    Currently I have this markup that represents an icon container and some elements styled with CSS inside it that in the end show as graphic icon. <div class="icon"> <div class="icon-element1"></div> <div class="icon-element2"></div> <div class="icon-element3"></div> </div> The number of the child elements can be different depending on the complexity of the icon. What I want is to somehow move as much as possible to CSS stylesheet, so that ideally I would have only <div class="icon"></div> and the rest would just render from CSS styles, something close in concept to :before/:after, a kind of virtual divs. I don't want to use JavaScript to add the elements dynamically. It would be possible to do this if we had multiple :before/:after. Here is an example of an icon I get by using the markup from above: As you can see, there are 3 child elements representing gray case, white screen and turquoise button. Please advise, how I can simplify this markup so that not to have to put all the divs each time I want this icon to be shown.

    Read the article

  • Should I be using Expression Blend to design really dynamic UIs?

    - by Robert Rossney
    My company's product is, at its core, a framework for developing metadata-driven UIs. I don't know how to characterize it less succinctly than that, and hope I won't need to for purposes of this question, but we'll see. I've been trying to come up to speed on WPF, and have been building UI prototypes here and there, and recently I decided to see if I could use Expression Blend to help with the design of these UIs. And I'm pretty mystified at this point. It appears to me as though Expresssion Blend is designed with the expectation that you already know all of the objects that are going to be present in the UI at design time. But our program generates these object dynamically at runtime. For instance, a data row might be presented in a horizontal StackPanel containing alternating TextBlocks (for captions) and TextBoxes (for data fields). The number of these objects depends on metadata about the number of columns in the data row. I can, pretty readily, write code that runs through a metadata record and populates a StackPanel dynamically, setting up the binding of all of the controls to properties in either the data or metadata. (A TextBox's Width might be bound to metadata, while its Text is bound to data.) But I can't even begin to figure out how to do something like this in Expression Blend. I can manually create all these controls, so that I have a set of controls that I can apply styles to and work out the visual design of the app, but it's really a pain to do this. I can write code that goes through my data model and emits XAML for all these controls, I suppose, and then copy and paste it. But I'm going to feel really stupid if it turns out there a way to do this sort of thing in Expression Blend and I've dropped back and punted because I'm too dim to figure out the right way to think of it. Is this enough information for someone to try formulating an answer?

    Read the article

  • The best way to write a jQuery plugin - If there is such a way?

    - by Nick Lowman
    There are quite a few ways to write plugins i.e. here's a nice example and what I've seen quite a lot of lately is the following code pattern and it's used by Doug Neiner here; (function($){ $.formatLink = function(el, options){ var base = this; base.$el = $(el); base.el = el; base.$el.data("formatLink", base); base.init = function(){ base.options = $.extend({}, $.formatLink.defaultOptions, options); //code here } base.init(); }; $.formatLink.defaultOptions = { }; $.fn.formatLink = function(options){ return this.each(function(){ (new $.formatLink(this, options)); }); }; })(jQuery); So, can anyone tell me the benefits of using the pattern above rather than the one below. I can't see the point in calling the $.extend function for every element in the jQuery stack (above), where the example below only does this once and then works on the stack. To test it I created two plugins, using both patterns, which applied styles to about 5000 li elements and the code below took about 1 second whereas the pattern above took about 1.3 seconds. (function($){ $.fn.formatLink = function(options){ var options = $.extend({}, $.fn.formatLink.defaultOptions, options || {}); return this.each(function(){ //code here }); }); $.fn.formatLink.defaultOptions ={} })(jQuery);

    Read the article

  • Is there any reason why jQuery Sortable would work in IE/Chrome but not Firefox?

    - by DNS
    I have a fairly straightforward list of horizontally floated items, like this: <div class="my-widget-container"> <div class="my-widget-column">...</div> ... </div> Both the container and each column have a fixed width, set using jQuery's .width(). The container is position: relative and the column is float: left and overflow: hidden. Not sure if any other styles/properties are relevant. When I apply a jQuery-UI sortable to this, the result is exactly what I'd expect in Chome 8 and IE 8; the columns can be dragged around to change their order. But in Firefox 3.6 I can click an item and drag to create a new sort-helper, yet the actual sort never happens; the real item's position in the DOM never changes. I dug around a little in Sortable, and added a debug print to _intersectsWithPointer. Whenever the drag helper moves, Sortable runs through its list of elements and uses this method to determine whether the drag helper has passed over one. What I saw was that item.left had the same value for all my columns, which is obviously not correct, and probably the source of the problem. It looks like all columns had a left position corresponding to that of the first column. I'm using jQuery 1.4.3 and jQuery UI Sortable 1.8. Those aren't the very latest versions, but they're pretty recent, and I don't see anything in the Sortable release notes that indicates any such problem has been fixed. Does anyone know what might be happening here, or have any ideas for further debugging?

    Read the article

  • How can I solve this CSS links inheritance problem?

    - by Craig Whitley
    It's stumped me an I've tried a couple of things - then again I'm not very experienced so I may just be going about it the wrong way. Basically I want to have different link styles for both the navigation and the pagination. The #navigation styling is overriding my .pagination styling though, and it doesn't appear to matter if the pagination is a class or an ID. I've also tried putting !important in the pagination styling, but this then makes the navigation inherit the pagination (been using firebug to check the inheritance). #navigation a:active, a:link, a:visited, a, a:focus { color: #ffde2f; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 24px; text-decoration: none; } #navigation a:hover { color: #ffffff; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 24px; text-decoration: none; } .pagination a:active, a:link, a:visited, a, a:focus { color: #fff; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 14px; text-decoration: none; } .pagination { color: #fff; font-size: 14px; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; }

    Read the article

  • Building Active Record Conditions in an array - private method 'scan' called error

    - by Nick
    Hi, I'm attempting to build a set of conditions dynamically using an array as suggested in the first answer here: http://stackoverflow.com/questions/1658990/one-or-more-params-in-model-find-conditions-with-ruby-on-rails. However I seem to be doing something incorrectly and I'm not sure if what I'm trying is fundamentally unsound or if I'm simply botching my syntax. I'm simplifying down to a single condition here to try to illustrate the issue as I've tried to built a simple Proof of concept along these lines before layering on the 5 different condition styles I'm contending with. This works: excluded.push 12 excluded.push 30 @allsites = Site.all(:conditions => ["id not in (?)", excluded]) This results in a private method 'scan' called error: excluded.push 12 excluded.push 30 conditionsSet << ["id not in (?)", excluded] @allsites = Site.all(:conditions => conditionsSet) Thanks for any advice. I wasn't sure if the proper thing was to put this as a followup item to the related question/answers I noted at the top. Since I've got a problem not an answer. If there is a better way to post this related to the existing post please let me know.

    Read the article

  • Is using a GUI worse than using bash and other text interface tools?

    - by Glycerine
    As a freelancer, and previous Adobe trainer, I get a look-in at many development workflows and alternate styles of programming and design and therefore quite open to different workflows. But a recent post I had, I needed to use SQL - so I whipped out navicat and wrote a nice join statement. I had sniggering comments and sideways glances when I told the developers I was working with navicat, I preferred a GUI to bash and I prefer Aptana to notepad. I felt a little insulted and under skilled as I didn't want to sit in front of reams of spewing green text. I know and use the tools when required but I prefer more attractive, modern products. Have you guys had this? What do you do to overcome it - apart from using bash and notepad more? How do you subdue a developer who's being arrogant about his skill? And is it my fault? I hope this question is not subjective, I do feel like I am inferior to my peers due to it - so some advise would really help.

    Read the article

  • Why initialize an object to empty

    - by ProgEnthu
    I am learning windows programming with the help of MSDN.Why would somebody initialize an object like the following? WNDCLASS wc = { }; Will this zero all the memory of the object? Whole source code is following: #ifndef UNICODE #define UNICODE #endif #include <windows.h> LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int nCmdShow) { // Register the window class. const wchar_t CLASS_NAME[] = L"Sample Window Class"; WNDCLASS wc = { }; wc.lpfnWndProc = WindowProc; wc.hInstance = hInstance; wc.lpszClassName = CLASS_NAME; RegisterClass(&wc); // Create the window. HWND hwnd = CreateWindowEx( 0, // Optional window styles. CLASS_NAME, // Window class L"Learn to Program Windows", // Window text WS_OVERLAPPEDWINDOW, // Window style // Size and position CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, // Parent window NULL, // Menu hInstance, // Instance handle NULL // Additional application data ); if (hwnd == NULL) { return 0; } ShowWindow(hwnd, nCmdShow); // Run the message loop. MSG msg = { }; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); DispatchMessage(&msg); } return 0; } LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_DESTROY: PostQuitMessage(0); return 0; case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint(hwnd, &ps); FillRect(hdc, &ps.rcPaint, (HBRUSH) (COLOR_WINDOW+1)); EndPaint(hwnd, &ps); } return 0; } return DefWindowProc(hwnd, uMsg, wParam, lParam); }

    Read the article

  • How to apply different CSS style to child elements as they occur inside one another?

    - by Starx
    For example my HTML is this <ul> <li>Sample 1</li> <li>Sample 2 <ul> <li>Sub 1</li> <li>Sub 2</li> <li>Sub 3 <ul> <li>Grandsub 1</li> <li>Grandsub 2</li> <li>Grandsub 3 <ul> <li>verySub 1</li> <li>verySub 2</li> </ul> </li> </ul> </li> </ul> </li> <li>Sample 3</li> </ul> I want to use different styles on every child <UL> without defining any class or id on them. I dont know how many child <ul> might occur inside one another so inline css will not to the job Is this possible?

    Read the article

  • Lite-Javascript Gallery - Can I position the img absolutely in relationship to the lis?

    - by blackessej
    I have a lite-javascript run image gallery. The javascript grabs each element in the list and places it as a background in the parent element. Then the CSS styles the thumbnails as small blocks with a defined height/width. A click-event for each object toggles it’s child’s element’s visibility and adds an “active” class name to the . Using CSS, I'm trying to place the absolutely to make it appear at the same position for each thumb, but it's moving in relation to the thumbs. Here's the CSS: #jgal li { background-position:50% 50%; background-repeat:no-repeat; border:solid #999 4px; cursor:pointer; display:block; float:left; height:60px; width:60px; margin-bottom:14px; margin-right:14px; opacity:0.5; } #jgal li img { position:absolute; top:0px; left:210px; display:none; } And the site: http://www.erisdesigns.net Thanks in advance for any help!

    Read the article

  • Dynamic use of :default_url in Paperclip

    - by dgilperez
    I'm trying to configure Paperclip to provide different missing images based on the instance's category attribute. Every category of the object has its own missing image. This is my first take: EDIT to add full models: class Service < ActiveRecord::Base attr_accessible :logo, :logo_file_name, :logo_content_type, :logo_file_size, :logo_updated_at belongs_to :category, :counter_cache => true has_attached_file :logo, :path => "/:id-:style-:filename", :url => ":s3_eu_url", :default_url => "/logos/:style/#{self.category.name]}.png", :styles => { :large => "600x400>", :medium => "300x200>", :small => "100x75>", :thumb => "60x42>" } end class Category < ActiveRecord::Base attr_accessible nil has_many :services end In my view, image_tag service.logo.url(:thumb) outputs: undefined method `category' for #<Class:0x0000010a731620> Any ideas? EDIT2: A working default_url is :default_url => "/logos/:style/missing.png", SOLUTION: See my own answer below.

    Read the article

  • Why are changes to classes ignored after dom changes?

    - by Lg102
    I have a price grid that uses relative positioning to move a field around, beneath a box with: overflow: hidden;. In this is field, there are absolute-positioned boxes containing prices. When this box is hovered, the matching values above and left of the will change color. In order to achieve this, a class is toggled using jQuery. This initially works. However, after the grid is moved, the class change doesn't affect the block above the grid anymore. In the Chrome console, i can see the class being added, but it's css-styling isn't applied. No other styles for the element have changed. I am 100% sure there is no other style-rule influencing the element, it just stops responding to the change in class after the DOM has been altered. Can i 'refresh' the DOM somehow? Edit: I've tried to get the relevant code only: Adding the cell in the first place: $("#price_dates_cells").append("<div id='"+weekday[theBeginDate.getDay()]+"-"+theBeginDate.getDate()+"-"+(theBeginDate.getMonth()-1)+"' class='datecell' style='left: "+( Math.floor( difference / ( 3600 * 24 * 1000) ) * ( cellwidth ) )+"px'>"+weekday[theBeginDate.getDay()]+"<br>"+theBeginDate.getDate()+" "+yearmonth[theBeginDate.getMonth()]+"</div>"); Toggle the class: var str_element = "#"+weekday[Bdate.getDay()]+"-"+Bdate.getDate()+"-"+(Bdate.getMonth()-1); $(str_element).toggleClass("red"); and the movement that seems to cause the problem: $('#price_grid').animate({"top": (( ( horizontalMovement ) * cellheight)) }, 'fast', 'linear');

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >