i have two tables, and its a one-to-one relationship. is there a way to make it generate a row for table b automatically, when saving for table a? or do i have to be explicit everytime?
I am using a DLL to generate an Excel File.
Instead of saving the Excel file to disk, should it be possible me to stream it directly to the visitor?
Thanks
I found this in Ryan Bates' railscast site, but not sure how it works.
#models/comment.rb
def req=(request)
self.user_ip = request.remote_ip
self.user_agent = request.env['HTTP_USER_AGENT']
self.referrer = request.env['HTTP_REFERER']
end
#blogs_controller.rb
def create
@blog = Blog.new(params[:blog])
@blog.req = request
if @blog.save
...
I see he is saving the user ip, user agent and referrer, but am confused with the req=(request) line. Any help is appreciated.
Thanks
I am planning to start a site in which the content is generated by the users. What is the best method to save the data submitted by user?
Is the method of saving the data in phpmyadmin database a good idea considering that the data submitted by users is large similar to a blog post. Btw I'm good in working with php and mysql but I'm not sure whether it is a good method.
I'm editing a Visual Studio 2010 web application.
When saving changes to a code-behind file, the file becomes read only in the editor for 1-2 minutes. Closing and re-opening the file makes it editable again.
As I save quite frequently, this can be a pain.
Has anyone else run into this issue, and know any work-arounds?
how can i manipulate pixel values of a loaded image then save portion of that image into a new image(1 image per word).i found several example regarding saving or loading image but i cant understand how can i save image portion???i am trying to do it with java
Hello!
I have a local phpMyAdmin (installed via apt-get) adn I'm tired of entering login and password every time I try to open it. Database contains no sensitive info, just test tables, and is visible only from 127.0.0.1
I want phpMyAdmin already be logged in as root user with password 1234 (for example) when I open it. How do I do that?
P.S. Saving password in a browser is not what I want.
I have a Java program that writes results to both a DB (SQL Server) and a spreadsheet (POI), and it would be best if neither is written to if there's an error with either.
It would be a lot worse if the spreadsheet was produced and then an error happened while saving to the DB, so I'm doing the DB-write first. Even so, I'm wondering if someone knows of a way to guarantee they both succeed or fail as a unit.
Thanks!
Is there a way to reload an Android application in the emulator without closing the emulator, saving any code changes, and running the emulator again? If I make even a simple change to the layout, it takes about 30 seconds by time I run it in Eclipse and Android "boots", and I can unlock the emulator to run the application. Is there any way to shorten this time when making changes, or is it something I just have to deal with?
I am using Castle ActiveRecord as my ORM. When I try to store unicode strings, I get question marks instead.
Saving unicode strings worked perfectly when I was using mysql, but when I recently switch to SQL Server it broke. How should I go about fixing this?
Hi have a google website. I want to add RSS feeds to it. I got some php based Rss reader. But when I try to insert it to my google site it is not working. Google site's HTML editor simply removes the code piece upon saving. Is there any solution?
Is there any way to convert conditional formatting to static formatting in Excel?
I'm trying to export a range of a Excel Sheet to a new Workbook, with identical appearance but no formulas, links, etc. The problem here is that I have conditional formatting that relies on calculations outside exported range.
I've tried saving the workbook to .html, oddly enough the formatting shows in IE but not when reopening it in Excel.
I want to save the login information of Facebook after closing the application.
So every time when user opens application, no need to login again.
Is done by saving the session object into a plist?
I'm using facebook connect.
Thanks for the help
In my project I am trying to save video to the iPhone after being taken by the camera.
When I call the method:
UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path)
It reports the error:
Implicit declaration of function 'UIVideoAtPathIsCompatibleWithSavedPhotosAlbum'
I've imported MobileCoreServices/UTCoreTypes.h
I was previously using this same code for saving camera pictures, and it worked fine.
In another class, in the same project, I am able to reference the UIKit method:
UIImagePNGRepresentation()
without any problems
So why does it give me this error?
I have a silly use case for eclipse:
At work, they use 2 spaces for a tab character. Indentation looks really squashed and I'm finding it obstructs readability.
Now, I can't set Eclipse to use 4 spaces for a tab as it'll edit any files I change, and obviously don't want to violate the coding standards.
So, can I have a custom view onto my document, with saving maintaining the original spacing?
Cheers
Using ASP.net, what methods can I use to do the following:
Open up a connection to a given URL to read HTML content
Parse the given URL for hyperlinks, and place them in an array
Loop through each hyperlink (only 1 level down), opening each one, saving the HTML contents in a table, and move to the next hyperlink until done.
If ASP.net is not up to the task, other languages or free scripts/toolkits would be acceptable.
Thanks.
Hi all -
I'm creating a flash application that will post images to a url for saving to disk/display later. I was wondering what are some suggested strategies for making this secure enough so that the upload is verified as coming from the application and not just some random form post.
Is it reliable enough to check referring location realizing that I don't need bulletproof security, or perhaps setting authentication headers is a better strategy even though it seems unreliable from what I have read.
Thanks for any advice - b
Hi Folks,
I want to store a string which itself is an XML string as a property of an JSON object , what's the reliable and proper way of dong this? Should I first encode the XML data into BASE64 first prior saving it to an JSON object, due to the fact that JSON does not support binary data?
Example of data I want to store:
{
"string1" : "...moderately complex XML..."
}
Thank you in advance for any hints and suggestions!
I'm developing this really important squirrel application.
There is a wizard where squirrels are added to the database.
So say there are three screens to this wizard:
Squirrel name details
Height and weight
Nut storage
So at each step of the wizard I'm wanting to save the details to the database.
The Height and weight view looks like:
@model HeightWeightViewModel
@{
ViewBag.Title = "Height and weight";
}
<h2>Height and weight</h2>
@using (Html.BeginForm()) {
<h3>Height</h3>
<div>
@Html.EditorFor(model => model.Squirrel.Height)
</div>
<h3>Weight</h3>
<div>
@Html.EditorFor(model => model.Squirrel.Weight)
</div>
<input type="submit" value="Previous" />
<input type="submit" value="Next" />
}
So I'm hoping that Previous and Next buttons will save these details. The Previous button while saving will also take the user
to the Squirrel name details page. The Next will save and take the user to the nut storage page.
I got the Next button working using:
public ActionResult Edit(SquirrelViewModel squirrelViewModel)
{
_unitOfWork.SaveHeightWeight(squirrelViewModel);
return RedirectToAction("Edit", "NutStorage", new { id = squirrelViewModel.Squirrel.Id });
}
So the Next button saves the details and sends the user to the NutStorage page.
The Previous button does the same as Next but I actually want it to send the user to the first step of the Wizard after saving.
I'm not sure how to do this. Would I have another method to post to for Previous?
I can't image how to implement this.
Maybe I should be using ActionLinks instead of submit buttons but that would not post the details to be saved.
Can anyone suggest how to get the previous button to save and send the user to the first page of the wizard while still
having the Next functionality working?
Hi,
I am extracting attachment from Inbox,Send,Drafts e.t.c. mails.
And saving them in a folder.
Using below logic:
http://stackoverflow.com/questions/1361695/how-to-access-attachments-from-notes-mail
But problem i am facing here is.
Attachment having same type and name but different content.
In current situation it is replacing old file with new one.
How i can uniquely manage this attachment for different mails.
In Access 2007 I want to be able to click on a name field in a report and call a separate report with personal information about the person who's name was clicked to start the event. This would be as an alternative to creating a subreport or including the subreport fields in the main report in the interest of saving space. How do I reference the value of the clicked field for use in a query called with the OnClick event?
Thanks for your help.
i started using nginx upload module (which creates upload files like /tmp/000121545) but i need paperclip to use original filename while saving files (like /public/avatars/LuckyLuke.jpg)
previously in the parameters Rails were passing just
"avatar"=>#<File:/tmp/RackMultipart20100413-6151-t3ecq0-0>
no original filename as well, so i am wondering where from does it come in paperclip? i tried looking through plugin code but it's currently a bit too complex for me.
Is there any limit to maximum row of table in DBMS (specially MySQL)?
I want create table for saving logfile and it's row increase so fast I want know what shoud I do to prevent any problem.
I am using the System.Windows.Forms.WebBrowser object for displaying and printing a report. Unfortunately the Page Setup dialog is not obeying the language settings on the user's computer and all of the text is coming up in English. The .NET dialogs for opening and saving a file are coming up in the correct language but not the Printing/Page Setup dialogs for the Web Browser.