Search Results

Search found 8286 results on 332 pages for 'defined'.

Page 152/332 | < Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >

  • Trouble using eval() with cython

    - by Peter Stewart
    I was trying to speed up some code, and then I tried compiling a class and a function using cython and WOW! I havn't measured it yet but it looks at least 10x faster. I first looked at cython just two days ago, I'm very impressed! However, I can't get eval() to work. def thefirst(int a): d = eval('1+2+a') return d I compile this to module1.pyd file and call it with the python file: from module1 import thefirst x = thefirst(2) print x This returns: NameError: name 'a' is not defined. All help is appreciated.

    Read the article

  • Value Comparison with a multivalued column in SQL Database Table

    - by Rishabh Ohri
    Hi All, Suppose there is a table A which has a column AccessRights which is multivalued( Eg of values in it in this format STOLI,HELP,BRANCH(comma separated string) Now a stored procedure is written against this table to fetch records based on a AccessRight parameter sent to the SP. Let that parameter be @AccessRights, this is also a comma separated string which may have a value like STOLI,BRANCH,HELPLINE etc Now I want to compare individual values from the parameter @AccessRights with the column AccessRights. Current Approach is I split the Comma Separated string(@AccessRights) using a User Defined Function Split. And I get Individual values in a Table variable(Contains only one column "accessGroup"), the individual values are in a Table variable under the column name accessGroup and I use following code in the SP for comparison Where AccessRights like '%'+accessGroup+'%' Now if the user passes the parameter (HELP, OLI) instead of( HELP,STOLI) the SP will give the output. What should be done for comparison so that that subststring OLI does not give the output for STOLI

    Read the article

  • Send instance method to module

    - by Matchu
    Given the following module, module Foo def bar :baz end end def send_to_foo(method) # ...? end send_to_foo(:bar) # => :baz What code should go in send_to_foo to make the last line work as expected? (send_to_foo is obviously not how I would implement this; it just makes clearer what I'm looking for.) I expected Foo.send(:bar) to work at first, but it makes sense that it doesn't. It would if the method were defined as def self.bar, but that's no fun.

    Read the article

  • Need to upload files to google docs from my application and store reference to the uploaded file...

    - by Ali
    Hi guys - I'm working on a basic google applications based system. Like I earlier defined I'm building a simple ordering system and to each order placed I attach a file or document. I would like to be able to set it such that whatever file I upload is uploaded into google docs and I somehow am able to maintain a reference to that file from my own application i.e these files are concerned with such and such order. My application is google application based hopefully and I'm building it to be such for later on deployment into the cloud. How do I start on this and what do I need to do? Are there already working widgets I can use and apply or would I need to create my own customised solution for this? I'm working in Php MySQL.

    Read the article

  • Who is a web developer? What does he do

    - by Sinan
    I am wrting an article on web developers. It seems to me there are some problems on the definition of "what is a web developer". It looks like a web developer title is a bit misunderstood. And people with this title doesnt get the recognition they deserve. While most people at IT have some well defined job defitinitions. A web developer requires multiple skills. Like knowing a programming language, web security, etc. I was wondering what do you think about this issue? What skills does a web developer need? Where does his responsibilities start and end? etc.

    Read the article

  • Why can't I set a custom color-tint for the UINavigationBar?

    - by mobibob
    I want to change the color on the navigation bar and the documentation states not to attempt to change the 'alpha' value. So, how can I set a color that is not the SDK defined values (e.g., [UIColor redColor], brownColor, etc.) if all the constructors provide an alpha value? I tried getting the current alpha value but that did not help. When I use a custom color, it causes the navigation bar to look like an x-ray (a scraggy, black-on-white). [self.navigationController.navigationBar setTintColor: [UIColor brownColor]];

    Read the article

  • How do I write x86 Debug registers from user space on OSX?

    - by nall
    I'd like to play around with the debug MSRs defined in the x86 spec (DR0-7) from my OSX user-space program. Unfortunately, these require CPL == 0 (aka ring 0). I've thumbed through the OSX syscalls and with the exception of kernel_debug nothing really jumps out as a way to access these. It may be the case that they are only available via some higher level interface like kernel_debug, but it's unclear to me if that's the case or if I just haven't found the magic invocation to get to them. Anyone know how to do this?

    Read the article

  • Cocoa NSOutlineView bug - [NSCFTimer copyWithZone:]: unrecognized selector sent to instance

    - by Circle
    I'm using an NSOutlineView with the function - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item defined so it gives the group row GUI look. When I add a root item, it works fine. When I add an item to root's child array and expand it, it works fine. If I contract the item though, the following error is logged: [NSCFTimer copyWithZone:]: unrecognized selector sent to instance I also get an EXC_BAD_ACCESS error if the app window is deactivated by switching to another app. I used the debugger to try to find where I might have made an error in one of my functions, but the stack trace only shows functions I did not create (RunCurrentEventLoopInMode, CFRunLoopRunSpecific, handleWindowNeedsDisplay, etc.) Does anyone have any idea where my error(s) might be?

    Read the article

  • View problem - how to show integer from activity in XML?

    - by Oliver Goossens
    Hi there, I started two days ago with android, gone through the hello android stuff and also started to read the Hello Android book, which is great. PROBLEM: I use in my app - VERY EASY APP- the XML output. So basically the main activity just tells the android to show the XML layout of main. But what if I have in the activity - code defined integer variable and I want this integer variable also be shown on the display? How do I PUSH the integer variable to the XML??? From main XML reference to other strings in XML is easy - @string/app_name ... but how do I use the integer variable from the activity? Please help Thank you Oliver

    Read the article

  • Setting HTML Text Element value

    - by Gpx
    Hi, in my C# WPF prog i´am trying to set a value of a HTML Text Element which is defined like: <input name="tbBName" type="text" id="tbBName" tabindex="1" /> What i found about it and tried is: mshtml.HTMLDocument doc = (mshtml.HTMLDocument)webBrowser1.Document; mshtml.HTMLInputTextElement tbName = (mshtml.HTMLInputTextElement)doc.getElementsByName("tbBName"); tbName.value = "Test"; But i got the exception: Unable to cast COM object of type 'System.__ComObject' to interface type 'mshtml.HTMLInputTextElement'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3050F520-98B5-11CF-BB82-00AA00BDCE0B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). I know what it says but i dont know which object i can use to access the Texbox. Thanks for any answers.

    Read the article

  • Linq : problem with primary key

    - by Nickson
    I get the following error message The table/view 'TABLE1' does not have a primary key defined and no valid primary key could be inferred. This table/view has been excluded. To use the entity you will need to review your schema, add the correct keys and uncomment it when I try to add a view to an Entity Data Model. For testing, I have created a very simple view and I still get the error. below is the view definition SELECT DISTINCT TOP (100) PERCENT MIN(id) AS Expr4, MIN(EmpNo) AS Expr1, MIN(Name) AS Expr2, MIN(Category) AS Expr3 FROM dbo.MYView1 GROUP BY id does any one know of a simple work around. I have looked at this thread http://stackoverflow.com/questions/745341/can-ms-sql-views-have-primary-and-foriegn-keys but in my scenario, what is recommended is not applicable. If I could only have the view added to the Model.

    Read the article

  • Multiline TextBox control in WPF

    - by Stian Karlsen
    For some reason I need the content of a TextBox to span multiple lines, and I need this to be defined directly in XAML. I know I can set TextWrapping="Wrap", and I will do that too, but what I need to do is add newlines anywhere I want in the TextBox. Can this be done in XAML? I know the following example won't work, but what I want is something like this: <TextBox>Test1 \n Test2 \n Test3</TextBox> .. and then have these displayed on three lines. Test1 Test2 Test3

    Read the article

  • !(ReferenceEquals()) vs != in Entity Framework 4

    - by Eric J.
    Unless a class specifically overrides the behavior defined for Object, ReferenceEquals and == do the same thing... compare references. In property setters, I have commonly used the pattern private MyType myProperty; public MyType MyProperty { set { if (myProperty != value) { myProperty = value; // Do stuff like NotifyPropertyChanged } } } However, in code generated by Entity Framework, the if statement is replaced by if (!ReferenceEquals(myProperty, value)) Using ReferenceEquals is more explicit (as I guess not all C# programmers know that == does the same thing if not overridden). Is there any difference that's escaping me between the two if-variants? Are they perhaps accounting for the possibility that POCO designers may have overridden ==? In short, if I have not overridden ==, am I save using != instead of ReferencEquals()?

    Read the article

  • MVC ActionLink omits action when action equals default route value

    - by rjygraham
    I have the following routes defined for my application: routes.MapRoute( "Referral", // Route name "{referralCode}", // URL with parameters new { controller = "Home", action = "Index" } // Parameter defaults ); routes.MapRoute( "Default", // Route name "{controller}/{action}", // URL with parameters new { controller = "Home", action = "Index" } // Parameter defaults ); And I'm trying to create an ActionLink to go on the Index action on my AdminController: @Html.ActionLink("admin", "Index", "Admin") However, when the view is executed the ActionLink renders as (Index action value is omitted): <a href="/Admin">admin</a> Normally this would be ok, but it's causing a collision with the "Referral" route. NOTE: If I instead use ActionLink to render a different action like "Default," the ActionLink renders correctly: <a href="/Admin/Default">admin</a> The fact that the "Default" action renders correctly leads me to believe the problem has to do with the default value specified for the route. Is there anyway to force ActionLink to render the "Index" action as well?

    Read the article

  • Reflection and changing a variables type at runtime?

    - by james-west
    Hi I'm trying to create an object Of a specific type. I've got the following code, but it fails because it can't cast the new table object to the one that is already defined. I need table to start of an IEnumerable type so I can't declare is an object. Public sub getTable(ByVal t as Type) Dim table As Table(Of Object) Dim tableType As Type = GetType(Table(Of )).MakeGenericType(t) table = FormatterServices.GetUninitializedObject(tableType) End sub So in short - is there a way of changing a variable type at runtime? (or a better way of doing what I'm doing) Thanks in advance. James

    Read the article

  • Buddypress on local server install has issues

    - by meds
    I have buddypress working nicely on a server, however I can't display the 'members' page or any individual profile page on a local webserver install I have made. If I try and visit /members/ I just get redirected back to the main buddypress page. I also just noticed online members never shows whose online and the link to the default blog on the main page is listed as http://localhost.localdomain/mu/BP_HOME_BLOG_SLUG which seems to indicate to me that BP_HOME_BLOG_SLUG is undefined, I can't find where it gets set or defined, not sure if these two problems are related to the other problems. No idea what's causing it, I've been pouring over the php files but haven't even gotten a clue, any suggestions on what I could do?

    Read the article

  • How to perform bulk update using rails admin

    - by Shubham Kedia
    ![enter image description here][2] I just have to perform a Bulk update for my products using the action which i have defined. While inspecting the link, it displays the following: onclick="jQuery('#bulk_action').val('bulk_add_to_categories'); jQuery('#bulk_form').submit(); return false;" But when I click on it I get this error. I need to do something like this I need to have an separate UI for all the products that have came from that bulk action, and then put them into the selected categories, but I am not able to do that. Can anyone help me on this? Any help would be great. I have seen lot of tutorial and read the rails admin github page but I was not able to find anything helpful. Please guide me.

    Read the article

  • Wpf: Tips for better performance

    - by viky
    I am working on a wpf application. In which I am working with a TreeView, each node represents different datatypes, these datatypes are having properties defined and using data template to show their properties. My application reads from xml and create tree accordingly. My problem is that when I load it, it is too slow, I want to know about the tricks that will help me to improve performance of my(any) wpf application. Edit: Please provide me some tips for better performance in wpf!! I am using wpf Profiler but it is not much helpful for me.

    Read the article

  • assigning in system of differential equations

    - by Alireza
    hi every one! when i solve numerically a system of two differential equations: s1:=diff(nDi, t)=...; s2:=diff(nT, t)=...; ics:={...}; #initial condition. sys := {s1, s2, ics}: sol:=dsolve(sys,numeric); with respect to "t",then the solution (for example)for "t=4" is of the form, sol(4): [t=4, n1(t)=const1, n2(t)=const2]. now, how is possible to use values of n1(t) and n2(t) for all "t"'s in another equation, namely "p", which involved n1(t) or n2(t)(like: {p=a+n1(t)*n2(t)+f(t)},where "a" and "f(t)" are defined), and to plot "p" for an interval of "t"?

    Read the article

  • Can IIS admin change password of Windows Service account

    - by sweta Jha
    We have a service account defined for anonymous access which is used for several web sites hosted on the web server. This account has access to several network resources like report server, file servers and so on. While deploying a new web site, we used the same service account for anonymous access. IIS takes the username/password for the account and then a dialog opens for confirm password. Accidently, we gave a wrong password in both the text boxes, the new site with wrong password is working fine but all other previously hosted sites which were using the service account, started giving the unautorized access error. Is it possible that when we entered wrong password for the new web site, the password of the account got reset and all sites stopped functioning?

    Read the article

  • How do I use FB.Connect.streamPublish in an iframe facebook app?

    - by Gary
    I'm making a simple iframe-based facebook app. I have the following code to size my iframe: FB_RequireFeatures(["Connect"], function(){ FB.XdComm.Server.init('/xd_receiver.htm'); FB.CanvasClient.startTimerToSizeToContent(); FB.CanvasClient.syncUrl(); }); I want to add a link that will display a popup which will allow the user to post an app-defined image/link to the user's wall. To get things working initially, I tried just using the following code on a click event: FB.Connect.streamPublish(''); However, nothing happens. I've tried adding: FB.init(<?=API_KEY?>, '/xd_receiver.htm'); both inside the FB_RequireFeatures function, before it, after it... no luck. Nothing happens. No errors are thrown. Nothing. Any ideas?

    Read the article

  • How to use both DataSource and DataSourceID in gridview

    - by jame
    work on C# asp.net vs05.i need to save some value and show them on the gridview.So under the button event i write a code that save value ,and show on gridview.I can save value but problem occur when show on gridview.So i use the DataSource .I also set the GridviewTask-->Choose Data Source--> DataSourceID ,because user need to edit information set on the page. after use the DataSourceID show this error message : Both DataSource and DataSourceID are defined on 'GridView2'. Remove one definition. How can i use the both in one grid view?if i can not? then how to give user this facility that they can edit information set on the grid with out use any other contorl.

    Read the article

  • How to get the ObjectId value from MongoDB?

    - by LVarayut
    I'm using Jongo with Play framework 2, java. I added some data into my MongoDB. {"_id" : ObjectId("538dafffbf6b562617252178"), ... } However, when I fetched the ObjectId from the database, it gave me like: de.undercouch.bson4jackson.types.ObjectId@484431ff instead of 538dafffbf6b562617252178. I don't quite understand how can I get the ObjectId value. My class is defined as following: public class Product { @JsonProperty("_id") protected String id; ... public Product() { } public String getId() { return id; } public void setId(String id) { this.id = id; } } EDIT In order to fetch the data, I simply use find() function provided by Jongo as following: public static Iterable<Product> findAll(){ return products().find().as(Product.class); }

    Read the article

  • Defining a SPI in Clojure

    - by Joe Holloway
    I'm looking for an idiomatic way(s) to define an interface in Clojure that can be implemented by an external "service provider". My application would locate and instantiate the service provider module at runtime and delegate certain responsibilities to it. Let's say, for example, that I'm implementing a RPC mechanism and I want to allow a custom middleware to be injected at configuration time. This middleware could pre-process the message, discard messages, wrap the message handler with logging, etc. I know several ways to do this if I fall back to Java reflection, but feel that implementing it in Clojure would help my understanding. (Note, I'm using SPI in a general sense here, not specifically referring to the way it's defined in the JAR file specification) Thanks

    Read the article

  • In cakePHP, how to retrieve joined result from multiple tables

    - by Manish Sharma
    Hi, can anyone tell me, how to retrieve joined result from multiple tables in cakePHP ( using cakePHP mvc architecture). For example, I have three tables to join (tbl_topics, tbl_items, tbl_votes. Their relationship is defined as following: a topic can have many items and an item can have many votes. Now I want to retrieve a list of topics with the count of all votes on all items for each topic. The SQL query for this is written below: SELECT Topic.*, count(Vote.id) voteCount FROM tbl_topics AS Topic LEFT OUTER JOIN tbl_items AS Item ON (Topic.id = Item.topic_id) LEFT OUTER JOIN tbl_votes AS Vote ON (Item.id = Vote.item_id); My problem is I can do it easily using $this-><Model Name>->query function, but this requires sql code to be written in the controller which I don't want. I'm trying to find out any other way to do this (like find()).

    Read the article

< Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >