hi all
I have a file having some number of records and I want to copy only first and last 10 records into another file.
Can anybody tell how to write jcl, using sort, icetool, ect.
Since there is for almost everything a module and it is repeatedly said that we should not reinvent the wheel and since I do not write modules for cpan I have no need to use OO.
But my question is, is professional Perlcode mainly written in OO-style?
I have the requirement of updating an app to use multiple (i.e., two in this case) datasources depending upon the type of query. For instance, use DB1 for reads and DB2 for write operations. How would I approach this?
Hi All,
i am trying to figure out how to write a linq query that will return a child collections "name" property as a string.
I have a BO that has a "options" property where the options are the "name" property of each option in an "order" object.
I would like the result to look something like
order.id = 12312
order.date = 12/03/10
order.options = "Option 1 Name, Option 2 Name, Option 3 Name"
I hope this makes sense. thanks for any and all help!
I don't have access to my dev environment, but when I write the below:
interface IExample
void Test (HtmlControl ctrl);
class Example : IExample
{
public void Test (HtmlTextArea area) { }
I get an error stating the methods in the class implementation don't match the interface - so this is not possible. HtmlTextArea is a child class of HtmlControl, is there no way this is possible? I tried with .NET 3.5, but .NET 4.0 may be different (I am interested in any solution with either framework).
Thanks
Reading online about this topic is confusing. Is there a way to cut around the history, politics and technicalities to answer the question: Which standard should I refer to when I write code to generate feeds?
I want to use UTF-8 encoding, which may affect the choice. Otherwise I'm most interested in compatibility with a decent range of readers.
In C#, I can write something like:
using (new MyDisposableClass().MethodA());
The semicolon causes a compiler warning to be shown which states possible mistaken empty statement. I haven't run the above code but won't the method still be called?
What uses is there of this type of coding convention? I saw another thread on here about this but I ask in case there areny differences now/therefore different replies.
Thanks
Is it possible to simply inherit from ProviderBase to write a MembershipProvider, instead of inhering from System.Web.Security.MembershipProvider?
There's just so much junk in the default one, we really want something much, much simpler.
Not sure this is possible, but Looking to write a script that would return the average hex or rgb value for an image. I know it can be done in AS but looking to do it in JavaScript.
What I'd like to do is write just Lazy C++ .lzz files and then have lzz run before a build to generate .cpp and .h files that will be built into the final application, sort of like how moc works with Qt.
Is there any way to do this?
I'm trying to a binary file consisting of floats with Octave (on OS X), but I'm getting the following error:
octave-3.2.3:2> load Input.dat R -binary
error: load: failed to read matrix from file `Input.dat'
The file was written like so:
std::ofstream fout("Input.dat", std::ios::trunc | std::ios::binary);
fout.write(reinterpret_cast<char*>(Buf), N*sizeof(double));
fout.close();
Any idea what could be going wrong here?
This code works well in Mac/Linux, but not in Windows.
import mmap
import os
map = mmap.mmap(-1, 13)
map.write("Hello world!")
pid = os.fork()
if pid == 0: # In a child process
print 'child'
map.seek(0)
print map.readline()
map.close()
else:
print 'parent'
What's the equivalent function of os.fork() on Windows?
Is there any protection provided by kernel? Because when we tried to allocate memory using an
kmalloc() from user space, the kernel allowed to allocated around 124
MB of memory, and when we try to write into it, the kernel crashed. If there
was protection of kernel memory area, this wouldn't have happened, i guess
I need to write a script that will recreate my opt folder if it gets deleted when I remove a package from it. Here's a link to my previous post: dpkg remove to stop processes
Now, the issue I'm running into could be better described here: http://lists.debian.org/debian-devel/2006/03/msg00242.html
I was thinking of just adding a postrem script which checks if an opt directory exists, and if not, creates one. My experience with shell scripts is pretty limited though..
Hi, I inserted some error record to my table, I can query via the sql below and found hundards of record marked with half.
SELECT * FROM `marathon`
WHERE gender = 'male' && distance = 'half';
How to write a SQL then I can modify the result rows distance from 'half' to 'full'.
Thank you.
I have a file containing the following content 1000 line in the following format:
abc def ghi gkl
How can I write a Perl script to print only the first and the third fields?
abc ghi
a = 7
for a in range(10):
if a == 7:
pass
if a == 8:
pass
if a == 9:
pass
else:
print "yes"
how to write it shortly?
#like this or... help
if a ?????[7,8,9]:
pass
I dont see any direct mention on using multiple slugs (or any behavior for that matter) for single model. Is there a way to use the sluggable behavior to generate two separate slugs for a model?
For example i need to generate two slugs for every record a product_id consisting of a slugified company name and sku and a distributor_id consisting of a different slugified company name.
Obviously i could write this myself fairly easily, im just wondering if this can be done quickly with Sluggable.
Table A
tableAID
tableBID
grade
Table B
tableBID
name
description
Table A links to Table b from the tableBID found in both tables.
If I want to find the row in Table A, which has the highest grade, for each row in Table B, I would write my query like this:
select max(grade) from TableA group by tableBID
However, I don't just want the grade, I want the grade plus id of that row.
All,
I am trying to use JQuery's URL Validator plugin.
http://docs.jquery.com/Plugins/Validation/Methods/url
I have a text box that has a URL. I want to write a function which takes the textbox value, uses the jquery's validator plugin to validate urls and returns true or false.
Something like Ex:
function validateURL(textval)
{
// var valid = get jquery's validate plugin return value
if(valid)
{
return true;
}
return false;
}
I wanted this to be a reusable function..
Thanks
Hi,
I am aware that this is not a direct 'development' question but I need that info to test a development project, so I think someone could've hit similar problem.
I will test a software that runs a TCP server and according to sent commands replies some answers. I will test the software and do not want to write code if it doesn't work well. So I want to send those commands and test drive the server software.
How can I achieve this with a Linux box?
I'm looking for a way to collect the dependencies from Flex ActionScript and MXML files. I was hoping that mxmlc could spit them out (like gcc's -M option), but its option list doesn't seem to have anything relevant. I could write a parser, but would prefer not to reinvent the wheel if it has already been done, particularly given the two very different languages involved. Is there a program available to do this for me?