Daily Archives

Articles indexed Tuesday April 13 2010

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

  • Unique Constraint At Data Level in GAE

    - by Ngu Soon Hui
    It seems that the unique constraint is not natively supported in GAE, although one can enforce unique check before putting an object to store. But that was in January 2009, what about now? Can I specify unique constraint on a column during schema creation? i.e. class Account(db.Model): name = db.StringProperty() email = db.StringProperty() as unique # something like this @classmethod def create(cls, name, email): a = Account(name=name, email=email) a.put() return a

    Read the article

  • How do I go about embedding a youtube chromeless player without adding controls?

    - by ndthl
    I am creating an online experiment. It involves participants watching a video then answering a questionnaire. I would like to embed a chromeless youtube video which plays automatically on page load, does not have controls for participants to play around with, and loads the next page once the video finishes. Now the autoplay/forward to next page functions are secondary and I'm not too concerned if I can't get them working. However I am very interested in how to embed a chromeless player. I have gone to the google playground but this code already has the controls attached. I am not very experienced at coding so I do not know what to remove from the code for none of the custom controls on the left to be displayed. Is anyone able to help me? Thanks, Wil

    Read the article

  • product suggestion based on user data

    - by Enkay
    I'm trying to add suggestions to product pages along the lines of : "Customers who purchased this item also purchased x and y". The way the data is compiled right now is a mysql table with 3 rows. PRODUCT | CUSTOMER |QUANTITY Product is the product ID. Customer is the customer ID. Quantity is the number of time that product was bought by that customer. For each product description page, the system needs to figure out which users bought that product, what other products those users bought, in what quantity and then return the 2 products that were bought the most by people who bought the current product. Hopefully this makes sense and someone can point me in the right directions as to what the mysql query should look like. Thanks.

    Read the article

  • How to make emacs stay in the current directory

    - by Mad Wombat
    When I start working on a project in emacs, I use M-x cd to get into the project root directory. But every time I use C-x C-f to open a file in one of the subdirectories (like app/model/Store.rb) emacs changes current directory to that of the file. Is there a way to make emacs stay at the root?

    Read the article

  • Be Lucrative Using Search Engine Optimization (SEO)

    Another way to make money online is through Search Engine Optimization (SEO). This technique influences different search engines such as Google, Yahoo, Bing and Live. This is usually done to help generate traffic into their websites equating to potential profit. The SEO technique has helped many into their success online. There are many contributing factors that influence your ranking in Google, but I will not discuss that here as there are far too many to rank.

    Read the article

  • Boost Targeted Traffic and Online Sales Leads by Spring Cleaning Your Website

    Spring is here - so this is a great time to do some important housekeeping on your website. This type of house cleaning will help attract more visitors to your online home, which allows you to present your line of products and/or services to an increasingly larger targeted audience. Here are several key areas to focus on in your site cleaning: keyword strategy, web page content, on-page elements (besides copy) and off-page elements. This article shares easy-to-understand tips on exactly what to do - and how it will benefit your site!

    Read the article

  • List of fonts installed by default in versions of Windows?

    - by Ricket
    I've been seeing more and more websites using fancy antialiased fonts. Every time I hit one, I think to myself "hmm, what web-safe font is that?" - but after looking at the CSS I typically find some font name in quotes, like "Palatino Linotype". Obviously not web-safe, but according to the Wikipedia article, "Palatino Linotype is shipped with Windows 2000 or later, and Microsoft Office Professional Edition 2003." So that covers what, 95% of users that might visit your website? And thanks to the power of CSS, the website can fallback to a similar generic font typename such as 'serif' for non-Windows users with a line like this: font: 16px/20px "Palatino Linotype", serif; Awesome! I want to start using fancy fonts! Is there a set of lists out there, of the fonts that are preinstalled by default in Windows 98, 2000, NT, ME, XP, 2003, etc., and maybe for the Mac OSX versions and various Linux distributions as well? It would be a great reference for picking web font faces! (if not, someone should compile it!) I had never before heard of Palatino Linotype and I want to know what other fonts have existed since old Windows versions that I've never known about!

    Read the article

  • wx Python is not properly drawing customtree items

    - by uberjumper
    Hi, I am currently using wx.CustomTree, to use to display a series of configuration settings. I generally fill them with wx.TextCtrl / wx.Combobox, to allow the user to edit / enter stuff. Here is my code: class ConfigTree(CT.CustomTreeCtrl): """ Holds all non gui drawing panel stuff """ def __init__(self, parent): CT.CustomTreeCtrl.__init__(self, parent, id = common.ID_CONTROL_SETTINGS, style = wx.TR_DEFAULT_STYLE | wx.TR_HAS_BUTTONS | wx.TR_HAS_VARIABLE_ROW_HEIGHT | wx.TR_SINGLE) #self.HideWindows() #self.RefreshSubtree(self.root) self.population_size_ctrl = None self.SetSizeHints(350, common.FRAME_SIZE[1]) self.root = self.AddRoot("Configuration Settings") child = self.AppendItem(self.root, "Foo", wnd=wx.TextCtrl(self, wx.ID_ANY, "Lots Of Muffins")) The problem is, any children nodes, the data for these nodes is not filled in. When i basically expand the configuration settings tree node. I see the "Foo" node, however the textbox is empty. This is the same for both text node, Until i actually click on the child node. I've looked tried every form of update / etc. Does anyone have any ideas?

    Read the article

  • Embedding binary blobs using gcc mingw

    - by myforwik
    I am trying to embed binary blobs into an exe file. I am using mingw gcc. I make the object file like this: ld -r -b binary -o binary.o input.txt I then look objdump output to get the symbols: objdump -x binary.o And it gives symbols named: _binary_input_txt_start _binary_input_txt_end _binary_input_txt_size I then try and access them in my C program: #include <stdlib.h> #include <stdio.h> extern char _binary_input_txt_start[]; int main (int argc, char *argv[]) { char *p; p = _binary_input_txt_start; return 0; } Then I compile like this: gcc -o test.exe test.c binary.o But I always get: undefined reference to _binary_input_txt_start Does anyone know what I am doing wrong?

    Read the article

  • python regular expression for domain names

    - by user230911
    I am trying use the following regression to extract domain name from a text, but it just produce nothing, what's wrong with it? I don't know if this is suitable to ask this "fix code" question, maybe I should read more. I just want to save some time. Thanks pat_url = re.compile(r''' (?:https?://)* (?:[\w]+[\-\w]+[.])* (?P<domain>[\w\-]*[\w.](com|net)([.](cn|jp|us))*[/]*) ''') print re.findall(pat_url,"http://www.google.com/abcde") I want the output to be google.com

    Read the article

  • how to write a function to output unconstant loop with PHP

    - by tunpishuang
    here is the function description test($argv) $argv is an array , for example $argv=array($from1,$to1,$from2,$to2.....); array items must be even. $argv=array(1,2,4,5) : this will output values like below: 1_4 1_5 2_4 2_5 the number of arrray $argv's is not constant. maybe 3 or 4 levels of loop will be outputed. i know this will used RECURSIVE , but i don't know exatly how to code.

    Read the article

  • Code Contracts: Do we have to specify Contract.Requires(...) statements redundantly in delegating me

    - by herzmeister der welten
    I'm intending to use the new .NET 4 Code Contracts feature for future development. This made me wonder if we have to specify equivalent Contract.Requires(...) statements redundantly in a chain of methods. I think a code example is worth a thousand words: public bool CrushGodzilla(string weapon, int velocity) { Contract.Requires(weapon != null); // long code return false; } public bool CrushGodzilla(string weapon) { Contract.Requires(weapon != null); // specify contract requirement here // as well??? return this.CrushGodzilla(weapon, int.MaxValue); } For runtime checking it doesn't matter much, as we will eventually always hit the requirement check, and we will get an error if it fails. However, is it considered bad practice when we don't specify the contract requirement here in the second overload again? Also, there will be the feature of compile time checking, and possibly also design time checking of code contracts. It seems it's not yet available for C# in Visual Studio 2010, but I think there are some languages like Spec# that already do. These engines will probably give us hints when we write code to call such a method and our argument currently can or will be null. So I wonder if these engines will always analyze a call stack until they find a method with a contract that is currently not satisfied? Furthermore, here I learned about the difference between Contract.Requires(...) and Contract.Assume(...). I suppose that difference is also to consider in the context of this question then?

    Read the article

  • Alternatives to connect to ORACLE database server without install the Oracle client.

    - by Salvador
    i am looking for an Delphi component to connect to an ORACLE database server in an direct way without install the oracle client. i knew the Oracle Data Access (ODAC) from DevArt. there are any other component with this capability? ODAC offers two connection modes to the Oracle server: connection through the Oracle Call Interface in Client mode and direct connection over TCP/IP in Direct mode. ODAC-based database applications are easy to deploy, do not require installation of other data provider layers. Thanks in advance.

    Read the article

  • Tutuorial for Quick Look Generator for Mac

    - by vgm64
    I've checked out Apple's Quick Look Programming Guide: Introduction to Quick Look page in the Mac Dev Center, but as a more of a science programmer rather than an Apple programmer, it is a little over my head (but I could get through it in a weekend if I bash my head against it long enough). Does anyone know of a good basic Quick Look Generators tutorial that is simple enough for someone with only very modest experience with Xcode? For those that are curious, I have a filetype called .evt that has an xml header and then binary info after the header. I'm trying to write a generator to display the xml header. There's no application bundle that it belongs to. Thanks!

    Read the article

  • What is .NET verifiable code?

    - by smwikipedia
    When I read about .NET type safty, I get to know the verifiable code. I want to see what an un-verifiable code looks like? Could someone give me an example? This should help me better understand the intention of code verification. Thanks in advance.

    Read the article

  • Retrieve click() handler in jQuery for later use

    - by Xiong Chiamiov
    I'm using the jQuery tablesorter plugin to sort a table, which assigns .click() handlers to the <th>s in the table. Since my table has alternating colors for each column, I've built a simple fix_table_colors(identifier) function that does as it should when I call it manually using Firebug. I would like, however, to have that automatically called after a sort. To do this, I decided to retrieve the .click() handler from the <th>s, and assign a new handler that simply calls the previous handler, followed by fix_table_colors(). (This SO question is similar, but uses standard onClick() attributes, which won't work here.) From the accepted answer to this question, I have created the following code: $(document).ready(function() { $("table.torrents").tablesorter({ debug: true, headers: { 1: { sorter: 'name' }, 2: { sorter: 'peers' }, 3: { sorter: 'filesize' }, 4: { sorter: 'filesize' }, 5: { sorter: 'filesize' }, 6: { sorter: 'ratio' } } }); $('table.torrents thead th').each(function() { var th = $(this); var clickHandler = th.data('events').click[0]; th.click(function() { clickHandler(); fix_table_colors('table.torrents'); }); }); }); While this is conceptually correct, clickHandler doesn't appear to actually be a function, and so I cannot call it. With a bit more digging in Firebug, I found that click[3] appears to hold the function I'm looking for (and click[10] my new one). I get an 'e is undefined' error on line 2 of tablesorter.min.js when using that, though. Am I even going down the right path? I have a feeling that with what I've found so far, I can make this work, but it's going to be much uglier than I would expect it needs to be.

    Read the article

  • Add new item to UITableView and Core Data as data source?

    - by David.Chu.ca
    I have trouble to add new item to my table view with core data. Here is the brief logic in my codes. In my ViewController class, I have a button to trigle the edit mode: - (void) toggleEditing { UITableView *tv = (UITableView *)self.view; if (isEdit) // class level flag for editing { self.newEntity = [NSEntityDescription insertNewObjectForEntityName:@"entity1" inManagedObjectContext:managedObjectContext]; NSArray *insertIndexPaths = [NSArray arrayWithObjects: [NSInextPath indexPathForRow:0 inSection:0], nil]; // empty at beginning so hard code numbers here. [tv insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationFade]; [self.tableView setEditing:YES animated:YES]; // enable editing mode } else { ...} } In this block of codes, I added a new item to my current managed object context first, and then I added a new row to my tv. I think that both the number of objects in my data source or context and the number of rows in my table view should be 1. However, I got an exception in the event of tabView:numberOfRowsInSection: Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (0), plus or minus the number of rows inserted or deleted from that section (1 inserted, 0 deleted). The exception was raised right after the delegate event: - (NSInteger) tableView:(UITableView *) tableView numberOfRawsInSection:(NSInteger) section { // fetchedResultsController is class member var NSFetchedResultsController id <NSFechedResultsSectionInfo> sectionInfo = [[fetchedResultsController sections] objectAtIndex: section]; NSInteger rows = [sectionInfo numberOfObjects]; return rows; } In debug mode, I found that the rows was still 0 and the event invoked after the the even of toggleEditing. It looks like that sectionInfo obtained from fetchedResultsController did not include the new entity object inserted. Not sure if I miss anything or steps? I am not sure how it works: to get the fetcedResultsController notified or reflect the change when a new entity is inserted into the current managed object context?

    Read the article

  • Getting mydomain.com/subdomain to resolve to subdomain.mydomain.com

    - by Donald Jenkins
    I have content on subdomain1.mydomain.com which can't reside on mydomain.com/subdomain1. Nevertheless, all my other content resides in folders of the mydomain.com/subdomain* type. For the sake of consistency, I'd like the content actually located at subdomain1.mydomain.com to appear as if it were on mydomain.com/subdomain1 — Is there any way, using .htaccess, that I can achieve this, bearing in mind that: (1) the subdomain itself also has a nested permalink structure, meaning that there are additional folders in the directory structure of the subdomain; (2) I want the browser to display the address as mydomain/subdomain1 after the redirect.

    Read the article

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