Search Results

Search found 12744 results on 510 pages for 'programming panda'.

Page 36/510 | < Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >

  • Are Scala "continuations" just a funky syntax for defining and using Callback Functions?

    - by Alex R
    And I mean that in the same sense that a C/Java for is just a funky syntax for a while loop. I still remember when first learning about the for loop in C, the mental effort that had to go into understanding the execution sequence of the three control expressions relative to the loop statement. Seems to me the same sort of effort has to be applied to understand Continuations (in Scala and I guess probably other languages). And then there's the obvious follow-up question... if so, then what's the point? It seems like a lot of pain (language complexity, programmer errors, unreadable programs, etc) for no gain.

    Read the article

  • Truly declarative language?

    - by gjvdkamp
    Hi all, Does anyone know of a truly declarative language? The behaviour I'm looking for is kind of what Excel does, where I can define variables and formulas, and have the formula's result change when the input changes (without having set the answer again myself) The behaviour I'm looking for is best shown with this pseudo code: X = 10 // define and assign two variables Y = 20; Z = X + Y // declare a formula that uses these two variables X = 50 // change one of the input variables ?Z // asking for Z should now give 70 (50 + 20) I've tried this in a lot of languages like F#, python, matlab etc, but every time i try this they come up with 30 instead of 70. Wich is correct from an imperative point of view, but i'm looking for a more declerative behaviour if you know what i mean. And this is just a very simple calculation. When things get more difficult it should handle stuff like recursion and memoization automagically. The code below would obviously work in C# but it's just so much code for the job, i'm looking for something a bit more to the point without all that 'technical noise' class BlaBla{ public int X {get;set;} // this used to be even worse before 3.0 public int Y {get;set;} public int Z {get{return X + Y;}} } static void main(){ BlaBla bla = new BlaBla(); bla.X = 10; bla.Y = 20; // can't define anything here bla.X = 50; // bit pointless here but I'll do it anyway. Console.Writeline(bla.Z);// 70, hurray! } This just seems like so much code, curly braces and semicolons that add nothing. Is there a language/ application (apart from Exel) that does this? Maybe I'm no doing it right in the mentioned langauges, or I've completely missed an app that does just this. I prototyped a language/ application that does this (along with some other stuff) and am thinking of productizing it. I just can't believe it's not there yet. Don't want to waste my time. Thanks in advance, Gert-Jan

    Read the article

  • How do i write tasks? (parallel code)

    - by acidzombie24
    I am impressed with intel thread building blocks. I like how i should write task and not thread code and i like how it works under the hood with my limited understanding (task are in a pool, there wont be 100 threads on 4cores, a task is not guaranteed to run because it isnt on its own thread and may be far into the pool. But it may be run with another related task so you cant do bad things like typical thread unsafe code). I wanted to know more about writing task. I like the 'Task-based Multithreading - How to Program for 100 cores' video here http://www.gdcvault.com/sponsor.php?sponsor_id=1 (currently second last link. WARNING it isnt 'great'). My fav part was 'solving the maze is better done in parallel' which is around the 48min mark (you can click the link on the left side. That part is really all you need to watch if any). However i like to see more code examples and some API of how to write task. Does anyone have a good resource? I have no idea how a class or pieces of code may look after pushing it onto a pool or how weird code may look when you need to make a copy of everything and how much of everything is pushed onto a pool.

    Read the article

  • How do i write task? (parallel code)

    - by acidzombie24
    I am impressed with intel thread building blocks. I like how i should write task and not thread code and i like how it works under the hood with my limited understanding (task are in a pool, there wont be 100 threads on 4cores, a task is not guaranteed to run because it isnt on its own thread and may be far into the pool. But it may be run with another related task so you cant do bad things like typical thread unsafe code). I wanted to know more about writing task. I like the 'Task-based Multithreading - How to Program for 100 cores' video here http://www.gdcvault.com/sponsor.php?sponsor_id=1 (currently second last link. WARNING it isnt 'great'). My fav part was 'solving the maze is better done in parallel' which is around the 48min mark (you can click the link on the left side). However i like to see more code examples and some API of how to write task. Does anyone have a good resource? I have no idea how a class or pieces of code may look after pushing it onto a pool or how weird code may look when you need to make a copy of everything and how much of everything is pushed onto a pool.

    Read the article

  • How to maintain a persistant network-connection between two applications over a network?

    - by John
    I was recently approached by my management with an interesting problem - where I am pretty sure I am telling my bosses the correct information but I really want to make sure I am telling them the correct stuff. I am being asked to develop some software that has this function: An application at one location is constantly processing real-time data every second and only generates data if the underlying data has changed in any way. On the event that the data has changed send the results to another box over a network Maintains a persistent connection between the both machines, altering the remote box if for some reason the network connection went down From what I understand, I imagine that I need to do some reading on doing some sort of TCP/IP socket-level stuff. That way if the connection is dropped the remote location will be aware that the data it has received may be stale. However management seems to be very convinced that this can be accomplished using SOAP. I was under the impression that SOAP is more or less a way for a client to initiate a procedure from a server and get some results via the HTTP protocol. Am I wrong in assuming this? I haven't been able to find much information on how SOAP might be able to solve a problem like this. I feel like a lot of people around my office are using SOAP as a buzzword and that has generated a bit of confusion over what SOAP actually is - and is capable of. Any thoughts on how to accomplish this task would be appreciated!

    Read the article

  • Translate imperative control flow with break-s/continue-s to haskell

    - by dorserg
    Consider the following imperative code which finds the largest palindrome among products of 3-digit numbers (yes, it's the one of the first tasks from "Project of [outstanding mathematician of 18th century]" site): curmax = 0 for i in range(999,100): for j in range(999,100): if ((i*j) < curmax): break if (pal(i*j)): curmax = i*j break print curmax As I'm learning Haskell currently, my question is, how do you translate this (and basically any imperative construct that contains something more complex than just plain iteration, e.g. breaks, continues, temporary variables and all this) to Haskell? My version is maxpal i curmax | i < 100 = curmax | otherwise = maxpal (i-1) (innerloop 999) where innerloop j | (j < 100) || (p < curmax) = curmax | pal p = p | otherwise = innerloop (j-1) where p = i*j main = print $ maxpal 999 0 but this looks like we're still in imperative uglytown. So what could you advise, what are the approaches of dealing with such cases FP-style?

    Read the article

  • Using MonadPlus in FRP.Reactive.FieldTrip

    - by ony
    I'm studying FRP at this moment through FieldTrip adaptor. And hit the problem with strange way of frames scheduling and integration. So now I'm trying to build own marker Event for aligning Behaviour stepping. So... flipflop :: Behavior String flipflop = stepper "none" (xflip 2) where xflip t0 = do t <- withTimeE_ (atTime t0) return "flip" `mplus` xflop (t+3) xflop t0 = do t <- withTimeE_ (atTime t0) return "flop" `mplus` xflip (t+2) txtGeom = ((uscale2 (0.5::Float) *%) . utext . show <$>) main = anim2 (txtGeom . pure flipflop) Questions is: Why this example leads to memory leak? Is there safe way to build sequence of events where each next one is scheduled depending on previous?

    Read the article

  • First Come, First Served process scheduling

    - by user253530
    i have 4 processes: p1 - bursts 5, priority: 3 p2 - bursts 8, priority: 2 p3 - bursts 12, priority: 2 p4 - bursts 6, priority: 1 Assuming that all processes arrive at the scheduler at the same time what is the average response time and average turnaround time? For FCFS is it ok to have them in the order p1, p2, p3, p4 in the execution queue?

    Read the article

  • Rewriting Live TCP/IP (Layer 4) (i.e. Socket Layer) Streams

    - by user213060
    I have a simple problem which I'm sure someone here has done before... I want to rewrite Layer 4 TCP/IP streams (Not lower layer individual packets or frames.) Ettercap's etterfilter command lets you perform simple live replacements of Layer 4 TCP/IP streams based on fixed strings or regexes. Example ettercap scripting code: if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "gzip")) { replace("gzip", " "); msg("whited out gzip\n"); } } if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "deflate")) { replace("deflate", " "); msg("whited out deflate\n"); } } http://ettercap.sourceforge.net/forum/viewtopic.php?t=2833 I would like to rewrite streams based on my own filter program instead of just simple string replacements. Anyone have an idea of how to do this? Is there anything other than Ettercap that can do live replacement like this, maybe as a plugin to a VPN software or something? I would like to have a configuration similar to ettercap's silent bridged sniffing configuration between two Ethernet interfaces. This way I can silently filter traffic coming from either direction with no NATing problems. Note that my filter is an application that acts as a pipe filter, similar to the design of unix command-line filters: >[eth0] <----------> [my filter] <----------> [eth1]< What I am already aware of, but are not suitable: Tun/Tap - Works at the lower packet layer, I need to work with the higher layer streams. Ettercap - I can't find any way to do replacements other than the restricted capabilities in the example above. Hooking into some VPN software? - I just can't figure out which or exactly how. libnetfilter_queue - Works with lower layer packets, not TCP/IP streams. Again, the rewriting should occur at the transport layer (Layer 4) as it does in this example, instead of a lower layer packet-based approach. Exact code will help immensely! Thanks!

    Read the article

  • Why did you decide "against" using Erlang?

    - by Zubair
    Have you actually "tried" (means programmed in, not just read an article on it) Erlang and decided against it for a project? If so, why? Also, if you have opted to go back to your old language, or to use another functional language like F#, Haskell, Clojure, Scala, or something else then this counts too, and state why.

    Read the article

  • Does a good programmer need to have good spatial sense?

    - by lisa1234
    Do you need to have good spatial sense to be a good programmer? I have next to nothing of it (I think it has to do with the differing vision of my eyes). I've already coded quite little things but wonder if this interferes with the ability to 'imagine' the assembly of the code in case of a more complex program? Sorry for my english, I'm Austrian and not so used to write in English.. Thanks for your ansers..

    Read the article

  • Listening Port Permanently. if file is on my stream, Get file. How to?

    - by Phsika
    i writed 2 client and server program. client dend file also server listen port and than get file.But i need My server App must listen on 51124 port permanently. if any file on my stream, show my message "there is a file on your stream" and than show me savefile dialog. But my server app in "Infinite loop". 1) listen 51124 port every time 2) do i have a file on my stream, show me a messagebox. private void Form1_Load(object sender, EventArgs e) { TcpListener Dinle = new TcpListener(51124); try { Dinle.Start(); Socket Baglanti = Dinle.AcceptSocket(); if (!Baglanti.Connected) { MessageBox.Show("No Connection!"); } else { while (true) { byte[] Dizi = new byte[250000]; Baglanti.Receive(Dizi, Dizi.Length, 0); string Yol; saveFileDialog1.Title = "Save File"; saveFileDialog1.ShowDialog(); Yol = saveFileDialog1.FileName; FileStream Dosya = new FileStream(Yol, FileMode.Create); Dosya.Write(Dizi, 0, Dizi.Length - 20); Dosya.Close(); listBox1.Items.Add("dosya indirildi"); listBox1.Items.Add("Dosya Boyutu=" + Dizi.Length.ToString()); listBox1.Items.Add("Indirilme Tarihi=" + DateTime.Now); listBox1.Items.Add("--------------------------------"); } } } catch (Exception) { throw; } } My Algorithm: if(AnyFileonStream()==true) { GetFile() //Also continue to listening 51124 port... } How can i do that?

    Read the article

  • Rewriting Live TCP/IP (Layer 4) Streams

    - by user213060
    I want to rewrite TCP/IP streams. Ettercap's etterfilter command lets you perform simple live replacements of TCP/IP data based on fixed strings or regexes. Example: if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "gzip")) { replace("gzip", " "); msg("whited out gzip\n"); } } if (ip.proto == TCP && tcp.dst == 80) { if (search(DATA.data, "deflate")) { replace("deflate", " "); msg("whited out deflate\n"); } } http://ettercap.sourceforge.net/forum/viewtopic.php?t=2833 I would like to rewrite streams based on my own filter program instead of just simple string replacements. Anyone have an idea of how to do this? Is there anything other than Ettercap that can do live replacement like this, maybe as a plugin to a VPN software or something? The rewriting should occur at the transport layer (Layer 4) as it does in this example, instead of a lower layer packet-based approach. Thanks!

    Read the article

  • Is C really a subset of C++?

    - by Allopen
    What I mean is, can any C code be implemented via C++? Maybe just simply change a compiler? I know C is much more efficient and concise. But despite of these, can C++ used to implement all functions that are implemented by C?

    Read the article

  • Government Mandates and Programming Languages

    A recent SEC proposal (which, at over 600 pages, I havent read in any detail) includes the following: We are proposing to require the filing of a computer program (the waterfall computer program, as defined in the proposed rule) of the contractual cash flow provisions of the securities in the form of downloadable source code in Python, a commonly used computer programming language that is open source and interpretive. The computer program would be tagged in XML and required to be filed with the Commission as an exhibit. Under our proposal, the filed source code for the computer program, when downloaded and run (by loading it into an open Python session on the investors computer), would be required to allow the user to programmatically input information from the asset data file that we are proposing to require as described above. We believe that, with the waterfall computer program and the asset data file, investors would be better able to conduct their own evaluations of ABS and may be less likely to be dependent on the opinions of credit rating agencies. With respect to any registration statement on Form SF-1 (Section 239.44) or Form SF-3 (Section 239.45) relating to an offering of an asset-backed security that is required to comply with Item 1113(h) of Regulation AB, the Waterfall Computer Program (as defined in Item 1113(h)(1) of Regulation AB) must be written in the Python programming language and able to be downloaded and run on a local computer properly configured with a Python interpreter. The Waterfall Computer Program should be filed in the manner specified in the EDGAR Filer Manual. I dont see how it can be in investors best interests that the SEC demand a particular programming language be used for software related to investment data.  I have a feeling that investors who use computers at all already have software with which they are familiar, and that the vast majority of them are not running an open source scripting language on their machines to do their financial analysis.  In fact, I would wager that most of them are using tools like Excel, and if they really need to script anything, its being done with VBA in Excel. Now, Im not proposing that the SEC should require that the data be provided in Excel format with VBA scripts included so everyone can easily access the data (despite the fact that this would actually be pretty useful generally).  Rather, I think it is ill-advised for a government agency to make recommendations of this nature, period.  If the goal of the recommendation is to ensure that the way things work is codified in a transparent manner, than I can certainly respect that.  It seems to me that this could be accomplished without dictating the technology to use.  To wit: An Excel document could contain all of the data as well as the formulae necessary, and most likely would not require the end-user to install anything on their machine The SEC could simply create a calculator in the cloud such that any/all investors could use a single canonical web-based (or web service based) tool Millions of Java and .NET developers could write their own implementations You can read more about this issue, including the favorable position on it, on Jayanth Varmas blog. Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • How to introduce a computer illiterate 50-year old to programming [closed]

    - by sunday
    The other day my dad asked me a question that I would have never expected from him. "How can I learn C++?" My dad is turning 56 this year and computers are a distant concept for him. He doesn't know how to use a phone very well besides calling numbers (no speed dial or contacts); though he has started to learn computers a little better - to the point that he knows how to open the internet (in Windows) and browse around (and has successfully completed several job applications entirely on his own online, of which he was offered positions too). But still, these are too narrow-windowed experiences to mean much, really. While he may not have the background, my dad knows how to read. And I mean reading as a skill, not just an ability. He has little to no college education (financial problems, family, etc.) and was fortunate enough to finish high school, but still taught himself to become a master electrician and has been one for almost 30 years now. He did the same with guitar, learning to play at a very professional level and has been praised for his skill. In high school, he picked up a weight lifting book - and was the only person in his high school at the time to qualify officially as an "athlete" by national standards. In all cases, he just needed something to read. Something to teach him. He absorbs information like a sponge. I have no doubt in my dad's motivation or capability of doing this, so my general goal is simply: Get my dad into the world of computers, and get him on the road to programming. I strongly believe that once I get him through the fundamentals, his drive and reading skill will keep him going on this own. So I'm asking you all: where should I start with all this? And what are the best resources out there? Should I get him to start Linux instead of Windows? Is C++ a bad idea? Remember, he needs to (IMO) learn computers first, and then get that first grasp (the "Hello world" experience) of programming. For money's sake and at top preference, I'd like free online resources that he can read, but by all means any good suggestions in print or paid-for-online are welcome (that I could possibly look into later to purchase). And also, I intend to start him off with C++ (no Python, Java, etc.), because I know it the best and will be able to help him along the way with code. (I have minimal knowledge right now in other languages). Edit: I'm getting a lot of persistent suggestions to use Python. The only reason I wanted to do C++ is that I KNOW it and can be THERE when my dad needs help. My VERY FIRST exposure to programming ever was Java. I learned Java, and I got good at it. I open to other suggestions, but please provide an effective application of your suggestions. EDIT #2: I understand my approach/thinking/knowledge could be lacking here. I'm a sophomore level undergraduate CS major. If you don't agree with anything in my post, tell me why - give me ideas, information - that's why I'm asking in the first place. To narrow down my general goal to specific reachable goals.

    Read the article

  • Practical guide to programming paradigms ?

    - by Pierre
    I think I might be misunderstanding the whole thing and I am looking for some programming wisdom. When faced with a programming challenge, I feel the most important question is "which programming paradigm(s) are better suited to handle it, and how to apply them". A distant second is "which language to use". Yet it seems that most of the programming related content I stumble upon on the Internet has it exactly backwards and focuses mostly on the language choice. An object-oriented solution is fundamentaly the same, whether it's implemented in c++, Java or PHP... So where is the paradigm centered content? Where is the "practical guide to programming paradigms and implementations" and other literature helping bringing real-world and programming concepts together? Note: I already know about "Programming Paradigms for Dummies: What Every Programmer Should Know" from Peter Van Roy.

    Read the article

  • Common programming mistakes for Scala developers to avoid

    - by jelovirt
    In the spirit of Common programming mistakes for Java developers to avoid? Common programming mistakes for JavaScript developers to avoid? Common programming mistakes for .NET developers to avoid? Common programming mistakes for Haskell developers to avoid? Common programming mistakes for Python developers to avoid? Common Programming Mistakes for Ruby Developers to Avoid Common programming mistakes for PHP developers to avoid? what are some common mistakes made by Scala developers, and how can we avoid them? Also, as the biggest group of new Scala developers come from Java, what specific pitfalls they have to be aware of? For example, one often cited problem Java programmers moving to Scala make is use a procedural approach when a functional one would be more suitable in Scala. What other mistakes e.g. in API design newcomers should try to avoid.

    Read the article

  • What is the best software to capture full-screen 3h programming session in Windows?

    - by Hugo S Ferreira
    Hi, I'm planning a laboratorial experiment to assess behavior of groups when programming using some tools under study. For that, I'll need to capture their entire screen to disk. Mostly, what will be displayed is code, so I'm not to worried with image quality. However, it's paramount that the team is not able to stop the recording by accident, and the tool should be rebust enough to hold at least 3h of video. If possible, it would be nice for researchers in other rooms to "watch" the video as it is recording. Actually, this last requirement reminded me that I could use a VNC recording software, and install a VNC client in each laboratory computer. Anyway, what is your experience with this? Which software do you recommend? Thanks.

    Read the article

  • Teaching high school kids ASP.NET programming

    - by dotneteer
    During the 2011 Microsoft MVP Global Summit, I have been talking to people about teaching kids ASP.NET programming. I want to work with volunteer organizations to provide kids volunteer opportunities while learning technical skills that can be applied elsewhere. The goal is to teach motivated kids enough skill to be productive with no more than 6 hours of instruction. Based on my prior teaching experience of college extension courses and involvement with high school math and science competitions, I think this is quite doable with classic ASP but a challenge with ASP.NET. I don’t want to use ASP because it does not provide a good path into the future. After some considerations, I think this is possible with ASP.NET and here are my thoughts: · Create a framework within ASP.NET for kids programming. · Use existing editor. No extra compiler and intelligence work needed. · Using a subset of C# like a scripting language. Teaches data type, expression, statements, if/for/while/switch blocks and functions. Use existing classes but no class creation and OOP. · Linear rendering model. No complicated life cycle. · Bare-metal html with some MVC style helpers for widget creation; ASP.NET control is optional. I want to teach kids to understand something and avoid black boxes as much as possible. · Use SQL for CRUD with a helper class. Again, I want to teach understanding rather than black boxes. · Provide a template to encourage clean separation of concern. · Provide a conversion utility to convert the code that uses template to ASP.NET MVC. This will allow kids with AP Computer Science knowledge to step up to ASP.NET MVC. Let me know if you have thoughts or can help.

    Read the article

  • Programming Practice/Test Contest?

    - by Emmanuel
    My situation: I'm on a programming team, and this year, we want to weed out the weak link by making a competition to get the best coder from our group of candidates. Focus is on IEEExtreme-like contests. What I've done: I've been trying already for 2 weeks to get a practice or test site, like UVa or codechef. The plan after I find one: Send them (the candidates) a list of direct links to the problems (making them the "contest's problem list) get them to email me their correct answers' code at the time the judge says they have solved it and accept the fastest one into the team. Issues: We had practiced on UVa already (on programming challenges too), so our former teammate (which will be in the candidate group) already has an advantage if we used it. Codechef has all it's answers public, and since it shows the latest ones it will be extremely hard to verify if the answer was copied. And I've found other sites, like SPOJ, but they share at least some problems with codechef, making them inherit the issue of Codechef So, what alternatives do you think there are? Any site that may work? Any place to get all stuff to set up a Mooshak or similar contest (as in the stuff to get the problems, instructions to set up the server itself are easy to google)? Any other idea?

    Read the article

< Previous Page | 32 33 34 35 36 37 38 39 40 41 42 43  | Next Page >