Search Results

Search found 5180 results on 208 pages for 'outside'.

Page 64/208 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • How to use objetcs as modules/functors in Scala?

    - by Jeff
    Hi. I want to use object instances as modules/functors, more or less as shown below: abstract class Lattice[E] extends Set[E] { val minimum: E val maximum: E def meet(x: E, y: E): E def join(x: E, y: E): E def neg(x: E): E } class Calculus[E](val lat: Lattice[E]) { abstract class Expr case class Var(name: String) extends Expr {...} case class Val(value: E) extends Expr {...} case class Neg(e1: Expr) extends Expr {...} case class Cnj(e1: Expr, e2: Expr) extends Expr {...} case class Dsj(e1: Expr, e2: Expr) extends Expr {...} } So that I can create a different calculus instance for each lattice (the operations I will perform need the information of which are the maximum and minimum values of the lattice). I want to be able to mix expressions of the same calculus but not be allowed to mix expressions of different ones. So far, so good. I can create my calculus instances, but problem is that I can not write functions in other classes that manipulate them. For example, I am trying to create a parser to read expressions from a file and return them; I also was trying to write an random expression generator to use in my tests with ScalaCheck. Turns out that every time a function generates an Expr object I can't use it outside the function. Even if I create the Calculus instance and pass it as an argument to the function that will in turn generate the Expr objects, the return of the function is not recognized as being of the same type of the objects created outside the function. Maybe my english is not clear enough, let me try a toy example of what I would like to do (not the real ScalaCheck generator, but close enough). def genRndExpr[E](c: Calculus[E], level: Int): Calculus[E]#Expr = { if (level > MAX_LEVEL) { val select = util.Random.nextInt(2) select match { case 0 => genRndVar(c) case 1 => genRndVal(c) } } else { val select = util.Random.nextInt(3) select match { case 0 => new c.Neg(genRndExpr(c, level+1)) case 1 => new c.Dsj(genRndExpr(c, level+1), genRndExpr(c, level+1)) case 2 => new c.Cnj(genRndExpr(c, level+1), genRndExpr(c, level+1)) } } } Now, if I try to compile the above code I get lots of error: type mismatch; found : plg.mvfml.Calculus[E]#Expr required: c.Expr case 0 = new c.Neg(genRndExpr(c, level+1)) And the same happens if I try to do something like: val boolCalc = new Calculus(Bool) val e1: boolCalc.Expr = genRndExpr(boolCalc) Please note that the generator itself is not of concern, but I will need to do similar things (i.e. create and manipulate calculus instance expressions) a lot on the rest of the system. Am I doing something wrong? Is it possible to do what I want to do? Help on this matter is highly needed and appreciated. Thanks a lot in advance.

    Read the article

  • Assigning Git SHA1's without Git

    - by git-noob
    As I understand it when Git assigns a SHA1 hash to a file this SHA1 is unique to the file based on its contents. As a result if a file moves from one repository to another the SHA1 for the file remains the same as its contents have not changed. How does Git calculate the SHA1 digest? Does it do it on the full uncompressed file contents? I would like to emulate assigning SHA1's outside of Git.

    Read the article

  • Refactor instance declaration from try block to above try block in a method

    - by dotnetdev
    Hi, Often I find myself coming across code like this: try { StreamWriter strw = new StreamWriter(); } However, there is no reference to the object outside the scope of the try block. How could I refactor (extract to field in Visual Studio says there is no field or something) the statement in the try block so that it is declared above the try block so I can use it anywhere in the method? Thanks

    Read the article

  • Grep / RegExp help

    - by Calvin
    Hi everyone! I apologize if this is a really stupid question. I have data in the format: etc etc etc <span>etc etc etc</span> etc etc etc etc etc etc <span>etc etc etc</span> etc etc etc etc etc etc <span>etc etc etc</span> etc etc etc Is there a way to grep each line for a match that falls outside of the span tags?

    Read the article

  • Displaying a popup widget in QT over application border

    - by Chris Kaminski
    Let's say that I have an application frame, and I want to show a popup QCalendarWidget over on the right side of the frame. Normally, QT will clip the edges of the QCalendarWidget, cutting it in half and not displaying the rest, as it would be over the right side border. Is there a way to work around this limitation without resorting to implementing a QDialog? I want the widget to be visible outside the bounds of it's container.

    Read the article

  • What good alternatives are there to Google Charts?

    - by Rhubarb
    I have been experimenting with Google charts. Are there any alternatives that are reasonably as expressive but can be installed locally on your own web server? I don't like the idea of relying on an outside entity for a feature to work. Even if it is for cost, it would be preferable. Any suggestions?

    Read the article

  • [VIM] How to restrict operations to certain lines?

    - by Ayman
    I have to work some relatively huge code files. How do I restrict some operations like find-next normal-n and others to a certain function / block? How would I visually know if I'm within that block or outside it? Looking and line numbers seems awkward, specially that the line numbers I need to work with are generally 5 digits long!

    Read the article

  • Source Directory MSVC

    - by PhilCK
    argh, this should be an easy one. How can I set the directory that a MSVC project uses to store source files? I wish to use a directory outside the project dir, As this is a multiplatform project which will also have an xcode directory. Thanks Phil

    Read the article

  • Where is JBoss Seam most popular

    - by Walter White
    Hi all, I have been using JBoss Seam now for over a year and still haven't seen much acceptance here in the US. My metrics are, the number of jobs that indicate JBoss Seam and number of people talking about JBoss Seam (Java groups / JBoss Seam groups, etc.). Is JBoss Seam more popular outside the US? Walter

    Read the article

  • WebPage resize on HD Devices like Nexus One

    - by christian Muller
    Hi, our Webpage: http://www.checkdent.com/mobile/sv.php?id=12332181087788749 looks fine on Android G1, but comes resized on the Google Nexus (higher resolution) Half part of the Page is outside of the View! I implemented as mentioned at several places the: target-densityDpi=device-dpi < meta content="minimum-scale=1.0, width=device-width, , target- densityDpi=device-dpi, maximum-scale=0.6667, user-scalable=no" name="viewport" / it works great within the 'android browser' but in my Webview Application it still resize!! What can i Do? Regards Chris

    Read the article

  • Allow access to my server.

    - by Zachary Brown
    I have a server, did some of the programming myself. It ison my home network, but I need to be able to access it from anywhere over the internet. I have done the port forwarding like I am supposed to, but I still cant get to it from an outside computer. It just displays Internet Explorer cannot display the webpage. I don't know what else to do. I am on a Linksys WRT54G v8 router running ddWRT v24 micro firmware.

    Read the article

  • Account for simple url rewriting in ASP.NET MVC redirect

    - by Kevin Montrose
    How would you go about redirecting in ASP.NET MVC to take into account some external URL rewriting rules. For example: What the user enters: http://www.example.com/app/route What ASP.NET MVC sees: /route What I want to redirect to: http://www.example.com/app/other_route What actually happens when I do a simple RedirectToAction: http://www.example.com/other_route (which doesn't exist, from the outside anyway) This seems like it should be simple, but I'm drawing a blank.

    Read the article

  • Visual Source Safe on Mac OS X

    - by Jonathan Badeen
    Is there an application or API for using/accessing Visual SourceSafe (6.0) under Mac OS X? I'm currently using VSS Connect under Parallels for working with our company's ASP.NET site/s. I currently have my Windows drive shared and try to use TextMate on the Mac side to actually edit files. It would be nice to have the ability to check files in/out outside of my virtual machine though.

    Read the article

  • anonymous function variable scope [js, ajax]

    - by arthurprs
    $(".delete").click( function() { var thesender = this; $(thesender).text("Del..."); $.getJSON("ajax.php", {}, function(data) { if (data["result"]) $(thesender).remove(); // variable defined outside else alert('Error!'); } ); return false; } ); This can cause problems if user clicks on another ".delete" before the ajax callback is called?

    Read the article

  • How to restrict operations to certain lines?

    - by Ayman
    I have to work on some relatively huge code files in vim. How do I restrict some operations like find-next normal-n and others to a certain function / block? How would I visually know if I'm within that block or outside it? Looking and line numbers seems awkward, specially that the line numbers I need to work with are generally 5 digits long!

    Read the article

  • How to restrict rightBarButtonItem size in UINavigationBar ?

    - by lefakir
    I create a rightBarButtonItem with this method : - (UIBarButtonItem *)customBarButtonWithSelector:(SEL)callback { UIButton *customButton = [UIButton buttonWithType:UIButtonTypeRoundedRect]; customButton.bounds = CGRectMake(0, 0, 30.0f, 30.0f); return [[[UIBarButtonItem alloc] initWithCustomView:customButton] autorelease]; } At execution time the selector is fired when the bar is touched outside the button (near the middle). Is there a way to restrict the event responder in the defined bounds or in a acceptable range ?

    Read the article

  • input value in jquery fancybox

    - by Frankie-T
    Like asked here I got the problem, that I cannot read the value of an input type="text" field after writing something into it. The event is fired correctly, and with other inputs outside the fancybox it works great.

    Read the article

  • Javascript iFrame Limitations

    - by Matrym
    I know that, for security reasons, javascript can't read the contents of an iframe if it belongs to a different domain. This makes sense, given that the entire page could be an iframe with snooping scripts outside of the frame. The question is - are there equal limitations in the other direction? Can javascript within an iframe (from a different domain) read and manipulate the dom in its parent window? Thanks!

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >