Search Results

Search found 8332 results on 334 pages for 'console cowboy'.

Page 78/334 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • Adding a wrapper to an overloaded function

    - by Cev
    Say you had a timestamp function and then wanted to create a new function to combine your timestamp and Console.WriteLine(), e.g. public static void Write(string msg) { WriteTimeStamp(); Console.WriteLine( msg ); } But the WriteLine() method has 18 or so overloads, which will not be reflected in the signature of the wrapper function. How would you have the wrapper take non-strings and pass them on to WriteLine()?

    Read the article

  • catch output from linux telnet to a python script

    - by sandra
    Hello. My problem is that i want to do something like this in linux console telnet 192.168.255.28 process.py i.e i would like to do some transformation with console telnet output using python script. I'm see Popen in python for this case, but i can't understand how can i get input from telnet if it do not stop all time.. Pleas any ideas.

    Read the article

  • onclose and onerror not getting called on DataChannel disconnect

    - by Will
    I have a wall application using WebRTC DataChannels. In the code I've managed to work out the connection, but I'm not getting notified when a peer disconnects. On the channels I have the following listeners: channels[uid].onerror = function( event ) { console.log( 'channels[uid].onerror', uid, arguments ) removePeer( uid ) } channels[uid].onclose = function() { console.log( 'channels[uid].onclose', uid, arguments ) removePeer( uid ) } When I reload tabs disconnecting peers, I don't get close messages. When I send to them, I don't get an error.

    Read the article

  • System.IO.Path or equivelent use with Unix paths

    - by pm_2
    Is it possible to either use the System.IO.Path class, or some similar object to format a unix style path, providing similar functionality to the PATH class? For example, I can do: Console.WriteLine(Path.Combine("c:\\", "windows")); Which shows: "C:\\windows" But is I try a similar thing with forward slashes (/) it just reverses them for me. Console.WriteLine(Path.Combine("/server", "mydir")); Which shows: "/server\\mydir"

    Read the article

  • Difference between screen.availHeight and window.height

    - by akshayexp
    Hi, I am executing the following javascript on my browser(firefox) 1.console.debug("Screen height = "+ screen.availHeight); //output 770 2.console.debug("Window Height ="+ $(window).height()); //output 210 (i am using jQuery as well) What is the difference between the two? Are units of 770 is pixels and 210 is mm ? Similarly, when I write $(document).height() and $(window).height() , there is a difference . What is the reason ?

    Read the article

  • Is possible to initialize an object in javascript in this way?

    - by Kucebe
    I'd like to initialize an object in javascript calling directly a method that belongs to it: var obj = (function(){ return{ init: function(){ console.log("initialized!"); }, uninit: function(x){ console.log("uninitialized!"); } }; }).init(); //later obj.uninit(); obj.init(); This specific example doesn't work, is there something similar?

    Read the article

  • How can a property resolve its own name and type with reflection?

    - by Tim Santeford
    Is there a way for a property to access its own name and type at runtime using reflection? I want to access this info without hard coding the name or index of the property in the class. Simple Example Code: Private ReadOnly Property MyProperyName() As String Get Console.WriteLine((Get Current Property Info).Type.ToString) Console.WriteLine((Get Current Property Info).Name) Return "" End Get End Property Expected output: System.String MyPropertyName

    Read the article

  • How to send file to remote computer?

    - by Phsika
    i can get file name via below codes. How can i send this file to remote computer. this remote computer ip: 192.168.2.105 also i can use 51124 port class Program { static void Main(string[] args) { string[] dosyalarinYollari = System.IO.Directory.GetFiles(@"z:\20071008\1.2.392.200036.9116.2.6.1.48.1215563310.1191800303.305777\", "*.dcm", System.IO.SearchOption.AllDirectories); foreach (string s in dosyalarinYollari) { Console.Write(s+"\n"); // i need to send tihs s file to remote machine } Console.ReadKey(); } }

    Read the article

  • c# : simulate memory leaks..

    - by dotnet-practitioner
    Hi, I would like to write the following code in c#. a) small console application that simulates memory leak. b) small console application that would invoke the above application and release it right away simulating managing memory leak problem.. In other words the (b) application would continuously call and release application (a) to simulate how the "rebellious" memory leak application is being contained with out addressing the root cause which is application (a). Some sample code for application (a) and (b) would be very helpful. Thanks

    Read the article

  • What happens when user click .NET assembly (EXE)?

    - by Sathish
    Consider we have .NET Winforms application or Console Application. Can anyone tell me what will happen step-by-step until the WinForm or Console Application is launched. I would like know the internals - like how EXE will communicate with Framework, what is the role of CLR, what happens in case of exception while launching applicaiton itself.etc...

    Read the article

  • At What point should you understand pointers?

    - by Vaccano
    I asked a question like this in an interview for a entry level programmer: var instance1 = new myObject{Value = "hello"} var instance2 = instance1; instance1.Value = "bye"; Console.WriteLine(instance1.Value); Console.WriteLine(instance2.Value); The applicant responded with "hello", "bye" as the output. Some of my co-workers said that pointers are not that important anymore or that this question is not a real judge of ability. Are they right?

    Read the article

  • How to use #if directives in C#(3.0)

    - by Newbie
    I just found two piece of code #if CONSOLE // defined by the console version using ournamespace.FactoryInitializer; #endif and #if _NET_1_1 log4net.Config.DOMConfigurator.ConfigureAndWatch(new System.IO.FileInfo(s) ); #else log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(s) ); #endif Can any one please tell me with a running sample( please provide a simple one) what is the significance of those code snippets and when and how to use those? Thanks.

    Read the article

  • How to validate user with SimpleMembership

    - by Rushino
    I am using SimpleMembership for user login stuff in my web application. I wrote a console that actually access my web application classes to avoid duplicate code. However, since my console application doesn't have anything related to user sessions the Login method doesn't work. But is there a way to validate a user only using the SimpleMembership? In case i have to do it manually.. how can i do it ?

    Read the article

  • Javascript this points to Window object

    - by terrani
    Hi, I have the following code. I expected to see "archive" object on my firebug console, but I see Window object. Is it normal? var archive = function(){} archive.prototype.action = { test: function(callback){ callback(); }, test2: function(){ console.log(this); } } var oArchive = new archive(); oArchive.action.test(oArchive.action.test2);

    Read the article

  • jQuery responds to click() differently for user and programmatic triggers

    - by Moss
    Here's the code: this.Form.find("input[type=checkbox]").click(function(event) { if ($(this).is(":checked")) { console.log("checked"); } else { console.log("unchecked"); } }); If the checkbox is not checked, and I click with the mouse, I get "checked". If I trigger it programmatically like $("#someCheckbox").click(), I get "unchecked". How to make the two behave the same way?

    Read the article

  • Pass variables between separate instances of ruby (without writing to a text file or database)

    - by boulder_ruby
    Lets say I'm running a long worker-script in one of several open interactive rails consoles. The script is updating columns in a very, very, very large table of records. I've muted the ActiveRecord logger to speed up the process, and instruct the script to output some record of progress so I know how roughly how long the process is going to take. That is what I am currently doing and it would look something like this: ModelName.all.each_with_index do |r, i| puts i if i % 250 ...runs some process... r.save end Sometimes its two nested arrays running, such that there would be multiple iterators and other things running all at once. Is there a way that I could do something like this and access that variable from a separate rails console? (such that the variable would be overwritten every time the process is run without much slowdown) records = ModelName.all $total = records.count records.each_with_index do |r, i| $i = i ...runs some process... r.save end meanwhile mid-process in other console puts "#{($i/$total * 100).round(2)}% complete" #=> 67.43% complete I know passing global variables from one separate instance of ruby to the next doesn't work. I also just tried this to no effect as well unix console 1 $X=5 echo {$X} #=> 5 unix console 2 echo {$X} #=> "" Lastly, I also know using global variables like this is a major software design pattern no-no. I think that's reasonable, but I'd still like to know how to break that rule if I'd like. Writing to a text file obviously would work. So would writing to a separate database table or something. That's not a bad idea. But the really cool trick would be sharing a variable between two instances without writing to a text file or database column. What would this be called anyway? Tunneling? I don't quite know how to tag this question. Maybe bad-idea is one of them. But honestly design-patterns isn't what this question is about.

    Read the article

  • Problem with Javascript object and accessing property which exists

    - by Newbie
    I have something like this: var test = {}; function blah() { test[2] = 'filled'; } console.log(test); //result test -> 2:"filled" console.log(test[2]); //result undefined I don't understand why I'm getting 'undefined' in the second instance when according to the first instance, the property of that object clearly exists! Does anyone have any ideas? Thanks

    Read the article

  • How do i have a jar communicate with another jar

    - by ObviousComplexities
    Ok so i have 2 jars (Console, Core) 1st-Console) receives user input 2nd-Core) processes the input and gives an output i'm trying to have the two "Communicate" with each other by exchanging input and output now i have tried writing to a file to communicate when i ran into the problem of "Notifying" the other that there is input to receive and output to give i'm a bit new to this ideal so if its an easy function, please don't criticize.

    Read the article

  • When is type testing OK?

    - by svidgen
    Assuming a language with some inherent type safety (e.g., not JavaScript): Given a method that accepts a SuperType, we know that in most cases wherein we might be tempted to perform type testing to pick an action: public void DoSomethingTo(SuperType o) { if (o isa SubTypeA) { o.doSomethingA() } else { o.doSomethingB(); } } We should usually, if not always, create a single, overridable method on the SuperType and do this: public void DoSomethingTo(SuperType o) { o.doSomething(); } ... wherein each subtype is given its own doSomething() implementation. The rest of our application can then be appropriately ignorant of whether any given SuperType is really a SubTypeA or a SubTypeB. Wonderful. But, we're still given is a-like operations in most, if not all, type-safe languages. And that seems suggests a potential need for explicit type testing. So, in what situations, if any, should we or must we perform explicit type testing? Forgive my absent mindedness or lack of creativity. I know I've done it before; but, it was honestly so long ago I can't remember if what I did was good! And in recent memory, I don't think I've encountered a need to test types outside my cowboy JavaScript.

    Read the article

  • How should I take being told that I was wrong?

    - by Chris
    On a fairly important project with short timelines I decided to use SubSonic for straight forward data access. I wired up a handful of forms, created matching database tables and POCO's for each and used SubSonic's simple repository mode for the data access. Everything worked well and I was able to bang these forms out pretty quickly and I moved on to other things. Since that time I have heard that using SubSonic was a 'cowboy move' and that it was implemented 'incorrectly' and that 'the person who used it, didn't even know how to use SubSonic'. What I would like to know is, how should I take this? There were and still are no standards for data access at this company, so there is no violation of a standard. The forms worked exactly as requested and saved the data to the database correctly. And with only spending a few days on the forms instead of weeks, saved a lot of time which was used for other functionality in the project. So in light of all of this, I am confused as to what was 'incorrect'. Am I missing something here? Thanks for your answers.

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >