Search Results

Search found 15621 results on 625 pages for 'creating'.

Page 76/625 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • Passing variables, creating instances, self, The mechanics and usage of classes: need explenation

    - by Baf
    I've been sitting over this the whole day and Im a little tired already so please excuse me being brief. Im new to python. I just rewrrote a working program, into a bunch of functions in a class and everzthings messed up. I dont know if its me but Im very surprised i couldn t find a beginners tutorial on how to handle classes on the web so I have a few questions. First of all, in the init section of the class i have declared a bunch of variables with self.variable=something. Is it correct that i should be able to access/modify these variables in every function of the class by using self.variable in that function? In other words by declaring self.variable i have made these variables, global variables in the scope of the class right? If not how do i handle self. ? Secondly how do i correctly pass arguments to the class? some example code would be cool. thirdly how do i call a function of the class outside of the class scope? some example code would be cool. fouthly how do I create an Instance of the class INITIALCLASS in another class OTHERCLASS, passing variables from OTHERCLASS to INITIALCLASS? some example code would be cool. I Want to call a function from OTHERCLASS with arguments from INITIALCLASS. What Ive done so far is. class OTHERCLASS(): def __init__(self,variable1,variable2,variable3): self.variable1=variable1 self.variable2=variable2 self.variable3=variable3 def someotherfunction(self): something=somecode(using self.variable3) self.variable2.append(something) print self.variable2 def somemorefunctions(self): self.variable2.append(variable1) class INITIALCLASS(): def __init__(self): self.variable1=value1 self.variable2=[] self.variable3='' self.DoIt=OTHERCLASS(variable1,variable2,variable3) def somefunction(self): variable3=Somecode #tried this self.DoIt.someotherfunctions() #and this DoIt.someotherfunctions() I clearly havent understood how to pass variables to classes or how to handle self, when to use it and when not, I probably also havent understood how to properly create an isntance of a class. In general i havent udnerstood the mechanics of classes So please help me and explain it to me like i have no Idea( which i dont it seems). Or point me to a thorough video, or readable tutorial. All i find on the web is super simple examples, that didnt help me much. Or just very short definitions of classes and class methods instances etc. I can send you my original code if you guys want, but its quite long. Thanks for the Help Much appreciated!

    Read the article

  • Creating a network adapter - how hard is it?

    - by Vilx-
    I'm interested in building a little (commercial) device on top of Arduino. I want it to be able to interface with network. Network as in standard Ethernet, Cat5, RJ-45, etc. I know that there is an Ethernet Shield, but it costs even more than the Arduino itself, and it's pretty big. Naturally, I want my device to be as small and as cheap as possible. So I'm thinking about recreating an Ethernet module myself. The problem is - I haven't got any experience with Ethernet, nor do I have a good idea where to start looking. Thus I can't even say if my ideas are feasible. Ultimately I would like the device to have three ports - one for incoming signal, two for outgoing, so the device is essentially a little switch where it is plugged in itself as well. The switching capabilities need not be very fast - the volume of data will be low. 10Mbit is more than enough, can be even slower. If that is not possible, a single port for controlling the device itself will also do. Another possibility I'm considering is power line communications - sending information through power lines. That's another area I've no experience with. What hardware should I be looking at, and where can I find information about the necessary software? So - can anyone tell me if these ideas are feasible, and if yes - where should I start looking?

    Read the article

  • Creating anonymous functions in loop with not the same arguments

    - by onio9
    Hello! I want to make in loop set of buttons, and add to them some events, but anonymous functions is the same. I write example code: for(var i:int=0;i<5;i++) { var button:SimpleButton = new SimpleButton(...); ... button.addEventListener(MouseEvent.CLICK, function(event:MouseEvent):void { trace(i); }); } ... And I want to trace 1,2,3.. from click buttons instead of 4,4,4,4 .. Do you know how can I make this ?

    Read the article

  • Will creating index help in this case

    - by The King
    I'm still a learning user of SQL-SERVER2005. Here is my table structure CREATE TABLE [dbo].[Trn_PostingGroups]( [ControlGroup] [char](5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [PracticeCode] [char](5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [ScanDate] [smalldatetime] NULL, [DepositDate] [smalldatetime] NULL, [NameOfFile] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [DepositValue] [decimal](11, 2) NULL, [RecordStatus] [char](1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, CONSTRAINT [PK_Trn_PostingGroups_1] PRIMARY KEY CLUSTERED ( [ControlGroup] ASC, [PracticeCode] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] Scenario 1 : Suppose I have a query like this... Select * from Trn_PostingGroups where PracticeCode = 'ABC' Will indexing on Practice Code seperately help me in making my query faster?? Scenario 2 : Select * from Trn_PostingGroups where ControlGroup = 12701 and PracticeCode = 'ABC' and NameOfFile = 'FileName1' Will indexing on NameOfFile seperately help me in making my query faster ??

    Read the article

  • Creating a User Registration Page using MongoEngine

    - by Drew Watkins
    I am currently working an a webapp, using mongoengine and django, which will require users to create an account from a registration page. I know MongoEngine has an authentication backend, but does it also include a registration form, etc..., like django itself does? If not, are there any example projects which show how to implement this? The only open-source mongoengine project I've found is django-mumblr, but I can't find the examples I want in it. I'm not interested in alternative options, such as MongoKit or mango for handling authentication. I am just getting started with django and mongoDB, so please excuse my lack of knowledge. Thanks in advance for the help!

    Read the article

  • Creating parameterized type object using annonymous class

    - by Andrei Fierbinteanu
    This might be a stupid question, but I just saw a question asking how to create a Type variable for a generic type. The consensus seemed to be that you should have a dummy method returning that type, and then use reflection to get it (in this case he wanted Map<String, String>). Something like this : public Map<String, String> dummy() { throw new Error(); } Type mapStringString = Class.forName("ThisClass").getMethod("dummy").getGenericReturnType(); My question is, not having used reflection that much, couldn't you just do something like: Type mapStringString = new ParameterizedType() { public Type getRawType() { return Map.class; } public Type getOwnerType() { return null; } public Type[] getActualTypeArguments() { return new Type[] { String.class, String.class }; } }; Would this work? If not, why not? And what are some of the dangers/problems if it does (besides being able to return some Type like Integer<String> which is obviously not possible.

    Read the article

  • Creating XML file from XSD

    - by miki-er
    I have to convert a dll file to XML in command line. I've created an xsd file fron the dll (by the command :xsd.exe ---.dll) now I'm searching command that can create the XML. Can so,one help me??

    Read the article

  • Why is CoRegisterClassObject creating two extra threads?

    - by Stijn Sanders
    I'm trying to fix a problem that only recently happens on a number of machine's on a VPN. They each run a client application I wrote that exposes a COM automation object. For some strange reason I haven't been able to discover yet, one thread in the application takes up all of the available CPU time, slowing other operation on the machine. In observing the application's strange behaviour, I've noticed it's the third thread started, and if I debug on my machine I notice the first call to CoRegisterClassObject created two extra threads. If the second of these two threads is the one that gets into an infinite loop, I'm not at all shure how to fix this. Where could I check next about what's wrong? Could it have started by one of the recent patches rolled out by Microsoft this last 'patch tuesday'? I had a go with ProcessExplorer to extract a stack trace of the thread: ntoskrnl.exe!ExReleaseResourceLite+0x1a3 ntoskrnl.exe!PsGetContextThread+0x329 WLDAP32.dll!Ordinal325+0x1231 WLDAP32.dll!Ordinal325+0x129e WLDAP32.dll!Ordinal325+0x1178 ntdll.dll!LdrInitializeThunk+0x24 ntdll.dll!LdrShutdownThread+0xe9 kernel32.dll!ExitThread+0x3e kernel32.dll!FreeLibraryAndExitThread+0x1e ole32.dll!StringFromGUID2+0x65d kernel32.dll!GetModuleFileNameA+0x1ba

    Read the article

  • Creating quick GUI front ends

    - by Jeenu
    Hi, I wanted to have a GUI front-end for a script that accepts numerous command-line options, most of them are UNIX paths. So I thought rather than typing them in (even with auto-completion) every time, I'd create a GUI front end which contains text boxes with buttons beside them, which when clicked will invoke the file browser dialogue. Later, I thought I'd extend this to other scripts which would sure require a different set of GUI elements. This made me think if there's any existing app that would let me create a GUI dialog, after parsing some kind of description of the items that I want that window should contain. I know of programs like Zenity, but I think it's doesn't give me what I want. For example, if I were to use it for the first script, it'll end up flashing sequence of windows in succession rather than getting everything done from a single window. So, basically I'm looking at some program that lets me create a window from a text description, probably XML or the like. Please suggest. Thanks Jeenu

    Read the article

  • Dynamic Object Not Creating for Privately Inherited Class.

    - by mahesh
    Hi, What is the reason for the following code that does not let me to create object. class base { public: void foo() { cout << "base::foo()"; } }; class derived : private base { public: void foo() { cout << "deived::foo()"; } }; void main() { base *d = new derived(); d->foo(); } It Gives me error : " 'type cast' : conversion from 'derived *' to 'base *' exists, but is inaccessible" Thanks in advance :)

    Read the article

  • creating shared library from c++

    - by robi
    when i tried to create shared library file using a "cl" command in vc++, it shows a error saying that "fatal error c1083: can't open compiler generated file 'file.obj':permission denied" can any1 help me...???

    Read the article

  • Creating a fixed axis for Silverlight Toolkit charts

    - by Bill Jeeves
    Every example I see of a series in a Silverlight chart fromt he toolkit has a binding for bothe IndependentValueBinding and DependentValueBinding. In my code I want a fixed axis for the categories (Independent) - so every value get's "X" perhaps. Is there a way to do this? Essentially I have ten bar series in one chart and I want them all to sit together. It seems silly to create a new class to hold them in just so I can add a string property for the axis name.

    Read the article

  • access: creating a grid for a report

    - by every_answer_gets_a_point
    i will be printing the access report. the report will not be printed a regular white people. it will be printed on top of a paper with checkboxes and fields on it. i need those checkboxes and fields to be printed on according to the access data. are there any libraries for access that make this easier? is there a feature that will help to print on specific coordinates?

    Read the article

  • Creating a form on non-gui thread

    - by luntain
    You can't access gui controls from a thread they were not created on, at least so says the message of an exception that is sometimes raised when you do it. Recently I was puzzled by seeing that forms created on background threads work just fine. My mental model was that all actions initiated by UI input is handled on the GUI thread. Clicking on a button on such a form should raise the dreaded exception (the form and all its controls were created on a background thread not the gui thread), but it doesn't. Something is wrong with my map. (*) well to be honest I have seen one problem where opening the standard open file dialog was blocking everything

    Read the article

  • Creating webpage on form submit?

    - by Joachim Mcdonald
    How is it possible to allow a user to create a webpage containing some html, based on their entries in a form? ie. I would want them to be able to input a name and when the button is clicked, a webpage called that name would be created. I imagine that this must be possible in php, but what functions/code would I be using? Thank you!

    Read the article

  • Creating an Application to Save Arbitrary Application State

    - by ashes999
    See this SuperUser question. To summarize, VM software lets you save state of arbitrary applications (by saving the whole VM image). Would it be possible to write some software for Windows that allows you to save and reload arbitrary application state? If so (and presumably so), what would it entail? I would be looking to implement this, if possible, in a high-level language like C#. I presume if I used something else, I would need to dump memory registers (or maybe dump the entire application memory block) to a file somewhere and load it back somewhere to refresh state. So how do I build this thing?

    Read the article

  • Creating Html Helper Method - MVC Framework

    - by nettguy
    I am learning MVC from Stephen Walther tutorials on MSDN website. He suggests that we can create Html Helper method. Say Example using System; namespace MvcApplication1.Helpers { public class LabelHelper { public static string Label(string target, string text) { return String.Format("<label for='{0}'>{1}</label>", target, text); } } } My Question under which folder do i need to create these class? View folder or controller folder? or can i place it in App_Code folder?

    Read the article

  • Structuremap and creating objects with initial state

    - by Simon
    I have an object which needs a dependency injected into it public class FootballLadder { public FootballLadder(IMatchRepository matchRepository, int round) { // set initial state this.matchRepo = matchRepository; this.round = round; } public IEnumerable<LadderEntry> GetLadderEntries() { // calculate the ladder based on matches retrieved from the match repository // return the calculated ladder } private IMatchRepository matchRepo; private int round; } For arguments sake, lets assume that I can't pass the round parameter into the GetLadderEntries call itself. Using StructureMap, how can I inject the dependency on the IMatchRepository and set the initial state? Or is this one of those cases where struggling against the framework is a sign the code should be refactored?

    Read the article

  • Creating and Saving an Excel File

    - by Kris
    I have the following code that creates a new Excel file in my C# code behind. When I attempt to save the file I would like the user to select the location of the save. In Method #1, I can save the file my using the workbook SaveCopyAs without prompting the user for a location. This saves one file to the C:\Temp directory. Method #2 will save the file in my Users\Documents folder, then prompt the user to select the location and save a second copy. How can I eliminate the first copy from saving in the Users\Documents folder? Excel.Application oXL; Excel._Workbook oWB; Excel._Worksheet oSheet; Excel.Range oRng; try { //Start Excel and get Application object. oXL = new Excel.Application(); oXL.Visible = false; //Get a new workbook. oWB = (Excel._Workbook)(oXL.Workbooks.Add(Missing.Value)); oSheet = (Excel._Worksheet)oWB.ActiveSheet; // ***** oSheet.Cells[2, 6] = "Ship To:"; oSheet.get_Range("F2", "F2").Font.Bold = true; oSheet.Cells[2, 7] = sShipToName; oSheet.Cells[3, 7] = sAddress; oSheet.Cells[4, 7] = sCityStateZip; oSheet.Cells[5, 7] = sContactName; oSheet.Cells[6, 7] = sContactPhone; oSheet.Cells[9, 1] = "Shipment No:"; oSheet.get_Range("A9", "A9").Font.Bold = true; oSheet.Cells[9, 2] = sJobNumber; oSheet.Cells[9, 6] = "Courier:"; oSheet.get_Range("F9", "F9").Font.Bold = true; oSheet.Cells[9, 7] = sCarrierName; oSheet.Cells[11, 1] = "Requested Delivery Date:"; oSheet.get_Range("A11", "A11").Font.Bold = true; oSheet.Cells[11, 2] = sRequestDeliveryDate; oSheet.Cells[11, 6] = "Courier Acct No:"; oSheet.get_Range("F11", "F11").Font.Bold = true; oSheet.Cells[11, 7] = sCarrierAcctNum; // ***** Method #1 //oWB.SaveCopyAs(@"C:\Temp\" + sJobNumber +".xls"); Method #2 oXL.SaveWorkspace(sJobNumber + ".xls"); } catch (Exception theException) { String errorMessage; errorMessage = "Error: "; errorMessage = String.Concat(errorMessage, theException.Message); errorMessage = String.Concat(errorMessage, " Line: "); errorMessage = String.Concat(errorMessage, theException.Source); }

    Read the article

  • Problem creating a webpage in OOP pattern?

    - by Starx
    I want to develop a website in OOP pattern, but I am stuck in a point whether I need to inherit from multiple classes. For example I have a main class "index" this class has several methods which need to inherited from other classes and I have created seperate classes for it like class "banner", class "content", class "footer" Not only this but class "content" has several methods to be inherited from other classes like class "gallery", class "news", etc I found out that multiple inheritance is not allowed, and using interface I cannot write codes in its methods, so how can i achieve a solution for this problem.

    Read the article

  • BSoD when creating threads

    - by Behrooz
    I am trying to create +5 threads synchronously so there shouldn't be any concurrency error. Code: System.Threading.Thread t = new System.Threading.Thread(proc); t.Start();//==t.BlueScreen(); t.Join(); Is darkness a feature ? I am doing something wrong? OS:Microsoft windows vista(unfortunately) x64 Language:C# 3.0|4.0 .Net version:3.5|4

    Read the article

  • Creating new folders if they don't exist for fopen

    - by Gbps
    I have a C++ program that takes user input for fopen in order to initiate a file write. Could someone help me find a function which will return a FILE* and use the Windows specific version of mkdir in order to create the folder structure for fopen to never fail to open a new file in the specified location because one of the folders does not exist. Thanks a bunch!

    Read the article

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