Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 54/613 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • ASP-style tags for Perl web development?

    - by Alex R
    I feel like I'm traveling 10 years back in time by asking this, but... Are there any modules, patches, or any "new" version of Perl (released in the last 10 years) to enable writing web-oriented Perl scripts using ASP-style tags? e.g. from ASP/JSP some html <% some code %> more HTML e.g. from PHP some html <? some code ?> more HTML Please don't worry about "why" I'm asking this... It's related to programming language research.

    Read the article

  • bitmap button not displaying in 3D style

    - by Rohit Sasikumar
    Hi, I want to display on my dialog, a bitmap button. I am using the below code CImage image; hr = image.Load(_T("myimage.png")); // just change extension to load jpg bitmap.Attach(image.Detach()); m_button.ModifyStyle(0,BS_BITMAP); m_button.SetBitmap(bitmap); This way bitmap is correctly displayed on button, but the button is not displayed in 3D style as normal buttons would look. I have set owner drawn property to false, still it displaying like this. Any ideas as to what could be wrong? Thanks, Rohit

    Read the article

  • PySide using Style Sheets to change QtoolBox

    - by efi_ex
    I'm Wondering if somebody knows a better reference than the QT one for style sheets. I try to change the background of the content from a QToolBox but background-color only changes the header of the toolbox and the background of the content it reveals is left in a standard color. I then tried to change the bg of QWidget which worked but left me with problems now at Radiobuttons and Checkboxes, i also think changing QWidget isn't a good solution. The first picture is with Qt standard colors (this is a maya tool) the second when i change QWidget http://i.imgur.com/MNlSedx.png?1 http://i.imgur.com/wuplpmw.png?1

    Read the article

  • Achieve Rails-style migrations in MS Access VBA application

    - by avguchenko
    This is a simple way to do Rails-style migrations in a VBA application. Just add additional migrations like migration(name, sql_string, database) to run_migratons and call run_migrations somewhere in the beginning of your execution. Function migrate(signature As String, sql As String, dbs As DAO.database) Dim rs As DAO.Recordset Set rs = dbs.OpenRecordset("select * from versions where migration = '" & signature & "'") If rs.EOF Then dbs.Execute (sql) rs.AddNew rs("migration") = signature rs.Update End If End Function Function setup_versions(dbs As DAO.database) Dim t As DAO.TableDef On Error Resume Next Set t = dbs.TableDefs("versions") If Err.Number <> 0 Then dbs.Execute ("CREATE TABLE versions (migration text)") End If Err.Clear End Function Function run_migrations(dbs As DAO.database) setup_versions(dbs) migrate("20100315142400_create_table", "CREATE TABLE table_name (field1 type, field 2 type)", dbs) 'add migrations here' End Function

    Read the article

  • Latex: reset font style

    - by watain
    Is there a way I can reset the style of a certain character sequence? I'm using the listings package to display source code and the prebreak property to display a escape character \ to indicate that the current lines was broken. The problem is that sometimes the backslash is colored because of the syntax highlighting used. So I need basically something like a resetstyle statement, as in the following imaginary example: \textbf{Some bold text \resetstyle{not bold, no color} foo bar} EDIT: Here are the settings that I'm using via lstset: \lstset{ extendedchars = \true, inputencoding = utf8, basicstyle = \scriptsize\ttfamily, breaklines = true, breakindent = 10pt, breakatwhitespace = true, breakautoindent = true, prebreak = \\, frame = leftline, showtabs = true, numbers = left, stepnumber = 2, numberstyle = \footnotesize, numbersep = 10pt, keywordstyle = \color[RGB]{0,0,255}, commentstyle = \itshape\color[RGB]{120,120,120}, stringstyle = \color[rgb]{0.627,0.126,0.941}, emphstyle = {[0]\color[RGB]{236,0,168}}, emphstyle = {[1]\color[RGB]{34,139,34}\underbar}, emphstyle = {[2]\textbf} }

    Read the article

  • Base-camp Style Subdomains and IDs of Models

    - by Newy
    I have an app that has Basecamp-style subdomains, that is, I have Projects, Users, Apples and Oranges. The Users, Apples and Oranges are all keyed to a Project and only exist in the http://project.myapp.com. I added a project_id to Users, Apples and Oranges and everything works, except of course that the ids of those three objects increment globally, and throughout my app I lookup objects by that id. This doesn't seem like best practice. Should I instead do lookups by a secondary key? How does that affect efficiency? If there's a good blog post that covers this, would be wesome.

    Read the article

  • Cast from Void* to TYPE* using C++ style cast: static_cast or reinterpret_cast

    - by David Relihan
    So if your converting from Void* to Type* or from Type* to Void* should you use: void func(void *p) { Params *params = static_cast<Params*>(p); } or void func(void *p) { Params *params = reinterpret_cast<Params*>(p); } To me static_cast seems the more correct but I've seen both used for the same purpose. Also, does the direction of the conversion matter. i.e. should I still use static_cast for: _beginthread(func,0,static_cast<void*>(params) I have read the other questions on C++ style casting but I'm still not sure what the correct way is for this scenario (I think it is static_cast)

    Read the article

  • How to have localized style when writing cell with xlwt

    - by lfagundes
    I'm writing an Excel spreadsheet with Python's xlwt and I need numbers to be formatted using "." as thousands separator, as it is in brazilian portuguese language. I have tried: style.num_format_str = r'#,##0' And it sets the thousands separator as ','. If I try setting num_format_str to '#.##0', I'll get number formatted as 1234.000 instead of 1.234. And if I open document in OpenOffice and format cells, I can set the language of the cell to "Portuguese (Brazil)" and then OpenOffice will show the format code as being "#.##0", but I don't find a way to set the cell's language to brazilian portuguese. Any ideas?

    Read the article

  • Problem with binding from style

    - by Maurizio Reginelli
    I have this block of xaml and I made a ViewModel which contains a property called MyBrush. I would like to set the grid background to that property but this block doesn't work. Could you tell me how can I do that? <Style x:Key="myKey" TargetType="myType"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="myType"> <Grid Background="{Binding RelativeSource={RelativeSource Self}, Path=MyBrush}"> ...

    Read the article

  • Drupal 6 / Views2 Grid style: whole cells link to nodes

    - by jackocnr
    I have a Users page, which is simply a nicely styled grid (HTML table) of users. I'm displaying a few fields for each one, and both the name and the profile picture have been set to link to the user node. What is the best way to change it so that the whole cell (HTML td) links to the user node? Would you have to use javascript? I've looked into modifying the theme of the view (over-riding the Style output e.g. views-view-grid--users.tpl.php), but cant see an elegant way to get the URL of the user node. And I think you would have to use javascript anyway to turn a whole block element into a link.

    Read the article

  • How to replace a div container with javascript

    - by Kovu
    Hi, I must have a little design in javascript. I have a menu with 5 entrys and only 1 HTML-page. So I will have a content-div and enabled and disabled different static content in it, each menu-entry is another content. I tried with 5 divs and disable 4 of them and enable 1, but the element under each other means every div is like a - enabled or not, so the "content" is moving then. Hope its understandable. Here is the code so far: <html><head><title>Des Einsame-Katerchen's kleine Homepage</title> <style type="text/css"> a:link { font-weight:bold; color:blue; text-decoration:none; } a:visited { font-weight:bold; color:blue; text-decoration:none; } a:focus { font-weight:bold; color:blue; text-decoration:none; } a:hover { font-weight:bold; color:blue; text-decoration:line-through; } a:active { font-weight:bold; color:blue; text-decoration:none; } h1:focus { background-color:red; } h1:hover { background-color:silver; } h1:active { background-color:green; } </style> <script> function an(id) { document.getElementById('start').style.visibility = 'hidden'; document.getElementById('start').style.height = '0px'; document.getElementById('me').style.visibility = 'hidden'; document.getElementById('me').style.height = '0px'; document.getElementById('rpg').style.visibility = 'hidden'; document.getElementById('rpg').style.height = '0px'; document.getElementById('musik').style.visibility = 'hidden'; document.getElementById('musik').style.height = '0px'; document.getElementById('screens').style.visibility = 'hidden'; document.getElementById('screens').style.height = '0px'; document.getElementById(id).style.visibility = 'visible'; document.getElementById(id).style.height = '500px'; } </script> </head> <body style=" " > <div style="width=100%; text-align:center; border: 1px red solid; height:40px;"> <div style="float:left; width:100px;"><a href="#" OnClick="an('start')" >Startseite</a></div> <div style="float:left; width:100px;"><a href="#" OnClick="an('me')" >Über mich</a></div> <div style="float:left; width:100px;"><a href="#" OnClick="an('rpg')" >RPG-Chars</a></div> <div style="float:left; width:100px;"><a href="#" OnClick="an('musik')" >Musik</a></div> <div style="float:left; width:150px;"><a href="#" OnClick="an('screens')" >Knuddels-Screens</a></div> </div> <br> <div id="start" style="border:1px red solid; width:500px; height:500px; overflow: visible; " > a </div> <div id="me" style="border:1px red solid; width:500px; height:0px; overflow: visible; visibility: hidden; " > b </div> <div id="rpg" style="border:1px red solid; width:500px; height:0px; overflow: visible; visibility: hidden; " > c </div> <div id="musik" style="border:1px red solid; width:500px; height:0px; overflow: visible; visibility: hidden; " > d </div> <div id="screens" style="border:1px red solid; width:500px; height:0px; overflow: visible; visibility: hidden; " > e </div> </body>

    Read the article

  • Androd ListView style

    - by xger86x
    Hi, i have a question about list views. I hope anyone knows the solution because i have been trying to solve this problem all the weekend. Well, i have a custom list view in which every row have a custom .xml (item_row.xml) with a set color background for the row item. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="70dip" android:orientation="vertical" android:background="@drawable/list_bg"> The problem is when i try to make a selector for the list. I want two things: When the item is focused, appears the typical orange rectangle over him. When the item is pressed the same. I have proved with a selector and a custom style but all i get is or the selector doesn't appear or the selector covering the item so i can't see it. If anyone can give me the right code i will be very grateful. Thanks

    Read the article

  • How to configure rime style in ICEfaces 3

    - by fresh_dev
    in icefaces 2 i was configuring rime style as follows: <h:head> <link href="./xmlhttp/css/xp/xp.css" rel="stylesheet" type="text/css"/> </h:head> <h:body styleClass="ice-skin-rime"> </h:body> <h:outputStylesheet library="org.icefaces.component.skins" name="rime.css" /> and i was wondering how to configure it in icefaces 3 because i tried the following and it doesn't work <context-param> <param-name>org.icefaces.ace.theme</param-name> <param-value>rime</param-value> </context-param> please advise thanks.

    Read the article

  • Regex for recursive "wiki-style" lists

    - by Syd Miller
    I'm trying to create a Regular Expression to match "wiki style" lists as in (using preg_replace_callback() ): * List Item 1 * List Item 2 *# List Item 2.1 *# List Item 2.2 * List Item 3 Asterisks denote Unordered Lists while Number-Signs denote Ordered Lists. I'm trying to get this so it can match infinite depth and so that * and # can be mixed. I tried the following expression (and variations of it): /\s([*#]{1,}) ([\S ]+)\s/si But it doesn't seem to want to work. What am I doing wrong? Or is there a better way of accomplishing this?

    Read the article

  • WPF. How do I create many LIstViews with the same look.

    - by Erik Z
    I've defined a listview in my recent project and realized that I will be using more listviews looking exactly the same and having the same solumns. Since I'm new to WPF am I curious of teh best way to do this. Is it to create a usercontrol? Use styles? I've tried to use styles but it didnt work the way I was hoping. I tried to set the "View" property using style, like this. <Style x:Key="ListViewStyle" TargetType="{x:Type ListView}"> <Setter Property="View"> <ListView.View> <GridView> But it didnt work so I'm asking for your opinion?! Thanks.

    Read the article

  • Condition check inside a function or before its call?

    - by Ashwin
    Which of these 2 programming styles do you prefer? Why? Are there particular advantages to one over the other? // Style 1 if (doBorder) doTheBorder(); if (doFrame) doTheFrame(); if (doDraw) doTheDraw(); void doTheBorder() { // ... } void doTheFrame() { // ... } void doTheDraw() { // ... } // Style 2 doTheBorder(); doTheFrame(); doTheDraw(); void doTheBorder() { if (!doBorder) return; // ... } void doTheFrame() { if (!doFrame) return; // ... } void doTheDraw() { if (!doDraw) return; // ... }

    Read the article

  • Best way to style GWT widgets in a library

    - by helios
    I'm developing some widgets into a library for internal use at the company I work for. I don't know what's the recommended way to style the widgets. There are at least these ways: use Widget.setPrimaryStyleName and let the user provide an external css. We use maven archetypes to build applications so we can provide default styles. Anyway I don't like it very much. use the GWT 2.0 CssResourceBundle. So we can compile the CSS into the module and it will be optimized (and it can be browser-dependant too). provide a module with the styling. Something like the default GWT themes. But I don't know how exactly this works. I want to: make the components as cohesive as I can (don't depend on externally included css's) leave open the door to modify styles (if I want to change the way some widget looks in a concrete application). What's your experience in this subject?

    Read the article

  • Remove year component from NSDateFormatter style

    - by JK
    I would like to present a date in the kCFDateFormatterFullStyle, but without the year. Is there any way to remove the year component from this style? My app requires localization so practically I cannot programmatically set the format string for all locales. I have come accross a solution which removes the "y" characters from the format string returned by the built in styles. Unfortunately, this is not acceptable as the year components are not represented by "y" in some other languages like Japanese. Any suggestions to get the kCFDateFormatterFullStyle without the year would be great! Thanks.

    Read the article

  • Pro/con: Initializing a variable in a conditional statement

    - by steffenj
    In C++ you can initialize a variable in an if statement, like so: if (CThing* pThing = GetThing()) { } Why would one consider this bad or good style? What are the benefits and disadvantages? Personally i like this style because it limits the scope of the pThing variable, so it can never be used accidentally when it is NULL. However, i don't like that you can't do this: if (CThing* pThing = GetThing() && pThing->IsReallySomeThing()) { } If there's a way to make the above work, please post. But if that's just not possible, i'd still like to know why. Question borrowed from here, similar topic but PHP.

    Read the article

  • Setting button width with fx:Style

    - by Kamo
    I have 4 buttons, all of them have the same width. <s:Button id="btn1" width="{btnWidth}" /> <s:Button id="btn2" width="{btnWidth}" /> <s:Button id="btn3" width="{btnWidth}" /> <s:Button id="btn4" width="{btnWidth}" /> Is it possible to set their width with Style, something like this: s|Button{ width: btnWidth; } I tried it, but auto-complete isn't working, which leads me to think that there's something wrong with the syntax. Basically my goal is to not have the width property set specifically for all 4.

    Read the article

  • styles/style.css No mapping found for HTTP request

    - by sonx
    Hi, it seems my styles folder added under the web folder is not getting mapped by dispatcher servlet on my JSP's. I get WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/onlinebasket/styles/style.css] in DispatcherServlet with name 'onlinebasket' here's my dispatcher servlet <servlet-mapping> <servlet-name>onlinebasket</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> and i this is my CSS URL on JSP <link rel="stylesheet" href="<c:url value="/styles/sytle.css"/>" type="text/css"/> This folder is on the web folder.

    Read the article

  • Is it necessarily bad style to ignore the return value of a method

    - by Jono
    Let's say I have a C# method public void CheckXYZ(int xyz) { // do some operation with side effects } Elsewhere in the same class is another method public int GetCheckedXYZ(int xyz) { int abc; // functionally equivalent operation to CheckXYZ, // with additional side effect of assigning a value to abc return abc; // this value is calculated during the check above } Is it necessarily bad style to refactor this by removing the CheckXYZ method, and replacing all existing CheckXYZ() calls with GetCheckedXYZ(), ignoring the return value? The returned type isn't IDisposable in this case. Does it come down to discretion?

    Read the article

  • How to name variables wich are structs

    - by evilpie
    Hello, i often work on private projects using the WinApi, and as you might know, it has thousands of named and typedefed structs like MEMORY_BASIC_INFORMATION. I will stick to this one in my question, what still is preferred, or better when you want to name a variable of this type. Is there some kind of style guide for this case? For example if i need that variable for the VirtualQueryEx function. Some ideas: MEMORY_BASIC_INFORMATION memoryBasicInformation; MEMORY_BASIC_INFORMATION memory_basic_information; Just use the name of the struct non captialized and with or without the underlines. MEMORY_BASIC_INFORMATION basicInformation; MEMORY_BASIC_INFORMATION information; Short form? MEMORY_BASIC_INFORMATION mbi; I often see this style, using the abbreviation of the struct name. MEMORY_BASIC_INFORMATION buffer; VirtualQueryEx defines the third parameter lpBuffer (where you pass the pointer to the struct), so using this name might be an idea, too. Cheers

    Read the article

  • How does the verbosity of identifiers affect the performance of a programmer?

    - by DR
    I always wondered: Are there any hard facts which would indicate that either shorter or longer identifiers are better? Example: clrscr() opposed to ClearScreen() Short identifiers should be faster to read because there are fewer characters but longer identifiers often better resemble natural language and therefore also should be faster to read. Are there other aspects which suggest either a short or a verbose style? EDIT: Just to clarify: I didn't ask: "What would you do in this case?". I asked for reasons to prefer one over the other, i.e. this is not a poll question. Please, if you can, add some reason on why one would prefer one style over the other.

    Read the article

  • WPF DataGrid: How to set content alignment of RowHeader to 'Center'

    - by Nike
    I use WPF DataGrid. I put a text value in RowHeader and want to set alignment of RowHeader content to 'Center'. I tried this: <toolkit:DataGrid.RowHeaderStyle> <Style TargetType="{x:Type toolkit:Primitives.DataGridRowHeader}"> <Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="HorizontalContentAlignment" Value="Center"/> </Style> </toolkit:DataGrid.RowHeaderStyle> but it doesn't work. Actually I think that there is TextBlock in RowHeader and I need to set its TextAlignment Property to Center. How can do it?

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >