Posts

Showing posts from April, 2015

bash - Best tool in unix for viewing large files -

I am a newbie in UNIX using problem me seeing the large log file in Unix using vi Have to face. Can you please recommend the best tools for fast viewing of large files on Unix? Additionally, can you post your way of viewing large files on Unix? less is not required to keep the whole file in memory, so it is huge Good for viewing files. But for log files, line wrapping is a nuisance.

parsing - Instrumenting JavaScript -

I want to write a JavaScript code for the "log" value of the global variable. For example, I want to know all the values ​​that a special variable foo was during execution. Logging is not a problem. What would be the easiest way to implement it? I was thinking of using Mozilla to create and modify this AST (Javascript implementation in Java) by Mozilla. If you are not limited to Rhino / Java, then to the Spidermanky / Trasomunky translator in the journal Ruby Mani Ruby Integrates this access to AST. I have not tried to modify the AST; Not sure if this is possible (it can be seen, but identify with the name in the code). Github at Johnson Reporo of Johnny Gabornet (Switch ID; Stackoverflow does not want to link me at this point ...) I recently added Tracemoney support and it has not yet integrated into the master source is. This is in Github me at the Johnson Repo (smparkes).

porting template to zend framework -

I have some problems using a pay-based form to zip the form. Currents Things I've Used To be presented as a pear. I can not explicitly use pre-existing decoration because I need to specify the CSS class for each component of my basic elements. To see this issue I have to present it, which is a template for a basic element: So you can see that I have many dynamic things that I would like to be able to specify: the status in the form, the class for the label, the class for the required section, for the square Error. I would like to be able to specify it from an ini file. I manage to set the original meta from ini, but not the custom field. One reason I can not use the original decor is that I need to have an "error" in the "li" class element or an error in subtype I'm not sure that this error is possible with decorator ... (correct me if I'm wrong) Besides, for the group I need to deal with some errors, and since the main g...

c# - SQL Server Compact Edition with Entity Framework -

I try to use SQL Server Compact Edition with Unit Framework in Visual Studio 2008 SP1 What I Do Here : 1) I create a new project, console application. 2) I right-click on the project, choose Add-> New Item. / P> 3) I choose to add a local database named "Something.sdf" 4) In the next page of the "Add new item" wizard, I get the default Dataset name (SomethingDataSet ) Now, in the server explorer, the new database is shown under Something.sdf data connection. 5) I click on the project again, and choose Add-> New item. 6) I want to create a model from the database, in the next page of the wizard, the default name, model 1. amx 7), an ADO unit data model. Now it asks me "Which of your data connections will you use to connect to the database?". In this dialogue, I can choose between using a pre-built data connection, or creating a new connection. The drop down is empty with pre-built data connections (I have some of my SDF here?) Wh...

c# - How to determine which code in a project/solution is the most often used? -

If I have a current solution that has many C # projects, then there are no static analysis tools that let me determine Which code codes are the most used to help? I want to use this information to determine the information in which area should already be ramped to their test coverage I have already done some statistical analysis Have seen the tools, but they mostly concentrate on things such as complexity, coding conventions, code duplication etc. Alternatively, if not thanks! Edit: / Strong> To make it clear, the code I see is not the code coverage. I want a rundown, in which parts of my application are often used, so that I can focus on improving the coverage in those areas. I am trying to avoid writing tests for those areas which have no one yet, because they are not often executed in the side cases. Even a static analysis tool that tries to detect that in run-time What happens usually does not try to guess how many times the code is executed. The subject is...

asp.net wiki software which forces users to enter certain information? -

I would like to use an asp.net based wiki Although there is a need to have the capacity where a page is created or edited by the user, then some information should be in the page and should be in the same section (fixed) of the page. For example if I want to use a wiki to create a restaurant review site, I want to enter the restaurant, address, hours of operation and they are always in one place on the page. So that all pages are a standard format. Is there any wiki software that can handle it? Wiki should be open source so that I can amend (hopefully not much) I know that Scuturn is popular, can it handle my needs? (Do not select the list of only some ASP.NII wiki, what I want) If you do not want to use Scruttern, then I think you can use MediaWiki to run under ASP.net. It's open source, and easy to customize pages for a standard tracking.

Is there a Java API for Google's AJAX Search API -

Does anyone know a Java library that provides a structured interface for Google's AJAX Search API? I can only find the Java API for our old SOAP based interface. They do not have a specific API but how they interact with the service using the Java JSON library .

sql server - SQL - How to assign a record in a variable -

AIM: Convert an XML to XML and specify the result in a variable set the result : M000017690 324067342 324067349 324067355 324154449 Convert XML: & lt; Products & gt; & Lt; Product ProductId = "324067342" /> & Lt; Product ProductId = "324067349" /> & Lt; Product ProductId = "324067355" /> & Lt; Product Product ID = "324154449" /> & Lt; Product Product ID = "M000017690" /> & Lt; / Products & gt; The following query I used to convert the resultset (above) to XML: Select 1 AS tag, NULL AS Parent, NULL as [product! 1! Product Id], as the tap [product! 2! Product ID, template for @ Templation Union, as template 2, 1 ISI Original, Product ID, Product ID, XML Exhibit with XML Now let me give this XML to another stored procedure Which requires a parameter type: XML is the basic idea to create an XML type object: declaration @xml_data as XML and assign the result of ...

java - Buffered Reader HTTP POST -

Looking for some help, I have currently written an HTTP server, it currently handles the OK GET request. However, buffer reader seems hanging while using the post. When the request is stopped, the remaining input stream is read through the buffer reader. I have found a few things on Google. I have tried to change the CRLF and the protocol version from 1.1 to 1.0 (Browsers automatically request as 1.1) Any ideas or help would be appreciated. Thanks I agree with Swan that you should do a standard and thorough investigation The library should be used. However, if you are writing a server to learn about HTTP, then there is some information about what you want to do. You can not actually use a Buffer Reader because it buffers input and can read many bytes, because this is the reason that your code is hanging, bytes available on the buffer reader socket Trying to read (since POST is not the end of data), and it is waiting for more bytes (which will never be available) The proces...

mobile - image to barcode recognition -

I know that the stack overflow has been discussed sometime but I was not getting enough answers. For a project, I am searching for the best possible software / API / library which can recognize the barcode number from the input image. It will be used on mobile phones (iPhones, Windows Mobile, Android etc.), so it should be good to catch bad angles, fog images and barcodes with such bad conditions. Regardless of being open source or commercial, it does not matter because this works well (actually open source will be better :)) If you have any experience with this topic, please Share with us :) Thanks Google has an open Source Project is I am quite familiar with knowing that what it will do to do everything for you, but I think The front that it would be a great place for you.

