I have hashtable, my program want to record the valuse of hashtable to process later!
But i have a quesiton . Can web write oject hastable in to file ? if can,how to load that file ?
Suppose, I want to record say poll choices by users everyday. In this case, i have a table named vote which has columns poll , choice and user-id . So how can i out the constraint (maybe in the django models or wherever possible) that poll and user-id both should not be the same for any entry but like the same user can vote for various different polls once and obviously various users can vote for the same poll. I hope I am clear.
If userA deleted OrderA while userB is modifying OrderA, then userB saves OrderA then there is no order in the database to be updated. My problem is there is no error! The SqlDataAdapter.Update succeeds and returns a "1" indicating a record was modified when this is not true. Does anybody know how this is supposed to work, thanks.
I am defining a primary key in MongoMapper.
class B
key :_id, string
key :externalId, string
end
The problem is that everything i add a new record in B, it appears that I need to explicity specify the _id, when it is already defined in the external id
B.new(:_id=>"123", :external_id=>"123 )
That does not quite make sense. There should be a way to specify externalId as the primary key, no?
i m binding gridview in asp.net application...
i m about to bind some thousand records in datagrid...
on RowDataBound event of the grid i need to check if the log in user is authorised to view the perticuler record...so i need to send database request...like wise such other two to three operation requires to send request to database....
about three to four request are sended to database during each row bound of the gridview...is it effective on speed of the grid?
Hi everybody,
I tried to pass a filepath to a function in R, but I failed =/ I hope someone here can help me.
>heat <- function(filepath)
{ chicks <- read.table(file=filepath, dec=",", header=TRUE, sep="\t")
...
}
When I call the function, nothing happens...
>heat("/home/.../file.txt")
... and "chicks" is not found
>chicks
Error: Object 'chicks' not found
What is the correct way to pass a path to a function?
Best wishes from Germany,
Phil
I have a table like this
C1 C2 C3 Code
1 2 3 33
1 2 3 34
2 4 1 14
1 2 3 14
i want to select only those record whose code is appearing only in single row. ie, in this case rows with code 33 and 34.. as they appear only once in this table.
How can i write a query for that
Hi,
I run this snippet twice, in the ubuntu terminal, (encoding set to utf-8) once with ./test.py and then with ./test.py >out.txt:
uni = u"\u001A\u0BC3\u1451\U0001D10C"
print uni
Without redirection it prints garbage. With redirection I get a UnicodeDecodeError. Can someone explain why I get the error only in the second case, or even better give a detailed explanation of what's going on behind the curtain in both cases?
Basically, I get a path like "C:\test\subfolder1\subfolder2\subfolder3\myfile.txt", but it's possible that subfolders 1-3 don't exist already, which means I'd get an exception if I try to write to the file.
Is there a way to create the directory structure the target file is in, either by using some task that creates the structure when it outputs to the file and then deleting the file, or by parsing the directory part of the path and using the mkdir task first?
Any help is appreciated.
Thanks,
B.J.
I have a model with several attributes, among them title and artist.
The case of title and artist should be ignored in all the Active Record finders.
Basically, if title or artist are present in the :conditions (or dynamically i.e. find_all_by_artist), then the WHERE artist = :artist should become WHERE UPPER(artist) = UPPER(:artist) or something along these lines.
Is there a way of doing it with Rails?
I have used TableView and i am displaying Data coming from the Web.NOW I WANT TO PERFORMING the Paging TableView so after 5 record i want to show "showmore" Option and by pressing "showmore" It Display remaining data so how it is possible?
I have an tblEmployeeProfile & a tblPersonnel. tblPersonnel is an HR table, that consists of all employees in the company; tblEmployeeProfile contains details about an employee's position.
tblPersonnel.PersonnelID
tblPersonnel.FirstName
tblPersonnel.MiddleName
tblPersonnel.LastName
tblPersonnel.PhoneNumber
tblPersonnel.Email
tblEmployeeProfile.EmployeeID
tblEmployeeProfile.ManagerID
tblEmployeeProfile.DepartmentID
tblEmployeeProfile.JobCategoryID
tblEmployeeProfile.SalaryID
I want to return a record with the following fields:
EmployeeID, FirstName, MiddleName, LastName, Email, ManagerFullName
where EmployeeID = @EmployeeID
*tblEmployeeProfile.ManagerID = tblPersonnel.PersonnelID*
I can't seem to get the query correct for getting the ManagerFullName
I want to use file_get_contents to implement a proxy so I can do ajax cross domain requests. Querystring will be used to supply the URL to file_get_contents. Now the problem is people can muck around with the qurystring in order to read local files on the server. I dont wnat this. Can someone get me a function to sinitize the querystring in order only to accept urls and not local files: ie:
?url=http://google.com.au - OK
?url=./passwords.txt - Not OK
i get values from table true or false which i set boolean when i save a new record.
But i want when i retive these values from table using JSTL
How i could print(map) these true and false value on YES and NO values
in our jsp pages.
Hi, Here is my scenario:
I have three models Subscriber, Subscription, Plan, with has_many :through relationship
between Subscriber and Plans.
A subscriber can have multiple plans with one active plan. Whenever a subscriber selects a plan I save it using accepts_nested_attributes_for :subscriptions. I get one plan from the form.
Now my problem is I want to get the ID of the record created in subscriptions table.
Okay, so I've figured out how to get my external ip using wget:
wget -q -O - http://whatismyip.com/automation/n09230945.asp
that outputs the ip to the command console. adding currentip.txt to the end will write it to a text file. But what I want to do is use
netsh interface ip set address name="Local Area Connection 2" source=static addr=[WHAT DO I PUT HERE]
Also, a way to make the command prompt not flash would be nice too :)
I want to list records with a particular month and year. The table name is 'Arrival' and 'date' is the field that stores the date that the record was added. This is to be done from a C# application. For example, if the user selects month as 'April' and year as '2009' in the application, it will list all the records that were added on April,2009. (I only need the query, hope I can figure out the rest :) )
Hi All,
Could I get ideas on retrieving the dataset using lookup method. Basically, my scenario as I have source data needs to lookup for other source table and on matching column from source I need to get all the records from other source data.
its a one to many relations. I tried Lookup but gives only one record on matching condition, OLE DB command don't retrieve any data as it will do only Insert/Update operations.
Thanks
prav
I'm trying to print strings in one line.
I've found solutions but they don't works with windows correctly.
I have text file contains names and I want to print them like this
name=john then change john to next name and keep name=, I've made this code but didn't work correctly with windows:
op = open('names.txt','r')
print 'name=',
for i in op.readlines():
print '\r'+i.strip('\n')
thank you for your time
In Perl, I would write:
$x = "abbbc";
$x =~ s/(b+)/z/;
print "Replaced $1 and ended up with $x\n";
# "Replaced bbb and ended up with azc"
How do I do this in Python -- do a regular-expression string replacement and record what it was that got replaced?
removed
So if you look at the tabs and look at hw2, you'll notice it has a little extra spacing that overlaps the spacing on the right. That's because wrapped the div in the <li>. You will notice the others not having it. I don't understand why is it making that extra little spacing after I wrap it.
Just for the record, this is for CSS spacing which has nothing to do with the JS.
Update: I found a ghetto work around!
Hello,
I have this problem with my .Asp file. I get an error saying 'GetFrontpageInfo' is undefined.
This is the code:
http://www.kollelbaaleibatim.com/Content_of_asp_file.txt
click "view source" to see the code.
TY
I have a command e.g. ls-l file.txt
When there is insufficient space on my drive, the above command just stalls waiting for something to happen. Does anyone know about a code that I could write enabling me to display a message about the lack of space on my drive? E.g. could I use IPC or do you have any other ideas? Thanks in advance.
Hi,
I have a method which handles a set of records.This method,return true\false after processing.So,if all the records are processed(doing some db updates),will return true.Now,suppose after processing 1 record,some exception is thrown,should I write result=false(at the end of method result is returned) in catch block? And,allow processing of other records to be done?