tagging

Rails HABTM fields_for – check if record with same name already exists

大兔子大兔子 提交于 2019-12-24 16:29:52
问题 I have a HABTM-relation between the models "Snippets" and "Tags". Currently, when i save a snippet with a few tags, every tag is saved as a new record. Now i want to check if a tag with the same name already exists and if that´s the case, i don´t want a new record, only an entry in snippets_tags to the existing record. How can i do this? snippet.rb: class Snippet < ActiveRecord::Base accepts_nested_attributes_for :tags, :allow_destroy => true, :reject_if => lambda { |a| a.values.all?(&:blank?

How to get common tag pattern for sentences list in python with NLTK

杀马特。学长 韩版系。学妹 提交于 2019-12-24 12:25:51
问题 Here I have a list of sentences.With NLTK I can tag the sentence and get the tag pattern of that sentences. So as like this I can get the tag patterns for the whole list.But what I wanted is to identify the common tag patterns which most sentences get matched.For example: What is encapsulation tag pattern : {<WP><VBZ><NN>} How was your wedding tag pattern : {<WRB><VBD><PRP$><NN>} What is your plan today tag pattern : {<WP><VBZ><PRP$><NN><NN>} So the common tag pattern(Combining regexp tagger)

How do I enable arrow navigation on keyboard for a list of Div using jQuery

喜欢而已 提交于 2019-12-24 02:59:15
问题 I am following a tutorial [here][1] to make a Facebook like friend tagging system. But the tutorial lacks the "arrow navigating" capability like Facebook. I would like to figure out how to achieve this. Basically, when I input text on the contenteditable area, it will generate divs of suggested friends like the following: <div class="display_box"> <img src="user_img/John.jpg"> <a href="#" class="addname" title="John">John</a><br> <span>India</span> </div> <div class="display_box"> <img src=

Tagging from Scratch: the Tag Cloud Issue

孤街醉人 提交于 2019-12-23 16:40:20
问题 I'm following the instructions from http://railscasts.com/episodes/382-tagging and building a Tag System from Scratch. Everything are working great but not the tag_cloud helper. It raises database error while searching for tag_counts. Following scope: #Picture.rb class Picture < ActiveRecord::Base attr_accessible :description, :title, :tag_list has_many :taggings has_many :tags, through: :taggings #Because of the following I'm getting an error from the Posgresql (showed in "Database Error")

Facebook javascript photo upload+tagging API changed last night (2012 Sept.12th)?

时光怂恿深爱的人放手 提交于 2019-12-23 15:54:24
问题 I'm using the Javascript SDK and wanted to upload an image and tag friends at the same time. Yesterday I got everything working, uploading an image and specifying tags for 9 friends, but when I tried it again today it was broken, the image would still upload and I also get an id and post_id in the response, but tags wouldn't be added anymore. I stripped out all of the unnecessary code and boiled it down to the very basics (see below), without success. However making a second call to /photoId

MySQL tagging question: how to select an item that has been tagged as X, Y, and Z?

我的梦境 提交于 2019-12-22 09:55:36
问题 I'm dealing with a database where items are "tagged" a certain number of times. item (100k rows) id name other stuff tag (10k rows) id name item2tag (1,000,000 rows) item_id tag_id count I'm looking for the fastest solution to: Select items that have been tagged as X, Y, and Z (where X, Y, and Z correspond to (possibly) tag names) ? Here's what I have so far... I'd just like to make sure I'm doing it in the best way possible: First get the tag_ids from the names: SELECT tag.id WHERE name IN (

Auto Categorization of Content

孤街浪徒 提交于 2019-12-22 09:55:17
问题 I'm developing a script that extracts the messages from the message archive of a particular meetup.com group of which I'm a member - http://www.meetup.com/opencoffee/messages/archive/ The idea is to dynamically add these to a wordpress site and allow people to search messages, auto tag messages etc. The issue I have is how best to auto categorize these messages. I would welcome any thoughts and ideas of how best to go about this and what would be the most efficient way of programming this.

asp.net mvc - implementing an “autocomplete” tags selection for a blog?

∥☆過路亽.° 提交于 2019-12-21 05:14:17
问题 I'm working on a blog system for my own use, and would like to implement an auto-complete tags selection (similar to stackoverflow), how would I implement something like this? Any example or links to a tutorial would be greatly appreciated. Thanks. 回答1: See my question here Jquery, Autocomplete using json, id's vs display values We actually "borrowed" (read copy and pasted) SO's autocomplete javascript and then tweaked it slightly - such as renaming it so it won't interfere with jquery ui's

Project Organization using Maven + Git

风格不统一 提交于 2019-12-21 04:24:11
问题 Our team is currently in the process of moving from SVN to Git. We currently use Maven as our build tool. Currently our projects have a build hierarchy through Maven, but are flat on the file hierarchy/repository side. My goal is to more closely match the Maven build hierarchy and the file structure hierarchy in our repositories in order to make everything easier to understand. My question is what is the proper level to create Git repos so that the file hierarchy/organization is maintained?

How to mention users with “@” in app like Instagram

旧时模样 提交于 2019-12-20 10:57:12
问题 I am creating an app that has photo sharing, and I am trying to add in the functionality to mention (or tag) users. Twitter is what originally starting using "@" with a username to tag users but now everything from Facebook to Instagram is using it. Is this something that is implemented on the iOS side or in the back end? I am currently programming the back end in Django, but for some reason I think this would be accomplished on the iOS end. There is surprisingly very little information out