please give me the code.
input file:
#box8 {
position:absolute;
}
#box8 .buttons {
text-align:left;
}
output file should be like this:
headers:#box8
#box8
Items:position:absolute;
text-align:left;
I've got a text file, and wish to extract every above the !--- comment ---! into a new file, not based line numbers (but checking for the comment), How would I do this?
test123
bob
ted
mouse
qwerty
!--- comment ---!
123456
098786
I am trying to write a simple application that gets updated. For this I need a simple function that can download a file and show the current progress in a ProgressDialog. I know how to do the ProgressDialog, but I'm not sure how to display the current progress and how to download the file in the first place.
First, some background: I'm developing a web application using Python. All of my (text) files are currently stored in UTF-8 with the BOM. This includes all my HTML templates and CSS files. These resources are stored as binary data (BOM and all) in my DB.
When I retrieve the templates from the DB, I decode them using template.decode('utf-8'). When the HTML arrives in the browser, the BOM is present at the beginning of the HTTP response body. This generates a very interesting error in Chrome:
Extra <html> encountered. Migrating attributes back to the original <html> element and ignoring the tag.
Chrome seems to generate an <html> tag automatically when it sees the BOM and mistakes it for content, making the real <html> tag an error.
So, using Python, what is the best way to remove the BOM from my UTF-8 encoded templates (if it exists -- I can't guarantee this in the future)?
For other text-based files like CSS, will major browsers correctly interpret (or ignore) the BOM? They are being sent as plain binary data without .decode('utf-8').
Note: I am using Python 2.5.
Thanks!
public string ContructOrganizationNameLogo(HttpPostedFileBase upload, string OrganizationName, int OrganizationID,string LangName)
{
var UploadedfileName = Path.GetFileName(upload.FileName);
string type = upload.ContentType;
}
I want to get the extension of the file to dynamically generate the name of the file.One way i will use to split the type. but can i use HttpPostedFileBase object to get the extension in the clean way?
I have made an ActiveX control and have made its .cab file for automatic installation on client machine using Internet Explorer.. It working fine of Windows XP, but on windows Vista and Windows 7 its installation is blocked by UAC (User account control), and when I disable it, all things works fine... I have signed my .cab file with a certificate for development enviornment... What is the way to over come this problem.. I don't want to tell users to disable their UAC module...
hi,
i have an export sql file containing tables and data from mysql and i want to import it into a sqlite 3 db.
please can you tell me the best way?
i get error reading file in via sqlite3 binary.
I was thinking about making a little crop/resize batch processor online, and wanted to know if there was a way for me to do the following:
upload image and specify dimensions
click "process" and app resizes image
image downloads automatically to wherever it was I uploaded it (say from my desktop), but with a new name (based on the time for example).
This would make it so I could host a free image processor that never stored any data other than tempfiles.
Is that possible? Something like Rails' send_file method, but I'm using Sinatra and am looking for something in pure ruby.
I need to use a few Cyrillic characters in a Java file and in order for Eclipse to allow me to do so I need to change the encoding for that file (currently to UTF-8).
Are there any possible problems that this could cause?
I'm writing a C program where I fork(), exec(), and wait(). I'd like to take the output of the program I exec'ed to write it to file or buffer.
For example, if I exec ls I want to write file1 file2 etc to buffer/file. I don't think there is a way to read stdout, so does that mean I have to use a pipe? Is there a general procedure here that I haven't been able to find?
I'd like to add characters to the end of every line of text in a .txt document.
#Define Variables
$a = c:\foobar.txt
$b = get-content $a
#Define Functions
function append-text
{
foreach-Object
{
add "*"
}
}
#Process Code
$b | append-text
Something like that. Essentially, load a given text file, add a "*" the the end of every single line of text in that text file, save and close.
Hi, I have got this working line of code
I would like to run via VBScript a share program on a remote computer in a domain environment. The first part is ok where it is asking me to enter a computer name, but the problem is in the second part. I don't know how to run the program on the remote computer that I've entered in the first part.
computer = inputbox ("What computer do you wish to check? (Press Enter if this computer)","Computer")
set WMI = GetObject("WinMgmts://" & computer)
If computer="" then computer = "this computer"
Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""\\compname\Share\progr.exe""")
Set objShell = nothing
After running this script, it runs the program on my computer, not on the remote computer. I want to run the program on a specific computer that I have entered from keyboard.
Please help. Thank you.
I am creating an HTML document which we are then pushing out to MS Word using a "application/msword" content type. This works so far except that the files open in Word with Web View. Once Normal View is selected all works fine. Is there any way to force Word to open with Normal View instead of Web View?
ok im trying to upload this csv file onto my table in pgsql
but im getting this error
ERROR: invalid input syntax for integer: "mlname,mfname,slname,sfname,address,postalcode,membershiptype,hphone,email"
CONTEXT: COPY members2, line 1, column id: "mlname,mfname,slname,sfname,address,postalcode,membershiptype,hphone,email"
i really understand why im getting this error, both my table and my csv file have the same column names
Hi,
I have to extract columns from a text file explained in this post:
http://stackoverflow.com/questions/2499746/extracting-columns-from-text-file-using-perl-similar-to-unix-cut
but I have to do this also in a Windows Server 2008 which does not have Perl installed. How could I do this using PowerShell? Any ideas or resources? I'm PowerShell noob...
I have a small database with tables containing a small amount of data which I need to copy into memory.
Currently I am using:
insertcommand.CommandText = "SELECT sql FROM sqlite_master WHERE sql NOT NULL;";
To pull all the table schema from the file database, however I'm not really sure how to proceed with creating these tables in the new memory database, and copying all the relevant data across.
In short, how do I copy an SQLite database from file to memory using C# and System.Data.SQLite?
In my MSI package I need to set user rights to a directory using cacls.exe. It works fine in an NTFS environment but fails when run on a Fat32 file system. Is there a method to determine the type of file system of the drive the software is installed to?
I'm using WiX 3 to create my MSI package but any hint pointing to the MSI database would help as well.
Many thanks in advance.
I'm using Entity Framework for a new project (VS 2008, .net 3.5 sp1) and "reasonably happy" with it, especially compared to dataset-based solutions.
One of recurring annoyances is "Could not find file CodeGenerationSchema.xsd" exception during application startup. Exception seems to re-appear rather frequently after changes to the model.
Googling gives temporary and strange workarounds for this error:
Delete .suo file, or
Set Options Debugging General Enable Just My Code = On
May be someone have more permanent, straightforward fix or can explain the reason of this issue.
I don't know if this is possible but, I have a class and I'v made an instance of it. I also put things in it. It has vectors and other things. I was wondering if I could save its contents (the instance) to a binary file, then reload it and cast it in from the file. Thanks
Is there any way of placing a file into application "sandbox" i.e into eg:
/var/mobile/Applications/30B51836-D2DD-43AA-BCB4-9D4DADFED6A2/Documents
of iphone?
My Application expects a file to be put into /Documents folder of application so that it can be uploaded to my local server.
This method should confirm to the rules of Apple so that it should not be rejected.
I'm looking to export a page that looks good in print media, to word.
Can this be done automatically, or mostly automatically with office apis?
The alternative is to create a program that reads all our style meta data and font meta data and convert to word and force a download.
The issue is our style metadata is already built for css, its a web app after all. And writing my own css parser, doesn't sound like a good use of time.
I want to wrap a existing msi installer file into NSIS installer executable. Because there is not any option to change the icon of the msi file. I just want to customize the icon of the output setup.exe. Along with this I would also want to make sure that NSIS does not add any extra user interface into my installer. Have anybody an idea to do this ? Thanks in advance.
Hi,
I'm using linq to sql. I have a table in dbml file that some of its fields can be generate dynamically (at run time). Is there any way to add fields to a table dynamiccaly , or add a class to dbml file dynamically?
Thank you,
Naseem