Search Results

Search found 691 results on 28 pages for 'registering'.

Page 22/28 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28  | Next Page >

  • python gui events out of order

    - by dave
    from Tkinter import * from tkMessageBox import * class Gui: def __init__(self, root): self.container = Frame(root) self.container.grid() self.inputText = Text(self.container, width=50, height=8) self.outputText = Text(self.container, width=50, height=8, bg='#E0E0E0', state=DISABLED) self.inputText.grid(row=0, column=0) self.outputText.grid(row=0, column=1) self.inputText.bind("<Key>", self.translate) def translate(self, event): input = self.inputText.get(0.0, END) output = self.outputText.get(0.0, END) self.outputText.config(state=NORMAL) self.outputText.delete(0.0, END) self.outputText.insert(INSERT, input) self.outputText.config(state=DISABLED) showinfo(message="Input: %s characters\nOutput: %s characters" % (len(input), len(input))) root = Tk() #toplevel object app = Gui(root) #call to the class where gui is defined root.mainloop() #enter event loop Working on a gui in tkinter I'm a little confused as to the sequence the event handlers are run. If you run the above code you'll hopefully see... 1) Editing the text widget triggers the event handler but it seems to fire it off without registering the actual change, 2) Even when the text widget is cleared (ie, keep pressing BackSpace) it still seems to have a one character length string, 3) The output widget only receives its update when the NEXT event trigger is fired despite the fact the data came on the previous event. Is this just how bindings work in tkinter or am i missing something here? The behaviour i would like when updating the input widget is: 1) Show the change, 2) Enter event handler, 3) Update output widget, 4) Show message box.

    Read the article

  • Possibility of a custom Contacts field with a set list of values and Contacts lookup performance

    - by areyling
    I'm pretty sure it's not viable to do what I'd like to based on some initial research, but I figured it couldn't hurt to ask the community of experts here in case someone knows a way. I'd like to create a custom field for contacts that the user is able to edit from the main Contacts app; however, the user should only be allowed to select from a list of four specific values. A short list of string values would be ideal, but an int with a min/max range would suffice. I'm interested in knowing if it's possible either way, but also wondering if it make sense to go this route performance wise. More specifically, would it be better to look up a contact (based on a phone number) each time a call or SMS message is received or better to store my own set of data (consisting of name, numbers, and the custom field) and just syncing contact info in a thread every so often? Or syncing contacts the first time the app is run and then registering for changes using ContentObserver? Here is a similar question with an answer that explains how to add a custom field to a contact. Thanks in advance.

    Read the article

  • Using boost asio for pub/sub style tcp in a game loop

    - by unohoo
    I have been reading through the boost asio documentation for a couple of hours now, and while I think the documentation is really great, I am still left a bit confused on how to implement the system that I need. I have to stream info, from a game engine, to a list of computers over tcp. One snag is that, unlike traditional pub/sub, the computer that does the distribution of info is actually the computer that has to connect to the subscribers as well (instead of the subscribers registering with the publisher). This is done via a config file - a list of ip's/ports along with the data that they each require. The subscribers listen, but do not know the ip of the publisher. (As a side note, I'm quite new to network programming, so maybe I'm missing something .. but it's strange that I do not find much information regarding this style of "inverted" client-server model..) I am looking for suggestions for the implementation of such a system using boost asio. Of course I have to integrate the networking into an already existing engine, so with regards to that: What would be a good way to handle messages being sent to multiple computers every frame? Use async_write, call io_service.run and then reset every frame? Would having io_service.run have its own thread be better? Or should I just use threads and use blocking writes?

    Read the article

  • Android: CustomListAdapter

    - by primal
    Hi, I have implemented a custom list view which looks like the twitter timeline. adapter = new MyClickableListAdapter(this, R.layout.timeline, mObjectList); setListAdapter(adapter); The constructor for MyClickableListAdapter is as follows private class MyClickableListAdapter extends ClickableListAdapter{ public MyClickableListAdapter(Context context, int viewId, List objects) { super(context, viewId, objects); } ClickableListAdapter extends BaseAdapter and implements the necessary methods. The xml code for the list view is as follows <ListView android:id="@+id/android:list" android:layout_width="fill_parent" android:layout_height="wrap_content" /> This is what it looks like. I have 3 questions 1) I tried registering a context menu for the list view by adding the line after setting the list adapter registerforContextMenu(getListView()); But on long-click the menu doesnt get displayed. I cannot understand what I am doing wrong! 2) Is it possible to display a textview above the listview? I tried it by adding the code for textview above the listview. But then, only the textview gets displayed. 3) I have seen in many twitter clients that on clicking post a window pops up from the top covering only some portion of the screen and rest of the timeline is visible. How can this be done possibly without starting a new activity? Any help would be much appreciated..

    Read the article

  • error 734 the ppp link control protocal was terminated

    - by satheesh
    Hi, i want to connect my mobile internet to pc using bluetooth device. I installed blue soleil software in my pc. Steps: 1.I can able to pair my cellphone with pc bluetooth device. 2.I selected my device and select bluetooth dialup networking service. 3.It asks an alert "DUN connection with device?" in my mobile. 4.After Clicked "YES", connect bluetooth DUN connection window opens. 5.In that window there was a fields "User Name", "PassWord" which i leave empty and then in "Dial = 99**1#" and click Dial button. 6.After that it say "Registering your computer on the netwok.." and become fails. 7. The Error is as "error 734 the ppp link control protocal was terminated" The same procedure should be followed for Nokia 3110c it works fine.But in my samsung mobile c3053 it not connected also i am tryig with samsung corby pro BT3510 mobile . Is there any settings changes needed for samsung mobiles ? Can anyone help me ? Thanks in advance...........

    Read the article

  • From Sinatra Base object. Get port of application including the base object

    - by Poul
    I have a Sinatra::Base object that I would like to include in all of my web apps. In that base class I have the configure method which is called on start-up. I would like that configure code to 'register' that service with a centralized database. The information that needs to be sent when registering is the information on how to contact this web-service... things like host and port. I then plan on having a monitoring service that will spin over all registered services and occasionally ping them to make sure they are still up and running. In the configure method I am having trouble getting the port information. The 'self.settings.port' variable doesn't seem to work in this method. a) any ideas on how to get the port? I have the host. b) is there a sinatra plug-in that already does something like this so I don't have to write it myself? :-) //in my Sinatra::Base code. lets call it register_me.rb RegisterMe < Sinatra::Base configure do //save host and port information to database end get '/check_status' //return status end //in my web service code require register_me //at this point, sinatra will initialize the RegisterMe object and call configure post ('/blah') //example of a method for this particular web service end

    Read the article

  • Detect a USB drive being inserted - Windows Service

    - by Tom Bell
    I am trying to detect a USB disk drive being inserted within a Windows Service, I have done this as a normal Windows application. The problem is the following code doesn't work for volumes. Registering the device notification: DEV_BROADCAST_DEVICEINTERFACE notificationFilter; HDEVNOTIFY hDeviceNotify = NULL; ::ZeroMemory(&notificationFilter, sizeof(notificationFilter)); notificationFilter.dbcc_size = sizeof(DEV_BROADCAST_DEVICEINTERFACE); notificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; notificationFilter.dbcc_classguid = ::GUID_DEVINTERFACE_VOLUME; hDeviceNotify = ::RegisterDeviceNotification(g_serviceStatusHandle, &notificationFilter, DEVICE_NOTIFY_SERVICE_HANDLE); The code from the ServiceControlHandlerEx function: case SERVICE_CONTROL_DEVICEEVENT: PDEV_BROADCAST_HDR pBroadcastHdr = (PDEV_BROADCAST_HDR)lpEventData; switch (dwEventType) { case DBT_DEVICEARRIVAL: ::MessageBox(NULL, "A Device has been plugged in.", "Pounce", MB_OK | MB_ICONINFORMATION); switch (pBroadcastHdr->dbch_devicetype) { case DBT_DEVTYP_DEVICEINTERFACE: PDEV_BROADCAST_DEVICEINTERFACE pDevInt = (PDEV_BROADCAST_DEVICEINTERFACE)pBroadcastHdr; if (::IsEqualGUID(pDevInt->dbcc_classguid, GUID_DEVINTERFACE_VOLUME)) { PDEV_BROADCAST_VOLUME pVol = (PDEV_BROADCAST_VOLUME)pDevInt; char szMsg[80]; char cDriveLetter = ::GetDriveLetter(pVol->dbcv_unitmask); ::wsprintfA(szMsg, "USB disk drive with the drive letter '%c:' has been inserted.", cDriveLetter); ::MessageBoxA(NULL, szMsg, "Pounce", MB_OK | MB_ICONINFORMATION); } } return NO_ERROR; } In a Windows application I am able to get the DBT_DEVTYP_VOLUME in dbch_devicetype, however this isn't present in a Windows Service implementation. Has anyone seen or heard of a solution to this problem, without the obvious, rewrite as a Windows application?

    Read the article

  • Firefox add-on development: Register global dynamic custom keyboard shortcuts

    - by dezwart
    I have been tasked with developing a Firefox add-on that is capable of registering global keyboard shortcuts (ones that will work throughout all areas of Firefox) that will open up the side-bar and execute an XMLRPC request based on previously recorded input. The idea here is that there will be many potential XMLRPC requests that the user will want to execute via a keyboard shortcut. Currently, the add-on is capable of handling pre-defined static keyboard shortcuts via the Firefox overlay. What I would like to achieve, is to allow the user to register their own dynamic custom keyboard shortcut. There is an add-on that currently has some of this functionality, called Keyconfig. I'm not keen on having to ask users to install a second add-on to define their own shortcuts. It also seems that using the dynamic keyboard shortcut registration method in Keyconfig would require the user to close all Firefox windows before the dynamic shortcut is made available. What I would like to know is: Is an XPCOM component the best way to register dynamic keyboard shortcuts from within a Firefox add-on? Is there a way to register the keyboard shortcut so that it is immediately available to all Firefox windows, without having to close the windows beforehand?

    Read the article

  • Having trouble hiding keyboard using invisible button which sits on top of uiscrollview

    - by phil
    I have 3 items in play... 1) UIView sits at the base of the hierarchy and contains the UIScrollview. 2) UIScrollview that is presenting a lengthy user form. 3) An invisible button on the UIScrollview that I'm using to provide "hide the keyboard" features. Notice in the code below that I'm registering to be notified when the keyboard is going to appear and again when it's going to disappear. These are working great. My problem is seemingly one of "layers". See below where I insert the button into the view atIndex:0. This causes the button to be activated and "stuffed" behind the scrollview so that when you click on it, the scrollview grabs the touch and the button is unaware. There is no way to "reach" the button and suppress the keyboard. However, if I insert atIndex:1, the button gets super imposed on top of the text entry fields and so any touch at all is acted upon by the button, which immediately suppresses the keyboard and then disappears. How do I insert the button on top of the UIScrollview but behind the UITextfields that sit there? other logistics: I have a -(void) hidekeyboard function that I have setup with the UIButtion as an IBAction(). And I have the UIButton connected to "files owner" via a ctrl-drag/drop. (Do I need both of those conventions?) This code in ViewDidLoad()... [[NSNotificationCenter defaultCenter] addObserverForName:UIKeyboardWillShowNotification object:nil queue:nil usingBlock:^(NSNotification *notification){ [self.view insertSubview:self.keyboardDismissalButton atIndex:0]; }];

    Read the article

  • What corresponds to the Unity 'registration name' in the unity configuration section?

    - by unanswered
    When registering and resolving types in a Unity Container using code you can use 'Registration Names' to disambiguate your references that derive from an interface or base class hierarchy. The 'registration name' text would be provided as a parameter to the register and resolve methods: myContainer.RegisterType<IMyService, CustomerService>("Customers"); and MyServiceBase result = myContainer.Resolve<MyServiceBase>("Customers"); However when I register types in the configuration files I do not see where the 'registration name' can be assigned I register an Interface: <typeAlias alias="IEnlistmentNotification" type="System.Transactions.IEnlistmentNotification, System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> Then two types that I happen to know implement that interface: <typeAlias alias="PlaylistManager" type="Sample.Dailies.Grid.Workers.PlaylistManager, Sample.Dailies.Grid.Workers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> <typeAlias alias="FlexAleManager" type="Sample.Dailies.Grid.Workers.FlexAleManager, Sample.Dailies.Grid.Workers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> Then I provide mappings between the interface and the two types: <type type="IEnlistmentNotification" mapTo="FlexAleManager"><lifetime type="singleton"/></type> <type type="IEnlistmentNotification" mapTo="PlaylistManager"><lifetime type="singleton"/></type> That seems to correspond to this code: myContainer.RegisterType<IEnlistmentNotification, FlexAleManager>(); myContainer.RegisterType<IEnlistmentNotification, PlaylistManager>(); but clearly what I need is a disambiguating config entry that corresponds to this code: myContainer.RegisterType<IEnlistmentNotification, FlexAleManager>("Flex"); myContainer.RegisterType<IEnlistmentNotification, PlaylistManager>("Play"); Then when I get into my code I could do this: IEnlistmentNotification flex = myContainer.Resolve<IEnlistmentNotification>("Flex"); IEnlistmentNotification play = myContainer.Resolve<IEnlistmentNotification>("Play"); See what I mean? Thanks, Kimball

    Read the article

  • Django extending user model and displaying form

    - by MichalKlich
    Hello, I am writing website and i`d like to implement profile managment. Basic thing would be to edit some of user details by themself, like first and last name etc. Now, i had to extend User model to add my own stuff, and email address. I am having troubles with displaying form. Example will describe better what i would like achieve. This is mine extended user model. class UserExtended(models.Model): user = models.ForeignKey(User, unique=True) kod_pocztowy = models.CharField(max_length=6,blank=True) email = models.EmailField() This is how my form looks like. class UserCreationFormExtended(UserCreationForm): def __init__(self, *args, **kwargs): super(UserCreationFormExtended, self).__init__(*args, **kwargs) self.fields['email'].required = True self.fields['first_name'].required = False self.fields['last_name'].required = False class Meta: model = User fields = ('username', 'first_name', 'last_name', 'email') It works fine when registering, as i need allow users to put username and email but when it goes to editing profile it displays too many fields. I would not like them to be able to edit username and email. How could i disable fields in form? Thanks for help.

    Read the article

  • How to encapsulate a WinAPI application into a C++ class

    - by Semen Semenych
    There is a simple WinAPI application. All it does currently is this: register a window class register a tray icon with a menu create a value in the registry in order to autostart and finally, it checks if it's unique using a mutex As I'm used to writing code mainly in C++, and no MFC is allowed, I'm forced to encapsulate this into C++ classes somehow. So far I've come up with such a design: there is a class that represents the application it keeps all the wndclass, hinstance, etc variables, where the hinstance is passed as a constructor parameter as well as the icmdshow and others (see WinMain prototype) it has functions for registering the window class, tray icon, reigstry information it encapsulates the message loop in a function In WinMain, the following is done: Application app(hInstance, szCmdLIne, iCmdShow); return app.exec(); and the constructor does the following: registerClass(); registerTray(); registerAutostart(); So far so good. Now the question is : how do I create the window procedure (must be static, as it's a c-style pointer to a function) AND keep track of what the application object is, that is, keep a pointer to an Application around. The main question is : is this how it's usually done? Am I complicating things too much? Is it fine to pass hInstance as a parameter to the Application constructor? And where's the WndProc? Maybe WndProc should be outside of class and the Application pointer be global? Then WndProc invokes Application methods in response to various events.

    Read the article

  • Unmanaged Process in Mono

    - by Residuum
    I want to start a quite expensive process (jackd) from a Mono application, and do not need full access to the process from the application itself. As the process is so expensive in terms of CPU usage, a Glib.IdleHandler for polling the process will not work, as it is never executed, and the GUI becomes unresponsive. Is there any way to have the cake and eating it at the same time in Mono? EDIT: I only need to be able to start and stop the process from Mono, I do not need information about the state of the process or if it has exited, as my application will register itself as a client to jackd, basically I need a "replacement" for bash's jackd &>/dev/null 2>&1 & for the System.Diagnostics.Process ;). Here is what I have so far for starting and stopping the process: public void StartJackd() { _jackd = new Process (); _jackd.StartInfo = _jackdStartup; if (_jackd.Start ()) { _jackd.EnableRaisingEvents = true; _jackd.Exited += JackdExited; } } public void StopJackd() { if (_jackd != null && !_jackd.HasExited) { _jackd.CloseMainWindow (); } } And somewhere else I have this code for registering the IdleHandler: GLib.Idle.Add(new GLib.IdleHandler(UpdateJackdConnections)); This handler will fire all the time, while the process is not running, but never, when jackd is running.

    Read the article

  • Determine whether app is communicating with APNS sandbox or production environment

    - by goldierox
    I have push notifications set up in my app. I'm trying to determine whether the device token I've received from APNS in the application:didRegisterForRemoteNotificationsWithDeviceToken: method came from the sandbox or development environment. If I can distinguish which environment initialized the token, I'll be able to tell my server to which environment to send the push notification. I've tried using the DEBUG macro to determine this, but I've seen some strange behavior with this and don't trust it to be 100% correct. #ifdef DEBUG BOOL isProd = YES; #else BOOL isProd = NO; #endif Ideally, I'd be able to examine the aps-environment entitlement (value is Development or Production) in code, but I'm not sure if this is even possible. What's the proper way to determine whether your app is communicating with the APNS sandbox or production environments? I'm assuming that the server needs to know this in the first place. Please correct me if this is assumption is incorrect. Edited: Apple's documentation on Provider Communication with APNS details the difference between communicating with the sandbox and production. However, the documentation doesn't give information on how to be consistent with registering the token (from the iOS client app) and communicating with the server.

    Read the article

  • Error with MySQL Query

    - by Ken
    Okay, I must be an idiot, because this is my 3rd question for today. Here's my code: date_default_timezone_set("America/Los_Angeles"); include("mainmenu.php"); $con = mysql_connect("localhost", "root", "********"); if(!$con){ die(mysql_error()); } $usrname = $_POST['usrname']; $fname = $_POST['fname']; $lname = $_POST['lname']; $password = $_POST['password']; $email = $_POST['email']; mysql_select_db("`users`, $con) or die(mysql_error()"); $query = ("INSERT INTO `users`.`data` (`id`, `usrname`, `fname`, `lname`, `email`, `password`) VALUES (NULL, '$usrname', '$fname', '$lname', '$email', 'password'))"); mysql_query('$query') or die(mysql_error()); mysql_close($con); echo("Thank you for registering!"); I always get the error returned as: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$query' at line 1. Help a newbie. I'm about to stab my monitor.

    Read the article

  • Virtual audio driver (microphone)

    - by Dalamber
    Hello guys, I want to develop a virtual microphone driver. Please, do not say anything about DirectShow - that's not "the way". I need a solution that will work with any software including Skype and MSN. And DirectShow doesn't fit these requirements. I found AVStream Filter-Centric Simulated Capture Driver (avssamp.sys) in Windows 7 WDK. What I need is an audio part of it. By default it reads avssamp.wav and plays it. But this driver is registered as WDM streaming capture device. And I want it in Audio Capture Device. There are some posts in the web but they are all the same: http://www.tech-archive.net/Archive/Development/microsoft.public.development.device.drivers/2005-05/msg00124.html http://www.winvistatips.com/problem-installing-avssamp-audio-capture-sources-category-t184898.html I think registering this filter-driver as audio capture device will make Skype recognize it as a microphone and thefore I will be able to push any PCM file as if it goes from mic. If someone already faced this problem before, please help. Thanks in advance.

    Read the article

  • I can't insert data into my database

    - by Ken
    I don't know why, but my data doesn't go into my database 'users' with the table 'data'. <html> <body> <?php date_default_timezone_set("America/Los_Angeles"); include("mainmenu.php"); $con = mysql_connect("localhost", "root", "g00dfor@boy"); if(!$con){ die(mysql_error()); } $usrname = $_POST['usrname']; $fname = $_POST['fname']; $lname = $_POST['lname']; $password = $_POST['password']; $email = $_POST['email']; mysql_select_db(`users`, $con) or die(mysql_error()); mysql_query(INSERT INTO `users`.`data` (`id`, `usrname`, `fname`, `lname`, `email`, `password`) VALUES (NULL, '$usrname', '$fname', '$lname', '$email', 'password')) or die(mysql_error()); mysql_close($con) echo("Thank you for registering!"); ?> </body> </html> All i get is a blank page.

    Read the article

  • How do I distribute my slightly customized Linux in VirtualBox?

    - by goodrone
    Suppose I've got some Arch Linux installation which I'd like to distribute among students with (sometimes very) basic Linux knowledge to make them able to compile C programs in an environment very similar to that in the university. (Things like Cygwin or MinGW seem to be inappropriate here.) I also choose VirtualBox as a holder for the virtual system. The question is: how do I distribute it? I mean: installing VirtualBox on the target machine (if not still installed) uncompressing and copying my image file (.VDI) registering the image (so that VirtualBox could see it when launched) configuring the guest system in VirtualBox (network, memory, etc.) optionally installing PuTTY to simplify interfacing with the guest Linux Should I create an installer? Which one? Or just write some .BAT-scripts? (Target host system is Windows, mostly XP and Vista.) I definately don't want to have a webpage with screen shot explaining where to click and what to press, because it's boring. Additionaly, what will be the best (the most user-friendly) way to configure network when the guest Linux system is run for the first time?

    Read the article

  • Why won't my Setup Project Perform my Custom Registration Process

    - by Jordan S
    I am trying to write an Setup Project/Installer for a class library driver that I wrote in C# using Visual Studio 2008. The driver project has a section of code that looks like this... [ComRegisterFunction] public static void RegisterASCOM(Type t) { Trace.WriteLine("Registration Started."); DoRegistration(true); } In the driver project Properties - "Assembly Information" I have set checked the box that says Make COM-Visible = true. I added a Setup Project to the solution in VS, added the output dll from the driver project so that it installs on the target machine and set the Register property of the dll to "vsdraCOM". So, my understanding is that when the installer runs it SHOULD execute the methods of the dll that are marked with [COMRegisterFunction]. Using SysInternals Debug View I can monitor when the above code snippet is hit by watching for the "Registration started" text to show up in the window. When I build the solution, I can see the text show up so I know the driver is registering properly. The problem is that when I run the installer, I don't think it is doing the registration bit. I see nothing show up in Debug View. And if i try to access my driver via another application I get an error saying it "Cannot create ActiveX object". Why does the registration not occur during the install process? The driver does register for COM but it does NOT call my custom registration method. Does anyone have and suggestions of what I could be missing? Is there another way I can debug this? (I can provide more code if anyone want's to take a look!!)

    Read the article

  • ctypes DLL with optional dependencies

    - by pisswillis
    Disclaimer: I'm new to windows programming so some of my assumptions may be wrong. Please correct me if so. I am developing a python wrapper for a C API using ctypes. The API ships with both 64 and 32 DLLs/LIBs. I can succesfully load the DLL using ctypes.WinDLL('TheLibName') and call functions etc etc. However some functions were not doing what they should. Upon further investigation it appears that the 32bit DLL is being used, which is what is causing the unexpected behaviour. I have tried using ctypes.WinDLL('TheLibName64') but the module is not found. I have tried registering the DLL with regsrv32, but it reports there is no entry point (it also reports no entry point when I try and register TheLibName, which is found by WinDLL(). The DLL came with a sample project in Visual Studio (I have 0 experience with VS so again please correct me here) which builds both 32 and 64 bit versions of the sample project. In the .vcsproj file the configurations for the 64 bit version include: AdditionalDependencies="TheLibName64.lib" in the VCLinkerTool section. In windows/system32 there are both TheLibName.dll/.lib, and TheLibName64.dll/.lib. So it seems to me that my problem is now to make the python ctypes DLL loader load these optional dependencies when the DLL is loaded. However I can't find any information on this (perhaps because, as a doze noob, I do not know the correct terminology) in the ctypes documentation. Is there a way to do this in ctypes? Am I going about this in completely the wrong way? Any help or general information about optional DLL dependencies and how they are loaded in windows would be much appreciated. Thanks

    Read the article

  • Django Many-to-Many Question

    - by DZ
    My questions seems like a common problem that when I have seen any questions on it is never really asked right or not answered. So Im going to try to get the question right, and maybe someone knows how to resolve the issue, or correct my understanding. The problem: When you have a many-to-many relation ship (related_name not through) and you are trying to use the admin interface you are required to input one of the rleationships even though it does not have to exsist for you to create the first entry. Meaning you have to assign a group to an event to create the group. Wow that sounds complicated. So I can see why the question is not getting answered. Lets try the non code explanation example... First and important versions: Django 1.1.1 Phython 2.6 So I have a model where I created a many-to-many realtionship and Im using the related_name Im creating an app that is an event organizer, for simplicty lets say events although they could be anytype). For this first post Im going to stay away from the code and just try to explain. A few keys: (explaining comment) ** - many-to-many So in the model we have 1) The Main Event (this is main model) 2) Groups (link to events and their can be many events for a group) a) Events** I have simplified this example a little becuase I recognize that what does it matter. Just create the event first... But there are specific varations where that will not work. What the many-to-many related_name does it created another table with the indecies of the two other tables. Nothing says that this extra table HAS to be populated. Becuase if I look in the database and work within myPHPadmin I can create a group with out registering an event, since the connection between the two is a seperate table the DB does not care. How do I make the admin interface this realize it? Ok I know thats a lot so I hope I have explained it clearly. Thank you anyone for your comments/thoughts/advice

    Read the article

  • Preloading data without messing up association when data is loaded the 2nd time.

    - by denniss
    This is how my model looks like User belongs_to :computer Computer has_many :user Users are created when people register for an account on the web site but computers are pre-loaded data that I create in seeds.rb/some .rake file. All is fine and good when the app is first launched and people start registering and get associated with the right computer_id. However, suppose I want to add another computer to the list Computer.destroy_all Computer.create({:name => "Akane"}) Computer.create({:name => "Yoda"}) Computer.create({:name => "Mojito"}) #newly added running the rakefile the second time around will mess up the associations because computer_id in the User table refer to the old id in Computer table. Since I have run the script above, the id keeps incrementing without any regard to the association that user has to it. Question: Is there a better way for me to pre-load data without screwing up my association? I want to be able to add new Computer without having to destroy the user's table. Destroying the computer table is fine with me and rebuilding it again but the old association that the existing users have must stay intact.

    Read the article

  • Calling a non-activeX DLL in a VB6 application in Vista/Win7

    - by user1490330
    I have a VB6 app that utilizes a non-activeX DLL (non-registering). It's declared via the classic Public Declare Function "Function Name" Lib "Library.DLL" syntax. On my dev machine (XP) it works fine but when I deploy to Vista or Win7 I'm constantly greeted with a Run Time Error 48 - File Not Found for the DLL in question. I have tried copying that DLL to every directory I can think of including every environment path on the test machine and the app path too. These are all 32-bit test environments so it's not a SysWow64 issue. Possibly throwing a wrench into the mix is the fact that the application in question is an Outlook COM Addin. I managed to install VB6 on Win7 and was able to run a tiny sample app that utilizes this DLL (outside of the Outlook process) so I know it works PROVIDED the DLL is located in App path. If I call App.Path from my DLL when I run it on the test environment it shows, to no surprise, my installation directory however the DLL is there. I tried turning off UAC. I tried making the App.Path directory permissions open to everyone, still no dice.

    Read the article

  • I've registered my oath about 5 times now, but... (twitteR package R)

    - by user2985989
    I'm attempting to mine twitter data in R, and am having trouble getting started. I created a twitter account, an app in twitter developers, changed the settings to read, write, and access, created my access token, and followed instructions to the letter in registering it: My code: > library(twitteR) > download.file(url="http://curl.haxx.se/ca/cacert.pem", + destfile="cacert.pem") > requestURL <- "https://api.twitter.com/oauth/request_token" > accessURL <- "https://api.twitter.com/oauth/access_token" > authURL <- "https://api.twitter.com/oauth/authorize" > consumerKey <-"my key" #took this part out for privacy's sake > consumerSecret <- "my secret" #this too > twitCred <- OAuthFactory$new(consumerKey=consumerKey, consumerSecret = consumerSecret, requestURL = requestURL, accessURL = accessURL, authURL = authURL) > twitCred$handshake(cainfo="cacert.pem") To enable the connection, please direct your web browser to: https://api.twitter.com/oauth/authorize?oauth_token=zxgHXJkYAB3wQ2IVAeyJjeyid7WK6EGPfouGmlx1c When complete, record the PIN given to you and provide it here: 0010819 > registerTwitterOAuth(twitCred) [1] TRUE > save(list="twitCred", file="twitteR_credentials") And yet, this: > s <- searchTwitter('#United', cainfo="cacert.pem") [1] "Unauthorized" Error in twInterfaceObj$doAPICall(cmd, params, "GET", ...) : Error: Unauthorized I'm about to have a temper tantrum. I'd be extremely grateful if someone could explain to me what is going wrong, or, better yet, how to fix it. Thank you.

    Read the article

  • OnClickListener on Tabs not working

    - by Aracos
    Greetings, I am trying to get the Click - event when clicking on the currently selected tab of my TabActivity. The onTabChangedHandler is only called whenever the tab is changed, not if the currently active Tab is clicked. The debugger tells me i have the onClickListener Registered for the TabWidget within my TabHost. Am i registering for the wrong View? Also, I am unable to create a Context Menu for the Tabs, only for its content, is this problem related? public class TestDroidViewTab extends TabActivity implements TabContentFactory , OnTabChangeListener, OnClickListener { private static final String LOG_KEY = "TEST"; ListView listView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); final TabHost tabHost = getTabHost(); TabHost.TabSpec ts = tabHost.newTabSpec("ID_1"); ts.setIndicator("1"); ts.setContent(this); tabHost.addTab(ts); ts = tabHost.newTabSpec("ID_2"); ts.setIndicator("2"); ts.setContent(this); tabHost.addTab(ts); ts = tabHost.newTabSpec("ID_3"); ts.setIndicator("3"); ts.setContent(this); tabHost.addTab(ts); tabHost.setOnClickListener(this); tabHost.setOnTabChangedListener(this); } public void onClick(View v) { Log.d(LOG_KEY, "OnClick"); } public void onTabChanged(String tabId) { Log.d(LOG_KEY, "OnTabChanged"); }

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28  | Next Page >