Is there a way to set a limit on how many menu items users can add to Primary Links menu? I'm working on a Drupal site and I have a horizontal primary links nav bar. There is only room for no more than 7-8 links in the nav bar. I don't want the future maintainer of the site to add more than 8 items to the menu. Is there a way I can set a limit on that? Some module or override function?
Thanks,
Given this table:
Order
custName description to_char(price)
A desa $14
B desb $14
C desc $21
D desd $65
E dese $21
F desf $78
G desg $14
H desh $21
I am trying to display the whole row where prices have the highest occurances, in this case $14 and $21
I believe there needs to be a subquery. So i started out with this:
select max(count(price))
from orders
group by price
which gives me 3.
after some time i didn't think that was helpful. i believe i needed the value 14 and 21 rather the the count so i can put that in the where clause. but I'm stuck how to display that. any help?
I want to insert n elements into a map where n is known ahead of time. I do not want memory allocation at each insertion. I want all memory allocation at the beginning. Is there a way to do this? If so, how? Will writing some sort of memory allocator help?
I'd like to know whether it's possible to have phone numbers converted
into international format when a call is outgoing.
For instance, if a french user (sorry it's the only format i know i
won't make a mistake :-) try to call with the national format :
01.47.12.34.56 then a method will convert it into international format
like this : +33.1.47.12.34.56
I've looked into the doc of the PhoneNumberUtils but i don't know if
there is a method doing what i want.
I know of an Eclipse feature to show revision information (gradual coloring, more info like revisionnumber, date and author on mouseover) for the last changes in a line in the linenumbers-view.
Does anyone know how to activate this feature for a file, or even better, by default? I accidently hit some shortcut lately which made it show in one file, it does not show up in the others, though.
I want to use lua (that internally uses only doubles) to represent a integer that can't have rounding errors between 0 and 2^64-1 or terrible things will happen.
Is it possible to do so?
hello,
suppose I have a text list in emacs like this:
a
b
c
...
d
Is there a way to assign numbers to those items in Emacs, by selecting the region? End results should look like:
1. a
2. b
3. c
j. ...
n. d
Thanks.
here is the script does what i want but not exactly,
my question is, how can i stop user entering text once it reached the lmit of 255 characters?
var limit = 255;
var txt = $('textarea[id$=txtPurpose]');
$(txt).keyup(function() {
var len = $(this).val().length;
if (len > limit) {
//this.value = this.value.substring(0, 50);
$(this).addClass('goRed');
$('#spn').text(len - limit + " characters exceeded");
return false;
}
else {
$(this).removeClass('goRed');
$('#spn').text(limit - len + " characters left");
}
});
if there is a better way please let me know.
When I change the assembly information to lets say 1.0.0.1 i thought that i could read the version with $(Version) but it seems that it does not change?
Hi,
I am trying to get access to the AssemblyVersion and AssemblyFileVersion numbers in the assembly information using the post build event command line in visual studio 2008. Is there a way to get access to that information similar to how $(TargetName) gets its macro definition from the project title.
I've used boost::gregorian::date a bit now.
I can see that there are the related months & years & weeks duration types.
I can see how to use known durations to advance a given date.
Qu: But how can I get the difference between two dates in months (or years or weeks) ?
I was hoping to find a function like:
template<typename DURATION>
DURATION date_diff<DURATION>(const date& d1,const date& d2);
There would need to be some handling of rounding too.
I want to convert 8 digit value to date time how can I do it for example if user enter 08082010 then it should convert it to 08/08/2010, using C#
hope you understand my question, if you need any further info about it please do tell me thanks in advance ,
can any one please let me know, i need to set the "Total Price" value to be in two decimal point value like "56.35". Now its showing more fraction values like "56.3566666". I need it to be format it by musql "SELECT" query.
I have 2 worksheets, one with company data and the other with a min max and answer column.
What i need to do is find out if value in column D in the company data is between the min/max in worksheet 2 output answer in worksheet 2.
Please can someone help. This is clearly a vlookup question but i haven't got a clue how to do the min/max.
Any help will be greatly appreciated.
worksheet 1
NAME TYPE NUMBEROFEMPLOYEES Output
Wetland Plants Ltd Client 4
Capital Management LLP Clients 3
College ltd Clients 156
Worksheet 2
max min output
100000000 60000 big
59999 15000 medium
14999 0 small
Cheers guys
Is there a way for me to get a pseudo-ID of a post from the category it belongs to? Let's say I have these posts
post_id | post_title | post_cat
--------+------------+---------
0 | a post | cat1
1 | a post1 | cat2
2 | a post2 | cat1
3 | a post3 | cat2
...
57 | a post57 | cat2
I want the posts from cat2 and the posts' ids to be relative to the category they were posted in. Something like
post_id | post_title | post_cat | cat_post_id
--------+------------+----------+--------
1 | a post1 | cat2 | 1
3 | a post3 | cat2 | 2
57 | a post57 | cat2 | 3
Take 8 digit no as input i dont know where is the decimel point ,but i have to find the no before decimel point . i know this is My homework but i need answer for interview plz help me
I work in Javascript with integer numbers only (mainly adding numbers and shifting them). I wonder how big they can be without loosing any bits.
For example, how big X can be such that 1 << X will represent 2^X ?
I have asked the question before but in a different manner. I am trying taking form data, compiling into a temporary CSV file and trying to send over to a client via FTP over SSL (this is the only route I am interested in hearing solutions for unless there is a workaround to doing this, I cannot make changes). I have tried the following:
ftp_connect - nothing happens, the
page just times out
ftp_ssl_connect - nothing happens,
the page just times out
curl library - same thing, given URL
it also gives error.
I am given the following information:
FTPS Server IP Address
TCP Port (1234)
Username
Password
Data Directory to dump file
FTP Mode: Passive
very, very basic code (which I believe should initiate a connection at minimum):
Code:
<?php
$ftp_server = "00.000.00.000"; //masked for security
$ftp_port = "1234"; // masked but not 990
$ftp_user_name = "username";
$ftp_user_pass = "password";
// set up basic ssl connection
$conn_id = ftp_ssl_connect($ftp_server, $ftp_port, "20");
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
echo ftp_pwd($conn_id); // /
echo "hello";
// close the ssl connection
ftp_close($conn_id);
?>
When I run this over a SmartFTP client, everything works just fine. I just can't get it to work using PHP (which is a necessity). Has anybody had success doing this in the past? I would be very interested to hear your approach.
Hello,
I am using a PHP file called comments.php that has a query that enters values into a mySQL table called "comment." As the query does this, it auto-generates a field called "commentid", which is set to auto_increment in MySQL. The file also contains a loop what echoes out all comments for a given submission.
It all works fine and dandy, but I want to simultaneously pull this "commentid" and turn it into a hashtag / anchor that when appended to the end of the URL makes that comment at the top of the user's browser.
Someone said on another question that in order to do this one thing I should do is create an anchor on the row where the comment is being printed out. How can I do this?
Thanks in advance,
John
The query that inserts comments into the MySQL table "comment":
$query = sprintf("INSERT INTO comment VALUES (NULL, %d, %d, '%s', NULL)", $uid, $subid, $comment);
mysql_query($query) or die(mysql_error());
The fields in the table "comment":
commentid loginid submissionid comment datecommented
The row in a loop where the comments are echoed out:
echo '<td rowspan="3" class="commentname1">'.stripslashes($row["comment"]).'</td>';
I have written the following program using Parallel Haskell to find the divisors of 1 billion.
import Control.Parallel
parfindDivisors :: Integer->[Integer]
parfindDivisors n = f1 `par` (f2 `par` (f1 ++ f2))
where f1=filter g [1..(quot n 4)]
f2=filter g [(quot n 4)+1..(quot n 2)]
g z = n `rem` z == 0
main = print (parfindDivisors 1000000000)
I've compiled the program with ghc -rtsopts -threaded findDivisors.hs and I run it with:
findDivisors.exe +RTS -s -N2 -RTS
I have found a 50% speedup compared to the simple version which is this:
findDivisors :: Integer->[Integer]
findDivisors n = filter g [1..(quot n 2)]
where g z = n `rem` z == 0
My processor is a dual core 2 duo from Intel.
I was wondering if there can be any improvement in above code. Because in the statistics that program prints says:
Parallel GC work balance: 1.01 (16940708 / 16772868, ideal 2)
and SPARKS: 2 (1 converted, 0 overflowed, 0 dud, 0 GC'd, 1 fizzled)
What are these converted , overflowed , dud, GC'd, fizzled and how can help to improve the time.
I want to produce a JSON file, containing some initial parameters and then records of data like this:
{
"measurement" : 15000,
"imi" : 0.5,
"times" : 30,
"recalibrate" : false,
{
"colorlist" : [234, 431, 134]
"speclist" : [0.34, 0.42, 0.45, 0.34, 0.78]
}
{
"colorlist" : [214, 451, 114]
"speclist" : [0.44, 0.32, 0.45, 0.37, 0.53]
}
...
}
How can this be achieved using the Python json module? The data records cannot be added by hand as there are very many.