Now i am using the plugins spreadsheet(http://spreadsheet.rubyforge.org/) on ruby on rails, but i have a problem on merging cells, so who can help me to achieve the feature! thank you!
In our office, we regularly enjoy some rounds of foosball / table football after work. I have put together a small java program that generates random 2vs2 lineups from the available players and stores the match results in a database afterwards.
The current prediction of the outcome uses a simple average of all previous match results from the 4 involved players. This gives a very rough estimation, but I'd like to replace it with something more sophisticated, taking into account things like:
players may be good playing as attacker but bad as defender (or vice versa)
players do well against a specific opponent / bad against others
some teams work well together, others don't
skills change over time
What would be the best algorithm to predict the game outcome as accurately as possible?
Someone suggested using a neural network for this, which sounds quite interesting... but I do not have enough knowledge on the topic to say if that could work, and I also suspect it might take too many games to be reasonably trained.
EDIT:
Had to take a longer break from this due to some project deadlines. To make the question more specific:
Given the following mysql table containing all matches played so far:
table match_result
match_id int pk
match_start datetime
duration int (match length in seconds)
blue_defense int fk to table player
blue_attack int fk to table player
red_defense int fk to table player
red_attack int fk to table player
score_blue int
score_red int
How would you write a function predictResult(blueDef, blueAtk, redDef, redAtk) {...}
to estimate the outcome as closely as possible, executing any sql, doing calculations or using external libraries?
In Rails, I have a question on how to get the multiple params !
for example:
the string in log like this
Processing ConfigurationsController#emergency_config (for 192.168.1.124 at 2010-05-31 11:45:53) [POST]
Parameters: {"authenticity_token"=>"I3GPKyrjmDRLkMIxFVS/47mgEI4ETO/+YW+R8R5Q2GM=", "tid"=>"1", "emergency"=>{"department"=>["1", "2", "3", "4", "5", "6", "7", "8"]}}
so,how can i get the department values from it? who can tell me the answer? thank you!
I have a simple class derived from a generic list of string as follows:
[Serializable]
[System.Xml.Serialization.XmlRoot("TestItems")]
public class TemplateRoleCollection : List<string>
{
}
when I serialize this, I get the following XML:
<TestItems>
<string>cat</string>
<string>dog</string>
<string>wolf</string>
</TestItems>
Is there any way to override the xml element name which is used for serializing items in the collection?
I would like the following xml to be produced:
<TestItems>
<TestItem>cat</TestItem>
<TestItem>dog</TestItem>
<TestItem>wolf</TestItem>
</TestItems>
Hey,Guys!
In rails , I met a question!
when i use the multiple select ,i don't know ,how can i get the all parameter values ,it likes
in javaEE,
String[] strs=request.getParameters("aaa");
so,who can tell me the method in rails to realize the function?
Thank you in advance!
Now , I execute the command line "rake db:migrate" on the window OS, but I got the problem in the console. it print couldn't find HOME environment -- expanding~/.ruby-uuid'`
who can help me to solve this ? Thank you and best regards!
I want to use selenium test to cover my rails project ! but i just find little documents on selenium test . I want someone to give me some documents for selenium test of all types !like website ,pdf ,text etc. you can sent them to my gmail [email protected] Thank you ,and best regards!
Here's a simplified version of some code I'm working on:
void
stuff(int fd)
{
int ret1, ret2;
char buffer[32];
ret1 = recv(fd, buffer, 32, MSG_PEEK | MSG_DONTWAIT);
/* Error handling -- and EAGAIN handling -- would go here. Bail if
necessary. Otherwise, keep going. */
/* Can this call to recv fail, setting errno to EAGAIN? */
ret2 = recv(fd, buffer, ret1, 0);
}
If we assume that the first call to recv succeeds, returning a value between 1 and 32, is it safe to assume that the second call will also succeed? Can ret2 ever be less than ret1? In which cases?
(For clarity's sake, assume that there are no other error conditions during the second call to recv: that no signal is delivered, that it won't set ENOMEM, etc. Also assume that no other threads will look at fd.
I'm on Linux, but MSG_DONTWAIT is, I believe, the only Linux-specific thing here. Assume that the right fnctl was set previously on other platforms.)
I have a public repository. No one else has forked, pulled, or done anything else to it. I made some minor changes to one file, successfully committed them, and tried to push. It says 'Everything up-to-date'. There are no branches. I'm very, very new to git and I don't understand what on earth is going on.
git remote show origin tells me:
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (up to date)
Any ideas what I can do to make this understand that it's NOT up to date?
Thanks
Updates:
git status:
# On branch master
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# histmarkup.el
# vendor/yasnippet-0.6.1c/snippets/
no changes added to commit (use "git add" and/or "git commit -a")
git branch -a:
* master
remotes/origin/master
git fsck:
dangling tree 105cb101ca1a4d2cbe1b5c73eb4a238e22cb4998
dangling tree 85bd0461f0fcb1618d46c8a80d3a4a7932de34bb
Update 2: I re-opened the modified file, and the modifications I KNOW I had made were gone. So I added them again, went through the rigamarole of git status, git add filename, git commit -m "(message)", and git push origin master, and all of a sudden it works the way it's supposed to.
I have a large database with over 150 tables that I've recently been handed. I'm just wondering if there is an easy way to view all foreign key constraints for the entire DB instead of on a per-table basis.
Hey,Guys!
Now I hava a problem,how can I make the callback#after_add receive a reference to the join model in a has_many :through association?
my code like this:
class Emergency
has_many :departments, :through => :eme_references, :after_add => Proc.new { |eme_reference| eme_reference.eme_flag = 1}
end
the attribute eme_flag is the model EmeReference's attribute! but in the block ,i get the eme_reference.class is Emergency.
I want to set the attribute eme_flag of the model EmeReference.
That is my question!
cheers!
Hey,Guys!
Now I hava a problem,how can I make the callback#after_add receive a reference to the join model in a has_many :through association?
my code like this:
class Emergency
has_many :departments, :through => :eme_references, :source => :email, :after_add => Proc.new { |eme_reference| eme_reference.eme_flag = 1}
end
the attribute eme_flag is the model EmeReference's attribute! but in the block ,i get the eme_reference.class is Emergency.
I want to set the attribute eme_flag of the model EmeReference.
That is my question!
cheers!
As the title said, I got a problem! i encountered the "RJS Error:[object error]",the code in my application is
page << "#{hidden_print("#{url_for(:controller => 'tables', :action => 'dispatch', :id => id, :pop => true, :print =>true)}")} "
the method hidden_print is
def hidden_print(url)
"window.parent.headFrame.document.all.iframe_helper.src = '#{url}';"
end
I want to get the object of this code ,
<input class="radio"
id="conversation_sub_kind_id_208"
name="conversation[sub_kind_id]"
onclick="set_department_name('department_name208')"
type="radio"
value="208" />
I want to use jQuery Framework to get the object, like the document.getElementbyTagName("conv..."); what should i do in here?
Thank you, and best regards!
Hey ,Guys!
I want to use the method request.query_string to send the key-value to the controller,how can i use in the sentences;
=link_to 'excel' , reports_excel_path(:format => 'xls',:from => 'conversations')
Thank you!
I have a question.Here is the code!
f.select(:departments,Department.all.collect{|c|[c.name,c.id]},{},:size=>10,:multiple => ture)
class Emergency
has many :departments
end
the html source like this:
<select id="emergency_departments" multiple="multiple" name="emergency[departments][]" size="10"><option value ="">""</option>....</select>
now I want to get the default selected tag , who can tell me how ?
Hello all i am having a fun filled irritating little problem which i am sure can be resolved in less than 5 seconds with the enlightened and combined minds of stack overflow users
ok first off it seems i am having trouble communicating what my trouble is with the gentlemen and ladies who are trying to help me in earlier posts
so i am going to make it very simple
i need to get 337 and 229 out of this son of satan string that is constantly updating every 2 seconds now i dont know how to go about doing this i know i should probably use split but i dont know how to do it on this because i have very little experience with it
Last login: Thu Jun 5 08:20:35 2014 from .** /*/*-..****.**///*-****.**.*/****/*/***status Virtual server [...] is UP. *: 337 bananas left ****(s)******: 229 bananas eaten(s) ** *. [* ] –
i am tired and would like to finish this before i am gray or sentanced to prison for raving naked down my street please help and thanks in advance
p.s dont really care if this gets down voted a bit tired and more than a little angry so enjoy
There is a model relation like this.
class A
belongs_to :ref_config,:class_name => 'User'
end
My question is :
the A has a attribute named flag, now i want to create a function like this:
if flag == 1, I want the class A like this belongs_to :ref_config,:class_name => 'Department and if flag == 2, i want the class A like this belongs_to :ref_config,:class_name => 'User'
How can I implement the function
Thank you!
Here is the latest in my link-listing series. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] ASP.NET Data Web Control Enhancements in ASP.NET 4.0: Scott Mitchell has a good article that summarizes some of the nice improvements coming to the ASP.NET 4 data controls. Refreshing an ASP.NET AJAX UpdatePanel with JavaScript: Scott Mitchell has another nice article in his series...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.
Here is the latest in my link-listing series. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] ASP.NET Data Web Control Enhancements in ASP.NET 4.0: Scott Mitchell has a good article that summarizes some of the nice improvements coming to the ASP.NET 4 data controls. Refreshing an ASP.NET AJAX UpdatePanel with JavaScript: Scott Mitchell has another nice article in his series...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.
Here is the latest in my link-listing series. Also check out my VS 2010 and .NET 4 series for another on-going blog series I’m working on. [In addition to blogging, I am also now using Twitter for quick updates and to share links. Follow me at: twitter.com/scottgu] ASP.NET ASP.NET Code Samples Collection: J.D. Meier has a great post that provides a detailed round-up of ASP.NET code samples and tutorials from a wide variety of sources. Lots of useful pointers. Slash your ASP.NET compile/load time without any hard work: Nice article that details a bunch of optimizations you can make to speed up ASP.NET project load and compile times. You might also want to read my previous blog post on this topic here. 10 Essential Tools for Building ASP.NET Websites: Great article by Stephen Walther on 10 great (and free) tools that enable you to more easily build great ASP.NET Websites. Highly recommended reading. Optimize Images using the ASP.NET Sprite and Image Optimization Framework: A nice article by 4GuysFromRolla that discusses how to use the open-source ASP.NET Sprite and Image Optimization Framework (one of the tools recommended by Stephen in the previous article). You can use this to significantly improve the load-time of your pages on the client. Formatting Dates, Times and Numbers in ASP.NET: Scott Mitchell has a great article that discusses formatting dates, times and numbers in ASP.NET. A very useful link to bookmark. Also check out James Michael’s DateTime is Packed with Goodies blog post for other DateTime tips. Examining ASP.NET’s Membership, Roles and Profile APIs (Part 18): Everything you could possibly want to known about ASP.NET’s built-in Membership, Roles and Profile APIs must surely be in this tutorial series. Part 18 covers how to store additional user info with Membership. ASP.NET with jQuery An Introduction to jQuery Templates: Stephen Walther has written an outstanding introduction and tutorial on the new jQuery Template plugin that the ASP.NET team has contributed to the jQuery project. Composition with jQuery Templates and jQuery Templates, Composite Rendering, and Remote Loading: Dave Ward has written two nice posts that talk about composition scenarios with jQuery Templates and some cool scenarios you can enable with them. Using jQuery and ASP.NET to Build a News Ticker: Scott Mitchell has a nice tutorial that demonstrates how to build a dynamically updated “news ticker” style UI with ASP.NET and jQuery. Checking All Checkboxes in a GridView using jQuery: Scott Mitchell has a nice post that covers how to use jQuery to enable a checkbox within a GridView’s header to automatically check/uncheck all checkboxes contained within rows of it. Using jQuery to POST Form Data to an ASP.NET AJAX Web Service: Rick Strahl has a nice post that discusses how to capture form variables and post them to an ASP.NET AJAX Web Service (.asmx). ASP.NET MVC ASP.NET MVC Diagnostics Using NuGet: Phil Haack has a nice post that demonstrates how to easily install a diagnostics page (using NuGet) that can help identify and diagnose common configuration issues within your apps. ASP.NET MVC 3 JsonValueProviderFactory: James Hughes has a nice post that discusses how to take advantage of the new JsonValueProviderFactory support built into ASP.NET MVC 3. This makes it easy to post JSON payloads to MVC action methods. Practical jQuery Mobile with ASP.NET MVC: James Hughes has another nice post that discusses how to use the new jQuery Mobile library with ASP.NET MVC to build great mobile web applications. Credit Card Validator for ASP.NET MVC 3: Benjii Me has a nice post that demonstrates how to build a [CreditCard] validator attribute that can be used to easily validate credit card numbers are in the correct format with ASP.NET MVC. Silverlight Silverlight FireStarter Keynote and Sessions: A great blog post from John Papa that contains pointers and descriptions of all the great Silverlight content we published last week at the Silverlight FireStarter. You can watch all of the talks online. More details on my keynote and Silverlight 5 announcements can be found here. 31 Days of Windows Phone 7: 31 great tutorials on how to build Windows Phone 7 applications (using Silverlight). Silverlight for Windows Phone Toolkit Update: David Anson has a nice post that discusses some of the additional controls provided with the Silverlight for Windows Phone Toolkit. Visual Studio JavaScript Editor Extensions: A nice (and free) Visual Studio plugin built by the web tools team that significantly improves the JavaScript intellisense support within Visual Studio. HTML5 Intellisense for Visual Studio: Gil has a blog post that discusses a new extension my team has posted to the Visual Studio Extension Gallery that adds HTML5 schema support to Visual Studio 2008 and 2010. Team Build + Web Deployment + Web Deploy + VS 2010 = Goodness: Visual blogs about how to enable a continuous deployment system with VS 2010, TFS 2010 and the Microsoft Web Deploy framework. Visual Studio 2010 Emacs Emulation Extension and VIM Emulation Extension: Check out these two extensions if you are fond of Emacs and VIM key bindings and want to enable them within Visual Studio 2010. Hope this helps, Scott
Carl Franklin & Richard Campbell of .NET Rocks are taking their show on the road and are going to make a stop in Tulsa Oklahoma on Wednesday April 28th, 2010. This event will be from 6:00 PM until 9:00 PM. This is a FREE EVENT, with FREE FOOD and FREE SWAG. They are also going to be bringing a special surprise guest speaker (It could be Scott Hanselman, Scott Guthrie, Don Box, Billy Hollis, Dan Appleman or …) Broken Arrow North Auditorium 808 East College Street Please visit the Tulsa Developers .NET web site for updated information as it becomes available. Register by going to this link.
HR Intelligence Can Help Companies Win the Race for Talent
Today during a keynote at Taleo World 2012,
Oracle President Mark Hurd outlined the ways that executives can use HR
intelligence to help them make better business decisions, shape the
future of their organizations and improve the bottom line.
He highlighted that talent management is one of the top three focus
areas for CEOs, and explained how HR intelligence can help drive
decisions to meet business objectives. Hurd urged HR leaders to use data
to make fact-based decisions about hiring, talent management and
succession to drive strategic growth.
To
win the race for talent, Hurd explained that organizations need
powerful technology that provides fact-based valuable insight that is
needed to proactively manage talent, drive strategic initiatives that
promote innovation, and enhance business performance.
To view the full story and press release, click here.