In a system which requires use of multiple languages, what are the best practises to ensure a loosely-coupled architecture when code is calling another language's code?
In Java, which is faster:
Cloning an Object, then passing it to multiple listeners assuming the cloned object contains nothing more complicated than nested arrays, primitives and Strings
Using Streams to pass data through from one object to another?
HI!
I want to design view which will contain multiple objects in different locations. For example - it would be great if viewmodel could have field like list of objects (rectangles) and when i change/add members to list, new rectangles appear on view in specified positions.
How do i create such view/viewmodel?
Is this code threadsafe? It seems like it should be, because @myvar will never be assigned from multiple threads (assuming block completes in < 1s).
But do I need to be worried about a situation where the second block is trying to read @myvar as it's being written?
require 'rubygems'
require 'eventmachine'
@myvar = Time.now.to_i
EventMachine.run do
EventMachine.add_periodic_timer(1) do
EventMachine.defer do
@myvar = Time.now.to_i # some calculation and reassign
end
end
EventMachine.add_periodic_timer(0.5) do
puts @myvar
end
end
I have the following transaction:
SQL inserts a 1 new record into a table called tbl_document
SQL deletes all records matching a criteria in another table called tbl_attachment
SQL inserts multiple records into the tbl_attachment
Until this transaction finishes, I don't want others users to be aware of the (1) new records in tbl_document, (2) deleted records in tbl_attachment, and (3) modified records in tbl_attachment.
Would Read Committed Isolation be the correct isolation level?
I have programmed an emulator, but I have some doubts about how to organizate it properly, because, I see that it has some problems about classes connection (CPU <- Machine Board).
For example: I/O ports, interruptions, communication between two or more CPU, etc.
I need for the emulator to has the best performance and good understanding of the code.
PD: Sorry for my bad English.
EDITED -
Asking for multiple patterns.
I got this snippet of controller code from Railscast 193, functionally its all working, but i am getting a warning message. http://railscasts.com/episodes/193-tableless-model
@search = Search.new(:text => params[:search])
getting warning:
/Users/Server/.gem/ruby/1.8/gems/activerecord-2.3.4/lib/active_record/named_scope.rb:13: warning: multiple values for a block parameter (0 for 1)
from /Users/Server/.gem/ruby/1.8/gems/activerecord-2.3.4/lib/active_record/named_scope.rb:92
Any ideas why i am getting the warning? thanks
I pretty sure I've seen this somewhere but I can't seem to find it anywhere. I have an HttpModule that can be used across multiple requests. In other words instead of creating a new instance of the Module on every request it only ever needs to create it once. Does this ring a bell to anyone? If so, what's the method for configuring to work this way?
I have a simple Post model with a m2m field to a Tag model.
The Tag had for some reason to use a non default primary key.
Inside the admin page for a Post, the labels for the multiple selection field for Tags appear, but not the input field itself. I also tried using the filter_horizontal for the tags, but still only the labels appear without the actual field.
Any ideas why it breaks and/or workarounds?
Thanks!
Which is the best Visual SVN Diff displayer for Linux.
BeyondCompare and VisualSVN1.5 work well on Windows. What are the equivallent tools for Linux. Specifically Ubuntu.
I know command line diff works; But I'd like multiple column syntax highlighted and differences.
Better if the tool has a support for Git and Hg as well.
Hi All,
I am using in UitableView database.My table view works successfully (add single item,add multiple item,delete all) only problem is there when i want to delete single item for this i using Uitableview edit option.
so how i add database method for deleting single item from database and also from table view.
Please help me.
I'm writing a form in XAML that has multiple buttons with content of different sizes (ie "OK" and "Save As...") Ideally, I'd like them all to be the smallest size possible to hold the largest content. In the example above, both buttons would be the width necessary to hold "Save As..." plus the margins and padding.
If they were Grid cells, I could use a SizeGroup. Is there a similar declaration for Buttons?
Do you know any real life examples of actionStack() action helper in Zend Framework?
It seems quite a big overhead to have multiple dispatch loops. Then when it is really needed?
is it possible in some way to compare multiple variables to one constant in a if statement? It would be very helpful if instead of
if ( col.Name != "Organization" && col.Name != "Contacts" && col.Name != "Orders" ) { }
I could just say
if ( col.Name != "Organization" || "Contacts" || "Orders" ) { }
And I know I could use a list but in some instances I dont want to... Thanks!
I need to prevent the screen saver from running while my application is running.
I know how to do this on the Windows versions, with SendInput calls, but I need to do something similar for Linux ports.
It looks complicated, because ideally, I'd like something that would work on multiple Linux distros (SuSe, Red Hat, Ubunutu...) and it looks like there are at least 3 different screen-saver frameworks: xscreensaver, gnome-screensaver, and something else in KDE.
I have a view with multiple controls inside (a picker, a switch, a slider...).
I use an animation to move this view; it appears from bottom and goes up until it disappear by the top.
I can't get the inside controls respond to touches while the view is moving.
How can I catch those touches?
I am getting more and more used to doing everything from inside emacs, but it seems that eshell, shell and term will only run one instance each. Is there a way to run multiple terminals (preferably term) inside emacs?
If I have a sprite, how would I check collision between two points? For example, in a game I am making, I would like to draw multiple lines that my sprite collides against. I'm thinking that this is more flexible than other collision systems if I had a lot of platforms.
Hello. Can anyone tell me how to get and display the biggest values from a database? I have multiple values in my database with the heading "gmd", but how would I get only the first 3 biggest ones to be displayed? How would I do it in this example:
$query = "SELECT gmd FROM account";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
}
Thanks.
I am converting a PHP MySQL web application written for English language into a Multi-Language site. Do you know any vulnerabilities that affect web applications in another language? Or perhaps vulnerabilities that could be introduced in the conversion of code base to support multiple languages. (If you know any vulnerabilities of this type in another language I'll give you a +1)
Hello guys, I'm trying to add some online tests to my site and before I rolled up my sleeves I was wondering if there is any ruby on rails plugin support for such a task.
Essentially I'm looking for something that lets me add multiple choice questions. Performing the scoring logic would be an added bonus.
Any one know of anything?
Im working on a web site that has to be reachable from many countries under the same domain.
Id like to know how can I receive a request with nginx (or any other static file server), and send it to different web servers depending on IP's location.
I mean, what is the point on having multiple db machines on country A and B, if the server that serves you the page is chosen by round robin.
Maybe theres another solution to my problem, and I would be very happy if someone can explain it to me.
Hi!
I have multiple text fields on form and i want two of them should validate like If one of them is empty then say "Both fields are required". Additionally I have also other text fields on form and they are already validating on button click.
Can it be handled using Asp.Net CustomValidator ?
I use something like that to pass to the parameter 'text' what follows after the domain
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?text=$1 [L,QSA]
So if I have www.example.com/tralala I get $text='tralala'
But I want it to be possible to have in the parameter the character ":" multiple times:
www.example.com/me:you:him
Can you give me a hand?
If I test www.example.com/me:you:him I get the error:
Forbidden
You don't have permission to access /you:me:him on this server.