dns - linux: adding hosts programmatically? -

Is there a way to add a programmable host to a local name resolver under Linux? I, rather example: add the name foo and wrap it in local port 127.1.2.3 Use the case: I have a locally accessed app through a web browser, I want to make this application accessible through a local URI. Add the name foo and local port 127.0.0.1: Tie 99 99 What do you want this? You can add foo 127.0.0.1 to your nameservers or equalize, but connections to foo on port 1234 will always go to 127.0.0.1:1234 - Port 9999 based on the name, which is lost in time. On Linux, add the IOP to the loopback device (i.e. Ip addr 127.1.2.3 Dev , and then 127.1.2.3:1234 to replace all the connections in 127.0. Use to go to 0.1: 99 99, but I can not tell with your question that if you want to see the observation behavior.

smtp - Setting up a no-reply email address with Google Apps -

The email of my domain has been established with Google Apps, and I am interested in sending automated emails (for example, When users register) with "/ no-reply@example.com" and / or with answer-per-field. I have a few questions about how this is done: Should I really set a user in Google Apps named "No-answer"? If a "answer-answer" user is not setting up, can I log in to a real address (for example: "support@example.com") Should do this and send the email with a "no-answer @ example" rather than "com" or should I use the reply-e-mail header? If the answer-answer header is required to use, then there is a way to block from the correct address (i.e.: Google's SMTP server used to log in User name)? Unless you have a actually Think about a good reason for this, I can suggest that you send @ support instead of answering your email @. The full reason for a support @ email address is to get comments and ...

c# - Partial Class Constructors -

Is there any other way of partial constructor that can not be defined or defamed? Actually my partial class constructor is defined: public partial class test {public test} {// do stuff}} After being named the class constructor likes to be able to insert additional code. In addition, is there a way of placing more than one file to inject additional code after the name of the constructor? supports the feature of C # They allow for the forwarding of the definition of a partial orbit Which can alternatively define the second part of the partial orbit. There are certain restrictions of partial methods: They can not accept the parameters, however they can accept the ref parameter They can not be either virtual or external and can not override or overwrite any other method ("new" keyword) Partial methods are vetted and contained Are private. It is not possible to partly apply two different parts of the partial orbit. Generally partial ways are genera...

visual studio - Finding what is different from VB(MSVisualStudio 2005) and VBA(Excel) -

I got the code online to do something like what I wanted to do, as always, I removed it in Visual Studio and That is not a problem. There is a problem with it when I try to lock it in Excel, it ends up to work as I think VBA is a water version of VB (this article Based on reading :) So, how did I know what went wrong between going between two programming environments? To give a bit more detail: I have a program in program studio that presses a button when I send an email to me then I tried to lock it into Excel as macro, but That does not work. EDIT: Notice of additional problem I have Visual Studio Public Class here in Form 1 Private sub button 1_Click (System.Object , ByVal as the system. Sender). Button handles 1. Click the CDO_Mail_Small_Text () end sub sub CDO_Mail_Small_Text () object object in the form of Dim IConf as the string string DM FFDS in the form of iMsg = CreateObject ("CDO.Message") iConf = CreateObject ("CDO.Configuration"). IConf...

css - JQuery: Creating boxed text that shows on top of a div on hover -

Suppose i have a div that is called maindie, and in & lt; P & gt; Something else can happen? Want to create?) When you hover over first and element, and you move your mouse over the first element Preferably, the text of the second element is enclosed in a black box, or something like Facebook photo page captions, for example. How can this be done? I'm thinking of adding a toggle function to the hover event, but I'm not sure how to do this, because I'm very new in JQuery. Also, to create a box for the element shown on the hover, Strong> Can provide some CSS (potentially half-transparent, possibly with an ambiguity of 60% or so)? Also, if it can be done with toggle (), then slow or fast (in the form of show (slow)) can be used with speed of animation ? Besides, I am thinking that a high order is necessary for this goal, but I'm not sure that the box will be displayed directly above, not with the side, or something like that. Not real...

linux - Google perftool cannot read file "libprofiler.so.0" -

I'm trying the Google Display Tool for CPU time profiling. However, I had some problem, which I could not read the shared library file "libprofiler.so.0" I had read the README of the Google Display Tool, there are 3 steps in the manual: Compile your program with -lprofiler . I did this part without any problem. Run my program's binary to create a profile result file. I failed in this step. When I try to run my binary, there is an error message: "Error while loading the shared library: libprofiler.so.0: can not open the shared object file: such a file or directory is not." . I Goga, Someone says that "libprofiler.so.0" is "/ usr / local / lib" , so I have copied the share The library files in the directory with my binary, and tried to run its binary, it still reports the same error message. I used Linux only for one year, please forgive me if my question is very stupid My machine's information: OS: Ubuntu 8...

c# - GZipStream and decompression -

मेरे पास कोड है जो संपीड़न करना चाहिए: FileStream fs = new FileStream (" G: \\ gj.txt ", FileMode.Open); फ़ाइल स्ट्रीम एफडी = नया फ़ाइलस्ट्रीम ("जी: \\ gj.zip", FileMode.Create); जीज़िपस्ट्रीम सीएसस्ट्रीम = नया जीज़िपस्ट्रीम (एफडी, संपीड़नमोड। कॉम्प्रेस); बाइट [] संकुचित बफर = नया बाइट [500]; इंट ऑफ़सेट = 0; Int nRead; NRead = fs.Read (संकुचित बफर, ऑफसेट, संपीड़ित बफर। लैंग); जबकि (nRead & gt; 0) {csStream.Write (संपीड़ित बफर, ऑफसेट, एनआरआईडी); Offset = offset + nRead; NRead = fs.Read (संकुचित बफर, ऑफसेट, संपीड़ित बफर। लैंग); } Fd.close (); fs.Close (); और मुझे लगता है कि यह करता है, लेकिन मैं जो उपरोक्त तरीके से संकुचित किया गया था उसको दबाव डालना चाहता हूँ। मैं इस तरह से कुछ करना: फ़ाइल स्ट्रीम fd = नया फ़ाइलस्ट्रीम ("जी: \\ gj.new", FileMode.Create); फ़ाइल स्ट्रीम एफएस = नया फ़ाइलस्ट्रीम ("जी: \\ gj.zip", FileMode.Open); जीज़िपस्ट्रीम सीएसस्ट्रीम = नया जीज़िपस्ट्रीम (एफएस, संपीड़नमोड। डीकंप्रेस); बाइट [] विघटित बफर = नया बाइट ...

javascript - Slow performance on asp.net website, where to start looking for the problem? -

I've developed a site using Asp.net C # 3.5 and now I think some pages are being loaded in the Sluubly Really. I need to start going through the website now and try to know how to make it so slow but I do not know where it starts, whether the problem is most likely ? A page that is too slow uses the following: asp.net c # 3.5 AjaxControlToolkit () Roundcoreors Extender CollapsiblePanelExtender Two different UpdatePanels 11 Connection MySQL Database (a very heavy, some Using unions and internal joints) Most connections to database results in popularizing formives or gridview, so completely I have 2 formviews and 6 g Duwu (each Gridwu can show up to 10 items) What slows a CSS file site? Using CSS file I have about 60 KB. Using AjaxControlToolkit can slow down the site? Is there a better way to use JavaScript on the site? I think it is impossible to help you find the problem at a slow pace, but when will you start searching for the problem? Data Controller? A...

FFMPEG: Set output res and bitrate depending upon input video -

I am processing user videos with different aspect ratios. It seems that FFMPEG only assigns you a certain resolution Allows to I want the output res to be suitable for input res. Similarly, I would like FFMPEG to set the input bitrate based on input video wisely: obviously it should not be bigger than the input. I can get the properties of a video, ffmpeg -i example.flv but output for it Some ugly parsing is required, so I'm wondering if there is a more direct feature in FFMPEG or some other tool. Actually, I have Youtube problem: it comes in nonsense, proper equal quality should come out. I know this is a very old question, but I want to add my 2 cents to its value I am First of all, try using ffmpeg to get information on video, try to use ugly output instead of ffprobe (bundle with ffmpeg) to get you good json output of info -print_format json Options like -pretty can add, which is very easy to parse. In addition, take a look at the following article: It sh...

c# - Is HttpClient from WCF REST Starter Kit Silverlight compatible? -

I know that in previous versions of the WCF REST starter kit, the HttpClient class is usable from Silverlight was not . Has this changed? I did not find anything of quick search, which gave a clear answer. No moment .. I have heard that they go to some blogs around the end of the year , But it was sometime ago. Marcus

Long, slow operation in Django view causes timeout. Any way for Python to speak AJAX instead? -

I was programming in a while, but in general, Django and web programming are new to me. I have a very long operation done in Python View. Since the local () function takes so long to return to my idea, an HTTP timed out is sufficiently reasonable, I understand that part. What is the best way to give an HTTPresponse back to my users immediately, then the results of some Python codes have been shown dynamically within the page? I suspect that the answer may be in AJAX, but I'm not sure that AJAX can be fed on the server by Python on the client, or even such modules can also be used to do this generally. Ajax does not require any special technology on the server side. You just need to give feedback in some forms, which can understand some javascript on the client side. JSON is an excellent choice, because it is made in Python (2.6 has a json library, and for other versions, there is django.utils.simplejson in the projector). So you just have to put your data into JS...

PHP MySQL inserting data to multiple tables -

I'm trying to create a experimental web application that reduces redundant data. I have three set of example tables Is: table id | Created (Unix timestamp). Updated_at (Unix timestamp) table two ID. Foreign key on a table. Title Table Three (Page) ID Foreign key content for both one table and two. Metadata It is being thought that all the things created in the app will be a generation / editing time. Many (but not all) things will be titled (for example, a page or a section for a page). Finally, some things will have specific characteristics themselves, for example content and metadata for one page. I am trying to prepare the best way to enter data in multiple tables. I know that I can do multiple insert queries from PHP, keep track of the rows created in the current transaction, and after removing those lines, the transaction should be part of after the failure, however, if the PHP script completely dies , Then it can be closed before all extinctions are completed....

php - Monitoring user tracking, statistics, and auditing for app -

I am trying to include user statistics in a site and have decided to take it in my user table: Go to the counter The last visit time At the time when the user registers / Li> Do I miss other statistics? Should I track every login time in a separate table too? Is it considered good auditing or too much? There are also other usage statistics which I thought the pages could be helpful as well as ideas. Do you recommend enforcing your own tracking or use a solution like Google Analytics (I think it will add a lot of external code to the site, so I thought it would be your own page view Applying tracking would be better) any thoughts on this? Deciding the extent of usage tracking on your website is ultimately personal decision is the long-term goals of your website / On. To consider some things: Is this data going by the web app owner to decide the future product? (Identifying the popularity of features, identifying high load sections of your site etc.) Is the...

Without using recursion how can a stack overflow exception be thrown? -

How can the stack overflow throw without using recursion? If you call adequately, a stack overflow can occur at any time. However, if you get overgrowth errors without using recycling, then you should think again how you doing things is so easy with recursion because in an infinite loop, you call a ton of methods.

nokogiri - Xpath: how do you select the second text node (specific text node) -

एक html पृष्ठ पर विचार करें & lt; html & gt; सेब नारंगी दवाओं & lt; / html & gt; आप कैसे xpath का उपयोग करके नारंगी का चयन कर सकते हैं? / html / text () [2] doesn काम नहीं करते हैं। आप चयन करके सीधे इसे नहीं कर सकते substring-after (/ html / text (), "") // कुछ इस तरह की स्ट्रिंग प्राप्त करने के लिए आपको टेक्स्ट () को कट करने के लिए xpath स्ट्रिंग फ़ंक्शन को कॉल करना होगा, यहां एक है

Mapping integers to booleans in Objective-C -

In Objective-C, I can add an unstable collection integers (monotonic, non-compatible, can be quite large) to boolean Value will be Clearly just one NSDictionary w / NSNumbers should be in the form of keys and value. Is there any better way in which there is no such thing involved in creation? I'm not actually trying to pre-optimize as much to learn if there is a technique I'm not familiar about. This data is private for the implementation of a particular class, so the rest of the Cocoa API is not a requirement. The common case of mapping one scalar to another is not some cocoa, it handles it well, Because it is centered on objects and it should be wrapped before doing anything to present the scalar. But in the case of boolean, there are only two possible mapped states, which opens a very easy way of doing this: set = presence in the Boolean state.

c++ - Using cin.get() to grab a line of text, then using it in a loop to display that line? -

OK, so I've come to this code snippet in my textbook that will resonate every other character in user type is. Now, I understand every other character, but I'm having difficulty using cin.get (). I think why cin.get is first, but why is it inside the loop? I'm feeling that I'm not entirely about the nature of input streams ... EDIT: It just clicked ... I'm stupid Thanks for clearing it. CH Next; Int count = 0; Cout & lt; & Lt; "Enter a line of input: \ n"; Cin.get (next); While (next! = '\ N') {if ((count% 2) == 0) cout & lt; & Lt; the upcoming; Count ++; Cin.get (next); } Thanks advance! get cin in this case "grab a line of text" As you believe cin.get in this case only holds one character with cin.get you read the characters that the user is typing One by one, one by one. This is why you have cin.get in a loop.

javascript - How to show/hide the same blocks inside similar blocks with JQuery -

कोड निम्नानुसार है: & lt; div class = "mama" & gt; & Lt; div वर्ग = "बेटा" & gt; आइटम 1 & lt; / div & gt; & Lt; / div & gt; & Lt; div class = "mama" & gt; & Lt; div वर्ग = "बेटा" & gt; आइटम 2 & lt; / div & gt; & Lt; / div & gt; $ (".mama")। होवर (फ़ंक्शन () {$ ("। बेटा")। शो ();}, फ़ंक्शन () {$ ("। पुत्र")। Hide ();}); मदद करने के लिए अग्रेषित करें धन्यवाद! घटना का प्रयोग करें और अपने कार्यों को संबंधित तत्वों तक सीमित करें: $ ("div.mama")। होवर (फ़ंक्शन () {$ (this) .find ("div.son")। शो ();}, फ़ंक्शन () {$ (this) .find ( "Div.son")। छुप ();}); इस पर कई भिन्नताएं हैं कि आप इसे केवल प्रभावित तत्वों के बच्चों तक कैसे सीमित कर सकते हैं।

c# - Get read/write properties of Anonymous Type -

I need to bring all the properties of an anonymous type that can be written. Example: var person = new {name = "person's name", age = 25}; Type anonymous type = person.GetType (); Var Properties = Anonymous Type.GetProperties (BindingFlags.Public | BindingFlags.Instance); The problem is that all properties have their canwrite property false . It has come back as the right one for non-anonymous forms. I tried to call PropertyInfo.GetSetMethod () , which returns null . How can I check whether the property can be written? Edit: Maybe it would be enough to know if some type is unknown or not, how will I know if some type is anonymous due to reflection? There are anonymous types generated from C # always is immutable, so writeable The set of properties is empty This is optional in VB: Each property default to be unstable, but if you upgrade it with the key ; For the similarity and hash code generation only the declared property using the key ...

objective c - What's the difference? -

I will propose your question by saying that I am an early-purpose developer. What is the difference between: NSString * foo; NSString * foo; NSString * foo; Is there any difference? NSString * name only all of the three names named a variable * This is actually a matter of style preference. Some people like to like star next to this type that this is an indicative type. Some people need to star in multiple announcements, such as: NSString, a star icon next to the variable to emphasize language requirements. * Foo, * times; My personal preference is actually with one place before and after the first starring of your examples, using a starter just before the variable to use the pointer in formatting Do I avoid declaring more than one variable in the same announcement.

c# - ASP.NET, JQuery - Sharing regular expressions -

If you have both clients (JavaScript) and server side code (C #, vb.net) and to avoid duplication Want to store in one place where you store them? I can use the register and write Riyazax as a string, but just wondering if someone is more elegant. You can store them as a protected variable in the code-behind of your ASP.NET page, and then use data-driven expressions You can store them in your JavaScript as a public variable ... In your ASPX page: & lt; Script type = "text / javascript" & gt; Var regexPhone = new RegExp ("& lt;% # regexPhone%>";); Var regexEmail = new RegExp ("& lt;% # regexEmail%>"); Var regexBlah = new RegExp ("& lt;% # regexBlah%>"); & Lt; / Script & gt; Back in your code: protected string regexPhone = "put the regex string here"; Protected string regexEmail = "put the regex string here"; Protected string regexBlah = "put the regex string here...

php - WebDAV/ftp/etc custom solution -

We have a project (web / php) where we want users to use their files, our applications Used in, standardized protocols such as FTP or WebDAV will make it easier for our users to access their files, which are primarily templates and images. The thing is, that the user will be browsing, should somehow be programmatically generated, because of custom permissions in this application, dynamic file / directory and with different permissions in physical files and folders. (The files that the user should have access should be mixed with those people who should not have them) How will we accomplish this with the best and most easily? Generate file links and use FTP? Create a custom server application using Python / Java? Please share any thoughts! I try to use standard Apache mod_dav_fs , And access control using standard limit instructions. It is not clear from your description why it is a requirement of the program - you can definitely have different access controls on differen...

ruby - minimize rails logging -

I know there are some different levels for logging of railings, but how do I only Log on to the things I want, or rather, I only want things in my logs, which I do not like. logger.debug P> Is it possible to make me your logging level? In addition to this (I swear to the last part of my question) It seems that when the rail is in development mode, then it is my entry level i config / environment / development.rb / P> means that all of you Want the message. If your purpose is to debug (to improve production performance), you can choose to post filter from command line. tail -f development.log | Grep debug If display, privacy, security is your goal, then you can open logger squares and override some methods class logger Def Warning #do The log level in config / enfironment.rb will override all the environments (development, production, data, etc.). Etc.) - It can explain why your development setting is being ignored.

php - Storing a piece of the string for later use in replacement -

It is not certain that the subject was clear, it is difficult to describe, easy to show: It needs change: $ text = '% textgroup% img_green% img_Red and some more text here'; To do this: $ text = 'bunch of text & lt; Img src = "/ assets / images / green.gif" alt = "green" / & gt; & Lt; Img src = "/ assets / images / Red.gif" alt = "red" /> And some more text here '; Thanks in advance. $ text = preg_replace ('/% img _ (\ W +) / ',' & lt; img src = "/ assets / images / \ 1.jpg" alt = "\ 1" /> ", $ text); Check how it's working

linux - Organizing School Workspace/Writing Makefile -

I am doing some programming for school and I think I have reused the libraries again, , User input, error handling etc.). Right now, my personal SVN directory structure looks like this: trunk / | - 2520 | `- Assignment | | - A2. | - Makefile | | - README | | - calculator.c | | - calculatorlib.c | `- calculatorlib.h` - libs | - Misc | | - Error Leash. | | - Error Lib H | | - userinputlib.c | `- userinputlib.h` - stacks | - Stacklib.c` - stacklib.h Some of these files (UserPobil and Errilib) are used in almost every project I'm working on For the obvious reasons I copy the files Without having done these files, I want to be able to get involved in the project's work area (2520 / assignment / A2) because I do not want to manage copies of a file and I do not want to check in duplicate SVN The same file. I have to do library files in project workspaces, so my makefile works without having to do a very manual configuration (or hard-coding path). At first, I thought abo...

How do I convert a byte to a long in Java? -

I'm reading 8 bytes of data from the hardware device, I need to convert them to a numeric value, I think I I want to change them for a long time as it should have 8 bytes. I am not very familiar with operating Java and low level data types. I think there are two problems (in addition to the fact there is almost no document of hardware in it), the bytes are expected to be unsigned, so I can not convert a straightforward integer Ended with (some taken from source code, maybe I should read one week earlier): Public stable last long (byte [] bytere, int offset, int lane ) {Long val = 0; Lane = monastery.man (lane, 8); For (inti = (lane -1); i> = 0; i--) {val & lt; & Lt; = 8; Val == (Bytere [Offset + I] and 0x00FF); } Return valve; } For endnines, test with some numbers that you know, and Then you will be using the transfer to move a byte for a long time. You can have this a starting point. The difficulty is that depending on the funeral you will change it...

Eclipse JavaScript project "was not validated since its include path is incomplete." -

I am using eclips and want to start using the JavaScript verification tool which is now available. I think this is the 3.4 version, but the help ... does not show the version number ... about it, only tells me that it is producing 200 9 120-1017. This is a pre-existing EJB / JSP application that I have added to the "Javascript Toolkit" aspect. The issue in hand is that JavaScript validation has not run. This message shows a single error under "JavaScript problems": This project was not valid because the path involved is incomplete. The definition of class can not be found for the string. Please include the path, then try validating this project in the window. Preferences | Web | JavaScript | Include path, "JavaScript Global Reference Root" is set to "Project" (default). The "user library" is empty. There are four tabs in the project properties under "Javascript | Libraries": include "Library", "G...

What windows C IDE can I use that will use gcc to compile and let me insert breakpoints just like Visual Studio would for C#? -

Which system can I use CIDE which will use GCC to compile and for C # Like a visual studio will you put breakpoints? I have searched Google and have not got anything in 2005 recently. I am coming back to C since graduation and want non-MS IDE to use GSC, but it is a versatile version of Visual Studio. The idea of ​​using the GDB command line is still not attractive. I successfully used Eclipse with C / C ++ plugin. I like You can download it, it's a real pretty. If you do JNI, then this is simply inevitable because you can set up your project to both C / C ++ and Java

iphone - how to remove cc,bcc in MailComposerViewController? -

I am using MailComposerViewController from apple site. But when I send my message with blank CC, BCC Field, then it gives the error that it asks to fill that field. How can I send the vacant area without the CC, BCC? Bcos is optional for this user. Many help? I'm not sure what you are missing, but here you have something that will help you : - Make sure that you are implementing the MFMailComposeViewControllerDelegate Representative Protocol. MFMailComposeViewController * mc = [[MFMailComposeViewController alloc] initWithNibName: Zero Bundle: Zero] - Here you have a snippet of code that works for me: ; Mc.mailComposeDelegate = self; [MC SetoRePaint: [NSARRAOIJject: Self and Reciprntem Email]]; NSString * Subject = [NSString stringWithFormat: NSLocalizedString (@ "mail topic", void)]; [MC set topic: subject]; [MC SetmoseBedi: [Self Composing ModaASSHL] is HTML: Yes]; [Self current model visualizer: animated MC: yes]; [MC release]; And here you have a r...

algorithm - Optimization! - What is it? How is it done? -

It's common to listen to "highly customized code" or to some developer, who needs to customize their and whatnot However, as a self-taught, new programmer, I've never really understood what people actually do while talking about such things. It is to take care to explain this general idea? Apart from this, some recommend reading material and in fact you feel like saying on this matter. Feel free to rant and propagate. customizable is a word that we use abruptly to mean "one Doing something good in a certain way "We rarely" optimize "something - and more, we improve it until it meets our expectations Optimization Such There are changes which we do in the hope of optimizing some part of the program. A fully customized program usually means that the developer left the window to readability and to re-align the algorithm again in order to reduce the "wall time". (It is not a requirement that "optimized code" is di...

JPA one-to-many relationship question (relations on one entity) -

जेपीए उदाहरण में एक कोड है: @OneToOne (cascade = CascadeType.ALL ) निजी देवता मां; @OneToOne (कैस्केड = कैस्केड टाइप। एएल) निजी देवता पिता; @OneToMany (कैस्केड = कैस्केड टाइप। एएल) निजी सेट & lt; देवता & gt; बच्चे; पिता और माता के साथ संबंध @OneToOne एनोटेशन द्वारा लागू किया जाता है और @ManyToOne संबंध में क्यों नहीं है? यदि बाल और माता पिता अलग कक्षाएं होंगी तो माता-पिता में @OneToMany संग्रह होगा & lt; बाल & gt; बच्चों और बाल में @ManyToOne जनक माता पिता है। यह (ईश्वर) उदाहरण उचित लगता है लेकिन मैं स्पष्टीकरण की तलाश क्यों कर रहा हूं। जेपीए विनिर्देशों के लिए लिंक बहुत सराहना की जाएगी। मुझे लगता है कि आप सही हैं, यह होना चाहिए ManyToOne रिश्ते यह इस कोड के लेखक से एक गलती होगी। कोड के अन्य भाग भी संदिग्ध हैं, मैं इसे बहुत अधिक भरोसा नहीं करता ... यदि आप अच्छे दृढ़ता उदाहरण की तलाश कर रहे हैं, तो मैं हाइबरनेट दस्तावेज़ीकरण का सुझाव देता हूं। जितना संभव हो उतना जेपीए के साथ चिपक जाती है। नोट: आप अपना कोड हाइबरनेट में स्विच कर स...

c# - LINQ to SQL - selecting a list of the highest version numbers -

I am trying to write some linux to SQL which will bring me back to the list of rows, in which an instance of the basacquenites , But I want the row with the highest version, therefore, from the following table of data: Id was created Version Version BaseQuestionID 2 2009-10-07 13:47 47: 27.687 1 2 3 2009-10-07 13:49 49: 35.010 1 3 4 2009-10-09 16: 03: 45.973 1 5 5 2009-10-16 16: 01: 33.603 2 5 6 2009-10-16 16:16-16: 22.680 1 6 7 2009-10-16 16: 16: 53.807 2 6 8 2009-10-16 16: 41: 31.180 3 6 9 2009-10-19 08: 06: 23.210 4 6 I have to go back: created id version version BaseQuestionID 2 2009-10-07 13:47 47: 27.687 1 2 3 2009-10-07 13:49 49: 35.010 1 3 5 2009-10-16 16:01: 33.603 2 5 9 2009-10-19 08: 06: 23.210 4 6 I have tried many things, but so far It has not been dismissed. I am working in vb.net, but am trying and translating from c # if you know it ... any indicator will be highly appreciated. How about (C #): in q Q. Q. For q.BaseQuestionID grouped group group by ...

php - Sanitize $_GET parameters to avoid XSS and other attacks -

I have a website in php that contains content (for embedding) in a template page to load Is given in the parameter, I add ".php" at the end of the parameter and include that page I need to do some security check to avoid XSS or other stuff (not because of my SQL injection, because We do not have a database). What have I come up with: $ page = $ _GET ['page']; If (Stroos (strtolower ($ page), 'http') ||! Strokes ($ page, '/') ||! Strokes ($ page, '\\') ||! Struts ($ page, '. . ')) Attach the ".php" to the {// $ page and include the page Can I do more to further my input? $ page = preg_replace ('/ [^ - a-zA-Z0- 9 _ ] / ',' ', $ _GET [' page ']); Which is probably the fastest way to clean it, it will take anything and ensure that it contains only letters, numbers, underscores or dashes.

How to replace single-quote with double-quote in sql query - oracle 10g? -

How do I change a single-quote (') with double-quote (") in SQL query - Oracle 10G This should work: update myTable myField = REPLACE (myField, '' ',' '' ');

c# - How should I combine two paths including backwards relative paths? -

I have a complete path and a relative path, and I want to add both, there is an inherent way? The relative path can also be " ../../ aa2 / file.exe ". ( path.combine does not support it - which is very bizarre from itself.) Try path Gatefoot (path.combin (ab, relay))

FBML multi friend selector in fb:dialog -

Is an FB: There is no way to show the multi-select selector widget (FB: multi-man-selector) in the dialog ? I have a button, on selection I would like to show the friend selector popup and users can invite their friends. I found the friend selector working on the main page, but there was no indication about displaying that widget in Fb: dialog. Thanks jugs You have to edit it, but this is a dispute: pop-inweightsfreeends: function (e) {if (e) {e.preventDefault (); } var fbml = '& lt; Fb: request-form \ action = "." \ "= TWOFOUSE.BRAND + '. Amp; amp; lb; fb: req-choice url = \' '+ TWOFace.INVITE_DIALOG.postBack +' \ '\ label = \' join '+ TWOFace.BRAND +' \ '/ & Gt; "& gt; \ & Lt; Fb: multi-friend-selector \ showbread = "false" \ rows = "4" \ actiontext = "invite your friends to use" + TWOFace.BRAND + '"& gt; \ & Lt; / Fb: Multi-selector-selector ...

java - Creating temporary JMS jms topic in Spring -

I try to use spring to handle JM connections for mainframe service, trying to rebuild some legacy code I am here. I need to connect to make a temporary topic for the mainframe service answer and it needs to be set that the message message.setJMSReplyTo (replyTo); . Does anyone provide examples of this? I have not found anything in the documentation that allows you to get a low-level JM object like session or subject connection to create a temporary topic. If you use the JmsTemplate by using the JMS API's low-level access You need to use one of the methods, the easiest of these, where the session callback provides you JMS session object. With that, you can call createTemporaryQueue () or createTemporaryTopic () . You can probably use any other implementation () methods, although some do the initial work, such as

c# - sending sms through way2sms help needed -

I am creating a desktop app in Visual C # 2.0 which can send SMS via way2sms.com. Has any of you tried such a thing ...? help please. This is the solution for the link Can pass the URL parameters provided with the help of web request class. I did it with the following rows HTTP WebBurvey request = (WebTequest.Create HTTP WebBrowsition) ("_http: //www.aswinanand.com/sendsms.php? Uid =" + this .txtUserID.Text + "& Amp; pwd =" + this.txtPassword.Text + "& amp; Phone =" + this.txtToMobileNo.Text + "& msg =" + this.txtMessage.Text); StreamerMinder Reader = New Streamminder (Request Gatesresons (.) GetResponseStream (), Encoding .UTF8); Return Reader Reed to End (); There is another tool available in Java, which is now implementing in C #.

asp.net mvc - Xval and Tinymce -

I have a problem submitting a asp.net mvc form which is using Xval for verification and tiny Text areas used as an editor The TinyMce editor has been initialized with the new tinymce jquery plugin and the form validation and submission works perfectly if I delete the editor. But if I initialize the editor, the form is submitted only at seconds time when I click the submit button ... when I submit the form first whenever they are not empty (they are marked with the necessary attribute), even then I get Xval validation errors on the text fields. If I am submitting the form for a second time, is it an excel -quiry verification - tinnemus bug or am I doing something wrong? How would you debug a problem like this? I tried firebug without any success. If you call: tinyMCE.triggerSave () ; in the onclick of the button (or I believe that onsubmit of form ) then ensure the tinyMCE That value is saved and verification is done properly.

winapi - CryptEncrypt() API -

Getting a junk byte at the end of the buffer is normal when this function returns? If you are using a block cipher, then it is normal that one of the block size Could be more padded. With a stream cipher, the result will usually be the same as the input.

How do I DRY up common text in a Django template? -

I have some static text that should appear in 2 templates in the template. For example: & lt; Div & gt; {% If something%} is a static text {% else%} something happened {% endif%} & lt; / Div & gt; ... more HTML & lt; Span & gt; {% If something%} is a static text {% else%} some more laugh {% endif%} & lt; / Span & gt; I can duplicate the above text in 2 separate locations in my template file (as shown above). I also have a model that will store the text (it is tasty but the cost of call to DB for a normal work) I used the included template I'm thinking of using it, but maybe this is not the best way to achieve my goal. What is the best way to do this? {% if some%} is a static text {% Else%} something else happened {% endif%} "Variations" can be passed as a variable on the template tag so that you use that entire block in the way of a variable Able to do

How to check if mysql entry is empty in PhP? -

यहाँ वर्णन चर मैं अपनी तालिका से गूंज रहा हूँ: $ description = mysql_result ($ परिणाम, $ मैं, "विवरण"); कभी-कभी $ i'th रिकॉर्ड खाली होता है और इसमें कोई भी डेटा नहीं है / कोई विवरण नहीं। मुझे क्या करना है "गूंज" उपलब्ध "रिकॉर्ड्स के लिए उपलब्ध है यदि (isset ($ description)) {गूंजती" कोई विवरण उपलब्ध नहीं है "; else) {echo $ desctipion;} मेरा प्रयास हालांकि काम नहीं करता है, क्योंकि इसके बाद प्रतिध्वनियों को हर रिकॉर्ड के लिए कोई विवरण उपलब्ध नहीं है जो खाली नहीं हैं। उत्तर क्या है? isset ($ description) सही होगा क्योंकि $ का विवरण अभी भी सेट है, भले ही इसका मान 'खाली' है आप का उपयोग करने की आवश्यकता क्या है। यदि (खाली ($ विवरण)) {गूंज "कोई विवरण उपलब्ध नहीं है"; } Else {$ $ echo; }

sql - MySQL - Create an UNIQUE index on two columns for ON DUPLICATE KEY -

I have a table with 4 columns, I want to be able to update the INSERT or the value column of the build (I Does not care about index queue ID). CREAT table Tablename (id, (primary) user_id, (index) Setting_id, (index) value (index)); Originally I wanted to save a value, whenever I ran the query "One place ..." But then I chose it and instead of an INSERT ... on duplicate key updates. The problem is that I do not have a single column for "INSERT ... ... duplicate key update to use" to find out whether it is a new line or if the current row Need updates in So I thought I would use a unique key that was a mix of two columns, create unique index index_name on the line unique ( table (user_id, setting_id); However, I'm not sure how to proceed from here. To test this new INDEX while trying to find an already existing line with these two column values Do I organize my questions? `tablename` : On the key update of INSERT VALUES (1, 34,15) duplica...

How does one indicate the "default" connection string for Enterprise Library? -

I am not able to call DatabaseFactory.CreateDatabase (), ie, with no parameters, point to it To do that, which connection string is to drag me from the file, there is only one connection string in my config file. Only one help is found on the internet to show the default connection string using the Enterprise Library Configuration Tool (view Studs Right-click on My config file yo). But from there, I do not see any way to "select" a connection string or consider it to be default. YOu should define the data configuration section in your configuration & lt; Configuration & gt; & Lt; ConfigSections & gt; & Lt; Section name = "data configuration" ... and then set the value & lt; Data Configuration Default Database = "Connection String Name" / & gt;

zend framework - Custom routes and i18n -

I am experiencing a lot with the CakePHP framework, but I'm checking the Zend Framework for an application But will get traffic. I need to add some non-standard passages and add to i18n (url-based) and I have seen parts of the reference documents that refer to it, and are making registry keys etc. , But I did not find any information about how to do this practically - how do I put it in the registry with the head of the "HandbookDrandlet." Your best thing is to do this in the bootstrap file, so that you have all your Get translation objects in the application.

java - Existence of a table generation framework for experiments -

I am running a computer program with many programs whose measurements I am measuring. For each run, I record time, exact and memory. Is there any framework that can help me to create running tests and tables? I am currently using Python CSV library to generate basic tables, however, you make things complicated based on how many variables you want to change, because table format may have to be different . For examples of different formats, see. There are probably more formats that I do not know. I like writing it in python, but structures in other languages ​​(especially Java / C ++ as I know them) will be acceptable An existing This is the outstanding only to list the structure - no one is rolling out! Also, I will be honored for the best answer on Australian time on Sunday night, so the gift will be 6 days . I have actually written my own structure (in the end), but I need to compare it against others. I Bounty for community wiki questions are still valid Thi...

sql server - sql query to get content older than 3 weeks -

My content table appears (contentID, title, created). I need to get all the content that was created more than 3 hours ago. The SQL Server database has been created, datetime type. How about: Content ID, select the title , Where the built-in material was made & lt; DATEADD (week, -3, getdate ()); This takes the question closer to 21 days is fine, clearly it means, but I think it is good to use the terminology used in the question. For example ... For some time ago I was asked to survey average in 1, 50 visitors to one site I described it as ratio of 0.02, and the client was not happy I told the customer that they were the same But I have learned my lesson, and now if I change the way I have been described, I am sure that I comment on that effect, and preferably not to change it in the first place. Wants place If the customer wants 3 weeks, then do it as 3 weeks, not 21 days.

Migrating from Silverlight 2 to 3 -

We are considering porting a minorly complex Silverlight 2 app to Silverlight 3. Is there any possible disadvantage about which to be known? Are people feeling this port good? I know about porting. But to take advantage of the benefits of SL3, we have modularized our style in many files from 1 file, depending on which member controls his own control.

How Do I Find The Cells With Contiguous Data In A Row In Excel VBA? -

Looking at the image ... if I know the range ("B3") . How can I get cells with cell E3 related cells? Since F3 should not be considered since the empty G3. The result can be either a range object (B3: E3) or counting of cells (in this case 4). Setting B3 as active cell and doing. range (activate, activale.ind (xltorite) .count I get the count, although this method is not reliable, until the data is stored in B3, it is counted until cells end up the sheet. Of course, it is obtained by looping through the cells But I want to use a worksheet function or some other efficient method It seems that the number of consecutive columns in a row starting with cell B3 Trying to determine. The code given below is $ B $ 3: $ E $ 3 and 4. Depending on your data, if the data is only in cell B3, then $ B $ 3 and 1 will return.

forms - not getting radio button values in jquery ajaxform -

I have a form that is linked to a JQuery form (AjaxForm) object. In the form I have some radio buttons: & lt; Input type = "radio" id = "dialog_stranka_dodajuredi_tip_fizicna" name = "dialog_stranka_dodajuredi_tip" value = "2" /> Selection 2 & lt; Input type = "radio" id = "dialog_stranka_dodajuredi_tip_pravna" name = "dialog_stranka_dodajuredi_tip" value = "1" /> Selection 1 Now, when the form is posted via AJAX, the parameter "dialog_stranka_dodajuredi_tip" is empty. I also tried to force the incident of a change like this: $ ('input [(' 'change' '(function) (switch (persian) (Case of Alert ('Number 2 has been selected)'); Pause; Case 1: Warning ('No.1 (' Input [name = Dialog_straca_dodojoyed_tip]: checked '). Val ())) {Case 2: Alert Selection of '); break;}}); But the value of the property of Val is not worth the warn...

javascript - jQuery plugin to animate colors from one class to another -

There are a lot of jQuery color plugins, though I could not get animate between CSS class announcements. For example .class1 to .class2 : / P> .class1 {background-color: # 000000}. Class2 {background-color: # 000088} Is this possible? The jQuery command already allows you to animate color variations. This one edit: To get the same effect with CSS classes, jQuery UI Igor Viera James Padole's

c# - Interface coding issue -

I send a value (attrname [5] = "WRM version";) from sendAgentInfo () to a.dll Is obtained in the form of WrmVersion in SPDL. Here I am sending those values ​​to an interface (IRSorporality) located in data.dll. But the problem is that the interface 'IRSorporis' interface is not found, if it gets in the interface, it should be displayed in a LISTVIEW in the UI (UI.dll in ResourcePolicySystemsControl.cs0) What I did is coding below a.dll public null SendAgentInfo () {string [] attrname = new string [6]; String [] attrval = new string [6]; Attrname [5] = "WRM version"; Attrval [5] = Registry.Get Value (@ "HKEY_LOCAL_MACHINE \ Software \ syscon \ Single Point Operations Windows Resource Monitor", "OnResource", "0"). ToString ();} sp.dll string in the code wrmVersionSPURT = this_event.variableData [5] .atr_value ;. . IResourcePolicy irp = (IResourcePolicy). Irp.WrmVersion = wrmVersionSPURT; . . code data.dll public ...

Jquery plugins: how to access options? -

Currently I'm writing a jQuery plugin with some options. Simplified piece of code from a web page with an example: And here (again simplified) plugin code: (function ($) {$ .fn.myFunc = function (options) {/ / Default settings expansion option = $. Product ({width: 300, height: 200}, option); This is doing something for example with return.each (function () {// # div1 $ (this) .) {// Here I need to use the option of any other (like # divis) object / / How can I do this?}}}}}}}}) (JQuery); Well, this question is in the list - How can I use the options of the second object from within the plug-in function? Something like $ ("# Div2") Options.width You set up those options before you enter your plugin For .data (key, val) method: // set 'option' for '# div2' $ ("# div2"). Data ('option', {width: 500, height: 500}); // Get 'Options' for '# div2' (this will be in your plugin code) var opts = $ ('...

Gorgeous Silverlight 'OSX ScreenSaver esque' Animation How-To? -

Any idea how to recreate similar animations to a very colorful swirly thing?!?! They either have implemented a particle library or are using third parties if you have them If you download it, then opening it, you can browse the content of two DLS. If you are looking for a similar effect then you will probably need to use the particle library as they are using.

visual studio 2005 - cmake: How to make a script for copying Data files accompanying my program -

I'm trying to automate my building process with cmake. There is currently only one problem: In the Limiter's philosophy (where there is one), the data is the best place to copy files. I have a library and some example examples require data. I currently do the following: I use CMAKE_CURRENT_BINARY_DIR post-build phase of all data using custom command in CMakeLists.txt of each example. I use it in my debugging workflow, so no goal is established. It works very well, but there are some drawbacks in it: Copy is created every time the project is created. This happens sometimes with VS 2005 when it is not newly created. Since the data folders are large, it takes time to copy, and it gets a bit upset. I'm sure this is a very strange way of doing this. I want to copy those directories to executable paths, so I do not need to indicate how to set a debug working directory Copy these directories The right time to do is to be at CMK configuration / generation ...

asp.net - Why is IIS7 matching to handlers with the classicmode precondition when the app is running in integrated mode? -

I have an application in an application pool that is running in integrated mode. I added a handler for system.web> httpHandlers and I got 404 results. That's why I have enabled unsuccessful request tracing and in the request details I see many entries like this: HANDLER_PRECONDITION_NOT_MATCH Name: PageHandlerFactory-ISAPI-2.0 Precondition classicMode, runtimeVersionv2.0, bitness32 The pre-condition always looks classic mode Why is IIS 7 trying to match the request for these handlers when the application pool is running in integrated mode? Thank you! Your HTTP handler should actually be configured in & lt your web.config of the file; System.webServer / & gt; section.

How can I simplify this jquery/javascript -

I am trying to improve my jquery / javascript syntax. Is this a better way of writing? if (ok) var mymsg = '& lt; P id = "ok-box" & gt; + "You're good to go" + '& lt; / P & gt; '; } Other {var mymsg = '& lt; P id = "no-fine-box" & gt; + "Error" + '& lt; / P & gt; '; } I was wondering if jquery / javascript had the same syntax as the following PHP syntax, it would be great: $ mymsg = ($ Ok)? "You're good to go": "Error"; You mean like: var mymsg = OK? '& Lt; P id = "fine-box" & gt; You're good to go & lt; / P & gt; : '& Lt; P id = "no-fine-box" & gt; Error & lt; / P & gt; '; It does! :)

vb.net - Implementing .Net RIA Services with Silverlight3 using only existing code/classes? -

According to my latest questions, I am in a process of researching Silverlight 3 and its application forms the appropriate RIA resolution Is a pre-built project that wants to webbet our customers. And my experience in net and silver light is about 3-4 weeks. Now let me RIA services have come to know about. I need to use the current VB class; Which was created as a quick wrapper class to simulate a small piece of client's application code. It is used as a proof of concept, it has a function that uses the client's DLL files to return simple data types. This class has already been successfully used with Flex / Webbob combination. Unfortunately, I do not have enough knowledge or experience in Silverlight / RIA services, to understand what I have to do to file the work. All the examples that I find online, simply specify the method where you use databases as datasource etc. Then Question: Can you please inform me that how would I have to go about implementing the CILLA service...

ruby on rails - has_many through self referential association -

I want (as an example) for all posts by friends of has_many Create association person, such as person & gt; Something like has_many: remote_posts to give me something; Friends & gt; Person & gt; Post . .. Here's how I would go about it Generate script / model post title: string person_id: integer script / model friendship person_id generated: integer friend_id: integer script / Model Person Name: String Class person & lt; ActiveRecord :: Base has has_many: The post is has_many: friendship ,: foreign_key = & gt; 'Friend_id' near_main: People ,: through => & gt; : Friendship has_many: remote_posts,: class_name = & gt; 'Post' ,: By: = & gt; : People ,: Source = & gt; : Posts & Class Friendship & lt; ActiveRecord :: Base is_to: Friend #Allo's friend to see that the purpose of friendship is in the final post & lt; ActiveRecord :: Base is_to: End of person # Build some people and friends ('...