Search Results

Search found 1064 results on 43 pages for 'eval'.

Page 14/43 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Assigning Datasource to a region

    - by minal
    Hi, I was wondering if there is an existing control that I could use to achieve what I am trying. Basically, I have a html table that I display my header information. It looks something like this: <table class="tableEdit"> <tr> <th>Job ID</th><td>10</td> <th>Client</th><td>Tom</td> </tr> <tr> <th>Comments</th><td>Comments are here</td> </tr> </table> I am wondering if there is an existing control that I can use as a container. Then I can assign the datasource to that control and leverage the field values as such. <asp:Somecontrol runat="server" ID="someid"> <table class="tableEdit"> <tr> <th>Job ID</th><td><%# Eval("Id") %></td> <th>Client</th><td><%# Eval("Client.Name") %></td> </tr> <tr> <th>Comments</th><td><%# Eval("Comments") %></td> </tr> </table> </asp:Somecontrol> private void BindHeader() { SomeObjectType data = DAL.SomeMethod(); someid.Datasource = data; someid.DataBind(); } Is there anything out there to do this? I want to be able to control the layout of the fields within the container. Thanks.

    Read the article

  • ASP.Net Problem with Event Handlers and Control Creation Timing

    - by Oliver Weichhold
    What I am trying to achieve here is to display a number of LinkButtons in a RadGrid Column. The buttons are generated from a collection property member of the bound grid row item. The CollectionLinkButton control is nothing more than a asp:Panel derived control that populates its Child Controls from "DataItem.SomeCollection" and this is working fine. The problem I am facing is with this part: Collection='<%# DataBinder.Eval(Container, "DataItem.SomeCollection") %' This is because databound Collection Property is populated so late in the lifecycle of the page that the LinkButton Controls that the CollectionLinkButton class creates from the collection are not available yet during Postback when the Click event Handler is supposed to fire and I have currently no idea how to solve this problem. <radG:RadGrid ID="grid" runat="server" DataSourceID="ds_AB"> <MasterTableView> <Columns> <radG:GridTemplateColumn> <ItemTemplate> <local:CollectionLinkButton ID="LinkButton1" runat="server" CssClass="EntityLinkButton" Collection='<%# DataBinder.Eval(Container, "DataItem.SomeCollection") %>' CollectionProperty="Id" CollectionDisplayProperty="Name" Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'</local:CollectionLinkButton> </ItemTemplate> </radG:GridTemplateColumn>

    Read the article

  • vb.net inline IF with OR... not evaluating

    - by rockinthesixstring
    I'm working on a small problem where I'm trying to show/hide a panel based on two criteria A specific data field must not be blank The specific data filed must also not equal "Not Relocatable" Unfortunately this doesn't seem to be working for me (note that setting either one or the other criteria works just fine.) <asp:Panel runat="server" Visible='<%#If(Not String.IsNullOrEmpty(DataBinder.Eval(Container.DataItem, "_236")) Or Not DataBinder.Eval(Container.DataItem, "_236") = "Not Relocatable", True, False)%>'> <tr> <td> </td> <td class="align-right lightgreen"> Buyer would consider relocating a business, if it is: </td> <td> </td> <td colspan="3"> <%#DataBinder.Eval(Container.DataItem, "_236")%> </td> <td> </td> </tr> </asp:Panel> Can anyone lend a hand to rectify this problem for me?

    Read the article

  • R selecting duplicate rows

    - by Matt
    Okay, I'm fairly new to R and I've tried to search the documentation for what I need to do but here is the problem. I have a data.frame called heeds.data in the following form (some columns omitted for simplicity) eval.num, eval.count, ... fitness, fitness.mean, green.h.0, green.v.0, offset.0, green.h.1, green.v.1,...green.h.7, green.v.7, offset.7... And I have selected a row meeting the following criteria: best.fitness <- min(heeds.data$fitness.mean[heeds.data$eval.count = 10]) best.row <- heeds.data[heeds.data$fitness.mean == best.fitness] Now, what I want are all of the other rows with that have columns green.h.0 to offset.7 (a contiguous section of columns) equal to the best.row Basically I'm looking for rows that have some of the conditions the same as the "best" row. I thought I could just do this, heeds.best <- heeds.data$fitness[ heeds.data$green.h.0 == best.row$green.h.0 & ... ] But with 24 columns it seems like a stupid method. Looking for something a bit simpler with less manual typing. Thanks!

    Read the article

  • Passing Multiple values Through Query String?

    - by Googler
    Hi all, I tried to pass more than one value through Query String from page1.aspx to page2.aspx. This is my Query string in the Grid View <a href="javascript:void(0);" onclick='javascript:window.open("Update.aspx?Regno= <%#Eval ("ID") %>'+ ","'&Fn=<%#Eval ("FIRSTNAME") %>' +", "'&Ln=<%#Eval ("LASTNAME") %>'")';> Edit</a> On My Page2.aspx, my code behind on PageLoad is: if (Page.IsPostBack) return; string id = Request.QueryString["ID"]; string Firstname = Request.QueryString["FIRSTNAME"]; string LastName = Request.QueryString["LASTNAME"]; My Visual Studio IDE shows a syntax error on this query string. I dont know the exact way to pass multiple values through Query String. How to make it work? Can anyone pls help me on this.. Which is the right syntax to pass multiple query string?

    Read the article

  • Datalist itemcommand design?

    - by Surya sasidhar
    hi, in my application i am using datalist to display the images, i put properties of repeatcolumn=4 and reapeatdirection=horizontal. It is displaying good when there r more than or 4 images if there r only one or two or three images the gap between images r too long. if i have only one image the image displayed in datalist in the middle of the datalist. how can i solve this problem. i think you people understand my problem this is my datalist source code... datalist width="100%" <ItemTemplate > <table width="100%" > <tr> <td > <asp:ImageButton ID="imgeFrien" runat ="Server" Width="110px" Height ="100px" CommandName ="Image" CommandArgument ='<%# Eval("userid") %>' ImageUrl ='<%# "~/Userimages/"+ Eval("myimage") %>' /> </td> </tr> <tr> <td > <asp:Label ID="lblFrieNam" runat ="Server" Font-Names ="verdana" Text ='<%# Eval("username") %>'></asp:Label> </td> </tr> </table> </ItemTemplate> </asp:DataList>

    Read the article

  • How to write a file that called from a database on a page?

    - by Mehmet Kaleli
    Hi. I have a "news" page that belongs to a company. All news have a header, detail and html page and they come from database. So i have to print those html pages in a repeater on my "news.aspx". But i couldnt write dynamically. How can i do it or is there anyway else? <asp:Repeater ID="news" runat="server" OnItemDataBound="news_OnItemDataBound"> <ItemTemplate> <asp:HiddenField ID="newsid" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"newsid") %>' /> <tr> <td class="haberler-sayfasi-habermetni" style="width:580px;padding-bottom:30px;"> <h1 class="haberler-sayfasi-haberbasligi" style="background-image:url(images/haber-ikon.jpg); background-repeat:no-repeat;padding-left:25px;"> <%#DataBinder.Eval(Container.DataItem,"newsheader") %>/h1> <br /> <%#DataBinder.Eval(Container.DataItem,"newsspot") %> <br /><br /> <% **Response.WriteFile('dynamical filename with path');** %> </td> </tr> </ItemTemplate> </asp:Repeater>

    Read the article

  • Parse error: syntax error, unexpected ';'

    - by sufoid
    Hallo I have this script: <? require("lib2/config.inc.php"); require("lib2/tpl.class.php"); require("lib2/db.class.php"); require("lib2/um.class.php"); $tpl = new template("templates", "tpl"); $db = new db($db['location'], $db['username'], $db['passwort'], $db['database']); $um = new usermanagment(); /** User login **/ $checklogin = $um->check_login(); $userdata = $um->getuserdata(); if(!$checklogin && !$guest) { header("LOCATION: ./index2.php"); } eval("\$header .= \" ".$tpl->get("header")."\";"); eval("\$footer .= \" ".$tpl->get("footer")."\";"); $time = time(); $db->Query("UPDATE userdaten SET lastaction = '$time' WHERE userid = '".$userdata['userid']."'"); ?> And get this error: Parse error: syntax error, unexpected ';' in /home/httpd/html/login/global.php(22) : eval()'d code on line 96 Any ideas?

    Read the article

  • Is it safe to read regular expressions from a file?

    - by Zilk
    Assuming a Perl script that allows users to specify several text filter expressions in a config file, is there a safe way to let them enter regular expressions as well, without the possibility of unintended side effects or code execution? Without actually parsing the regexes and checking them for problematic constructs, that is. There won't be any substitution, only matching. As an aside, is there a way to test if the specified regex is valid before actually using it? I'd like to issue warnings if something like /foo (bar/ was entered. Thanks, Z. EDIT: Thanks for the very interesting answers. I've since found out that the following dangerous constructs will only be evaluated in regexes if the use re 'eval' pragma is used: (?{code}) (??{code}) ${code} @{code} The default is no re 'eval'; so unless I'm missing something, it should be safe to read regular expressions from a file, with the only check being the eval/catch posted by Axeman. At least I haven't been able to hide anything evil in them in my tests. Thanks again. Z.

    Read the article

  • Pass scalar/list context to called subroutine

    - by Will
    I'm trying to write a sub that takes a coderef parameter. My sub does some initialization, calls the coderef, then does some cleanup. I need to call the coderef using the same context (scalar, list, void context) that my sub was called in. The only way I can think of is something like this: sub perform { my ($self, $code) = @_; # do some initialization... my @ret; my $ret; if (not defined wantarray) { $code->(); } elsif (wantarray) { @ret = $code->(); } else { $ret = $code->(); } # do some cleanup... if (not defined wantarray) { return; } elsif (wantarray) { return @ret; } else { return $ret; } } Obviously there's a good deal of redundancy in this code. Is there any way to reduce or eliminate any of this redundancy? EDIT   I later realized that I need to run $code->() in an eval block so that the cleanup runs even if the code dies. Adding eval support, and combining the suggestions of user502515 and cjm, here's what I've come up with. sub perform { my ($self, $code) = @_; # do some initialization... my $w = wantarray; return sub { my $error = $@; # do some cleanup... die $error if $error; # propagate exception return $w ? @_ : $_[0]; }->(eval { $w ? $code->() : scalar($code->()) }); } This gets rid of the redundancy, though unfortunately now the control flow is a little harder to follow.

    Read the article

  • Help C++ifying this C style code.

    - by Flamewires
    Hey I'm used to developing in C and I would like to use C++ in a project. Can anyone give me an example of how I would translate this C-style code into C++ code. I know it should compile in a c++ complier but I'm talking using c++ techniques(I.e. classes, RAII) typedef struct Solution Solution; struct Solution { double x[30]; int itt_found; double value; }; Solution *NewSolution() { Solution *S = (Solution *)malloc(sizeof(Solution)); for (int i=0;<=30;i++) { S-x[i] = 0; } S-itt_found = -1; return S; } void FreeSolution(Solution *S) { if (S != NULL) free(S); } int main() { Solution *S = NewSolution(); S-value = eval(S-x);// evals is another function that returns a double S-itt_found = 0; FreeSolution(S); return EXIT_SUCCESS; } Ideally I would like to be able to so something like this in main, but I'm not sure exactly how to create the class, i've read a lot of stuff but incorporating it all together correctly seems a little hard atm. Solution S(30);//constructor that takes as an argument the size of the double array S.eval();//a method that would run eval on S.x[] and store result in S.value cout << S.value << endl; Ask if you need more info, thanks.

    Read the article

  • how to run href="#var=something" before onclick function fires in javascript?

    - by korben
    i'm using the below javascript to change an image on an aspx in asp.net c# <script language="JavaScript" type="text/javascript"> var updateImageWhenHashChanges = function() { theImage = document.getElementById("ctl00_ContentPlaceHolder1_Image1a"); if(window.location.hash == "#size=2") { theImage.src = "<%# Eval("realfilename", "/files/l{0}") %>"; } else if(window.location.hash == "#size=3") { theImage.src = "<%# Eval("realfilename", "/files/{0}") %>"; } else if(window.location.hash == "#size=1") { theImage.src = "<%# Eval("fullthumbname", "/thumbnails/{0}") %>"; } else { } } </script> here's how i call it with a link <a href="#size=3" onclick="updateImageWhenHashChanges();">test</a> the problem is that it only does what i'm expecting on the SECOND click of the link, because it seems onclick fires before the href, so the first time i'm just placing the var and the 2nd time i'm actually getting what i want. does anyone know how i can fix this? i'm trying to get the image to change on each click

    Read the article

  • Passing in extra parameters in a URL

    - by Scott Atkinson
    I have the below column on my table what gets binded on pageload, the parameters in there work fine but i need to add an additional parameter which is the fullname which is the next column along but im having trouble figuring our the syntax, here is my ASP <asp:TemplateField HeaderText="ID"> <ItemTemplate> <asp:HyperLink ID="hyperLeadID" runat="server" NavigateUrl='<%#Eval("ID","/documents/Q-Sheet.aspx?LeadID={0}&isHappyCallReferral=yes&isHappyName={1}") %>' Text='<%#Eval("ID")%>'></asp:HyperLink> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Referral Name"> <ItemTemplate> <asp:Label ID="lblRefName" CssClass="gvItem" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Name") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> As you can see at the end of ID column i have added isHappyName={1} which i assumed it would select the next column along as it starts at 0 but it keeps throwing an error which is "Index (zero based) must be greater than or equal to zero and less than the size of the argument list." Can someone help me to pass the usersname through the URL Thanks

    Read the article

  • How to write an R function that evaluates an expression within a data-frame

    - by Prasad Chalasani
    Puzzle for the R cognoscenti: Say we have a data-frame: df <- data.frame( a = 1:5, b = 1:5 ) I know we can do things like with(df, a) to get a vector of results. But how do I write a function that takes an expression (such as a or a > 3) and does the same thing inside. I.e. I want to write a function fn that takes a data-frame and an expression as arguments and returns the result of evaluating the expression "within" the data-frame as an environment. Never mind that this sounds contrived (I could just use with as above), but this is just a simplified version of a more complex function I am writing. I tried several variants ( using eval, with, envir, substitute, local, etc) but none of them work. For example if I define fn like so: fn <- function(dat, expr) { eval(expr, envir = dat) } I get this error: > fn( df, a ) Error in eval(expr, envir = dat) : object 'a' not found Clearly I am missing something subtle about environments and evaluation. Is there a way to define such a function?

    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

  • Getting JQuery UI Sortable to work on asp.net ListView items?

    - by Xaisoft
    I have the following ListView in which I am using the JQuery UI sortable function to be able to sort the items in the ListView. The problem is that I can't put a sortable class on the table in the ItemTemplate because it does not work, if I put a class="sortable" on the outer div, it works, but it allows me to sort everything within the ListView, I just want to be able to move sort the tables. Here is the markup <div> //Works here, but hr's become sortable too. <asp:ListView ID="lvwDocuments" runat="server"> <LayoutTemplate> <h3> Documents</h3> <asp:PlaceHolder ID="itemPlaceHolder" runat="server"> </asp:PlaceHolder> </LayoutTemplate> <ItemTemplate> <table class="sortable"> //Does not work Here <tr> <td> <p class="title"> <a runat="server" href='<%#Eval("url") %>'> <%#Eval("title") %></a></p> <br /> <p> <%#Eval("description") %></p> </td> </tr> </table> </ItemTemplate> <ItemSeparatorTemplate> <hr /> </ItemSeparatorTemplate> </div> Also, How can I preserve the sort order even after the page is refreshed.

    Read the article

  • How to get from JRuby a correctly typed ruby implementation of a Java interface?

    - by Guss
    I'm trying to use JRuby (through the JSR233 interface included in JRuby 1.5) from a Java application to load a ruby implementation of a Java interface. My sample implementation looks like this: Interface: package some.package; import java.util.List; public interface ScriptDemoIf { int fibonacci(int d); List<String> filterLength(List<String> source, int maxlen); } Ruby Implementation: require 'java' include Java class ScriptDemo java_implements some.package.ScriptDemoIf java_signature 'int fibonacci(int d)' def fibonacci(d) d < 2 ? d : fibonacci(d-1) + fibonacci(d-2) end java_signature 'List<String> filterLength(List<String> source, int maxlen)' def filterLength(source, maxlen) source.find_all { |str| str.length <= maxlen } end end Class loader: public ScriptDemoIf load(String filename) throws ScriptException { ScriptEngine engine = new ScriptEngineManager().getEngineByName("jruby"); FileReader script = new FileReader(filename); try { engine.eval(new FileReader(script)); } catch (FileNotFoundException e) { throw new ScriptException("Failed to load " + filename); } return (ScriptDemoIf) m_engine.eval("ScriptDemo.new"); } (Obviously the loader is a bit more generic in real life - it doesn't assume that the implementation class name is "ScriptDemo" - this is just for simplicity). Problem - I get a class cast exception in the last line of the loader - the engine.eval() return a RubyObject type which doesn't cast down nicely to my interface. From stuff I read all over the web I was under the impression that the whole point of use java_implements in the Ruby section was for the interface implementations to be compiled in properly. What am I doing wrong?

    Read the article

  • Oracle 12cR1 : Evaluación "What-If" de un comando crsctl con Oracle Clusterware

    - by grantunez-Oracle
    Oracle en su nueva version 12cR1 introdujo una nueva y pequeña característica  al Oracle Clusterware, pero el que sea pequeña, no significa que no sea de gran utilidad. En versiones anteriores, si queríamos saber que iba a pasar al ejecutar un comando con la herramienta crsctl, teníamos que hacerlo en un ambiente de pruebas, ya que si no sabíamos de que se trataba el comando, se convertía en algo muy peligroso hacerlo sobre producción. En Oracle Clusterware 12cR1 se introduce la evaluación de comando tipo "What-If" en la herramienta mencionada anteriormente, crsctl eval, que lo que nos permite es ver , que va a suceder si ejecuta el comando, sin que realmente se ejecute el comando. Primero vamos a ver que recursos tenemos arriba  [oracle@oel6-112-rac1 ~]$ crsctl stat res -t--------------------------------------------------------------------------------Name           Target  State        Server                   State details       --------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.ASMNET1LSNR_ASM.lsnr               ONLINE  ONLINE       oel6-112-rac1            STABLE               ONLINE  ONLINE       oel6-112-rac2            STABLEora.DATA.dg               ONLINE  ONLINE       oel6-112-rac1            STABLE               ONLINE  ONLINE       oel6-112-rac2            STABLEora.LISTENER.lsnr               ONLINE  ONLINE       oel6-112-rac1            STABLE               ONLINE  ONLINE       oel6-112-rac2            STABLEora.net1.network               ONLINE  ONLINE       oel6-112-rac1            STABLE               ONLINE  ONLINE       oel6-112-rac2            STABLEora.ons               ONLINE  ONLINE       oel6-112-rac1            STABLE               ONLINE  ONLINE       oel6-112-rac2            STABLEora.proxy_advm               ONLINE  ONLINE       oel6-112-rac1            STABLE               ONLINE  OFFLINE      oel6-112-rac2            CLEANINGora.LISTENER_SCAN1.lsnr      1        ONLINE  ONLINE       oel6-112-rac2            STABLEora.LISTENER_SCAN2.lsnr      1        ONLINE  ONLINE       oel6-112-rac1            STABLEora.LISTENER_SCAN3.lsnr      1        ONLINE  ONLINE       oel6-112-rac1            STABLEora.MGMTLSNR      1        ONLINE  ONLINE       oel6-112-rac1            169.254.247.50 192.1                                                             68.1.111,STABLEora.asm      1        ONLINE  ONLINE       oel6-112-rac1            STABLE      2        ONLINE  ONLINE       oel6-112-rac2            STABLE      3        OFFLINE OFFLINE                               STABLEora.cvu      1        ONLINE  ONLINE       oel6-112-rac1            STABLEora.gns      1        ONLINE  ONLINE       oel6-112-rac1            STABLEora.gns.vip      1        ONLINE  ONLINE       oel6-112-rac1            STABLEora.mgmtdb      1        ONLINE  ONLINE       oel6-112-rac1            Open,STABLEora.oc4j      1        ONLINE  ONLINE       oel6-112-rac1            STABLEora.oel6-112-rac1.vip      1        ONLINE  ONLINE       oel6-112-rac1            STABLEora.oel6-112-rac2.vip      1        ONLINE  ONLINE       oel6-112-rac2            STABLEora.orcl.db      1        OFFLINE OFFLINE      oel6-112-rac2            Instance Shutdown,STABLE       2        ONLINE  ONLINE       oel6-112-rac1            Open,STABLEora.scan1.vip      1        ONLINE  ONLINE       oel6-112-rac2            STABLEora.scan2.vip      1        ONLINE  ONLINE       oel6-112-rac1            STABLEora.scan3.vip      1        ONLINE  ONLINE       oel6-112-rac1            STABLE Ahora lo que vamos a hacer , es evaluar que pasaría, si por ejemplo, el recurso de ASM llegara a fallar en nuestro nodo [oracle@oel6-112-rac1 ~]$ crsctl eval fail resource ora.asm Stage Group 1: -------------------------------------------------------------------------------- Stage Number Required Action --------------------------------------------------------------------------------      1    N Create new group (Stage Group = 2)    Y Resource 'ora.asm' (1/1) will be in state [ONLINE|INTERMEDIATE] on server [oel6-112-rac1]    Y Resource 'ora.asm' (2/1) will be in state [ONLINE|INTERMEDIATE] on server [oel6-112-rac2] -------------------------------------------------------------------------------- Stage Group 2: -------------------------------------------------------------------------------- Stage Number Required Action --------------------------------------------------------------------------------      1    N Resource 'ora.proxy_advm' (oel6-112-rac2) will be in state [ONLINE|INTERMEDIATE] on server [oel6-112-rac2] --------------------------------------------------------------------------------  Como vamos a ver a continuación, no es lo mismo se decidiéramos detener el recurso, en este caso tenemos que forzarlo , ya que es un recurso que no se puede detener sin la opción "-f":  [oracle@oel6-112-rac1 ~]$ crsctl eval stop resource ora.asm Stage Group 1: -------------------------------------------------------------------------------- Stage Number Required Action --------------------------------------------------------------------------------      1    N Error code [222] for entity [ora.asm]. Message is [CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.DATA.dg', but the force option was not specified]. -------------------------------------------------------------------------------- [oracle@oel6-112-rac1 ~]$ crsctl eval stop resource ora.asm -f Stage Group 1: -------------------------------------------------------------------------------- Stage Number Required Action --------------------------------------------------------------------------------      1    Y Resource 'ora.DATA.dg' (oel6-112-rac1) will be in state [OFFLINE]    Y Resource 'ora.DATA.dg' (oel6-112-rac2) will be in state [OFFLINE]    Y Resource 'ora.orcl.db' (2/1) will be in state [OFFLINE]    Y Resource 'ora.proxy_advm' (oel6-112-rac1) will be in state [OFFLINE]      2    Y Resource 'ora.asm' (1/1) will be in state [OFFLINE]    Y Resource 'ora.asm' (2/1) will be in state [OFFLINE] --------------------------------------------------------------------------------  Como puedes ver, es una característica nueva y pequeña, pero bastante util para evaluar todos tus comandos de crsctl sin impactar a ninguno de tus recursos. Así te permitira valorar el impacto que tendra el comando que vas a ejecutar. Puedes encontrar mas información en: Utilizando el comando eval

    Read the article

  • How to install ac-R mode in emacs?

    - by David
    I have recently added the file ac-R.el to /usr/local/share/emacs/site-lisp, along with (require 'ac-R) to ~/.emacs Now, when I open emacs with --debug-init, I get the error Debugger entered--Lisp error: (void-variable ac-modes) add-to-list(ac-modes ess-mode) eval-buffer(#<buffer *load*<2>> nil "/usr/local/share/emacs/site-lisp/ac-R.el" nil t) ; Reading at buffer position 7191 load-with-code-conversion("/usr/local/share/emacs/site-lisp/ac-R.el" "/usr/local/share/emacs/site-lisp/ac-R.el" nil t) require(ac-R) eval-buffer(#<buffer *load*> nil "/home/dlebauer/.emacs" nil t) ; Reading at buffer position 3548 load-with-code-conversion("/home/dlebauer/.emacs" "/home/dlebauer/.emacs" t t) load("~/.emacs" t t) #[nil "\205\264 and when clicking on load-with-code-conversion, it says Can't find library /usr/share/emacs/23.1.50/lisp/international/mule.el even though I have installed mule via synaptic (I am using Ubuntu 10.04) How can I get the mule library in the right place?

    Read the article

  • centos 6 ps aux hangs up

    - by Guntis
    I have problem with my server. Server is running centos 6 (CloudLinux Server release 6.2). uname -a = 2.6.32-320.4.1.lve1.1.4.el6.x86_64 That is a kvm guest. On host is debian 6. If i run command ps aux, it stuck on random process (shows some processes only), top command is working fine. htop doesn't work too (black screen). top - 12:11:51 up 34 min, 1 user, load average: 4.26, 6.71, 16.15 Tasks: 201 total, 7 running, 192 sleeping, 0 stopped, 2 zombie Cpu(s): 7.9%us, 2.8%sy, 0.0%ni, 87.5%id, 1.6%wa, 0.0%hi, 0.2%si, 0.0%st Mem: 9862044k total, 2359484k used, 7502560k free, 171720k buffers Swap: 10485720k total, 0k used, 10485720k free, 1336872k cached server has one Intel(R) Xeon(R) CPU E5606 @ 2.13GHz, free -m total used free shared buffers cached Mem: 9630 2336 7293 0 170 1324 -/+ buffers/cache: 841 8789 Swap: 10239 0 10239 php -v PHP 5.3.19 (cli) (built: Nov 28 2012 10:03:07) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies with the ionCube PHP Loader v4.2.2, Copyright (c) 2002-2012, by ionCube Ltd., and with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies with Suhosin v0.9.33, Copyright (c) 2007-2012, by SektionEins GmbH mysql Server version: 5.1.63-cll php -i disable_functions => apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd, eval, exec, fp, fput, ftp_connect, ftp_e xec, ftp_get, ftp_login, ftp_nb_fput, ftp_put, ftp_raw, ftp_rawlist, highlight_file, ini_alter, ini_get_all, ini_restore, inject_code, openlog, passthru, php _uname, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_set sid, posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exec, syslog, system, xmlrpc_entity_de code, xmlrpc_server_create, putenv, show_source,mail => apache_child_terminate, apache_setenv, define_syslog_variables, escapeshellarg, escapeshellcmd, eval, exec, fp, fput, ftp_connect, ftp_exec, ftp_get, ftp_login, ftp_nb_fput, ftp_put, ftp_raw, ftp_rawlist, highlight_file, ini_alter, ini_get_all, ini_restore, inject_code, openlog, passthru, php_uname, phpAds_remoteInfo, phpAds_XmlRpc, phpAds_xmlrpcDecode, phpAds_xmlrpcEncode, popen, posix_getpwuid, posix_kill, pos ix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, posix_setuid, posix_uname, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, shell_exe c, syslog, system, xmlrpc_entity_decode, xmlrpc_server_create, putenv, show_source,mail ... suhosin.executor.disable_eval => Off => Off suhosin.executor.eval.blacklist => include,include_once,require,require_once,curl_init,fpassthru,base64_encode,base64_decode,mail,exec,system,proc_open,leak, syslog,pfsockopen,shell_exec,ini_restore,symlink,stream_socket_server,proc_nice,popen,proc_get_status,dl, pcntl_exec, pcntl_fork, pcntl_signal,pcntl_waitpid, pcntl_wexitstatus, pcntl_wifexited, pcntl_wifsignaled,pcntl_wifstopped, pcntl_wstopsig, pcntl_wtermsig, socket_accept,socket_bind, socket_connect, socket_cr eate, socket_create_listen,socket_create_pair,link,register_shutdown_function,register_tick_function,gzinflate => include,include_once,require,require_once,c url_init,fpassthru,base64_encode,base64_decode,mail,exec,system,proc_open,leak,syslog,pfsockopen,shell_exec,ini_restore,symlink,stream_socket_server,proc_nic e,popen,proc_get_status,dl, pcntl_exec, pcntl_fork, pcntl_signal,pcntl_waitpid, pcntl_wexitstatus, pcntl_wifexited, pcntl_wifsignaled,pcntl_wifstopped, pcntl _wstopsig, pcntl_wtermsig, socket_accept,socket_bind, socket_connect, socket_create, socket_create_listen,socket_create_pair,link,register_shutdown_function, register_tick_function,gzinflate Sometimes i cannot kill httpd process. I run kill -9 PID even several times, and nothing happens. php runs via suphp. I learned somewhere that it can be trojan. I ran strace ps aux and it stops on open("/proc/PID/cmdline", O_RDONLY) If i reboot server, problem is gone but after some time it is back again .. :( Thanks.

    Read the article

  • Installing ruby 1.9.1 on OS X with RVM, getting error I can't make sense of

    - by Pselus
    I'm trying to update my ruby install on Leopard to at least 1.9.1. I found a tutorial that tells me how to do it with RVM and I get as far as downloading, configuring and compiling the version I want, but during the compile I get errors. When checking the make.error.log file this is the message I get: [2010-11-07 13:43:44] make main.c: In function ‘objcdummyfunction’: main.c:19: warning: implicit declaration of function ‘objc_msgSend’ main.c: At top level: main.c:19: warning: ‘objcdummyfunction’ defined but not used eval.c: In function ‘ruby_cleanup’: eval.c:139: warning: passing argument 1 of ‘ruby_init_stack’ discards qualifiers from pointer target type gc.c: In function ‘garbage_collect_with_gvl’: gc.c:597: warning: cast from pointer to integer of different size w: illegal option -- L usage: w [hi] [user ...] make: [libruby.1.9.1.dylib] Error 1 (ignored) readline.c: In function ‘username_completion_proc_call’: readline.c:1159: error: ‘username_completion_function’ undeclared (first use in this function) readline.c:1159: error: (Each undeclared identifier is reported only once readline.c:1159: error: for each function it appears in.) make[1]: *** [readline.o] Error 1 make: *** [mkmain.sh] Error 1 I have no idea what any of that means. Help?

    Read the article

  • Why doesn't this batch file work for me?

    - by asdfg
    The following batch file is not woking. @echo off python -c "print('echo text')" %TEMP%\test.bat call %TEMP%\test.bat Can anyone help me with this?. edit: I needed unix eval functionality in windows. I could not find a direct way though. So I redirected the eval string to a temporary batch file and executed it. The temporary batch file was successfully created but calling it did not work in the above case. I noticed that any command after the test.bat creation did not work.

    Read the article

  • Converting listview to a composite control

    - by Paul
    The link below shows a listview composite control in its most basic form however I can't seem to extend this to what I'm trying to do. http://stackoverflow.com/questions/92689/how-to-define-listview-templates-in-code My listview has 1 tablerow with 2 fields. The first field contains 1 element whilst the second field contains 2 elements as shown below. <asp:ListView ID="lstArticle" runat="server"> <LayoutTemplate> <table id="itemPlaceholder" runat="server"> </table> </LayoutTemplate> <ItemTemplate> <div class="ctrlArticleList_rptStandardItem"> <table width="100%"> <tr> <td valign="top" class="ctrlArticleList_firstColumnWidth"> <a href="<%# GetURL(Container.DataItem) %>"> <%# GetImage(Container.DataItem)%> </a> </td> <td valign="top"> <span class="ctrlArticleList_title"> <a href="<%# GetURL(Container.DataItem) %>"> <%# DataBinder.Eval(Container.DataItem, "Title") %> </a> </span> <span class="ctrlArticleList_date"> <%# convertToShortDate(DataBinder.Eval(Container.DataItem, "ActiveDate"))%> </span> <div class="ctrlArticleList_standFirst"> <%# DataBinder.Eval(Container.DataItem, "StandFirst")%> </div> </td> </tr> </table> </div> </ItemTemplate> So to convert this I have to use the InstantiateIn method of the ITemplate for the layouttemplate and the ItemTemplate. Data is bound to the itemtemplate using the DataBinding event. My question at the moment is how do I setup the ItemTemplate class and bind the values from the above ListView ItemTemplate. This is what I've managed so far: private class LayoutTemplate : ITemplate { public void InstantiateIn(Control container) { var table = new HtmlGenericControl("table") { ID = "itemPlaceholder" }; container.Controls.Add(table); } } private class ItemTemplate : ITemplate { public void InstantiateIn(Control container) { var tableRow = new HtmlGenericControl("tr"); //first field in row var tableFieldImage = new HtmlGenericControl("td"); var imageLink = new HtmlGenericControl("a"); imageLink.ID = "imageLink"; tableRow.Controls.Add(imageLink); // second field in row var tableFieldTitle = new HtmlGenericControl("td"); var title = new HtmlGenericControl("a"); tableFieldTitle.Controls.Add(title); tableRow.Controls.Add(tableFieldTitle); //Bind the data with the controls tableRow.DataBinding += BindData; //add the controls to the container container.Controls.Add(tableRow); } public void BindData(object sender, EventArgs e) { var container = (HtmlGenericControl)sender; var dataItem = ((ListViewDataItem)container.NamingContainer).DataItem; container.Controls.Add(new Literal() { Text = dataItem.ToString() }); } One of the functions in the ListView just for an example is: public string GetURL(object objArticle) { ArticleItem articleItem = (ArticleItem)objArticle; Article article = new Article(Guid.Empty, articleItem.ContentVersionID); return GetArticleURL(article); } Summary What do I need to do to convert the following into a composite control: 1. <a href="<%# GetURL(Container.DataItem) %>"><%# GetImage(Container.DataItem)%></a> 2. <a href="<%# GetURL(Container.DataItem) %>"> <%# DataBinder.Eval(Container.DataItem, "Title") %> </a>

    Read the article

  • Download binary file From SQL Server 2000

    - by kareemsaad
    I inserted binary files (images, PDF, videos..) and I want to retrieve this file to download it. I used generic handler page as this public void ProcessRequest (HttpContext context) { using (System.Data.SqlClient.SqlConnection con = Connection.GetConnection()) { String Sql = "Select BinaryData From ProductsDownload Where Product_Id = @Product_Id"; SqlCommand com = new SqlCommand(Sql, con); com.CommandType = System.Data.CommandType.Text; com.Parameters.Add(Parameter.NewInt("@Product_Id", context.Request.QueryString["Product_Id"].ToString())); SqlDataReader dr = com.ExecuteReader(); if (dr.Read() && dr != null) { Byte[] bytes; bytes = Encoding.UTF8.GetBytes(String.Empty); bytes = (Byte[])dr["BinaryData"]; context.Response.BinaryWrite(bytes); dr.Close(); } } } and this is my table CREATE TABLE [ProductsDownload] ( [ID] [bigint] IDENTITY (1, 1) NOT NULL , [Product_Id] [int] NULL , [Type_Id] [int] NULL , [Name] [nvarchar] (200) COLLATE Arabic_CI_AS NULL , [MIME] [varchar] (50) COLLATE Arabic_CI_AS NULL , [BinaryData] [varbinary] (4000) NULL , [Description] [nvarchar] (500) COLLATE Arabic_CI_AS NULL , [Add_Date] [datetime] NULL , CONSTRAINT [PK_ProductsDownload] PRIMARY KEY CLUSTERED ( [ID] ) ON [PRIMARY] , CONSTRAINT [FK_ProductsDownload_DownloadTypes] FOREIGN KEY ( [Type_Id] ) REFERENCES [DownloadTypes] ( [ID] ) ON DELETE CASCADE ON UPDATE CASCADE , CONSTRAINT [FK_ProductsDownload_Product] FOREIGN KEY ( [Product_Id] ) REFERENCES [Product] ( [Product_Id] ) ON DELETE CASCADE ON UPDATE CASCADE ) ON [PRIMARY] GO And use data list has label for file name and button to download file as <asp:DataList ID="DataList5" runat="server" DataSource='<%#GetData(Convert.ToString(Eval("Product_Id")))%>' RepeatColumns="1" RepeatLayout="Flow"> <ItemTemplate> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="spc_tab_hed_bg spc_hed_txt lm5 tm2 bm3"> <asp:Label ID="LblType" runat="server" Text='<%# Eval("TypeName", "{0}") %>'></asp:Label> </td> <td width="380" class="spc_tab_hed_bg"> &nbsp; </td> </tr> <tr> <td align="left" class="lm5 tm2 bm3"> <asp:Label ID="LblData" runat="server" Text='<%# Eval("Name", "{0}") %>'></asp:Label> </td> <td align="center" class=" tm2 bm3"> <a href='<%# "DownloadFile.aspx?Product_Id=" + DataBinder.Eval(Container.DataItem,"Product_Id") %>' > <img src="images/downloads_ht.jpg" width="11" height="11" border="0" /> </a> <%--<asp:ImageButton ID="ImageButton1" ImageUrl="images/downloads_ht.jpg" runat="server" OnClick="ImageButton1_Click1" />--%> </td> </tr> </table> </ItemTemplate> </asp:DataList> I tried more to solve this problem but I cannot please if any one has solve for this proplem please sent me thank you kareem saad programmer MCTS,MCPD Toshiba Company Egypt

    Read the article

  • How to debug SITE.MASTER ASPX file?

    - by salvationishere
    I am developing a C#/SQL VS 2008 website application and I'm trying to set breakpoints in my site.master file--is there a way to do this? The contents of this file are: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <title>Forms Authentication, Authorization, and User Accounts</title> <link href="Styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <form id="form1" runat="server"> <div id="header"> <span class="title">User Account Tutorials</span><br /> <span class="breadcrumb"> <asp:SiteMapPath ID="SiteMapPath1" runat="server"> </asp:SiteMapPath> </span> </div> <div id="content"> <asp:ContentPlaceHolder ID="MainContent" runat="server"> <!-- Page-specific content will go here... --> </asp:ContentPlaceHolder> </div> <div id="navigation"> <asp:ContentPlaceHolder ID="LoginContent" runat="server"> <asp:LoginView ID="LoginView1" runat="server"> <LoggedInTemplate> Welcome back,<asp:LoginName ID="LoginName1" runat="server" /> </LoggedInTemplate> <AnonymousTemplate> Hello, stranger! </AnonymousTemplate> </asp:LoginView> <br /> <br /> </asp:ContentPlaceHolder> <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Logout.aspx" /> <ul> <li> <asp:HyperLink runat="server" ID="lnkHome" NavigateUrl="~/Default.aspx">Home</asp:HyperLink> </li> <asp:Repeater runat="server" ID="menu" DataSourceID="SiteMapDataSource1"> <ItemTemplate> <li> <asp:HyperLink ID="lnkMenuItem" runat="server" NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink> <asp:Repeater ID="submenu" runat="server" DataSource="<%# ((SiteMapNode) Container.DataItem).ChildNodes %>"> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li> <asp:HyperLink ID="lnkMenuItem" runat="server" NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink> </li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </li> </ItemTemplate> </asp:Repeater> </ul> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" /> </div> </form> </div> </body> </html>

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >