Is there a way to add sun one application server 7 to eclipse IDE. Its for maintaining an enterprise application project. The jdk is also 1.4 used for the application.
I have this model:
class Journals(models.Model):
jid = models.AutoField(primary_key=True)
code = models.CharField("Code", max_length=50)
name = models.CharField("Name", max_length=2000)
publisher = models.CharField("Publisher", max_length=2000)
price_euro = models.CharField("Euro", max_length=2000)
price_dollars = models.CharField("Dollars", max_length=2000)
Is there a way to let people fill out either price_euro or price_dollars?
I do know that the best way to solve the problem is to have only one field and another table that specify the currency, but I have constraints and I cannot modify the DB.
Thanks!
Hi,
How to load a multiple line query in one row using mysql.The data is stored in a text file.
For example:
"GGAGTTGTGGGAGTGGAGGAGGAAGAGGCGGTGGGGAGTACGGGGGCTGGTCCCAGAAGATGGCGGAGGC
GGGGGATTTCTGGTAGGTCCTACTTTAGGACAAGATGTGGTGGTACTGTTGAAGCGTCAGTCTTTGATTC"
Thanks in advance.
Is there a cross-platform way to list the processes running on one's computer through a python script? For Unix based system "ps -ef" works, but I am new to Python and don't know a way to write something that would work across any platform.
Thanks!
How does one combine two GCC compiled .o object files into a third .o file?
$ gcc -c a.c -o a.o
$ gcc -c b.c -o b.o
$ ??? a.o b.o -o c.o
$ gcc c.o other.o -o executable
If you have access to the source files the -combine GCC flag will merge the source files before compilation:
$ gcc -c -combine a.c b.c -o c.o
However this only works for source files, and GCC does not accept .o files as input for this command.
Normally, linking .o files does not work properly, as you cannot use the output of the linker as input for it. The result is a shared library and is not linked statically into the resulting executable.
$ gcc -shared a.o b.o -o c.o
$ gcc c.o other.o -o executable
$ ./executable
./executable: error while loading shared libraries: c.o: cannot open shared object file: No such file or directory
$ file c.o
c.o: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
$ file a.o
a.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
Hello all.
It's Tuesday morning and I am being thick as (I'm blaming my daughter waking up early this morning!)
I have the following example in a SQL table
Cust Group Sales
A 1 15
A 1 10
A 1 5
A 2 15
A 2 10
A 2 5
B 1 15
B 1 10
B 1 5
B 2 15
B 2 10
B 2 5
What I would like to show is the top 2 products per customer, per group sorted descending by Sales i.e.
Cust Group Sales
A 1 15
A 1 10
A 2 15
A 2 10
B 1 15
B 1 10
B 2 15
B 2 10
I'm assuming I need to declare two variables, Cust and Group, I'm just not sure how to complete this in one fell swoop.
Apologies for the thick question...no excuse. Thanks for any help.
Hi,
I have two cursors in my procedure that only differ on the table name that they join to.
The cursor that is used is determined by a parameter passed into the procedure
if (param = 'A') then
DECLARE CURSOR myCursor IS
SELECT x,y,z
FROM table1 a, table2 b
BEGIN
FOR aRecord in myCursor
LOOP
proc2(aRecord.x, aRecord.y, aRecord.z);
END LOOP;
COMMIT;
END;
elsif (param = 'B') then
DECLARE CURSOR myCursor IS
SELECT x,y,z
FROM table1 a, table3 b -- different table
BEGIN
FOR aRecord in myCursor
LOOP
proc2(aRecord.x, aRecord.y, aRecord.z);
END LOOP;
COMMIT;
END;
end if
I don't want to repeat the code for the sake of one different table.
Any suggestions on how to improve this?
Thanks in advance
Hi,
I´m using Wordpress to develop a blog, and I need to rate things using a 5 star rate.
I saw many different plugins that rate pages and posts. But, besides posts and pages, what I need is to rate several things in the same post/page.
I have a list of links, where users cane rate each one of them.
Any ideas?
Thanks!
This should be simple but I can't figure it out
<?php
$testid = 240;
$curid = 251;
$cal = $curid - $testid;
echo $cal;
?>
I want to determine the numbers in between two other numbers so for this example it detects there are 11 numbers in between the $testid and $curid, but i dont need it to do that.
I need it to literally figure the numbers in between $curid - $testid which in this example would be 241, 242, 243... all the way to 251 then i need to create a loop with those numbers and do a query below with each one
$cal = $curid - $testid;
mysql_query("SELECT * FROM wall WHERE id='".$cal."'")
// and for each number mysql should out put each data field with those numbers.
Thanks again, love you guys.
Hi,
I'm trying to create an infinite scroll component.
I'm using this site as a tutorial, but it seems that I can only get the infinite scroll on one way, because when I add elements to the leftmost side, the scrollLeft property auto-adjusts thus the page gets a quirky scroll, jumping instead of making a smooth movement.
Is there any way of achieving infinite scroll both-ways? I don't plan to use scrolling buttons, just mouse drag for moving the scroll view.
We would like to map a single table on two classes with NHibernate. The mapping has to be dynamically depending on the value of a column.
Here's a simple example to make it a bit clearer:
We have a table called Person with the columns id, Name and Sex.
The data from this table should be mapped either on the class Male or on the class Female depending on the value of the column Sex.
In Pseudocode:
create instance of Male with data from table Person where Person.Sex = 'm';
create instance of Female with data from table Person where Person.Sex = 'f';
The benefit is we have strongly typed domain models and can later avoid switch statements.
Is this possible with NHibernate or do we have to map the Person table into a flat Person class first? Then afterwards we would have to use a custom factory method that takes a flat Person instance and returns a Female or Male instance.
Would be good if NHibernate (or another library) can handle this.
I have two tables, one is a table of forum threads. It has a last post date column.
Another table has PostID, UserId, and DateViewed.
I want to join these tables so I can compare DateViewed and LastPostDate for the current user. However, if they have never viewed the thread, there will not be a row in the 2nd table.
This seems easy but I cant wrap my head around it. Advice please.
Thanks in advance.
Hi All,
I am trying to compare to textbox values on an aspx form. Both the values represent dates. The are formatted like "dd/MMM/yyyy". How can I compare them in javascript to see if they are not equal and which one is greater etc... Does javascript have a date constructor for strings like this? Any tips would be appreciated. Thanks for the help.
Cheers,
~ck in San Diego
This deletes the document from the Document table and outputs information about the deleted document into the FinishedDocument table.
DELETE
FROM Document
OUTPUT Deleted.DocumentId
, Deleted.DocumentDescription
INTO FinishedDocument
WHERE DocumentId = @DocumentId
I need to delete the document not just from the Document table, but also from the DocumentBackup table. Meanwhile, I need to maintain insertion into FinishedDocument.
Is all of this possible with only one statement? If not, is a second DELETE (against DocumentBackup), with all of it wrapped in a transaction, the way to go?
I have a class that contains two sets. They both contain the same key type but have different compare operations.
I would like to provide an iterator for the class that iterates through the elements of both sets. I want to start with one set, then when I increment an iterator pointing to the last element of the first set, I want to go to the first element of the second set. How do I do this? I would like to preserve the bidirectional iterator semantics of std::set, but if it turns out that implementing a forward iterator is much easier, so be it.
I'm willing to use the Boost Iterator library if that would help.
I need to config one SMTP server (sendmail) to send mail with 2 interfaces with different ip's depending server.
For example: In same machine with to ip: 1.1.1.1 and 2.2.2.2 i need to send email [email protected] by 1.1.1.1 and [email protected] by 2.2.2.2
I don't now if i can configure it on sendmail, or use iptables, some idea ?
Thx.
Hey folks :-)
I'm just getting started with ASP.NET MVC 2, and playing around with Validation.
Let's say I have 2 properties:
Password1
Password2
And I want to require that they are both filled in, and require that both are the same before the model is valid.
I have a simple class called "NewUser".
How would I implement that? I've read about ValidationAttribute, and understand that. But I don't see how I would use that to implement a validation that compares two or more properties against eathother.
Thanks in advance!
I'd like to display two independent Tumblr blogs next to each other on one page. I'd like them to look identical to their Tumblr theme. What's the best way to do this?
I'm able to use JavaScript to import the content like this:
<div id="tumblr1">
<script type="text/javascript" src="http://tumblr1.tumblr.com/js"></script>
<div>
<div id="tumblr2">
<script type="text/javascript" src="http://tumblr2.tumblr.com/js"></script>
<div>
But the content obviously won't be styled. Is there a simpler way to do this? If not, is there a simple way to style the content I'm getting from the js?
I use Postgresql + PHP.
Say I have this table:
Books ( id, title, year )
and this array of titles in PHP:
$titles = array ("bible","kafka","Book of Eli");
now I want update all rows where the title is in the $titles array above.
So I need a query like this:
UPDATE books SET year = '2001-11-11' WHERE title is in $titles;
Is is possible with one single query ? Or do I need to use FOR loop ?
Hello all,
I'm using C#/.NET with the C# wrapper for SQLite. I'm attempting to merge two SQLite databases together while excluding duplicates.
I found this, which is referenced from a few different forum questions.
http://old.nabble.com/Attempting-to-merge-large-databases-td18131366.html
Would I run the following queries in my SQLite configuration as listed below?
attach 'c:\test\b.db3' as toMerge;
insert into AuditRecords select * from toMerge.AuditRecords;
My main question is whether the above will remove duplicates, and if it doesn't, is there a merge or some other command I can use?
Thanks very much!
I developed a web application that allows users to modify existing web pages.
When a user type a url of an existing web page, I read the content of this page and using an ajax call, i display the content in a div inside my web application.
Now my problem is that often the content encoding of the existing web page is different than my web app (I use utf-8)
Is there a way to load content using an ajax call with different content encoding than the one of the main page?
Thanks,
Amir
Hi-
I have a website created in VS 2008 using asp.net v3.5.
My requirement is to add both Routing and Infragistics controls the website. But noticed, I can have only one of these working - not both. My infragistics control works if I remove the following from web.config
But by removing it- routing would not work.
Is there a way I can have both infragistics and routing working in a single website?
Thanks so much.
I have an issue with a WCF REST service (.NET 4) which has multiple host headers, but one end point.
The host headers are for example:
xxx.yyy.net
xxx.yyy.com
Both host headers are configured in IIS over HTTPS and redirect to the same WCF service endpoint.
I have an Error Handling behavior which logs some extra information in case of an error.
The problem is that the logging behavior only works for one of both URLs. When I first call the .net URL, the logging is only working for requests on the .net URL. When I first call the .com URL (after a Worker Process recycle), it’s only working on requests on the .com URL.
The configuration looks like this:
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="XXX.RemoteHostService">
<endpoint address="" behaviorConfiguration="RemoteHostEndPointBehavior" binding="webHttpBinding" bindingConfiguration="HTTPSTransport" contract="XXX.IRemoteHostService" />
</service>
</services>
<extensions>
<behaviorExtensions>
<add name="errorHandling" type="XXX.ErrorHandling.ErrorHandlerBehavior, XXX.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</behaviorExtensions>
</extensions>
<bindings>
<webHttpBinding>
<binding name="HTTPSTransport">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="RemoteHostEndPointBehavior">
<webHttp />
<errorHandling />
</behavior>
</endpointBehaviors>
</behaviors>
….
Should I configure multiple endpoints? Or in which way could I configure the WCF Service so the logging behavior is working for both URLs?
I tried several things, also solutions mentioned earlier on StackOverflow. But no luck until now...
I have a link on a website that says "add object". When I do this, an AJAX call is made and I want to do the following things:
1) if the container in the session does not exist, create one, else use existing
2) add the object to the container
I'm new to RESTful design and am wondering how to best accomplish this in Rails. Step #1 in particular