I want to create a site that is groupon.com clone.
Does anyone know interesting clones of the Groupon.com web site model?
ex)
StackOverflow clone = http://meta.stackoverflow.com/questions/2267/stack-overflow-clones
I have some ARes models (see below) that I'm trying to use associations with (which seems to be wholly undocumented and maybe not possible but I thought I'd give it a try)
So on my service side, my ActiveRecord object will render something like
render :xml => @group.to_xml(:include => :customers)
(see generated xml below)
The models Group and Customers are HABTM
On my ARes side, I'm hoping that it can see the <customers> xml attribute and automatically populate the .customers attribute of that Group object , but the has_many etc methods aren't supported (at least as far as I can tell)
So I'm wondering how ARes does it's reflection on the XML to set the attributes of an object. In AR for instance I could create a def customers=(customer_array) and set it myself, but this doesn't seem to work in ARes.
One suggestion I found for an "association" is the just have a method
def customers
Customer.find(:all, :conditions => {:group_id => self.id})
end
But this has the disadvantage that it makes a second service call to look up those customers... not cool
I'd like my ActiveResource model to see that the customers attribute in the XML and automatically populate my model. Anyone have any experience with this??
# My Services
class Customer < ActiveRecord::Base
has_and_belongs_to_many :groups
end
class Group < ActiveRecord::Base
has_and_belongs_to_many :customer
end
# My ActiveResource accessors
class Customer < ActiveResource::Base; end
class Group < ActiveResource::Base; end
# XML from /groups/:id?customers=true
<group>
<domain>some.domain.com</domain>
<id type="integer">266</id>
<name>Some Name</name>
<customers type="array">
<customer>
<active type="boolean">true</active>
<id type="integer">1</id>
<name>Some Name</name>
</customer>
<customer>
<active type="boolean" nil="true"></active>
<id type="integer">306</id>
<name>Some Other Name</name>
</customer>
</customers>
</group>
I have an indexed model called Article and I don't want solr to index unpublished articles.
class Article < ActiveRecord::Base
searchable do
text :title
text :body
end
end
How can I specify that article that is not #published? should not be indexed?
Where do the JFace providers belong in an MVP or MVC architecture? Or should Provider pattern be treated as a different way of View-Model separation? If so, is it the same as the ASP.NET Provider pattern?
Is there an article on a proper design of JFace applications using Providers?
I AM A NET DEVELOPER TRY TO INSTALL MYSQLDB FOR PYTHON I KEEP HAVING THIS ERROR MESSAGE
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb
I AM FOLLOWING THIS INSTRUCTION FROM THIS SITE <"http://sourceforge.net/project/shownotes.php?release_id=303257"
I DO NOT UNDERSTAND THESE LINES
Windows
.......
C:... python setup.py install
C:... python setup.py bdist_wininst
The latter example should build a Windows installer package, if you
have the correct tools. In any event, you must have a C compiler.
Additionally, you have to set an environment variable (mysqlroot)
which is the path to your MySQL installation. In theory, it would be
possible to get this information out of the registry, but like I said,
I don't do Windows, but I'll accept a patch that does this.
I HAVE BEEN SEARCHING FOR ANSWER ALL DAY
PLEASE DO ANYBODY REALLY KNOW HOW TO DO THIS
OR AT LEAST POINT ME IN THE RIGHT DIRECTION????
THANKS
and what is the c compiler for???????
I'm an ASP.NET c# developer using VS2010 as my development platform. I am interested in accessing Sketchup models using a web form interface.
Has anyone done this? I am looking for a simple "Hellow World" web application that uses the Ruby Extension model.
I'm using Paperclip and here's what I do in the model to delete attachments:
def before_save
self.avatar = nil if @delete_avatar == 1.to_s
end
Works fine unless @delete_avatar flag is set when the user is actually uploading the image (so the model receives both params[:user][:avatar] and params[:user][:delete_avatar]. This results in the following error:
TypeError: can't convert nil into String
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `dirname'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `flush_writes'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `each'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `flush_writes'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:144:in `save'
from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:162:in `destroy'
from /Work/project/src/app/models/user.rb:72:in `before_save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `send'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `callback'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:249:in `create_or_update'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2538:in `save_without_validation'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1078:in `save_without_dirty'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in `save_without_transactions'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `send'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in `transaction'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in `with_transaction_returning_status'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:723:in `create'
I assume it has something to do with the avatar.dirty? value because when it certainly is true when this happens. The question is, how do I totally reset the thing if there are changes to be saved and abort avatar upload when the flag is set?
Does LINQ model the aggregate SQL function STDDEV() (standard deviation)?
If not, what is the simplest / best-practices way to calculate it?
Example:
SELECT test_id, AVERAGE(result) avg, STDDEV(result) std
FROM tests
GROUP BY test_id
Getting going now with NInject... :)
For a WinForms application, and in particular the business logic classes used within it, is there a rule of thumb in terms of which Classes once should hook up using IOC? For example if you have a Domain Model which is modelled by C# classes is the concept that all classes should be wired together using IOC?
thanks
Fiddler is an HTTP proxy that, among other things, allows one to pause outgoing and incoming HTTP packets, modify their contents and continue.
Is there anything similar to this working in lower layers of the OSI model? In particular, I want to be able to pause a TCP ACK packet and later let it continue through the pipeline. *nux or Windows suggestions are appreciated.
Storage via JetS3t REST API seems to be very slow. Is there a caching front end for the JetS3t API for avoiding a network hit on the fetch calls [link text][1]
[1]: http://jets3t.s3.amazonaws.com/api/org/jets3t/service/S3Service.html#getObject(org.jets3t.service.model.S3Bucket, java.lang.String, java.util.Calendar, java.util.Calendar, java.lang.String[], java.lang.String[], java.lang.Long, java.lang.Long)
I have a table, where i have a click event on the tr:
<tr id="<%= candidate.AnsogerID %>" class="newCandidatesTableTr">
, this click event:
$(".newCandidatesTableTr").click(function(e) {
works just fine, but in the row i also have a click event on a td:
$(".insertCandidate").live("click", (function(e) {
and this conflicts eachother. I want to do one thing if the tr is clicked and other when this specific td in the tr is clicked. So how do i in my tr.click() event defined that the event shall not happend when i click the specific td?
Here is the code:
// Lists a table with old candidates who migth be the same person as the new candidate
$(".newCandidatesTableTr").click(function(e) {
alert(this.id);
GetCandidateName(this.id);
});
// Show insert candidate dialog
$(".insertCandidate").live("click", (function(e) {
var tempCanName = $(".suggentionCandidatesTableTitle").text();
var tempCanNameSub = tempCanName.substr(0, tempCanName.length - 1);
var canName = $(".suggentionCandidateName_" + canID + "").text();
$("#mergeCandidateDialog").empty();
$.blockUI({ message: $("#mergeCandidateDialog").append(
"<div>" + tempCanNameSub + "'s ansøgning vil blive lagt under den eksiterende ansøger " + canName + "'s data.<br /><br /> Ønsker du at fortsætte?<br /><br /></div>" +
"<div id=\"content\">" +
"<input type=\"button\" id=\"" + this.id + "\" class=\"insertCandidateYes\" value=\"Ja\" />" +
"<input type=\"button\" id=\"insertCandidateNo\" value=\"Nej\" /></div>"), css: { cursor: 'default', fontWeight: 'normal', padding: '7px', textAlign: 'left' }
});
}));
<% foreach (var candidate in Model.Ansogninger)
{
%>
<tr id="<%= candidate.AnsogerID %>" class="newCandidatesTableTr">
<td><div id="candidateID""><label title="<%= candidate.Navn %>"><%= candidate.AnsogerID %></label></div></td>
<td><div id="<%= "candidateName_" + candidate.AnsogerID %>" class="candidateNameTD"><%= candidate.Navn %></div></td>
<td><div id="candidateEmail"><%= candidate.Email %></div></td>
<td><div id="candidateRundeName"><%= Model.RundeName %></div></td>
<td id="testTD">
<div id="<%= "acceptCandidateButton_" + candidate.AnsogerID %>" class="acceptb">Godkend</div>
</td>
</tr>
<%
} %>
I have a table in my model named Customers with a field IsActive. Whenever I run a query on Customers, only the active customers should be retrieved. I can include the filter in every query, but that doesn't look very. I would like to be able to override the Customers property at the Object Context lever, but I am not sure if this is possible. Any help would be very appreciated! Thanks
While a long running stored proc (RMR_Seek) is executing (called via a Linq-To-SQL data context) I am trying to call another stored proc (RMR_GetLatestModelMessage) to check a table for the latest status message. The long running stored proc updates the table in question with status messages as it executes. I want to display the status message on a message panel to advise the user of the status of the execution of Proc_A. For various reasons it is not possible to determine how long RMR_Seek will take to execute so a progress bar with percentage increments is not feasible.
I thought I'd found the way to do it by calling the long running stored proc from in a BackgroundWorker process DoWork event handler. This worked fine and allowed me to update my message panel with some dummy status messages that were NOT obtained via Proc_B while Proc_A was running. However now that I have tried to implement this fully by calling Proc_B to obtain the status messages I am running into problems that seem to be related to the mix of the backgroundworker and my System.Windows.Forms.Timer. An extract of the code I am using is below. I have tried many different ways around this but each one seems to present its own set of problems.
The code below is problematic in the bw_DoWork event. The RMR_Seek stored proc gets called but does not execute properly - it also seems to be inconsistent as to whether _IsCompleted gets set to true. I'm sure there is a better way to achieve what I am trying to do.
private bool _IsCompleted;
private void RunRevenueSeek()
{
if (_SelectedModel == null)
{
MessageBox.Show("Please select a model from the list and try again.", "Model Generation", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
var bw = new BackgroundWorker();
bw.DoWork += new DoWorkEventHandler(bw_DoWork);
ProgressPanelControl.Visible = true;
_IsCompleted = false;
MessageTimer.Start(); // Has an interval of 3000
bw.RunWorkerAsync();
ProgressLabelControl.Text = "Refreshing Data";
this.Update();
...more code goes here
}
}
private void bw_DoWork(object sender, DoWorkEventArgs e)
{
using (var dc = new RevMdlrDataClassesDataContext())
{
dc.CommandTimeout = 300;
dc.RMR_Seek(_SelectedModel.ModelSet_ID);
_IsCompleted = true;
}
}
private void MessageTimer_Tick(object sender, EventArgs e)
{
string message = "";
if (_IsCompleted)
{
MessageTimer.Stop();
}
else
{
using (var dc = new RevMdlrDataClassesDataContext())
{
dc.CommandTimeout = 300;
dc.RMR_GetLatestModelMessage(_SelectedModel.ModelSet_ID, ref message);
ProgressLabelControl.Text = message;
this.Update();
}
}
}
.model small
.stack 100
.data
.code
mov ah,00h
mov al,0e3h
mov dx,00h
int 14h
back: nop
l1: mov ah,03h
mov dx,00h
int 14h
and ah,01h
cmp ah,01h
jne l1
mov ah,02h
mov dx,00h
int 21h
mov dl,al
mov ah,02h
int 21h
jmb back
mov ah,4ch
int 21h
end
this a pc to pc commnication receiver program.i would like to know
why have we used the mov dx,00h function and what is the meaning of mov al,0e3h this ?
So an InfoPath form is deployed to a SharePoint server. It gets deployed through central admin and then activated to a particular site collection. This site collection has a forms library with the appropriate content type for the activated InfoPath form.
Using the object model, how can I retrieve the form template back out of SharePoint programmatically. I know the url to the web, name of the list and the name of the form itself.
I attempted to add a ADO.NET Entity Data Model to my Visual Web Developer 2010 Express project and it generates but returns a whole slew of errors. Why is this generating errors? Here are the main errors:
'Public Property ID As Integer' has multiple definitions with identical signatures.
Method 'Onaddress_IDChanging' cannot be declared 'Partial' because only one method 'Onaddress_IDChanging' can be marked 'Partial'.
'_line1' is already declared as 'Private _line1 As String' in this class.
I am new to .NET, and don't have much experience in programming.
What is the standard way of handling user authentication in .NET in the following situation?
In Process A, User inputs ID/Password
Process A sends the ID/Password to Process B over a nonsecure public channel.
Process B authenticates the user with the recieved ID/Password
what are some of the standard cryptographic algorithms I can use in above model?
I am looking for a way to connect to a MS Analysis Services OLAP cube, run MDX queries, and pull the results into Python. In other words, exactly what Excel does. Is there a solution in Python that would let me do that?
Someone with a similar question going pointed to Django's ORM. As much as I like the framework, this is not what I am looking for. I am also not looking for a way to pull rows and aggregate them -- that's what Analysis Services is for in the first place.
Ideas? Thanks.
All I want is really absolutely basic 2D drawing stuff e.g. rectangles, circles, paths, curves, béziers and so on. I don't need all the 3D model meshes with all this texturing and lighting. Is there a good learning resource for a fast startup programming just for fun?
I'm using Aptana Studio with Pydev 1.5.3 to debug my Django applications. I use PyDev's remote debugger and some code in manage.py and for most of the time this setup is working successfully- I can set breakpoints, inspect variables and step/continue through my code.
However, I'd like to execute arbitrary code at the breakpoint- the thing I really miss after switching from pdb to Eclipse debugging. There is an interactive console available in debug perspective but it is inactive for me.
So my question- is it possible to set up an interactive console in PyDev with remote debugger which could "inject" code at breakpoint?
I'm looking to setup a custom route which supplies implicit parameter names to a Zend_Application. Essentially, I have an incoming URL which looks like this:
/StandardSystems/Dell/LatitudeE6500
I'd like that to be mapped to the StandardsystemsController, and I'd like that controller to be passed parameters "make" => "Dell" and "model" => "LatitudeE6500".
How can I setup such a system using Zend_Application and Zend_Controller_Router?
I have an XSD which was transformed from a RELAX NG schema with a few errors I am trying to fix. The big issue I have it with the following
<xs:element name="list">
<xs:complexType>
<xs:sequence>
<xs:choice>
<xs:sequence>
<xs:element minOccurs="0" ref="preamble"/>
<xs:element minOccurs="0" ref="title"/>
</xs:sequence>
<xs:sequence>
<xs:element minOccurs="0" ref="title"/>
<xs:element minOccurs="0" ref="preamble"/>
</xs:sequence>
</xs:choice>
<xs:group maxOccurs="unbounded" ref="block-selectionListItem"/>
</xs:sequence>
<xs:attributeGroup ref="attlist-selectionList"/>
</xs:complexType>
</xs:element>
As you can see the xs:choice block allows you to pick between two xs:sequence blocks. Seems to make sense except that Visual Studio gives the following warning on the second <xs:element minOccurs="0" ref="title/> element which is throwing everything off:
Multiple definition of element 'title' causes the content model to become ambiguous. A content model must be formed such that during validation of an element information item sequence, the particle contained directly, indirectly or implicitly therein with which to attempt to validate each item in the sequence in turn can be uniquely determined without examining the content or attributes of that item, and without any information about the items in the remainder of the sequence.
Because you can only choose one I do not see how this is ambiguous. Any help would be greatly appreciated!
Edit: To be a bit more concise here are the possible outputs of the XML that would validate with this schema:
<list>
<preamble>My Preamble</preamble>
<title>My Title</title>
</list>
or:
<list>
<title>My Title</title>
<preamble>My Preamble</preamble>
</list>
As you can see it can be either one way or the other but not both. Also you could just have a title or a preamble and not both.
I have build a static web interface for searching data from some tables in my PostgreSQL database. The query website consists of a simple textfield for entering the search term, the result website presents the results as a simple html table. The server side code for searching the PostgreSQL database and returning the results is written in python using psycopg2.
Now I would like to add some interactive "Ajax features" to my search engine. When entering the search term I would like to be able to see a list of possible search terms like Google does it. On the results page, I would like to be able to sort the table showing the results.
What would be the easiest/recommended way to implement these features for my search engine web site? Do I need a full-fledged web framework like Django for that?
I have a ul/li based side menu, styled with two CSS rules, the following of them is ignored by IE8 Quirks mode, and I assume IE6:
ul { padding-left: 15px; }
I can reproduce the problem in FF by removing this rule completely. I have also tried using jQuery to apply the rule, with no change in IE8:
$("ul.menu-class").find("ul").css("padding-left", 15);
Is this a box model issue, and, how can I reduce the UL 'padding' in IE Quirks Mode?