Search Results

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

Page 107/129 | < Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >

  • ASP.NET: I'm getting strange output when styling a Label control...

    - by pkiyan
    .labelOne { border-width:thin; border-style:solid; border-color:Red; background-color:Silver; } <asp:Label ID="Label1" runat="server" CssClass="labelOne"> <h1>Hello world</h1> </asp:Label> <br /><br /> <asp:Label ID="Label2" runat="server" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" BackColor="Silver"> <h1>Hello world</h1> </asp:Label> Hello. In the code sample above I have 2 Label controls with their contents set to an h1 header tag. The first Label is styled using css, and the second with the Label's inline properties (both Labels have identical styling). But the first Label doesn't output properly, it's border is broken. If I replace the first Label's markup with plain "Hello world" text it renders properly, but it breaks again when I use markup. Can someone explain why this is happening?

    Read the article

  • Compile time type determination in C++

    - by dicroce
    A coworker recently showed me some code that he found online. It appears to allow compile time determination of whether a type has an "is a" relationship with another type. I think this is totally awesome, but I have to admit that I'm clueless as to how this actually works. Can anyone explain this to me? template<typename BaseT, typename DerivedT> inline bool isRelated(const DerivedT&) { DerivedT derived(); char test(const BaseT&); // sizeof(test()) == sizeof(char) char (&test(...))[2]; // sizeof(test()) == sizeof(char[2]) struct conversion { enum { exists = (sizeof(test(derived())) == sizeof(char)) }; }; return conversion::exists; } Once this function is defined, you can use it like this: #include <iostream> class base {}; class derived : public base {}; class unrelated {}; int main() { base b; derived d; unrelated u; if( isRelated<base>( b ) ) std::cout << "b is related to base" << std::endl; if( isRelated<base>( d ) ) std::cout << "d is related to base" << std::endl; if( !isRelated<base>( u ) ) std::cout << "u is not related to base" << std::endl; }

    Read the article

  • kernel get stack when signalled

    - by yoavstr
    hi there i write readers and writers where the kernel have to syncronize between them and block writer who already read a massage when i am in the queue waiting I get signal so I do the fallowing while (i_Allready_Read(myf) == ALLREADY_READ || isExistWriter == false ) //while (!(i_Allready_Read(aliveProc,current->pid))) { int i, is_sig = 0; printk(KERN_INFO "\n\n*****entered set in read ******\n\n" ); if (i_Allready_Read(myf) == ALLREADY_READ ) wait_event_interruptible (readWaitQ1, !i_Allready_Read(myf)); else wait_event_interruptible (readWaitQ1, isExistWriter); //printk(KERN_INFO "Read Wakeup %d\n",current->pid); for (i = 0; i < _NSIG_WORDS && !is_sig; i++) { is_sig = current->pending.signal.sig[i] & ~current->blocked.sig[i]; } if (is_sig) { handledClose(myf); module_put (THIS_MODULE); return -EINTR; } } return 0;//success } inline void handledClose(struct file *myf)//v { /* *if we close the writer other writer *would be able to enter to permissiones */ if (myf == writerpid ) { isExistWriter = DOESNT_EXIST; //printk(KERN_INFO "procfs_close : this is pid that just closed %d \n", writerpid); } /* *else its a reader so our numofreaders *need to decremented */ else { removeFromArr(myf); numOfReaders--; } } and my close does nothing ... what did i do wrong?

    Read the article

  • optimize output value using a class and public member

    - by wiso
    Suppose you have a function, and you call it a lot of times, every time the function return a big object. I've optimized the problem using a functor that return void, and store the returning value in a public member: #include <vector> const int N = 100; std::vector<double> fun(const std::vector<double> & v, const int n) { std::vector<double> output = v; output[n] *= output[n]; return output; } class F { public: F() : output(N) {}; std::vector<double> output; void operator()(const std::vector<double> & v, const int n) { output = v; output[n] *= n; } }; int main() { std::vector<double> start(N,10.); std::vector<double> end(N); double a; // first solution for (unsigned long int i = 0; i != 10000000; ++i) a = fun(start, 2)[3]; // second solution F f; for (unsigned long int i = 0; i != 10000000; ++i) { f(start, 2); a = f.output[3]; } } Yes, I can use inline or optimize in an other way this problem, but here I want to stress on this problem: with the functor I declare and construct the output variable output only one time, using the function I do that every time it is called. The second solution is two time faster than the first with g++ -O1 or g++ -O2. What do you think about it, is it an ugly optimization?

    Read the article

  • CSS horizontal scrolling overflow with jQuery slider

    - by Jeffrey
    I'm trying to setup a full screen jquery slider. I've broken the project into two steps 1) css and 2) js. 1) CSS, below is a picture of what I'm shooting for (no fixed height) and below that is the code I have so far that doesn't work. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <style type="text/css"> /* Positioning */ #container { width: 2500px; } .block { display: inline; } /* Styling */ .block img { padding: 5px; } </style> </head> <body> <div id="container"> <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div> <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div> <div class="block"><img src="http://i42.tinypic.com/1zp2poz.gif"></div> </div> </body> </html> 2) Javascript, using jquery I'd like the divs to slide left when clicked on them... like the jQuery Coda Slider if possible. Thanks, any help is appreciated.

    Read the article

  • CSS: Why is my floated <span> being displayed below an <a>nchor in IE6/7 but not IE8/FF

    - by gsquare567
    i'm getting this weird CSS bug in ie6/7 (but not in ie8 or firefox): for some reason, my nchor and , two inline elements, which are on the same line, are being displayed on different lines. the span is floating to the right, too! heres the HTML: <div class="sidebartextbg"><a href="journey.php" style="width:50%" title="Track past, present and future milestones during your employment">Journey</a> <span class="notificationNumber">2</span> <!-- JOURNEY COUNT: end --> </div> and here's the CSS: .sidebartextbg { background:url("../images/sidebartextbg.gif") repeat-x scroll 0 0 transparent; border-bottom:1px solid #A3A88B; font-size:14px; line-height:18px; margin:0 auto; padding:5px 9px; width:270px; } .notificationNumber { background:url("../images/oval_edges.gif") no-repeat scroll 0 0 transparent; color:#FFFFFF; float:right; padding:0 7px; position:relative; text-align:center; width:17px; } so: why would the floated span be displayed on the line under the nchor? thanks!

    Read the article

  • HTML email image inverts on link click Outlook 07/10/13

    - by Matt Maclennan
    I'm having an issue on a HTML email in Word rendered Outlooks (2007, 2010, 2013) where I click an image link, and when the mouse is clicked, the image inverts... Here is the code below... <td align="left" width="360" valign="top" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse;" class="hide"> <a href="#" target="_blank"> <img src="test.jpg" width="360" height="528" alt="alt tag" style="display:block;" class="img_mob centertable" border="0" align="left"> </a> </td> Here is a comparison on the image clicked/not clicked... I have tried putting a text-decoration: none on the link. All the links are styled inline as well. This is the only image that it is having this issue on the email, so tried re-saving the image with no luck. The image is saved as a JPEG and SRGB from a Photoshop PSD. Any ideas? Thanks.

    Read the article

  • Namespace scoped aliases for generic types in C#

    - by TN
    Let's have a following example: public class X { } public class Y { } public class Z { } public delegate IDictionary<Y, IList<Z>> Bar(IList<X> x, int i); public interface IFoo { // ... Bar Bar { get; } } public class Foo : IFoo { // ... public Bar Bar { get { return null; //... } } } void Main() { IFoo foo; //= ... IEnumerable<IList<X>> source; //= ... var results = source.Select(foo.Bar); } The compiler says: The type arguments for method 'System.Linq.Enumerable.Select(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. It's because, it cannot convert Bar to Func<IList<X>, int, IDictionary<Y, IList<Z>>>. It would be great if I could create type namespace scoped type aliases for generic types in C#. Then I would define Bar not as a delegate, but rather I would define it as an namespace scoped alias for Func<IList<X>, int, IDictionary<Y, IList<Z>>>. public alias Bar = Func<IList<X>, int, IDictionary<Y, IList<Z>>>; I could then also define namespace scoped alias for e.g. IDictionary<Y, IList<Z>>. And if used appropriately:), it will make the code more readable. Now I have inline the generic types and the real code is not well readable:( Have you find the same trouble:)? Is there any good reason why it is not in C# 3.0? Or there is no good reason, it's just matter of money and/or time? EDIT: I know that I can use using, but it is not namespace based - not so convenient for my case.

    Read the article

  • How make this jquery function reusable?

    - by Pandiya Chendur
    Comsider this jquery function, function showresults(jsonobj) { $.each(jsonobj, function(i, employee) { divs += '<div class="resultsdiv"><br /><span style="display: inline-block;width:150px;" class="resultName">' + employee.Emp_Name + '</span><span class="resultfields" style="padding-left:100px;">Category&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.Desig_Name + '</span><br /><br /><span id="SalaryBasis" class="resultfields">Salary Basis&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.SalaryBasis + '</span><span class="resultfields" style="padding-left:25px;">Salary&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.FixedSalary + '</span><span style="font-size:110%;font-weight:bolder;padding-left:25px;">Address&nbsp;:</span>&nbsp;<span class="resultfieldvalues">' + employee.Address + '</span></div>'; }); } Here i am iterating my json data and drawing div elements.... As you see these div elements are hardcoded how to pass these html div elements dynamically by a variable... var divs=<div></div> function showresults(jsonobj,divs) { $.each(jsonobj, function(i, employee) { divs += divs Is this correct way of doing but there will be an error employee object wont be there know when my divs variable declared outside the function... Any suggestion...

    Read the article

  • IE7 - jquery addClass() breaks floating elements

    - by Patrick
    I have this nav that uses addClass('hover') when the mouse is rolled over an item. This works fine except in IE7 when the addClass function is called every element with float:left stops floating and the page totally loses its structure. This is my JS: _this.position_sub_menus = function(){ $('#header #nav > ul > li').mouseenter( function(e){ pos = $(this).offset(); height = $(this).height(); lvl2 = '#' + $(this).attr('id') + '-submenu'; if( $(this).position().left > ($('#nav').width()/2)){ pos.left = pos.left - $(lvl2).width() + $(this).width(); } $(this).addClass('hover'); $(lvl2).show(); $(lvl2).css( { 'left' : (pos.left - 12) + 'px', 'top' : pos.top + height + 'px'}); } ); This is the CSS of the of the elements that break: display: inline; float: left; margin-left: 10px; margin-right: 10px; position: relative; It's CSS from the 960 grid system. When I comment out the $(this).addClass('hover'); line the floated elements dont break. Is anyone familiar with this IE7 problem? Thanks guys

    Read the article

  • How to print contents from a session variable by looping in a foreach statement

    - by itsover9000
    im trying to write a code where can print and loop through the contents of my session variable by using a foreach statement here is my code <form class="form form-inline" method = "post" action="reportmaker.php"> <select name="rfield"> <option value="">--Select Field--</option> <?php $sc2=mysql_query("SELECT * from searchcolumn s left join report_fields r on s.scol_id=r.field_id where s.category != 'wh'"); foreach($sc2 as $sc){ ?> <option value="<?php echo $sc[advsearch_col]; ?>"><?php echo $sc[advsearch_name]; ?></option> <?php } ?> </select> <button type="submit" value = "submit" id="add" name="add" class="btn pull-right">Add More</button> </form> <?php if(isset($_POST['add'])) { $_SESSION['temp'][]=$_POST['rfield']; } if($_SESSION[temp][]!=""){ foreach($_SESSION[temp][] as $temp) { echo $temp; } } ?> the error that appears with this code is Fatal error: Cannot use [] for reading the line where the error is is this if($_SESSION[temp][]!=""){ i need to print the contents of the session array and this is the only way i know how is there a way to fix this? thanks =========EDIT thanks for the answers guys i finally got it

    Read the article

  • Documentation style: how do you differentiate variable names from the rest of the text within a comm

    - by Alix
    Hi, This is a quite superfluous and uninteresting question, I'm afraid, but I always wonder about this. When you're commenting code with inline comments (as opposed to comments that will appear in the generated documentation) and the name of a variable appears in the comment, how do you differentiate it from normal text? E.g.: // Try to parse type. parsedType = tryParse(type); In the comment, "type" is the name of the variable. Do you mark it in any way to signify that it's a symbol and not just part of the comment's text? I've seen things like this: // Try to parse "type". // Try to parse 'type'. // Try to parse *type*. // Try to parse <type>. // Try to parse [type]. And also: // Try to parse variable type. (I don't think the last one is very helpful; it's a bit confusing; you could think "variable" is an adjective there) Do you have any preference? I find that I need to use some kind of marker; otherwise the comments are sometimes ambiguous, or at least force you to reread them when you realise a particular word in the comment was actually the name of a variable. (In comments that will appear in the documentation I use the appropriate tags for the generator, of course: @code, <code></code>, etc) Thanks!

    Read the article

  • jQuery .die isnt killing an attached event?

    - by adam
    Hi I've just started experimenting with .live and .die and having some great results but one thing isn't working. I've been tinkering with firebugs console to try out my written code live to see if i can figure out the reason why .die isn't killing off an attached event. First if i do this //attach ajax submission $('a[href$=edit]').live("click", function(event) { $.get($(this).attr("href"), null, null); return false; }); Then as expected when I click on a link the ajax fires off and my server side code injects a form for inline editing. But sometimes I want to disable this behaviour and also make the link unclickable so I do the following //unbind ajax form creation when we click on a link, then disable its semantic behaviour $('a[href$=edit]').die("click").click( function(){ return false; } ); which works but if then try to remove this and restore that ajax goodness with the code below it doesn't work, Instead the link remains unclickable. I cant figure out why? Can anyone help? //remove any previous events from the links $('a[href$=edit]').die(); //attach ajax submission $('a[href$=edit]').live("click", function(event) { $.get($(this).attr("href"), null, null); return false; });

    Read the article

  • JavaScript text slideshow not working?

    - by I Build Websites
    I'm making a Javascript slideshow for my blog yet the array doesn't seem to be working. Can someone please say what I've been doing wrong <SCRIPT type="text/javascript"> var blog = new Array() blog[0]= "<h4>Sunday 17 of June 2012</h4><p title='Blog'>Donec tempus risus eget ligula viverra eget placerat odio tincidunt. Duis nisl sem, scelerisque faucibus congue vitae, accumsan at lectus. Cras vestibulum arcu ut lorem luctus eu pharetra tortor ultricies. Nam iaculis orci mauris. Etiam luctus, mauris sed adipiscing ullamcorper, augue enim volutpat sem, ut sagittis ipsum nibh ac nulla. Nam ultrices, quam eget sollicitudin porta, sapien mauris pulvinar augue, posuere hendrerit erat ligula ut magna. Maecenas laoreet nisi vitae magna consectetur a mollis purus tristique. Pellentesque elementum arcu non urna convallis eleifend. Aliquam eu lorem sed risus tempus tempor. Donec malesuada velit in odio vulputate iaculis. In tristique neque quis velit posuere adipiscing. Nullam dui neque, scelerisque non egestas feugiat, pellentesque vitae mauris.</p><hr>" and so the array continues till function display1() { document.getElementById(blogShow).innerHTML( blog[0]) } function display2() { document.getElementById(blogShow).innerHTML(blog[1]) } function display3() { document.getElementById(blogShow).innerHTML(blog[2]) } function display4() { document.getElementById(blogShow).innerHTML(blog[3]) } function display5() { document.getElementById(blogShow).innerHTML(blog[4]) } </SCRIPT> <div id="blogShow"> <SCRIPT type="text/javascript">display1()</SCRIPT> </div> <div id="blogNav"> <input type="button" onClick="display2()" value="1" class="button"> <input type="button" onClick="display3()" value="2" class="button"> <input type="button" onClick="display4()" value="3" class="button"> <input type="button" onClick="display5()" value="4" class="button"> </div> I know it's all inline and i will clean up after it works

    Read the article

  • Performance of stored proc when updating columns selectively based on parameters?

    - by kprobst
    I'm trying to figure out if this is relatively well-performing T-SQL (this is SQL Server 2008). I need to create a stored procedure that updates a table. The proc accepts as many parameters as there are columns in the table, and with the exception of the PK column, they all default to NULL. The body of the procedure looks like this: CREATE PROCEDURE proc_repo_update @object_id bigint ,@object_name varchar(50) = NULL ,@object_type char(2) = NULL ,@object_weight int = NULL ,@owner_id int = NULL -- ...etc AS BEGIN update object_repo set object_name = ISNULL(@object_name, object_name) ,object_type = ISNULL(@object_type, object_type) ,object_weight = ISNULL(@object_weight, object_weight) ,owner_id = ISNULL(@owner_id, owner_id) -- ...etc where object_id = @object_id return @@ROWCOUNT END So basically: Update a column only if its corresponding parameter was provided, and leave the rest alone. This works well enough, but as the ISNULL call will return the value of the column if the received parameter was null, will SQL Server optimize this somehow? This might be a performance bottleneck on the application where the table might be updated heavily (insertion will be uncommon so the performance there is not a problem). So I'm trying to figure out what's the best way to do this. Is there a way to condition the column expressions with something like CASE WHEN or something? The table will be indexed up the wazoo as well for read performance. Is this the best approach? My alternative at this point is to create the UPDATE expression in code (e.g. inline SQL) and execute it against the server. This would solve my doubts about performance, but I'd rather leave this in a stored proc if possible.

    Read the article

  • What's a good way to write batch scripts in C#?

    - by Scott Bilas
    I would like to write simple scripts in C#. Stuff I would normally use .bat or 4NT .btm files for. Copying files, parsing text, asking user input, and so on. Fairly simple but doing this stuff right in a batch file is really hard (no exceptions for example). I'm familiar with command line "scripting" wrappers like AxScript so that gets me part of the way there. What I'm missing is the easy file-manipulation framework. I want to be able to do cd(".."), copy(srcFile, destFile) type functionality. Tools I have tried: NANT, which we use in our build process. Not a good scripting tool. Insanely verbose XML syntax and to add a simple function you must write an extension assembly. Can't do it inline. PowerShell. Looks great, but I just haven't been able to switch over to this as my primary shell. Too many differences from 4NT. Whatever I do needs to run from an ordinary command prompt and not require a special shell to run it through. Can PowerShell be used as a script executor? Perl/Python/Ruby. Really hate learning an entirely new language and framework just to do batch file operations. Haven't been able to dedicate the time I need to do this. Plus, we're a 99% .NET shop for our toolchain and I really want to leverage our existing experience and codebase. Are there frameworks out there that are trying to solve this problem of "make a batch file in C#" that you have used? I want the power of C#/.NET with the immediate-mode type functionality of a typical cmd.exe shell language. Am I alone in wanting something like this?

    Read the article

  • Two floating div's, one underneath. works in every browser except IE

    - by Veltar
    So I have an html-structure that looks like this: <div id="contact-wrapper"> <div> <h4>België</h4> <p>Tuinwijklaan 79<br /> 9000 Gent<br /> Tel. 0468/115967<br /> [email protected]<br /> </p> </div> <div> <h4>Nederland</h4> <p>Kerkstraat 423-C<br /> 1017 HX Amsterdam<br /> Tel: +32 468 11 59 67<br /> [email protected] </p> </div><br /> <a id="link-contact" href="#">Contacteer ons</a> </div> The two div's are displayed next to each other, and the link under it, like this: But in ie9 it shows like this: This is my css for the divs: footer div#contact-wrapper, footer h1 { float: left; } footer div#contact-wrapper div { margin: 16px 0px 0px 45px; float: left; } footer div#contact-wrapper div:first-of-type { padding-right: 30px; margin-left: 60px; border-right: 1px dashed #a3b0b9; } footer div#contact-wrapper a#link-contact { display: inline-block; background: #ffffff url('../img/contact-arrow.gif') no-repeat 95% center; border: 4px solid #bbc2c7; font-size: 12px; color: #bbc2c7; margin: 5px 0px 0px 60px; padding: 3px 0px 3px 5px; width: 150px; }

    Read the article

  • Alternate colors on click with jQuery

    - by Jace Cotton
    I'm sure there is a simple solution to this, and I'm sure this is a duplicate question, though I have been unable to solve my solution particularly because I don't really know how to phrase it in order to search for other questions/solutions, so I'm coming here hoping for some help. Basically, I have spans with classes that assigns a background-color property, and inside those spans are words. I have three of these spans, and each time a user clicks on a span I want the class to change (thus changing the background color and inner text). HTML: <span class="alternate"> <span class="blue showing">Lorem</span> <span class="green">Ipsum</span> <span class="red">Dolor</span> </span> CSS: .alternate span { display : none } .alternate .showing { display : inline } .blue { background : blue } .green { background : green } .red { background : red } jQuery: $(".alternate span").each(function() { $(this).on("click", function() { $(this).removeClass("showing"); $(this).next().addClass("showing"); }); }); This solution works great using $.next until I get to the third click, whereafter .showing is removed, and is not added since there are no more $.next options. How do I, after getting to the last-child, add .showing to the first-child and then start over? I have tried various options including if($(".alternate span:last-child").hasClass("showing")) { etc. etc. }, and I attempted to use an array and for loop though I failed to make it work. Newb question, I know, but I can't seem to solve this so as a last resort I'm coming here.

    Read the article

  • how to align multiple div's next to each other?

    - by Ashok Kumar
    I am new to Html,I'm trying to align multiple div's next to each other horizontally. i tried float property and display inline property also, but nothing works correctly.can anyone suggest any methods for it? my code: #display2letter { width:150px; height:50px; background-color:grey; box: 10px 10px 5px #888888; } #display3letter { width:150px; height:50px; background-color:blue; box: 10px 10px 5px #888888; } #display4letter { width:150px; height:50px; background-color:grey; box: 10px 10px 5px #888888; } #one { position:fixed; left:23%; } #two { position:fixed; left:23%; } #three { position:fixed; left:23%; } here is the fiddle http://jsfiddle.net/pGHS9/1/

    Read the article

  • Using list() to extract a data.table inside of a function

    - by Nathan VanHoudnos
    I must admit that the data.table J syntax confuses me. I am attempting to use list() to extract a subset of a data.table as a data.table object as described in Section 1.4 of the data.table FAQ, but I can't get this behavior to work inside of a function. An example: require(data.table) ## Setup some test data set.seed(1) test.data <- data.table( X = rnorm(10), Y = rnorm(10), Z = rnorm(10) ) setkey(test.data, X) ## Notice that I can subset the data table easily with literal names test.data[, list(X,Y)] ## X Y ## 1: -0.8356286 -0.62124058 ## 2: -0.8204684 -0.04493361 ## 3: -0.6264538 1.51178117 ## 4: -0.3053884 0.59390132 ## 5: 0.1836433 0.38984324 ## 6: 0.3295078 1.12493092 ## 7: 0.4874291 -0.01619026 ## 8: 0.5757814 0.82122120 ## 9: 0.7383247 0.94383621 ## 10: 1.5952808 -2.21469989 I can even write a function that will return a column of the data.table as a vector when passed the name of a column as a character vector: get.a.vector <- function( my.dt, my.column ) { ## Step 1: Convert my.column to an expression column.exp <- parse(text=my.column) ## Step 2: Return the vector return( my.dt[, eval(column.exp)] ) } get.a.vector( test.data, 'X') ## [1] -0.8356286 -0.8204684 -0.6264538 -0.3053884 0.1836433 0.3295078 ## [7] 0.4874291 0.5757814 0.7383247 1.5952808 But I cannot pull a similar trick for list(). The inline comments are the output from the interactive browser() session. get.a.dt <- function( my.dt, my.column ) { ## Step 1: Convert my.column to an expression column.exp <- parse(text=my.column) ## Step 2: Enter the browser to play around browser() ## Step 3: Verity that a literal X works: my.dt[, list(X)] ## << not shown >> ## Step 4: Attempt to evaluate the parsed experssion my.dt[, list( eval(column.exp)] ## Error in `rownames<-`(`*tmp*`, value = paste(format(rn, right = TRUE), (from data.table.example.R@1032mCJ#7) : ## length of 'dimnames' [1] not equal to array extent return( my.dt[, list(eval(column.exp))] ) } get.a.dt( test.data, "X" ) What am I missing? Update: Due to some confusion as to why I would want to do this I wanted to clarify. My use case is when I need to access a data.table column when when I generate the name. Something like this: set.seed(2) test.data[, X.1 := rnorm(10)] which.column <- 'X' new.column <- paste(which.column, '.1', sep="") get.a.dt( test.data, new.column ) Hopefully that helps.

    Read the article

  • How should I map an abstract class with simple xml in Java?

    - by spderosso
    Hi, I want to achieve the following xml using simple xml framework (http://simple.sourceforge.net/): <events> <course-added date="01/01/2010"> ... </course-added> <course-removed date="01/02/2010"> .... </course-removed> <student-enrolled date="01/02/2010"> ... </student-enrolled> </events> I have the following (but it doesn't achieve the desired xml): @Root(name="events") class XMLEvents { @ElementList(inline=true) ArrayList<XMLEvent> events = Lists.newArrayList(); ... } abstract class XMLEvent { @Attribute(name="date") String dateOfEventFormatted; ... } And different type of XMLNodes that have different information (but are all different types of events) @Root(name="course-added") class XMLCourseAdded extends XMLEvent{ @Element(name="course") XMLCourseLongFormat course; .... } @Root(name="course-removed") class XMLCourseRemoved extends XMLEvent { @Element(name="course-id") String courseId; ... } How should I do the mapping or what should I change in order to be able to achieve de desired xml? Thanks!

    Read the article

  • Div appearing outside its parent, bizarre sizing problems...

    - by SLC
    I have a list, which is going to be a menu. I want to position it absolutely at the very top of the page. My code looks like this: <div id="sitenavmenu"> <div id="sitenavmenu-content"> <ul id="sitenavmenu-content-menu"> <li>Register</li> <li><%: Html.ActionLink("About", "About", "Home")%></li> <li>Contact Us</li> </ul> </div> </div> My CSS looks like this: #sitenavmenu { position:absolute; margin-left:300px; top:2px; width:500px; } #sitenavmenu-content-menu li { list-style-type:none; display:inline; padding-right:5px; font-size:small; } The problem I have is, if I don't position it absolutely, it looks fine. As soon as I position it absolutely (as it is shown above), the sitenavmenu div changes size, and although it shifts to the top, the sitenavmenu-content div appears below it. There is no other CSS as I have only just started, and I have checked padding etc. and everything is zero. I just can't figure out why it's not working, and I don't want to hack it. Edit: It's something to do with the height of #sitenavmenu. If I leave it, then the sitenav-content ends up horizontally centered in it, although #sitenavmenu is much taller. If I make them both the same size, so they should sit on top of each other, then the #sitenavmenu-content sits below.

    Read the article

  • OpenSceneGraph C++ Access Violation reading location 0x00421000

    - by Kobojunkie
    Working with OpenSceneGraph, and I keep running into this violation issue that I would appreciate some help with. The problem is with the particular line below which happens to be the first in my main function. osg::ref_ptr<osg::Node> bench = osgDB::readNodeFile("Models/test.IVE"); I have my models folder right in my directory. The error is as below. Unhandled exception at 0x68630A6C (msvcr100.dll) in OSG3D.exe: 0xC0000005: Access violation reading location 0x00421000. And this is where the problem seems to be coming up. /** Read an osg::Node from file. * Return valid osg::Node on success, * return NULL on failure. * The osgDB::Registry is used to load the appropriate ReaderWriter plugin * for the filename extension, and this plugin then handles the request * to read the specified file.*/ inline osg::Node* readNodeFile(const std::string& filename) { return readNodeFile(filename,Registry::instance()->getOptions()); } I would appreciate details on how best to tackle this kind of exception message in the future. Are there tools that make this easy to debug or are there ways to capture the exact issues and fix them? I would appreciate any help with this. My ultimate goal is to learn how to better debug C++ related issues please. With this, it means reading through the compiler error list http://msdn.microsoft.com/en-us/library/850cstw1(v=vs.71).aspx is not enough

    Read the article

  • jquery an div tags used in a ordered list

    - by shan2on
    hello everyone, i'm not sure where my errors are lying but here is my scenario... i have an un-ordered list in html that handles my main link bar... <ul id="navlist"> <li><a href="/" id="current">home</a></li> <li><a href="#" id="search">search</a></li> <li><a href="#" id="users">login</a></li> </ul> and what i want done is to call each id and have jQuery handle each and dislpay it where specified in my css file... for now, lets just ignore my "home" link... here is a snippet of my inline jquery $(document).ready(function() { $("a").click(function () { $("div#login").slideToggle("fast"); }); }) Now, whichever div i specify, it calls that ... however it will only call one div, using either from the un-orderd list, as mentioned above in the html. My Goal is to call a search bar when search is clicked, and to call a login box when login is clicked. to my knowledge (noob), i believe use an as a class, however that is what brings me here. i believe my error is in my jquery and not my css, as stated above, either instance will be displayed when the jquery function calls either tag. any help is greatly appreciated. thanks in advance shan2on

    Read the article

  • CSS refuse to obey

    - by Frank
    Hi, I'll make this short, I got this webpage : <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="Stylesheet" type="text/css" href="css/style.css" /> <link rel="Stylesheet" type="text/css" href="css/nav.css" /> </head> <body> <div id="header"> <ul id="navList"> <li><a href="#" id="navActive">foo</a></li> <li><a href="#">bar</a></li> </ul> </div> </body> </html> With this CSS style.css body { padding:0; margin:0; background-color:#000000; background-repeat:no-repeat; background-image:url('../img/bg.jpg'); } nav.css #navList { padding:0; margin:0; background-image:url('../img/menu.png'); list-style-type:none; padding:12px 150px; } #navList li { display:inline; } #navList li a { color:#bfbfbf; padding:14px 25px; text-decoration:none; } #navList li a:hover { color:#000000; background-color:#bfbfbf; text-decoration:none; } #navActive { color:#000000; background-color:#bfbfbf; } It looks like the CSS from the navActive id is never being applied... Could someone tell me why and/or suggest me a way to correct this. Thanks.

    Read the article

< Previous Page | 103 104 105 106 107 108 109 110 111 112 113 114  | Next Page >