Search Results

Search found 21310 results on 853 pages for 'multiple domains'.

Page 18/853 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Sitemap structure for network of subdomains

    - by HaCos
    I am working on a project that's a network of 2 domains (domain.gr & domain.com.cy) of subdomains similar to Hubpages [each user gets a profile under a different subdomain & there is a personal blog for that user as well] and I think there is something wrong with our sitemap submission. Sometimes it takes weeks in order a new profiles to get indexed. We make use of one Webmasters account in order to manage all network and we don't want to create different accounts for each subdomain since there are more than 1000 already. According to this post http://goo.gl/KjMCjN, I end up on a structure of 5 sitemaps with the following structure : 1st sitemap will be for indexing the others. 2nd sitemap for all users profile under the domain.gr 3nd sitemap for all users profile under the domain.com.cy 4th sitemap for all posts under the *.domain.gr - news sitemap http://goo.gl/8A8S9f 5th sitemap for all posts under the *.domain.com.cy - news sitemap again Now my questions: Should we create news sitemaps or just list all post in 2nd & 3rd sitemap? Does links ordering has anything to do? Eg: Most recent user created be first in sitemap or doesn't make any different and we just need to make sure that lastmod date is correct? Does anyone guess how Hubpages submit their sitemap in Webmasters so maybe we could follow there way? Any alternative or better way to index this kind of schema? PS: Our network is multi language - Greek & English are available. We make use of hreflang tags on the head of each page to separate country target of each version.

    Read the article

  • On what criteria should I evaluate domain registrars?

    - by jdotjdot89
    Though I've been a web developer for a fair amount of time, I am going for the first time to buy a few domain names. I have looked into the domains I'm going to buy and know that they're available, and I've been looking into which sellers to use. After doing a lot of research, the main ones I'm considering are 1&1, Namecheap, and Gandi. The problem is, when continuing to research, I'm not really sure what makes one domain seller distinct from another. I don't need much in the way of services--definitely not hosting, since I plan to use Heroku for that. I mainly only need the domain itself and DNS management, as well as possibly SSL certificates and WHOIS protection. Question: What makes one domain seller different from another? How can I go about evaluating which one is the best for me? Note: This question is not which domain seller is the best, but rather, what criteria can I use to evaluate them and rank one over another. I'm trying to find out what makes one domain seller different from another, since they all seem to be pretty similar to me right now.

    Read the article

  • Authentication system brainstorm

    - by gansbrest
    Hi. We got multiple small websites (microsites) and one main high traffic one with big users base. Right now the requirement is to build authentication system which should allow users to loign with the same identity across the network. All website are running on different domains, powered by Drupal 6 CMS and have separate databases (so sharing tables with prefix is not an option + it creates a huge mess in the db). Here is the set of core requirements I came up with: Users should be able to login with the same credentials to all sites within the network User’s data sharing between Main site (storage) and all micro sites within the network Data synchronization across the network when user changes the data (update email or password for example) The login/registration process should be seamless and consistent Register on any of the sites across the network and use that identity to login later on. In the future there might be a need to add openid authentication options. Basically we are looking at something similar stackexchange does, but not sure if they have central users base on not. I was thinking about custom solution which will include 2 parts (modules), one will be stored on the Main site for users data storing and responding to requests from clients. Second part (module) will be placed on each microsite, which is going to send requests to the Master. Some kind of client - server setup. One of the complications I see right away is #3. Data Synhcronization across the network. I just don't want to reinvent the wheel and maybe some work is already done in this direction. Looking forward to your ideas on how to approach this project. EDIT: We use MySQL database

    Read the article

  • Getting expired domain name - most effective route?

    - by kcdwayne
    There is a domain name I have been wanting for years that was used as a parked page (read: cybersquatted) that has entered into WHOIS's redemptionPeriod stage. The domain has been expired for 61 days now - after contacting the Registar, they informed me that it would stay in redemption for 75 days. After which, it would either be sold to resellers, or sent back to the public registry. (I have since sent a followup message requesting the reseller they use.) My question is: What is the best way to proceed? I know there is at least one competitor that would love to have this name, but I'm unsure if they even know it's expiring. I did not tell the Registar the domain in question, as they seem geared towards cybersquatting, and I do not trust them. Domain Front Running sucks. Should I use a backorder service? Should I just take my chances and try to grab it after75 days? I checked an auctionhouse by manually browsing their expired domains - it wasn't there.

    Read the article

  • Mobile (Portable) Website

    - by johnny_s
    I have an online presentation to do next week and I have it all ready to go. The website is html and css only (no db), and currently resides on my shared hosting account. Now although my shared hosting is (relatively) reliable, I have noticed that recently they have been making some changes and my website has been unavailable at times. I don't want this to happen to me on the morning of my presentation, so I am asking what is the best way to prepare for such a thing? My domain is www.presentation.mydomain.com and I would like to keep this if possible (even if issues arise). I have been thinking of a few alternatives; host my site on two different domains or servers (but what about domain name)? have a portable XAMPP version on a USB (again, domain name)? possible fail-over site/location? Any advice or suggestions are welcome. Update Presentation will be carried out on their laptop, not mine. So I am unable to install any software.

    Read the article

  • mod_wsgi for multiple trac projects [Windows]

    - by fampinheiro
    Hello, I have a system with windows server 2008, Apache httpd 2.2 and trac 0.11 i'm using mod_wsgi so the apache server do the web server job. Integration with Trac after read this site i found that the most suitable solution was the following (i have in my httpd.conf the line Include conf/extra/httpd-trac.conf) httpd-trac.conf LoadModule wsgi_module modules/mod_wsgi.so WSGIDaemonProcess tracs processes=3 threads=25 maximum-requests=1000 RewriteEngine On RewriteCond %{REQUEST_URI} ^/trac/([^/]+) RewriteCond c:\Project\Services\Trac\%1\conf\trac.ini !-f RewriteRule . - [F] RewriteCond %{REQUEST_URI} ^/trac/([^/]+) RewriteRule . - [E=trac.env_path:c:\Project\Services\Trac\%1] WSGIScriptAliasMatch ^/trac/([^/]+) c:\Project\Trac\trac.wsgi <Directory c:\Project\Trac> WSGIProcessGroup tracs WSGIApplicationGroup %{GLOBAL} Order deny,allow Allow from all </Directory> the problem i encouter is the following: C:\Project\Apache\binhttpd.exe -k start Syntax error on line 3 of C:/Project/Apache/conf/extra/httpd-trac.conf: Invalid command 'WSGIDaemonProcess', perhaps misspelled or defined by a module not included in the server configuration The objective: My objective is to have multiple trac projects with diferente authentication information. If you have other solution than this please tell me =) Thank you for your help.

    Read the article

  • Schedule multiple events with NSTimer?

    - by AWright4911
    I have a schedule cache stored in a pList. For the example below, I have a schedule time of April 13, 2010 2:00PM and Aril 13, 2010 2:05PM. How can I add both of these to a queue to fire on their own? item 0 -Hour --14 -Minute --00 -Month --04 -Day --13 -Year --2010 item 1 -Hour --14 -Minute --05 -Month --04 -Day --13 -Year --2010 this is how I am attempting to schedule multiple events to fire at specific date / time. -(void) buildScheduleCache { MPNotifyViewController *notifier = [MPNotifyViewController alloc] ; [notifier setStatusText:@"Rebuilding schedule cache, this will only take a moment."]; [notifier show]; NSCalendarDate *now = [NSCalendarDate calendarDate]; NSFileManager *manager = [[NSFileManager defaultManager] autorelease]; path = @"/var/mobile/Library/MobileProfiles/Custom Profiles"; theProfiles = [manager directoryContentsAtPath:path]; myPrimaryinfo = [[NSMutableArray arrayWithCapacity:6] retain]; keys = [NSArray arrayWithObjects:@"Profile",@"MPSYear",@"MPSMonth",@"MPSDay",@"MPSHour",@"MPSMinute",nil]; for (NSString *profile in theProfiles) { plistDict = [[[NSMutableDictionary alloc] initWithContentsOfFile:[NSString stringWithFormat:@"%@/%@",path,profile]] autorelease]; [myPrimaryinfo addObject:[NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects: [NSString stringWithFormat:@"%@",profile], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSYear"]], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSMonth"]], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSDay"]], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSHour"]], [NSString stringWithFormat:@"%@",[plistDict objectForKey:@"MPSMinute"]], nil]forKeys:keys]]; profileSched = [NSCalendarDate dateWithYear:[plistDict objectForKey:@"MPSYear"] month:[plistDict objectForKey:@"MPSMonth"] day:[plistDict objectForKey:@"MPSDay"] hour:[plistDict objectForKey:@"MPSHour"] minute:[plistDict objectForKey:@"MPSMinute"] second:01 timeZone:[now timeZone]]; [self rescheduleTimer]; } NSString *testPath = @"/var/mobile/Library/MobileProfiles/Schedules.plist"; [myPrimaryinfo writeToFile:testPath atomically:YES]; } -(void) rescheduleTimer { timer = [[NSTimer alloc] initWithFireDate:profileSched interval:0.0f target:self selector:@selector(theFireEvent) userInfo:nil repeats:YES]; NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; [runLoop addTimer:timer forMode:NSDefaultRunLoopMode]; }

    Read the article

  • Multiple database connection in Rails

    - by Sanal
    I'm using active_delegate for multiple connection in Rails. Here I'm using mysql as master_database for some models,and postgresql for some other models. Problem is that when I try to access the mysql models, I'm getting the error below! Stack trace shows that, it is still using the postgresql adapter to access my mysql models! RuntimeError: ERROR C42P01 Mrelation "categories" does not exist P15 F.\src\backend\parser\parse_relation.c L886 RparserOpenTable: SELECT * FROM "categories" STACKTRACE =========== d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract_adapter.rb:212:in `log' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/postgresql_adapter.rb:507:in `execute' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/postgresql_adapter.rb:985:in `select_raw' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/postgresql_adapter.rb:972:in `select' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all_without_query_cache' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:81:in `cache_sql' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/abstract/query_cache.rb:60:in `select_all' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:661:in `find_by_sql' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:1553:in `find_every' d:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:615:in `find' D:/ROR/Aptana/dedomenon/app/models/category.rb:50:in `get_all_with_exclusive_scope' D:/ROR/Aptana/dedomenon/app/models/category.rb:50:in `get_all_with_exclusive_scope' D:/ROR/Aptana/dedomenon/app/controllers/categories_controller.rb:48:in `index' here is my database.yml file postgre: &postgre adapter: postgresql database: codex host: localhost username: postgres password: root port: 5432 mysql: &mysql adapter: mysql database: project host: localhost username: root password: root port: 3306 development: <<: *postgre test: <<: *postgre production: <<: *postgre master_database: <<: *mysql and my master_databse model is like this class Category < ActiveRecord::Base delegates_connection_to :master_database, :on => [:create, :save, :destroy] end Anyone has any solution??

    Read the article

  • Problem retrieving multiple instances of the same asp.net session variable

    - by sw1sh
    I'm having problems with retrieving multiple instances of a session variable from an InProc session state. In the following code I persist a simple BusinessObject into a session variable on the Page_Load event. On the click of a button I try to retrieve the object back into 2 new declared instances of the same BusinessObject. All works great until I change one of the properties in the first instance, it changes the second instance as well. Is this normal behaviour? I would have thought as these were new instances they wouldn’t demonstrate static behaviour? Any ideas where I'm going wrong? Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then ' create a new instance of a business object and set a containg variable Dim BO As New BusinessObject BO.SomeVariable = "test" ' persist to inproc session Session("BO") = BO End If End Sub Protected Sub btnRetrieveSessionVariable_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRetrieveSessionVariable.Click ' retrieve the session variable to a new instance of BusinessObject Dim BO1 As New BusinessObject If Not Session("BO") Is Nothing Then BO1 = Session("BO") ' retrieve the session variable to a new instance of BusinessObject Dim BO2 As New BusinessObject If Not Session("BO") Is Nothing Then BO2 = Session("BO") ' change the property value on the first instance BO1.SomeVariable = "test2" ' why has this changed on both instances? Dim strBO1Property As String = BO1.SomeVariable Dim strBO2Property As String = BO2.SomeVariable End Sub ' simple BusinessObject class Public Class BusinessObject Private _SomeVariable As String Public Property SomeVariable() As String Get Return _SomeVariable End Get Set(ByVal value As String) _SomeVariable = value End Set End Property End Class

    Read the article

  • Flex - Drag and drop - Drop a subset of multiple items

    - by flanagann
    I'm developing two DataGrid with drag and drop support. Multiple items can be selected from the source data grid, and dropped into the target data grid. I'm using an drag and drop event listener which completes the operation only in certain cases. I'm using event.preventDefault() but it doesn't work, since it stops the drag and drop from all the items. My aim is, for example, finally dropping 2 elements from the total 4 elements that I previously selected. public function onDropPermission(event:DragEvent):void { var sourceGrid:mx.controls.DataGrid = new mx.controls.DataGrid(); sourceGrid = event.dragInitiator as mx.controls.DataGrid; var targetGrid:mx.controls.DataGrid = new mx.controls.DataGrid(); targetGrid = event.target as mx.controls.DataGrid; var i:int; for (i = 0; i < sourceGrid.selectedIndices.length; i++) { var j:int; for (j = 0; j < dataGroupPermissions.length; j++) { var permission:Permission = new Permission; permission = dataGroupPermissions[j] as Permission; if (permission.id == sourceGrid.selectedItems[i].id) { event.preventDefault(); } } } }

    Read the article

  • DQL delete from multiple tables (doctrine)

    - by singer
    Need to perform DQL delete from multple related tables. In SQL it is something like this: DELETE r1,r2 FROM ComRealty_objects r1, com_realty_objects_phones r2 WHERE r1.id IN (10,20) AND r2.id_object IN (10,20) I need to perform this statement using DQL, but I'm stuck on this :( <?php $dql = Doctrine_Query::create() ->delete('phones, comrealtyobjects') ->from('ComRealtyObjects comrealtyobjects') ->from('ComRealtyObjectsPhones phones') ->whereIn("comrealtyobjects.id", $ids) ->whereIn("phones.id_object", $ids); echo($dql->getSqlQuery()); ?> But DQL parser gives me this result: DELETE FROM `com_realty_objects_phones`, `ComRealty_objects` WHERE (`id` IN (?) AND `id_object` IN (?)) Searching google and stack overflow I found this(useful) topic: http://stackoverflow.com/questions/2247905/what-is-the-syntax-for-a-multi-table-delete-on-a-mysql-database-using-doctrine But this is not exactly my case - there was delete from single table. If there is a way to override dql parser behaviour? Or maybe some other way to delete records from multiple tables using doctrine. Note: If you are using doctrine behaviours(Doctrine_Record_Generator) you need first to initialize those tables using Doctrine_Core::initializeModels() to perform DQL operations on them.

    Read the article

  • how to handle multiple profiles per user?

    - by Scott Willman
    I'm doing something that doesn't feel very efficient. From my code below, you can probably see that I'm trying to allow for multiple profiles of different types attached to my custom user object (Person). One of those profiles will be considered a default and should have an accessor from the Person class. Can this be done better? from django.db import models from django.contrib.auth.models import User, UserManager class Person(User): public_name = models.CharField(max_length=24, default="Mr. T") objects = UserManager() def save(self): self.set_password(self.password) super(Person, self).save() def _getDefaultProfile(self): def_teacher = self.teacher_set.filter(default=True) if def_teacher: return def_teacher[0] def_student = self.student_set.filter(default=True) if def_student: return def_student[0] def_parent = self.parent_set.filter(default=True) if def_parent: return def_parent[0] return False profile = property(_getDefaultProfile) def _getProfiles(self): # Inefficient use of QuerySet here. Tolerated because the QuerySets should be very small. profiles = [] if self.teacher_set.count(): profiles.append(list(self.teacher_set.all())) if self.student_set.count(): profiles.append(list(self.student_set.all())) if self.parent_set.count(): profiles.append(list(self.parent_set.all())) return profiles profiles = property(_getProfiles) class BaseProfile(models.Model): person = models.ForeignKey(Person) is_default = models.BooleanField(default=False) class Meta: abstract = True class Teacher(BaseProfile): user_type = models.CharField(max_length=7, default="teacher") class Student(BaseProfile): user_type = models.CharField(max_length=7, default="student") class Parent(BaseProfile): user_type = models.CharField(max_length=7, default="parent")

    Read the article

  • How to manage multiple python versions ?

    - by Gyom
    short version: how can I get rid of the multiple-versions-of-python nightmare ? long version: over the years, I've used several versions of python, and what is worse, several extensions to python (e.g. pygame, pylab, wxPython...). Each time it was on a different setup, with different OSes, sometimes different architectures (like my old PowerPC mac). Nowadays I'm using a mac (OSX 10.6 on x86-64) and it's a dependency nightmare each time I want to revive script older than a few months. Python itself already comes in three different flavours in /usr/bin (2.5, 2.6, 3.1), but I had to install 2.4 from macports for pygame, something else (cannot remember what) forced me to install all three others from macports as well, so at the end of the day I'm the happy owner of seven (!) instances of python on my system. But that's not the problem, the problem is, none of them has the right (i.e. same set of) libraries installed, some of them are 32bits, some 64bits, and now I'm pretty much lost. For example right now I'm trying to run a three-year-old script (not written by me) which used to use matplotlib/numpy to draw a real-time plot within a rectangle of a wxwidgets window. But I'm failing miserably: py26-wxpython from macports won't install, stock python has wxwidgets included but also has some conflict between 32 bits and 64 bits, and it doesn't have numpy... what a mess ! Obviously, I'm doing things the wrong way. How do you usally cope with all that chaos ?e

    Read the article

  • A linked list with multiple heads in Java

    - by Emile
    Hi, I have a list in which I'd like to keep several head pointers. I've tried to create multiple ListIterators on the same list but this forbid me to add new elements in my list... (see Concurrent Modification exception). I could create my own class but I'd rather use a built-in implementation ;) To be more specific, here is an inefficient implementation of two basic operations and the one wich doesn't work : class MyList <E { private int[] _heads; private List<E _l; public MyList ( int nbHeads ) { _heads = new int[nbHeads]; _l = new LinkedList<E(); } public void add ( E e ) { _l.add(e); } public E next ( int head ) { return _l.get(_heads[head++]); // ugly } } class MyList <E { private Vector<ListIterator<E _iters; private List<E _l; public MyList ( int nbHeads ) { _iters = new Vector<ListIterator<E(nbHeads); _l = new LinkedList<E(); for( ListIterator<E iter : _iters ) iter = _l.listIterator(); } public void add ( E e ) { _l.add(e); } public E next ( int head ) { // ConcurrentModificationException because of the add() return _iters.get(head).next(); } } Emile

    Read the article

  • Correct configuration of multiple Analytics trackers per page, spanning domains and subdomains

    - by Eliot Shepard
    My company publishes sites on a somewhat convoluted domain structure, and we're having trouble getting accurate numbers in Analytics when we have multiple trackers on the page. We publish under two brands (A, B). Each brand has a "national" site at A.com, B.com, as well as per-city "local" sites at eg. ny.A.com, la.A.com, sf.A.com, etc. Right now we're trying to track in these dimensions: Full network (A.com, ny.A.com, B.com, la.B.com, etc.) All sites in brand (A.com, ny.A.com, la.A.com, etc.) Inidividual site (ny.A.com) Here are the commands we're using on an individual site: _gaq.push( ['t0._setAccount', 'UA-XXXXXX-1'], // full network ['t0._setDomainName', 'none'], ['t0._setAllowLinker', true], ['t0._trackPageview'], ['t1._trackPageLoadTime'], ['t1._setAccount', 'UA-XXXXXX-2'], // brand ['t1._setDomainName', 'none'], ['t1._setAllowLinker', true], ['t1._trackPageview'], ['t1._trackPageLoadTime'], ['t2._setAccount', 'UA-XXXXXX-3'], // individual ['t2._setDomainName', 'none'], ['t2._setAllowLinker', true], ['t2._trackPageview'], ['t2._trackPageLoadTime'] ); We send the same commands to each account because we've had strange results when trackers were configured differently in the past. However, right now we're seeing inflated numbers for uniques on all three trackers. What is the correct way to configure this setup? Thanks for your time.

    Read the article

  • iPhone SDK allow touches to affect multiple views

    - by Parad0x13
    I have a main view that has has two buttons on it that control methods to display the next image and display the previous image. In this case the 'Image' is a class that inherits from UIImageView and has multiple pictures on it that you can interact with, and I call this class a 'Pane'. The pane itself handles all the user interaction itself while the main view controls the display of next and previous panes with the buttons. Here is my dilemma, because the pane fully covers the main view it wont allow for the user to tap the buttons on the main view! So once a pane pops up you cannot change it via the buttons! Is there a way to allow touches through transparent parts of a view, or if not how in the world do I achieve this?! I cannot pass touchesBegan or any of those methods from the pane to the superview because all of the button touch methods are created in the xib file. I cannot insert the pane under the control panel because then you wouldn't be able to interact with the pane. And as far as I know theres no way to pass touch events to every single pane within the paneHoldingArray that belongs to the main view I cannot add the command buttons inside of the pane because I want to be able to replace the command button's image with a thumbprint render of the next/previous pane. I've been stuck on this for a very long time, please somebody help me out with a fix action or a new way to re-engineer the code so that it will work!

    Read the article

  • django: How to make one form from multiple models containing foreignkeys

    - by Tim
    I am trying to make a form on one page that uses multiple models. The models reference each other. I am having trouble getting the form to validate because I cant figure out how to get the id of two of the models used in the form into the form to validate it. I used a hidden key in the template but I cant figure out how to make it work in the views My code is below: views: def the_view(request, a_id,): if request.method == 'POST': b_form= BForm(request.POST) c_form =CForm(request.POST) print "post" if b_form.is_valid() and c_form.is_valid(): print "valid" b_form.save() c_form.save() return HttpResponseRedirect(reverse('myproj.pro.views.this_page')) else: b_form= BForm() c_form = CForm() b_ide = B.objects.get(pk=request.b_id) id_of_a = A.objects.get(pk=a_id) return render_to_response('myproj/a/c.html', {'b_form':b_form, 'c_form':c_form, 'id_of_a':id_of_a, 'b_id':b_ide }) models class A(models.Model): name = models.CharField(max_length=256, null=True, blank=True) classe = models.CharField(max_length=256, null=True, blank=True) def __str__(self): return self.name class B(models.Model): aid = models.ForeignKey(A, null=True, blank=True) number = models.IntegerField(max_length=1000) other_number = models.IntegerField(max_length=1000) class C(models.Model): bid = models.ForeignKey(B, null=False, blank=False) field_name = models.CharField(max_length=15) field_value = models.CharField(max_length=256, null=True, blank=True) forms from mappamundi.mappa.models import A, B, C class BForm(forms.ModelForm): class Meta: model = B exclude = ('aid',) class CForm(forms.ModelForm): class Meta: model = C exclude = ('bid',) B has a foreign key reference to A, C has a foreign key reference to B. Since the models are related, I want to have the forms for them on one page, 1 submit button. Since I need to fill out fields for the forms for B and C & I dont want to select the id of B from a drop down list, I need to somehow get the id of the B form into the form so it will validate. I have a hidden field in the template, I just need to figure how to do it in the views

    Read the article

  • C++ Multiple inheritance with interfaces?

    - by umanga
    Greetings all, I come from Java background and I am having difficulty with multiple inheritance. I have an interface called IView which has init() method.I want to derive a new class called PlaneViewer implementing above interface and extend another class. (QWidget). My implementation is as: IViwer.h (only Header file , no CPP file) : #ifndef IVIEWER_H_ #define IVIEWER_H_ class IViewer { public: //IViewer(); ///virtual //~IViewer(); virtual void init()=0; }; #endif /* IVIEWER_H_ */ My derived class. PlaneViewer.h #ifndef PLANEVIEWER_H #define PLANEVIEWER_H #include <QtGui/QWidget> #include "ui_planeviewer.h" #include "IViewer.h" class PlaneViewer : public QWidget , public IViewer { Q_OBJECT public: PlaneViewer(QWidget *parent = 0); ~PlaneViewer(); void init(); //do I have to define here also ? private: Ui::PlaneViewerClass ui; }; #endif // PLANEVIEWER_H PlaneViewer.cpp #include "planeviewer.h" PlaneViewer::PlaneViewer(QWidget *parent) : QWidget(parent) { ui.setupUi(this); } PlaneViewer::~PlaneViewer() { } void PlaneViewer::init(){ } My questions are: Is it necessary to declare method init() in PlaneViewer interface also , because it is already defined in IView? 2.I cannot complie above code ,give error : PlaneViewer]+0x28): undefined reference to `typeinfo for IViewer' collect2: ld returned 1 exit status Do I have to have implementation for IView in CPP file?

    Read the article

  • MySql: Query multiple identical dynamic tables.

    - by JYelton
    I have a database with 500+ tables, each with identical structure, that contain historical data from sensors. I am trying to come up with a query that will locate, for example, all instances where sensor n exceeds x. The problem is that the tables are dynamic, the query must be able to dynamically obtain the list of tables. I can query information_schema.tables to get a list of the tables, like so: SELECT table_name FROM information_schema.tables WHERE table_schema = 'database_name'; I can use this to create a loop in the program and then query the database repeatedly, however it seems like there should be a way to have MySql do the multiple table search. I have not been able to make a stored procedure that works, but the examples I can find are generally for searching for a string in any column. I want to specifically find data in a specific column that exists in all tables. I admit I do not understand how to properly use stored procedures nor if they are the appropriate solution to this problem. An example query inside the loop would be: SELECT device_name, sensor_value FROM device_table WHERE sensor_value > 10; Trying the following does not work: SELECT device_name, sensor_value FROM ( SELECT table_name FROM information_schema.tables WHERE table_schema = 'database_name' ) WHERE sensor_value > 10; It results in an error: "Every derived table must have its own alias." The goal is to have a list of all devices that have had a given sensor value occur anywhere in their log (table). Ultimately, should I just loop in my program once I've obtained a list of tables, or is there a query structure that would be more efficient?

    Read the article

  • Adding date to multiple fields via datepicker

    - by Andy
    i have a form in drupal with jquery based date module. there are multiple fields with date picker enabled. i want to set the value of all of them (they all have class .date-popup-init) to the value of the first field (#edit-field, the 'from' date) when that field is set. my code so far: <script type="text/javascript"> var DatePicked = function() { var firstdate = $("#edit-field"); var updater = firstdate.datepicker("getDate"); $(".date-popup-init").each(function(){ $(this).datepicker("setDate", updater); }); } $(function() { $("#edit-field").datepicker({ onSelect: DatePicked }); }); </script> this seems to randomly work; it sets the date of some fields to the value of #edit-field, seemingly different fields each time. also, the form adds more datepicker-enabled fields via ajax. is there any way to ensure that all these new fields, when they load, pick up the value of #edit-field as well? disclaimer: last night was my first attempt at javascript of any kind. i have a basic idea now. the above was cobbled through countless google examples.

    Read the article

  • Why my autocomplete doesn't whant to be multiple ???

    - by Toni Michel Caubet
    please, give me a hand on this one; i'm trying to use autocomplete so user can enter tags by comma separated, example: 'autocomplete, jquery , next , last' ok, i had the autocomplete working by sending him an $array with all the tags of my website with the previous format aswell, this is my code: <? $a = new etiqueta(0, ''); $b = $a->autocomplete_etiquetas(); mostrar_notificacion('autocomplete_etiquetas_cargado?'); ?> <script type="text/javascript"> function cargar_autocomplete_etiquetas(){ $("#tags").autocomplete({ source: [<? echo $b; ?>] }); } </script> All i want it's user to select a tag, apply the ', ' and the autocomplete to be ready for next tag i'm trying with (i know they are diff id's, also diff inputs): <? $b = new ingrediente(0, ''); $c = $b->autocomplete_ingredientes(); ?> <script type="text/javascript"> function cargar_autocomplete_ingredientes(){ $("#ingredientes").autocomplete({ source: [<? echo $c; ?>], multiple: true, multipleSeparator: ", " }); } </script> But with out success.... 10€ via paypal if answered before 23h (its 21:50 now), it's not much, it's an incentive :P

    Read the article

  • multiple mysql_real_query() in while loop

    - by Steve
    It seems that when I have one mysql_real_query() function in a continuous while loop, the query will get executed OK. However, if multiple mysql_real_query() are inside the while loop, one right after the other. Depending on the query, sometimes neither the first query nor second query will execute properly. This seems like a threading issue to me. I'm wondering if the mysql c api has a way of dealing with this? Does anyone know how to deal with this? mysql_free_result() doesn't work since I am not even storing the results. //keep polling as long as stop character '-' is not read while(szRxChar != '-') { // Check if a read is outstanding if (HasOverlappedIoCompleted(&ovRead)) { // Issue a serial port read if (!ReadFile(hSerial,&szRxChar,1, &dwBytesRead,&ovRead)) { DWORD dwErr = GetLastError(); if (dwErr!=ERROR_IO_PENDING) return dwErr; } } // Wait 5 seconds for serial input if (!(HasOverlappedIoCompleted(&ovRead))) { WaitForSingleObject(hReadEvent,RESET_TIME); } // Check if serial input has arrived if (GetOverlappedResult(hSerial,&ovRead, &dwBytesRead,FALSE)) { // Wait for the write GetOverlappedResult(hSerial,&ovWrite, &dwBytesWritten,TRUE); //load tagBuffer with byte stream tagBuffer[i] = szRxChar; i++; tagBuffer[i] = 0; //char arrays are \0 terminated //run query with tagBuffer if( strlen(tagBuffer)==PACKET_LENGTH ) { sprintf(query,"insert into scan (rfidnum) values ('"); strcat(query, tagBuffer); strcat(query, "')"); mysql_real_query(&mysql,query,(unsigned int)strlen(query)); i=0; } mysql_real_query(&mysql,"insert into scan (rfidnum) values ('2nd query')",(unsigned int)strlen("insert into scan (rfid) values ('2nd query')")); mysql_free_result(res); } }

    Read the article

  • Using the HTML5 &lt;input type=&quot;file&quot; multiple=&quot;multiple&quot;&gt; Tag in ASP.NET

    - by Rick Strahl
    Per HTML5 spec the <input type="file" /> tag allows for multiple files to be picked from a single File upload button. This is actually a very subtle change that's very useful as it makes it much easier to send multiple files to the server without using complex uploader controls. Please understand though, that even though you can send multiple files using the <input type="file" /> tag, the process of how those files are sent hasn't really changed - there's still no progress information or other hooks that allow you to automatically make for a nicer upload experience without additional libraries or code. For that you will still need some sort of library (I'll post an example in my next blog post using plUpload). All the new features allow for is to make it easier to select multiple images from disk in one operation. Where you might have required many file upload controls before to upload several files, one File control can potentially do the job. How it works To create a file input box that allows with multiple file support you can simply do:<form method="post" enctype="multipart/form-data"> <label>Upload Images:</label> <input type="file" multiple="multiple" name="File1" id="File1" accept="image/*" /> <hr /> <input type="submit" id="btnUpload" value="Upload Images" /> </form> Now when the file open dialog pops up - depending on the browser and whether the browser supports it - you can pick multiple files. Here I'm using Firefox using the thumbnail preview I can easily pick images to upload on a form: Note that I can select multiple images in the dialog all of which get stored in the file textbox. The UI for this can be different in some browsers. For example Chrome displays 3 files selected as text next to the Browse… button when I choose three rather than showing any files in the textbox. Most other browsers display the standard file input box and display the multiple filenames as a comma delimited list in the textbox. Note that you can also specify the accept attribute in the <input> tag, which specifies a mime-type to specify what type of content to allow.Here I'm only allowing images (image/*) and the browser complies by just showing me image files to display. Likewise I could use text/* for all text formats registered on the machine or text/xml to only show XML files (which would include xml,xst,xsd etc.). Capturing Files on the Server with ASP.NET When you upload files to an ASP.NET server there are a couple of things to be aware of. When multiple files are uploaded from a single file control, they are assigned the same name. In other words if I select 3 files to upload on the File1 control shown above I get three file form variables named File1. This means I can't easily retrieve files by their name:HttpPostedFileBase file = Request.Files["File1"]; because there will be multiple files for a given name. The above only selects the first file. Instead you can only reliably retrieve files by their index. Below is an example I use in app to capture a number of images uploaded and store them into a database using a business object and EF 4.2.for (int i = 0; i < Request.Files.Count; i++) { HttpPostedFileBase file = Request.Files[i]; if (file.ContentLength == 0) continue; if (file.ContentLength > App.Configuration.MaxImageUploadSize) { ErrorDisplay.ShowError("File " + file.FileName + " is too large. Max upload size is: " + App.Configuration.MaxImageUploadSize); return View("UploadClassic",model); } var image = new ClassifiedsBusiness.Image(); var ms = new MemoryStream(16498); file.InputStream.CopyTo(ms); image.Entered = DateTime.Now; image.EntryId = model.Entry.Id; image.ContentType = "image/jpeg"; image.ImageData = ms.ToArray(); ms.Seek(0, SeekOrigin.Begin); // resize image if necessary and turn into jpeg Bitmap bmp = Imaging.ResizeImage(ms.ToArray(), App.Configuration.MaxImageWidth, App.Configuration.MaxImageHeight); ms.Close(); ms = new MemoryStream(); bmp.Save(ms,ImageFormat.Jpeg); image.ImageData = ms.ToArray(); bmp.Dispose(); ms.Close(); model.Entry.Images.Add(image); } This works great and also allows you to capture input from multiple input controls if you are dealing with browsers that don't support multiple file selections in the file upload control. The important thing here is that I iterate over the files by index, rather than using a foreach loop over the Request.Files collection. The files collection returns key name strings, rather than the actual files (who thought that was good idea at Microsoft?), and so that isn't going to work since you end up getting multiple keys with the same name. Instead a plain for loop has to be used to loop over all files. Another Option in ASP.NET MVC If you're using ASP.NET MVC you can use the code above as well, but you have yet another option to capture multiple uploaded files by using a parameter for your post action method.public ActionResult Save(HttpPostedFileBase[] file1) { foreach (var file in file1) { if (file.ContentLength < 0) continue; // do something with the file }} Note that in order for this to work you have to specify each posted file variable individually in the parameter list. This works great if you have a single file upload to deal with. You can also pass this in addition to your main model to separate out a ViewModel and a set of uploaded files:public ActionResult Edit(EntryViewModel model,HttpPostedFileBase[] uploadedFile) You can also make the uploaded files part of the ViewModel itself - just make sure you use the appropriate naming for the variable name in the HTML document (since there's Html.FileFor() extension). Browser Support You knew this was coming, right? The feature is really nice, but unfortunately not supported universally yet. Once again Internet Explorer is the problem: No shipping version of Internet Explorer supports multiple file uploads. IE10 supposedly will, but even IE9 does not. All other major browsers - Chrome, Firefox, Safari and Opera - support multi-file uploads in their latest versions. So how can you handle this? If you need to provide multiple file uploads you can simply add multiple file selection boxes and let people either select multiple files with a single upload file box or use multiples. Alternately you can do some browser detection and if IE is used simply show the extra file upload boxes. It's not ideal, but either one of these approaches makes life easier for folks that use a decent browser and leaves you with a functional interface for those that don't. Here's a UI I recently built as an alternate uploader with multiple file upload buttons: I say this is my 'alternate' uploader - for my primary uploader I continue to use an add-in solution. Specifically I use plUpload and I'll discuss how that's implemented in my next post. Although I think that plUpload (and many of the other packaged JavaScript upload solutions) are a better choice especially for large uploads, for simple one file uploads input boxes work well enough. The advantage of this solution is that it's very easy to handle on the server side. Any of the JavaScript controls require special handling for uploads which I'll also discuss in my next post.© Rick Strahl, West Wind Technologies, 2005-2012Posted in HTML5  ASP.NET  MVC   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • Java multiple connections downloading file

    - by weulerjunior
    Hello friends, I was wanting to add multiple connections in the code below to be able to download files faster. Could someone help me? Thanks in advance. public void run() { RandomAccessFile file = null; InputStream stream = null; try { // Open connection to URL. HttpURLConnection connection = (HttpURLConnection) url.openConnection(); // Specify what portion of file to download. connection.setRequestProperty("Range", "bytes=" + downloaded + "-"); // Connect to server. connection.connect(); // Make sure response code is in the 200 range. if (connection.getResponseCode() / 100 != 2) { error(); } // Check for valid content length. int contentLength = connection.getContentLength(); if (contentLength < 1) { error(); } /* Set the size for this download if it hasn't been already set. */ if (size == -1) { size = contentLength; stateChanged(); } // Open file and seek to the end of it. file = new RandomAccessFile("C:\\"+getFileName(url), "rw"); file.seek(downloaded); stream = connection.getInputStream(); while (status == DOWNLOADING) { /* Size buffer according to how much of the file is left to download. */ byte buffer[]; if (size - downloaded > MAX_BUFFER_SIZE) { buffer = new byte[MAX_BUFFER_SIZE]; } else { buffer = new byte[size - downloaded]; } // Read from server into buffer. int read = stream.read(buffer); if (read == -1) { break; } // Write buffer to file. file.write(buffer, 0, read); downloaded += read; stateChanged(); } /* Change status to complete if this point was reached because downloading has finished. */ if (status == DOWNLOADING) { status = COMPLETE; stateChanged(); } } catch (Exception e) { error(); } finally { // Close file. if (file != null) { try { file.close(); } catch (Exception e) { } } // Close connection to server. if (stream != null) { try { stream.close(); } catch (Exception e) { } } } }

    Read the article

  • Multiple Cookie Generation Issue

    - by Shannon
    Hi all, jQuery newbie here. I need to be able to set multiple cookies within the code without have to change out this variable each and every time. Is there any way to make this code generate unique cookies for different pages? As it is now, I'm having to rename that variable for each page that the jQuery animations exist on. (sbbcookiename) Background on the issue: We are having issues with the sliders not autoplaying once one has already been triggered, due to it the cookie having been cached. Thanks for your help. (function(){ jQuery.noConflict(); var _TIMEOUT= 1000, initTimer= 0, sbLoaded= false, _re= null ; initTimer= setTimeout(initSlider, _TIMEOUT); jQuery(document).ready(initSlider); function initSlider(){ if(sbLoaded) return; if (jQuery('#campaign_name').length > 0) { var sbbcookiename = jQuery('#campaign_name').attr('class'); } else { var sbbcookiename = "slider728x90"; } var slideTimeout //timer ,sbTrigger = jQuery('#slidebartrigger') //convenience ,sbFirstSlide = (document.cookie.indexOf(sbbcookiename) == -1) //check cookie for 'already seen today' ; clearTimeout(initTimer); sbLoaded= true; function toggleSlideboxes(){ if(slideTimeout) clearTimeout(slideTimeout); var isDown = sbTrigger.is('.closeSlide'); jQuery('#slidebar')['slide' + (isDown ? 'Up' : 'Down')]((isDown ? 1000 : 1000), function(){ if(sbFirstSlide){ //if 'first time today' then clear for click-to-replay sbTrigger.removeClass('firstSlide'); sbFirstSlide = false; } sbTrigger[(isDown ? 'remove' : 'add') + 'Class']('closeSlide').one('click', toggleSlideboxes); if(!isDown) slideTimeout = setTimeout(toggleSlideboxes, 4000); }); } if(sbFirstSlide){ //not seen yet today so set a cookie for expire tomorrow, then toggle the slide boxes... var oneDay = new Date(); oneDay.setUTCDate(oneDay.getUTCDate()+1); oneDay.setUTCHours(0, 0, 0, 0); //set to literally day-by-day, rather than 24 hours document.cookie=sbbcookiename+"=true;path=/;expires="+oneDay.toUTCString(); toggleSlideboxes(); }else{ //already seen today so show the trigger and set a click event on it... sbTrigger.removeClass('firstSlide').one('click', toggleSlideboxes); } } })();

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >