Search Results

Search found 7850 results on 314 pages for 'except'.

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

  • Trouble making OAuth signed requests

    - by behrk2
    Hello, I am able to successfully make non-authenticated and protected calls to the Netflix API. I am having a little trouble making signed requests to the catalog, however. Using the OAuth Test page, it is clear to me that my Base String is correct. My request URL is also correct, except for the oauth_signature. The oauth_signature is the only thing that differs. If I understand correctly, the only difference between a protected call and a signed call is that there are no tokens involved, and that I am appending on call parameters (such as term). So, I am using the exact same code that I use for my protected calls that I am for my signed calls, except my signature key ONLY contains my shared secret (with an ampersand sign on the end of it). It does not use the access token. Am I missing something here? Where else can I be going wrong? Thanks!

    Read the article

  • weird data-grid-view/crystal-reports behaviour c# winforms

    - by jello
    I have a winforms project which I keep in different versions, each version having its own project folder. All these projects use the same database file, which is copied in each project folder too. So if I run a project, let's say 0.34, and then I try to run 0.35, all the database functions don't work, unless I detach the database in SQL server management studio express. So all the database functions don't work, except the data grid view and/or crystal reports. But then, if I detach the database, and I run any version, all the database functions work, except the data grid view and/or crystal reports. So to recap, when the database functions work (like select), crystal reports doesn't work. But when the database functions don't work because the database is not detached, crystal reports works. weird. any ideas?

    Read the article

  • Smooth mousover images inside scaled Flex App?

    - by Josh Handel
    I have a flex app I am scaling using systemManager.stage.scaleMode=StageScaleMode.NO_BORDER; for the most part it works well except for my bitmap data (mostly png's from the designers). I can set the mx:image tags to smoothBitmapContent=true and that works great for everything except my mouseover objects. When I do a mouseover, the source is being changed from one embedded image to another embedded image. I have tried several (many) online "smoothimage" classes, and tried to write my own, I have tried to reset smoothBitmapContent every chance I get but still no dice. It seems to mee that because I am scaling at the app level, that the flopped out bitmap is not getting smoothed when it renders. Does anyone have any suggestions on how to keep things smooth (perhaps there is a flag to tell Flex to smooth stuff when it scales it?). Thanks Josh

    Read the article

  • LINQ and set difference

    - by Pierre
    I have two collections a and b. I would like to compute the set of items in either a or b, but not in both (a logical exclusive or). With LINQ, I can come up with this: IEnumerable<T> Delta<T>(IEnumerable<T> a, IEnumerable<T> b) { return a.Except (b).Union (b.Except (a)); } I wonder if there are other more efficient or more compact ways of producing the difference between the two collections.

    Read the article

  • Compound dictionary keys

    - by John Keyes
    I have a particular case where using compound dictionary keys would make a task easier. I have a working solution, but feel it is inelegant. How would you do it? context = { 'database': { 'port': 9990, 'users': ['number2', 'dr_evil'] }, 'admins': ['[email protected]', '[email protected]'], 'domain.name': 'virtucon.com' } def getitem(key, context): if hasattr(key, 'upper') and key in context: return context[key] keys = key if hasattr(key, 'pop') else key.split('.') k = keys.pop(0) if keys: try: return getitem(keys, context[k]) except KeyError, e: raise KeyError(key) if hasattr(context, 'count'): k = int(k) return context[k] if __name__ == "__main__": print getitem('database', context) print getitem('database.port', context) print getitem('database.users.0', context) print getitem('admins', context) print getitem('domain.name', context) try: getitem('database.nosuchkey', context) except KeyError, e: print "Error:", e Thanks.

    Read the article

  • Easiest way to find the correct kademlia bucket

    - by Martin
    In the Kademlia protocol node IDs are 160 bit numbers. Nodes are stored in buckets, bucket 0 stores all the nodes which have the same ID as this node except for the very last bit, bucket 1 stores all the nodes which have the same ID as this node except for the last 2 bits, and so on for all 160 buckets. What's the fastest way to find which bucket I should put a new node into? I have my buckets simply stored in an array, and need a method like so: Bucket[] buckets; //array with 160 items public Bucket GetBucket(Int160 myId, Int160 otherId) { //some stuff goes here } The obvious approach is to work down from the most significant bit, comparing bit by bit until I find a difference, I'm hoping there is a better approach based around clever bit twiddling. Practical note: My Int160 is stored in a byte array with 20 items, solutions which work well with that kind of structure will be preferred.

    Read the article

  • Can't Reorder a UITableViewCell into _some_ empty sections of a UITableView

    - by Jeremy Lightsmith
    If I have a UITableView in edit mode, w/ reordering turned on, it seems I can't move some (but not all) cells into some (but not all) empty sections. For example, if I have this layout : Section 1 apple banana Section 2 doberman Section 3 Section 4 Then I can move 'doberman' into any slot in section 1 (except after 'banana'), but I can't move it into section 3 or 4 at all. On the other hand, I can move 'apple' & 'banana' into section section 2 (except after 'doberman'), and I CAN move it into section 3, but NOT into section 4. What gives? this seems like buggy behavior. How do people work around it? Is apple aware of this bug?

    Read the article

  • ASP.NET Page Unauthorization for common pages

    - by Mahesh
    Hi I am developing a web application which has form based authentication. All pages needs to be authenticated except AboutUs and ContactUs pages. I configured everything correct except AboutUs and ContactUs pages. Since I am denying all users in authorization section, application is redirecting even if the customer browse AboutUs and ContactUs pages. Configuration Rules <authentication mode= "Forms"> <forms name=".ASPXAUTH" loginUrl="Login.aspx" timeout="20" protection="All" slidingExpiration="true" /> </authentication> <authorization> <deny users="?" /> </authorization> Could you please let me know how can I tell asp.net to remove these pages for authorization?? Thanks, Mahesh

    Read the article

  • codemirror fails when adding </textarea> tag inside it

    - by Jorre
    I'm using codemirror http://marijn.haverbeke.nl/codemirror/ to let users create their own web templates inside a web application. Codemirror works great, except for the time that users have put a tag inside their source code. When I load that up inside code mirror, it breaks everything in the source code that follows after because it thinks my codemirror text area is closed. I'm using the following way to launch codemirror: CodeMirror.fromTextArea('code') It works great on my existing textarea "code" except when users add inside their templates (in the codemirror textarea). Any help is much appreciated!

    Read the article

  • Why connection in Python's DB-API does not have "begin" operation?

    - by newtover
    Working with cursors in mysql-python I used to call "BEGIN;", "COMMIT;", and "ROLLBACK;" explicitly as follows: try: cursor.execute("BEGIN;") # some statements cursor.execute("COMMIT;") except: cursor.execute("ROLLBACK;") then, I found out that the underlying connection object has the corresponding methods: try: cursor.connection.begin() # some statements cursor.connection.commit() except: cursor.connection.rollback() Inspecting the DB-API PEP I found out that it does not mention the begin() method for the connection object, even for the extensions. Mysql-python, by the way, throws the Deprecation Warning, when you use the method. sqlite3.connection, for example, does not have the methd at all. And the question is why there is no such method in the PEP? Is the statement somehow optional, is it enough to invoke commit() instead?

    Read the article

  • Django database caching

    - by hekevintran
    I have a Django form that uses an integer field to lookup a model object by its primary key. The form has a save() method that uses the model object referred to by the integer field. The model's manager's get() method is called twice, once in the clean method and once in the save() method: class MyForm(forms.Form): id_a = fields.IntegerField() def clean_id_a(user_id): id_a = self.cleaned_data['id_a'] try: # here is the first call to get MyModel.objects.get(id=id_a) except User.DoesNotExist: raise ValidationError('Object does not exist') def save(self): id_a = self.cleaned_data['id_a'] # here is the second call to get my_model_object = MyModel.objects.get(id=id_a) # do other stuff I wasn't sure whether this hits the database two times or one time so I returned the object itself in the clean method so that I could avoid a second get() call. Does calling get() hit the database two times? Or is the object cached in the thread? class MyForm(forms.Form): id_a = fields.IntegerField() def clean_id_a(user_id): id_a = self.cleaned_data['id_a'] try: # here is my workaround return MyModel.objects.get(id=id_a) except User.DoesNotExist: raise ValidationError('Object does not exist') def save(self): # looking up the cleaned value returns the model object my_model_object = self.cleaned_data['id_a'] # do other stuff

    Read the article

  • Draw text on a loaded pdf file with Zend Framework

    - by Rick de Graaf
    Hello, I'm trying to load a existing pdf file, and fill this with database information. Loading the file and everything is working, except for writing data to the loaded page. It doesn't write text to the loaded page. If I add a new page en use a foreach to apply drawing to all pages, all added pages are written, except for the loaded one. Below is the code I'm using: $pdf = Zend_Pdf::load('./documents/agreements/_root/gegevens.pdf'); // Load pdf $pdf->pages = array_reverse($pdf->pages); // reverse pages $pdf->pages[] = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); // Add a page (A4) $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); // Set font foreach($pdf->pages as $page) // Apply settings+text to every page (total of 2) { $page->setFont($font, 36); $page->setAlpha(0.25); $page->drawText('LALALALALALALA', 62, 260, 'UTF-8'); } $pdf->save('./documents/agreements/Gegevens_'.$this->school_id.'.pdf'); // Save file

    Read the article

  • Why does DataInputStream not support integers?

    - by Jason
    I need to read in a list of numbers from a file, none of which are larger than 32767. Originally I was going to use the Scanner class to pull in the data, then I read about DataInputStream. This would work well for me, except that according to the API, it supports all primitive variables EXCEPT ints! Listed are longs, shorts, bytes, chars, booleans, ect, but no ints. I have no need for double precision from the incoming data. Is this a deliberate or unintentional oversight?

    Read the article

  • Difficulty adding widgets to django form.

    - by codingJoe
    I have a django app that tracks activities that can benefit a classroom. Using the django examples, I was able to build a form to enter this data. But when I try to add widgets to that form, things get tricky. What I want is a calendar widget that lets the user enter the 'activity_date' field using a widget. If I use Admin interface. The AdminDateWidget works fine. however. This particular user isn't allowed access to the admin interface so I need a different way to present this widget. Also I couldn't figure out how to make the bring the admin widget over into non-admin pages. So I tried a custom widget. This is the first custom widget I've built, so I'm not quite sure what is supposed to be going on here. Any Expert Advice? How do I get my date widget to work? # The Model class Activity(models.Model): activity_date = models.DateField() activity_type = models.CharField(max_length=50, choices=ACTIVITY_TYPES) activity_description = models.CharField(max_length=200) activity_duration= models.DecimalField(decimal_places=2, max_digits=4) est_attendance = models.IntegerField("Estimated attendance") # The Form class ActivityForm(forms.ModelForm): # The following line causes lockup if enabled. # With the DateTimeWidget removed, the form functions correctly except that there is no widget. #activity_date = forms.DateField(label=_('Date'), widget=DateTimeWidget) ##!!! Point of Error !!! class Meta: model = Activity fields = ('activity_date', 'activity_type', 'activity_description', 'activity_duration', 'est_attendance') def __init__(self, *args, **kwargs): super(ActivityForm, self).__init__(*args, **kwargs) instance = getattr(self, 'instance', None) edit_aid = kwargs.get('edit_aid', False) # On a different approach, the following also didn't work. #self.fields['activity_date'].widget = widgets.AdminDateWidget() # The Widget # Example referenced: http://djangosnippets.org/snippets/391/ calbtn = u""" <button id="calendar-trigger">...</button> <img src="%s/site_media/images/icon_calendar.gif" alt="calendar" id="%s_btn" style="cursor: pointer; border: 1px solid #8888aa;" title="Select date and time" onmouseover="this.style.background='#444444';" onmouseout="this.style.background=''" /> <script type="text/javascript"> Calendar.setup({ trigger : "calendar-trigger", inputField : "%s" }); </script>""" class DateTimeWidget(forms.widgets.TextInput): dformat = '%Y-%m-%d %H:%M' def render(self, name, value, attrs=None): print "DTWgt render name=%s, value=%s" % name, value if value is None: value = '' final_attrs = self.build_attrs(attrs, type=self.input_type, name=name) if value != '': try: final_attrs['value'] = \ force_unicode(value.strftime(self.dformat)) except: final_attrs['value'] = \ force_unicode(value) if not final_attrs.has_key('id'): final_attrs['id'] = u'%s_id' % (name) id = final_attrs['id'] jsdformat = self.dformat #.replace('%', '%%') cal = calbtn % (settings.MEDIA_URL, id, id, jsdformat, id) a = u'<input%s />%s' % (forms.util.flatatt(final_attrs), cal) print "render return %s " % a return mark_safe(a) def value_from_datadict(self, data, files, name): print "DTWgt value_from_datadict" dtf = forms.fields.DEFAULT_DATETIME_INPUT_FORMATS empty_values = forms.fields.EMPTY_VALUES value = data.get(name, None) if value in empty_values: return None if isinstance(value, datetime.datetime): return value if isinstance(value, datetime.date): return datetime.datetime(value.year, value.month, value.day) for format in dtf: try: return datetime.datetime(*time.strptime(value, format)[:6]) except ValueError: continue return None

    Read the article

  • Programming issue while applying text to the third party control.

    - by srivatsa
    Hello I have used some third party controls in my windows application. There is a snippet which is being used in our code which re-initializes all the .text property of all the controls on the form. Everything works fine except for a control. This control is similar to the Windows Panel except for it has a dropdown appearance. This control has .Caption property instead of .Text property associated to it. This causes the problem whenever i use such codes foreach (Control oControl in this.Controls) { if (oControl is DropDownPanel) { { oControl.Text = rm_ResourceManager.GetString(oControl.Name + ".Text"); } } } The text is not set here for the DropDownPanel control in the above method. Since .Text is not available for DropDownPanel control. I cannot do the following either .. ((DropDownPanel)oControl).Caption = rm_ResourceManager.GetString(oControl.Name + ".Text"); Cos it shall throw exception if i try to cast oControl with that of DropDownPanel Any ideas how can i overcome such a condition. Regards

    Read the article

  • Does Adorner breaks MVVM?

    - by Padu Merloti
    I'm developing a WPF app using MVVM. Most of my views have only xaml markup and nothing (except default boilerplate) on code behind. All except one view that I use adorners to "blacken" the screen when I want to make the whole screen disabled. private void Window_Loaded(object sender, RoutedEventArgs e) { //todo: transfer to modelview contentAreaAdorner = AdornerLayer.GetAdornerLayer(contentArea); waitingAdorner = new WaitingAdorner(contentArea); } Is that ok? Or is there a better way to implement this in my viewmodel?

    Read the article

  • How should I re-raise a Delphi exception after logging it?

    - by Nik
    Do you know a way to trap, log, and re-raise exception in Delphi code? A simple example: procedure TForm3.Button1Click(Sender: TObject); begin try raise Exception.Create('Bum'); except on E: Exception do begin MyHandleException(E); end; end; end; procedure TForm3.MyHandleException(AException: Exception); begin ShowMessage(AException.Message); LogThis(AException.Message); // raise AException; - this will access violate end; So I need to re-raise it in the except block but I was wondering if there is a better way to write my own method to handle and (on specific conditions) to re-raise exceptions.

    Read the article

  • Problem with superfish submenu being trimmed by content in Firefox

    - by da5id
    Greetings, I have a problem which would seem to involve some kind of z-index issue, but for a change it's in everything except IE. If you take a look at http://cougar.motivo.com.au/ in anything except Internet Explorer and hover over the last menu item "Contact Us" you can se what I'm referring to. Basically the supersub menu appears to be being trimmed by the width of the element below it. You can see via the source that I've tried setting z-indexes & position:relative, but at this point I'm stumped. Any and all input would be gratefully received :) P.S. I am aware that there are still a couple of issues in IE6. I am yet to have the pleasure of addressing those (groans).

    Read the article

  • How to find duplicate values in SQL Server

    - by hgulyan
    Hi, I'm using SQL Server 2008. I have a table Customers customer_number int field1 varchar field2 varchar field3 varchar field4 varchar ... and a lot more columns, that doesn't matter for my queries. Column *customer_number* is pk. I'm trying to find duplicate values and some differences between them. Please, help me to find all rows that have same 1) field1, field2, field3, field4 2) only 3 columns are equal and one of them isn't (except rows from list 1) 3) only 2 columns equal and two of them aren't (except rows from list 1 and list 2) In the end, I'll have 3 tables with this results and additional groupId, which will be same for a group of similars (For example, for 3 column equals, rows that have 3 same columns equal will be a seperate group) Thank you.

    Read the article

  • Trying to catch integrity error with sqlaclhemey

    - by Lostsoul
    I'm having problems with trying to catch a error. I'm using pyramid/sqlalchemy and made a sign up form with email as the primary key. The problem is when a duplicate email is entered it raises a IntegrityError, so I'm trying to catch that error and provide a message but no matter what I do I can't catch it(the error keeps appearing). try: new_user = Users(email, firstname, lastname, password) DBSession.add(new_user) return HTTPFound(location = request.route_url('new')) except IntegrityError: message1 = "Yikes! Your email already exists in our system. Did you forget your password?" I get the same message when I tried except exc.SQLAlchemyError (although I want to catch specific errors and not a blanket catch all). Is there something wrong with my python syntax? or is there something I need to do special in sqlalchemy to catch it?

    Read the article

  • python: problem with dictionary get method default value

    - by goutham
    I'm having a new problem here .. CODE 1: try: urlParams += "%s=%s&"%(val['name'], data.get(val['name'], serverInfo_D.get(val['name']))) except KeyError: print "expected parameter not provided - "+val["name"]+" is missing" exit(0) CODE 2: try: urlParams += "%s=%s&"%(val['name'], data.get(val['name'], serverInfo_D[val['name']])) except KeyError: print "expected parameter not provided - "+val["name"]+" is missing" exit(0) see the diffrence in serverInfo_D[val['name']] & serverInfo_D.get(val['name']) code 2 fails but code 1 works the data serverInfo_D:{'user': 'usr', 'pass': 'pass'} data: {'par1': 9995, 'extraparam1': 22} val: {'par1','user','pass','extraparam1'} exception are raised for for data dict .. and all code in for loop which iterates over val

    Read the article

  • using different key for to_json :methods

    - by fphilipe
    When using :methods in to_json, is there a way to rename the key? I'm trying to replace the real id with a base62 version of it and I want that the value of base62_id has the key id. @obj.to_json( :except => :id :methods => :base62_id ) I tried to do @obj.to_json( :except => :id :methods => { :id => :base62_id } ) but that didn't work. Any advice?

    Read the article

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