Thursday, 3 October 2013

Find Value in colum - if found get value from row

Find Value in colum - if found get value from row

I have a spread sheet where i would like to find a value
This tells me how many i have in the colum if cems. Now what i need to do
is if that row has done in called cems - return the value in cell D. and
work my way down to get them all.
How would i do this?

Wednesday, 2 October 2013

integral of the square of the normal distribution

integral of the square of the normal distribution

Does someone know what the integral of the square of the normal
distribution with standard deviation sigma over the range -infinity to
+infinity is? Thanks!

yum update php 5.3.3 to 5.3.27 (centos 6.4)

yum update php 5.3.3 to 5.3.27 (centos 6.4)

How to update PHP 5.3.3 to the latest 5.3.27 on CentOS 6.4?
All repos have 5.3.3 version. I've added Webtatic.com repository which has
5.3.27 but "yum update php" shows me nothing.
Thanks in advance!

What is best way to store array data in MySQL / Rails?

What is best way to store array data in MySQL / Rails?

Lets take Stackoverflow as an example:
Two models: Questions and Tags
A Question can have many Tags.
Should a separate table "Question_tags" be created to manage the
associations or is there a way to create an array field in the Questions
table.
Which is better? Would a dedicated "Question_tags" table be overkill?

Using and refreshing charts with Durandal properly

Using and refreshing charts with Durandal properly

i've read a lot of on stackoverflow and at the Google Durandal Group about
implementing charts, using kendo for example. I tried some things related
to data binding, Kendo and Durandal but, unfortunately, i also failed with
that...
Actually, i'm exited of Durandel and i'm using it in my current project,
but i urgently need to be able to display a chart!
I have also downloaded the hot-towel project, but it all works limited. I
don't get any refreshing of my charts. The chart is shown correctly once
but then updated no longer by itself (what it should do in my case).
Which chart-JS solution fits best for Durandal? How does the data binding
between Knockout, Chart, and Durandal work?
Who can make a recommendation or give me any hints?
Any help is highly appreciated!
Thanks,
regards Michael

Tuesday, 1 October 2013

Python function not returning correct output

Python function not returning correct output

Trying to use python to change the value associated to a key in a
dictionary and it's not returning the correct output
def fetchAndReplace(dictionary,key,newValue):
keys = dictionary.keys()
for i in keys:
if i == key:
print dictionary[key]
dictionary[key] = newValue
return
else:
return "Nothing"
When I call this one a dictionary {'x':3,'y':2}, with x for key and 6 for
newValue It returns the string nothing, which it shouldn't. I can't find
anything wrong with my code so if you could point out the mistake I'm
overlooking I'd appreciate it.

jQuery place div in between two different divs

jQuery place div in between two different divs

I need to get for example all div's data-id's and place a new div with
data-id="6" in between data-id="3" and data-id="9".
The new data-id can be with an id of 1 too, so there's no div before it,
but it needs to be before data-id 2 (if it exists, if not then before the
next highest number)
Example:
<div class="container">
<div data-id="1"></div>
<div data-id="2"></div>
<div data-id="5"></div>
<div data-id="7"></div>
<div data-id="11"></div>
</div>
And I need to add a div with data-id="9" in between 7 and 11.
I'm still learning jQuery so I don't really have any clue how to achieve
this. I tried with insertBefore() but it doesn't work like I want it to.
It only works when the new div is data-id="10" and data-id="11" exists in
the container.

How to determine HP Smart Array model?

How to determine HP Smart Array model?

How to determine HP Smart Array model on HP server? I own HP 350 G6 server.
Really do not know where to look, is there a utility tool that can help me
find this information, or is there a sign on the hardware?
Thanks

VPS apache config - Invalid command 'PassengerDefaultRuby' after adding latest passenger gem

VPS apache config - Invalid command 'PassengerDefaultRuby' after adding
latest passenger gem

used to have this list of rubies in my vps:
ruby-1.9.2-p320 [ i686 ]
=* ruby-1.9.3-p194 [ i686 ]
ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
today I installed a new app on this vps on ruby 2.0, so I added 2.0 to rvm:
ruby-1.9.2-p320 [ i686 ]
ruby-1.9.3-p194 [ i686 ]
ruby-1.9.3-p374 [ i686 ]
ruby-1.9.3-p392 [ i686 ]
=* ruby-2.0.0-p247 [ i686 ]
installed passenger and passenger-apache-module, instructions says to add
these lines:
LoadModule passenger_module
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19/buildout/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.19
PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p247/ruby
to /etc/apache2/apache2.conf and restart apache, after restart I got this
error:
Syntax error on line 242 of /etc/apache2/apache2.conf:
Invalid command 'PassengerDefaultRuby', perhaps misspelled or defined by a
module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!
and one more problem, when I open my app at http://nccm.md I got:
Could not find rake-10.1.0 in any of the sources (Bundler::GemNotFound)
from gem list command I can see this gem is installed in ruby 2.0
environment, but the app looks for it in
usr/local/rvm/gems/ruby-1.9.3-p194@global and not in
ruby-2.0.0-p247@global. Why is that? Thank you for any help.