Search Results

Search found 1553 results on 63 pages for 'tail recursion'.

Page 7/63 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Understanding Long Tail Keywords For SEO

    Long tail keywords are typically two or more words (a phrase) that you type into a search engine like Google when you are searching for a product, service, the answer to a question or any kind of research you might find necessary. And if you're not at the top of the search engines (preferably in one of the first 3 positions), your chances of making money online decrease substantially.

    Read the article

  • Tail and wildcard characters

    - by Mitch
    I want to get the last 10 lines of multiple files. I know they all end with "-access_log". So I tried: tail -10 *-access_log But this gives me an error, where as: tail -10 file-* Gives me the output I'd expect. I would think this probably has more to do with BASH then tail. However commands like: cat *-access_log Work fine. Any suggestions?

    Read the article

  • tail-like view on HTML logfiles

    - by h0b0
    I'm working on an application that creates HTML log files. I'm tired of having to manually reload and scroll to the bottom in the browser to see the latest entries. A solution that does not really satisfy me is using the Firefox plugins ReloadEvery and ScrollyFox. In many situations reloading frequency and scrolling speed are just to slow. Of course I could actually use tail, but I would prefer a rendered HTML page. Do you have any suggestions? Firefox extensions are preferred, but any other tip is appreciated, too.

    Read the article

  • Why is the recursion idiom in Haskell "'n+1' and 'n'" and not "'n' and 'n-1'"?

    - by rulfzid
    I'm working my way through Graham Hutton's Haskell book, and in his recursion chapter, he often pattern-matches on "n+1", as in: myReplicate1 0 _ = [] myReplicate1 (n+1) x = x : myReplicate1 n x Why that and not the following, which (1) seems functionally identical and (2) more intuitive in terms of understanding what's happening with the recursion: myReplicate2 0 _ = [] myReplicate2 n x = x : myReplicate2 (n-1) x Is there something I'm missing here? Or is it just a matter of style?

    Read the article

  • Need help understanding a recursion example in Python

    - by Ali Mustafa
    Python is my first programming language, and I'm learning it from "How to Think Like a Computer Scientist". In Chapter 5 the author gives the following example on recursion: def factorial(n): if n == 0: return 1 else: recurse = factorial(n-1) result = n * recurse return result I understand that if n = 3, then the function will execute the second branch. But what I don't understand is what happens when the function enters the second branch. Can someone explain it to me?

    Read the article

  • How can I implement a tail-recursive list append?

    - by martingw
    A simple append function like this (in F#): let rec app s t = match s with | [] -> t | (x::ss) -> x :: (app ss t) will crash when s becomes big, since the function is not tail recursive. I noticed that F#'s standard append function does not crash with big lists, so it must be implemented differently. So I wondered: How does a tail recursive definition of append look like? I came up with something like this: let rec comb s t = match s with | [] -> t | (x::ss) -> comb ss (x::t) let app2 s t = comb (List.rev s) t which works, but looks rather odd. Is there a more elegant definition?

    Read the article

  • DNS "recursion not available" using a Cisco AnyConnect VPN connection

    - by codeape
    Does anyone have experience with configuring Cisco AnyConnect VPN? We have a problem with client DNS name resolution when connected over VPN. To me, it looks as if the Cisco AnyConnect VPN client intercepts DNS queries from the clients. Can someone confirm that the AnyConnect VPN client in fact does this (intercepts DNS traffic)? Where is this configured on the VPN server? EDIT: Here's how the routing table changes when I connect to the VPN: [~] $ diff -u /tmp/route_normal /tmp/route_vpn --- /tmp/route_normal 2010-01-20 19:23:47.000000000 +0100 +++ /tmp/route_vpn 2010-01-20 19:24:46.000000000 +0100 @@ -1,6 +1,10 @@ Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface +xxx.xxx.xx.xx.i 10.0.0.1 255.255.255.255 UGH 0 0 0 ath0 172.16.53.0 * 255.255.255.0 U 0 0 0 vmnet1 10.0.0.0 * 255.255.255.0 U 0 0 0 ath0 +172.17.20.0 * 255.255.255.0 U 0 0 0 cscotun 0 +192.168.111.0 172.17.20.212 255.255.255.0 UG 0 0 0 cscotun 0 172.16.140.0 * 255.255.255.0 U 0 0 0 vmnet8 +172.16.0.0 172.17.20.212 255.255.0.0 UG 0 0 0 cscotun 0 default 10.0.0.1 0.0.0.0 UG 0 0 0 ath0 EDIT 2: The IT guy has done "something" on the VPN endpoint. Now I get "recursion not available" when doing nslookup. The DNS servers have recursion enabled. So it must be the Cisco VPN DNS interception messing this up. ubuntu@domU-12-31-39-00-ED-14:~$ /opt/cisco/vpn/bin/vpn connect xxx.xxxxxx.xx ... >> Please enter your username and password ... >> notice: Establishing VPN... >> state: Connected >> notice: VPN session established to ... ubuntu@domU-12-31-39-00-ED-14:~$ nslookup www.vg.no ;; Got recursion not available from ..., trying next server ;; Got recursion not available from ..., trying next server ;; Got recursion not available from ..., trying next server ;; Got recursion not available from ..., trying next server Server: 172.16.0.23 Address: 172.16.0.23#53 ** server can't find www.vg.no.compute-1.internal: REFUSED ubuntu@domU-12-31-39-00-ED-14:~$ ping 195.88.55.16 PING 195.88.55.16 (195.88.55.16) 56(84) bytes of data. 64 bytes from 195.88.55.16: icmp_seq=1 ttl=240 time=110 ms 64 bytes from 195.88.55.16: icmp_seq=2 ttl=240 time=111 ms 64 bytes from 195.88.55.16: icmp_seq=3 ttl=240 time=109 ms ^C --- 195.88.55.16 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2017ms rtt min/avg/max/mdev = 109.953/110.379/111.075/0.496 ms

    Read the article

  • PCI compliance - Setting BIND to no recursion, cURL can't access external sites

    - by Exit
    I was running a PCI scan and was following direction to change the BIND options from: // recursion no; allow-recursion { trusted;}; allow-notify { trusted;}; allow-transfer { trusted;}; to: recursion no; allow-recursion { none;}; allow-notify { trusted;}; allow-transfer { none;}; The end result was that cURL operations stopped being able to access external sites. I realize that not everything will be 100% for PCI compliance, but can someone explain if there is a way to balance this for both PCI compliance and function?

    Read the article

  • Loops, Recursion and Memoization in JavaScript

    - by Ken Dason
    Originally posted on: http://geekswithblogs.net/kdason/archive/2013/07/25/loops-recursion-and-memoization-in-javascript.aspxAccording to Wikipedia, the factorial of a positive integer n (denoted by n!) is the product of all positive integers less than or equal to n. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120. The value of 0! is 1. We can use factorials to demonstrate iterative loops and recursive functions in JavaScript.  Here is a function that computes the factorial using a for loop: Output: Time Taken: 51 ms Here is the factorial function coded to be called recursively: Output: Time Taken: 165 ms We can speed up the recursive function with the use of memoization.  Hence,  if the value has previously been computed, it is simply returned and the recursive call ends. Output: Time Taken: 17 ms

    Read the article

  • Understanding Backtracking in C++

    - by nikhil
    I have a good basic understanding of the fundamentals of C++, I also have an understanding of how recursion works too. I came across certain problems like the classic eight queens problem and solving a Sudoku with Backtracking. I realize that I'm quite lost when it comes to this, I can't seem to be able to get my mind around the concept of going back in the recursion stack and starting again in order to solve the problem. It seems easy with a pen and paper but when it comes to writing code for this, I'm confused on how to begin attacking these problems. It would be helpful if there were a tutorial aimed at beginners to backtracking or if there were a good book where this was covered. If somebody can shed light on this topic or give me some links to decent references, I'd be really grateful. And yes I do know that it would be easier in functional languages but I'd like to understand the implementation in imperative languages too.

    Read the article

  • Recursion in F#

    - by MarkPearl
    Things are slowly coming together – I was able to look at a bit of F# code and intuitively know what it was going to do (yay)… So today I saw a blog post by Bob Palmer on Fibonacci numbers in F# which inspired me to look at bit into recursion. First the C# example… class Program { public static void CountDown(int n) { switch (n) { case 0: Console.WriteLine("End of Count"); break; default: Console.WriteLine(n); CountDown(n-1); break; } } static void Main(string[] args) { CountDown(10); Console.ReadLine(); } }   In F#, the equivalent would look something like this… open System let rec CountDown n = match n with | 0 -> Console.WriteLine("End of Count"); | n -> Console.WriteLine(n); CountDown (n-1); CountDown 10 Console.ReadLine()   Pretty simple stuff. With F# you when making recursive calls you need to explicitly declare that the function is recursive with the “rec” keyword. Otherwise the code is pretty easy to read and self explanatory.

    Read the article

  • What are basic programs like, recursion, Fibonacci, small trick programs?

    - by Mike
    This question may seem daft (I'm a new to 'programming' and should probably stop if this is the type of question I'm required to ask)... What are: "basic programs like, recursion, fibonacci, factorial, string manipulation, small trick programs"? I've recently read Coding Horror - the non programmer and followed the links to Kegel and How to get hired. Then I delved through some similar questions here (hence the block quote) and I realised that as a fully fledged non-programmer I probably wouldn't know if I knew recursion (or any of the others) because I wouldn't know what it looked like, or why it was used, and what the results would look like after it was used. I suppose I'm trying to get a picture of "the basics". What the principles are and why we learn them - where they'll be used and what result/s your looking for. If they'll be used as an interview question during my first interview sometime in 2020 I would like to look less ignorant than those 199 out of 200 who just don't know the how, or the why, of programming. As always...I'll get my coat. Thanks Mike

    Read the article

  • Can continuations be used as a replacement for recursion?

    - by Sam
    The following function generates a 'stack level too deep (SystemStackError)' for n = 5,000 def factorial(n) n == 0 ? 1 : factorial(n -1) * n end Is there a way to avoid this error using continuations/callcc? Note: I know this can be implemented without recursion. e.g. def factorial2(n) (1..n).inject(1) {|result, n| result * n } end

    Read the article

  • How can I improve the recursion capabilities of my ECMAScript implementation?

    - by ChaosPandion
    After some resent tests I have found my implementation cannot handle very much recursion. Although after I ran a few tests in Firefox I found that this may be more common than I originally thought. I believe the basic problem is that my implementation requires 3 calls to make a function call. The first call is made to a method named Call that makes sure the call is being made to a callable object and gets the value of any arguments that are references. The second call is made to a method named Call which is defined in the ICallable interface. This method creates the new execution context and builds the lambda expression if it has not been created. The final call is made to the lambda that the function object encapsulates. Clearly making a function call is quite heavy but I am sure that with a little bit of tweaking I can make recursion a viable tool when using this implementation. public static object Call(ExecutionContext context, object value, object[] args) { var func = Reference.GetValue(value) as ICallable; if (func == null) { throw new TypeException(); } if (args != null && args.Length > 0) { for (int i = 0; i < args.Length; i++) { args[i] = Reference.GetValue(args[i]); } } var reference = value as Reference; if (reference != null) { if (reference.IsProperty) { return func.Call(reference.Value, args); } else { return func.Call(((EnviromentRecord)reference.Value).ImplicitThisValue(), args); } } return func.Call(Undefined.Value, args); } public object Call(object thisObject, object[] arguments) { var lexicalEnviroment = Scope.NewDeclarativeEnviroment(); var variableEnviroment = Scope.NewDeclarativeEnviroment(); var thisBinding = thisObject ?? Engine.GlobalEnviroment.GlobalObject; var newContext = new ExecutionContext(Engine, lexicalEnviroment, variableEnviroment, thisBinding); Engine.EnterContext(newContext); var result = Function.Value(newContext, arguments); Engine.LeaveContext(); return result; }

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >