I have a variable which has the directory path along with file name. I want to extract the filename alone from the unix directory path and store it in a variable
fspec="/exp/home1/abc.txt"
Hello,
I use a library to parse an iCalendar file, but I don't understand the regex to split property.
iCalendar property has 3 different style:
BEGIN:VEVENT
DTSTART;VALUE=DATE:20080402
RRULE:FREQ=YEARLY;WKST=MO
The library uses this regex that I would like to understand:
var matches:Array = data.match(/(.+?)(;(.*?)=(.*?)((,(.*?)=(.*?))*?))?:(.*)$/);
p.name = matches[1];
p.value = matches[9];
p.paramString = matches[2];
Thanks.
I've create a plain and siple backup script that only backs up certain files and folders.
tar -zcf $DIRECTORY/var.www.tar.gz /var/www
tar -zcf $DIRECTORY/development.tar.gz /development
tar -zcf $DIRECTORY/home.tar.gz /home
Now this script runs for about 30mins then gives me the following error
gzip: stdout: File too large
Any other solutions that I can use to backup my files using shell scripting or a way to solve this error? I'm grateful for any help.
Isn't visual studio supposed to automatically generate this file for each webservice creation ? If yes why can't I see it anywhere in project directory ?
Hi,
I have a project with two header files mainwindow.h and website.h.
I want to access a method from website.cpp from inside mainwindow.cpp.
I can access any function from inside mainwindow by doing Window w then doing w-function();
However, when the function finishes from inside the mainwindow the memory for w is erased.
How do I keep w around and HOW DO I DECLARE Website w from my header file?
Thanks,
V$h3r
I have photo gallery code that does image re-sizing and thumbnail creation. I use ImageMagick to do this. I ran a gallery page through Google's Page Speed tool and it revealed that the re-sized images and thumbnails both have about an extra 10KB of data (JPEG files specifically).
What can I add to my scripts to optimize the file size?
Hi, I want to create an XML file with folllowing header dynamically.
<?xml version="1.0" encoding="utf-8"?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
How should i create this urlset node.
following is the that I create dump from mysql database.
mysql -u root tempbkk ttt.dump
but I want to create a dump that exclude one or more file while creating dump from database we select.What is the command for that ?
Is there any easy way to create a class that uses IFormatProvider that writes out a user-friendly file-size?
public static string GetFileSizeString(string filePath)
{
FileInfo info = new FileInfo(@"c:\windows\notepad.exe");
long size = info.Length;
string sizeString = size.ToString(FileSizeFormatProvider); // This is where the class does its magic...
}
It should result in strings formatted something like "2,5 MB", "3,9 GB", "670 bytes" and so on.
Hi, I just learned emacs archive-mode can let me edit files such as web.xml in a ear easily but I wonder if I have an updated jar file, can I use emacs to replace the old jar in that ear using command-line based emacs? (I have to ssh into servers using putty).
Thanks a lot,
Dean
Opera mini browser can save HTML pages in OBML (Opera Binary Markup Language) format for offline browsing. I am wondering if I can convert a HTML file to OBML format and save in my phone for later viewing.
For doing so, I need details about the OBML format, which seems to be undocumented. Do you know more details on this OBML format?
Thanks for your time.
say that i have a project which lies in a folder called 'bin', and i want some specific vim configuration automatically loaded when i edit any file inside the project folder. how can i do that?
Hi, i have a SQL Data Base. On this DB i have a Table with a XML Field. I wan to save a XML file on the XML Field using LINQ to SQL. It is possible?
Thanks.
Sorry for my poor english
Hi,
How can I can insert the contents of a file into another file right before a specific line using sed.
example I have file1.xml that has the following:
<field tagRef="376">
</field>
<field tagRef="377">
</field>
<field tagRef="58">
</field>
<group ref="StandardMessageTrailer" required="true"/>
</fieldList>
and file2.xml has the following:
<field tagRef="9647">
<description>Offset</description>
</field>
<field tagRef="9648">
<description>Offset Units/Direction</description>
</field>
<field tagRef="9646">
<description>Anchor Price</description>
</field>
how can i insert the contents of file2 into file1 just before
so it will look like this:
<field tagRef="376">
</field>
<field tagRef="377">
</field>
<field tagRef="58">
</field>
<field tagRef="9647">
<description>Offset</description>
</field>
<field tagRef="9648">
<description>Offset Units/Direction</description>
</field>
<field tagRef="9646">
<description>Anchor Price</description>
</field>
<group ref="StandardMessageTrailer" required="true"/>
</fieldList>
I know how to insert after that line using
sed 'group ref="StandardMessageTrailer"/r file2.xml' file1.xml newfile.xml
but I want to insert it before.
appreciate the help
Hi all,
I am using ASP.NEt MVC . I want to upload .zip files for which I am using html input file upload control on my view. I want only .zip files to be uploaded. Is there any way or attribute to specify and achieve this?
thanks,
kapil
Hi ,
I used jquery tools tooltip and i positioned icons 30 px under flash banner . The problem is when i hover icons , tooltips hide under flash banner , I gave high z-index to the tooltip div or other parent div in order position that above flash banner, but no difference .
Is there any way to overcome this problem ?
At the bottom picture , The green section is flash file and as you can see part of tooltip is hidden
I have a backup created of my mysql database (vbulletin forum v3.8) everyday. It's about 360mb in size. It's stored as one text file in a secure folder.
I'm thinking of getting another server, through a different host, and somehow automatically transferring the backup to my second server every day.
Any ideas on how I could automate this process? I'm thinking PHP and a cron job.
I am trying to find a File Picker that runs on ASPX.Net. I need it to insert images in TinyMCE since the one with TinyMCE is licensed. I have been looking for a Silverlight solution, like Silverlight Bridge. I tried to implement SLFileManager that is based on SB, but with little success. I need to be able to upload images, delete/rename etc and also insert the image inside TinyMCE. Any ideas?
I am unable to download a file from rtmp server, I'm using the following code:
Response.ContentType = "audio/mpeg";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + mpg);
audiofile = "rtmp://XXX/oflaDemo/" + audiofile;
Response.TransmitFile(audiofile);
It's showing a message that could not find the virtual path.
Could anyone help with this problem?
Hi,
does Android have a "best practices" guideline on creating & populating the db/tables programmatically vs. deploying a .db file in assets?
What are the pros/cons of both approaches?
I have a db with big long strings in several columns, and about 50 rows, so writing the insert statements alone would take quite some space. It seems a waste.
Thoughts?
Thanks!
llappall
How do you add Javascript file programmatically to the user control?
I want the user control to be a complete package - ie I don't want to have to add javascript that's related to the user control on the page where it's used, when I can do it inside the control itself.
Since there is no Page object in the user control, how would you do it?
Hi, I'm trying to display standard file/directory context menu in WinForms application - I'd like to enable the user to do things with files in my application as he could in Explorer.
There should be two options
popup the context menu with some system call
read everything from the system context menu and insert it into my context menu
Could you please point me in the right direction? Thanks
I'm trying to get a third party audio library (STK) working inside XCode. Along with the standard .h files, many of the implimentation files include a file called SKINI.msg. SKINI.msg is in the same directory as all of the header files. The header files are getting included fine, but the compiler complains that it can't find SKINI.msg. What do I need to do to get XCode to happily include SKINI.msg?