Hi,
Is some one able to explain why header files have something like this?
class foo; // This here?
class bar
{
bar();
};
Do you need an include statement when using this?
Thanks.
I'm using Inkscape, and I'm trying to import an EPS file to use it as a vector and eventually save it as an SVG.
This link here mentions several methods:
http://www.inkscapeforum.com/viewtopic.php?f=5&t=797
But the responses aren't rated since it's a forum, so I thought I'd ask here to find the best answer. I'd prefer not to have to use some website to convert the file to a PDF first.
Either way, when I import an EPS into Inkscape, or use the website to convert it to a PDF, in both cases the resulting file loses all colour and gradients, and the EPS file gets cut off on the right side.
It looks like ps2pdf is clipping the file incorrectly, and Inkscape is eliminating the colour.
I have these version installed in Ubuntu Lucid Linux:
Inskape 0.47.0-2ubuntu2
Ghostscript 8.71.dfsg.1-0ubuntu5.3
I searched the site but didn't see anything quite matching what I was looking for. I created a stand alone application that uses a web service I created. To run the client I use:
c:/scriptsdirecotry "run-client.bat" param1 param2 param3 param4
how would I go about coding this in python or F#. seems like it should be pretty simple but I haven't seen anything online that quite matches what i'm looking for.
Thanks in advance.
hello,
I am using fortran 90
I have defined a fortran module in fileA.f as:
module getArr
double precision a(100)
end module getArr
The same fileA.f contains a subroutine that uses this module
subroutine my_sub
use getArr
implicit none
getArr%a(1) = 10.5
end subroutine
In fileB.f, I have a fortrtan function. I am trying to access the value of getArr%a(1) as:
double precision function my_func(R)
use getArr
double precision x
x = getArr%a(1)
return
end
But I am getting errors at the compile time. It says it is unable to access the module getArr.
How should I declare it??
Thanks
I'm upgrading my static website that had .php extensions on the content pages. I've created my own simple cms which will start retrieving data from mysql database from now on, keeping the url structure same as the old once.
The cms has get function to retrieve url structure from the database. Overall it started working fine with .html when i tested. But when i change the .html extension to .php in my .htaccess code the content pages starts reflecting "Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request."
Here is my .htaccess code which i've used:
RewriteBase /
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([^?]*).php$ content.php?pid=$1
Perhaps there is a conflict, here is the code with .html extension that actually works fine.
RewriteBase /
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([^?]*).html$ content.php?pid=$1
So basically, content pages with .html are working & .php are not working. But i need my content pages to be with .php
Please help. Thanks in advance... :)
Hi ,
I am using DotNetOpenAuth Package,
I am trying to upload a package to google docs,
Using client credentials i am able to do it successfully using
following code,
DocumentEntry objDocumentEntry = new DocumentEntry();
objDocumentsService.setUserCredentials(strUserName,strPassWord);
string strAuthenticationToken =
objDocumentsService.QueryAuthenticationToken();
objDocumentEntry =
objDocumentsService.UploadDocument(Server.MapPath("test.docx"), "New
Name");
I want achieve save with plain oAuth,
I am having following code written for it,
if (this.TokenManager != null)
{
if (!IsPostBack)
{
var google = new
WebConsumer(GoogleConsumer.ServiceDescription, this.TokenManager);
// Is Google calling back with authorization?
var accessTokenResponse =
google.ProcessUserAuthorization();
if (accessTokenResponse != null)
{
this.AccessToken =
accessTokenResponse.AccessToken;
}
else if (this.AccessToken == null)
{
// If we don't yet have access, immediately
request it.
GoogleConsumer.RequestAuthorization(google,
GoogleConsumer.Applications.DocumentsList);
}
}
}
I successfully get "AccessToken",
But i am not sure how to use it..
Do we need to exchange this token? what excatly to do with this token?
Is it a sessionToken?
Please provide some inputs, I am badly stuck with this problem from
last 3 days,
Prashant C
I've got a Comodo certificate to sign my application files with the appropriate publisher (that'll be me).
But how do I sign my installation to prevent those triple "are you sure?" UAC dialogs?
Am using the Visual Studio (2008) setup project, no third party tools.
We have several fairly large JavaScript files embedded into a single script resources DLL. This is then consumed by multiple projects by way of a reference and page includes via the ASP.NET script manager. This keeps things nice and neat within our ASP.NET pages and requires very little work to integrate into new projects.
The problem is that some of these script files are quite larger (approx 100KB) and take time to download. By running minify on them before embedding this is reduced down a lot (around 70KB) but not enough. What we would like to do is GZIP the files before they are embedded. However, just gzipping the files causes syntax errors as the content is not unzipped. There is a content type "text/javascript" applied in AssemblyInfo when the resource is embedded but we can't find a way to specify content-encoding.
Is there any way to make this work without having to write a httpmodule/handler (which would mean changing the config for all consuming projects)?
Something odd I recently encountered, running file --mime-type on a collection of MP3 gets the mime-time wrong a third of the time:
$ for i in */*.mp3; do cat "$i"| file --mime-type -; done | sort | uniq -c
140 /dev/stdin: application/octet-stream
309 /dev/stdin: audio/mpeg
There doesn't seem to be any obvious reason, as even MP3s from the same source, will sometimes fail and sometimes not.
Bug, feature or anything obvious I am missing here?
I want to wright a login script for my organization,
The script needs to discover users by Group id's and then define the map drive they need on their computer.
I started writing down the script and it looks like this:
ID
if [gid=10524657]
then
mkdir /home/likewise-open/Domain/Username/Desktop/Share
sudo mount.cifs //fs01/salesnew /home/likewise-open/Domain/Username/Desktop/share -o user=X
else [gid=41654564] (etc....)
That is the first time i am writing a script in Ubuntu,
Can you tell me what am i doing wrong ?
Is it possible for Linux to identify the gid from the ID command ?
if not what is the alternative option?
Can someone please advise ?
I am thinking of adding a DataContext as a member variable to my aspx.cs code-behind class for executing LinqToSql queries.
Is this thread safe? I am not sure if a new instance of this code-behind class is created for each HTTP request, or if the instance is shared amongst all request threads?
My fear is that I will get 10 simultaneous concurrent http requests that will be using the same database session.
public partial class MyPage : System.Web.UI.Page
{
private DataContext myDB = new DataContext();
protected void MyAction_Click(object sender, EventArgs e)
{
myDB.DoWork();
}
}
Is there any class in .Net framework that can read/write standard ini files:
[Section]
<keyname>=<value>
...
Delphi have TIniFile component and I am looking if there is anything similar for C#.
It is possible to write a code that specifying the rows and column of spread sheet in terms of NUMBERS and NOT LIKE (B2:D6)
Example:
excelSheet.Range("B2:D6").Interior.Color = RGB(100, 100, 255)
instead of B2 and D6 I want to write 5 rows and 3 column..
It is posible to write in vb.net 2003 code?
i have store a list of items from gridView into registry as below:
*
frmPOSConfigSet.tblCatItems.First;
while not
frmPOSConfigSet.tblCatItems.Eof do
begin
RegItemSetting.WriteString('stk
Group\Candy',
frmPOSConfigSet.tblCatItemsCODE.Text,
frmPOSConfigSet.tblCatItemsSPHOTO.Text);
frmPOSConfigSet.tblCatItems.Next;
end;
*
[In Registry Editor]
stk Group
- Candy
- YUPI_GUM_HB , c:\Users\chai\Pictures\POS Item Images\image1.jpg
- YUPI_GUM_SBKISS , c:\Users\chai\Pictures\POS Item Images\image2.jpg
After i close the form and open again, all values in gridView is gone, how do i retrieve the ident (eg. YUPI_GUM_HB) and it's value (eg.c:\Users\chai\Pictures\POS Item Images\image1.jpg) from registry to the gridView when load the form?
I'm a recent vim convert (from fancy IDEs like eclipse.)
I love the :make command in vim and use it extensively; however I also like to edit multiple projects (with separate makefiles.)
So usually to edit more than one project I will do
pushd project1
vim project1.cpp
[suspend signal]
pushd ../project2
vim project2.cpp
and now I can switch between the two projects with ctrl+z i.e. suspend signal, and fg.
When this becomes an issue is when I want to open one project in the context of another so I can do copy/pasting. So if instead in the above I do
pushd project1
vim project1.cpp
:vsp ../project2/project2.cpp
I can edit both concurrently in the same vim process, however I can't effectively build one or the other with the :make command, it will only build project 1.
Does anyone have some kind of scheme that gives them the best of both worlds: being able to edit concurrently while still being able to build multiple projects with the :make command all from the same vim process?
Hello,
I'm working on a project which involves an FTP server running ProFTPd and a PHP/MySQL backend that creates accounts for users.
Upon the creation of accounts, users are sent e-mails with their account details and instructions for downloading FileZilla or CyberDuck, depending on their OS, detected via user-agent string.
To make things easier for novices, I thought of having .lnk files generated for FileZilla with the account logins details as parameters, so they would just have to click on the .lnk files to open up the server. This is not crucial feature but more of a technical challenge.
My questions are :
is this even feasible ?
are there any alternatives (eg. generating a .bat with a script pointing to the Filezilla executable ?)
are there any issues, perhaps with relative / absolute paths pointing to the executable ?
to go even further, what would be the simplest way of providing users with software with FTP access on a single account / single server (web interface is not an option).
I have this code that sends just one attachment by time, how can I adjust this code to send 1-2 attachments?
function SendMailMAPI(const Subject, Body, FileName, SenderName, SenderEMail,
RecepientName, RecepientEMail: String) : Integer;
var
message: TMapiMessage;
lpSender,
lpRecepient: TMapiRecipDesc;
FileAttach: TMapiFileDesc;
SM: TFNMapiSendMail;
MAPIModule: HModule;
begin
FillChar(message, SizeOf(message), 0);
with message do
begin
if (Subject<>'') then
begin
lpszSubject := PChar(Subject)
end;
if (Body<>'') then
begin
lpszNoteText := PChar(Body)
end;
if (SenderEMail<>'') then
begin
lpSender.ulRecipClass := MAPI_ORIG;
if (SenderName='') then
begin
lpSender.lpszName := PChar(SenderEMail)
end
else
begin
lpSender.lpszName := PChar(SenderName)
end;
lpSender.lpszAddress := PChar('SMTP:'+SenderEMail);
lpSender.ulReserved := 0;
lpSender.ulEIDSize := 0;
lpSender.lpEntryID := nil;
lpOriginator := @lpSender;
end;
if (RecepientEMail<>'') then
begin
lpRecepient.ulRecipClass := MAPI_TO;
if (RecepientName='') then
begin
lpRecepient.lpszName := PChar(RecepientEMail)
end
else
begin
lpRecepient.lpszName := PChar(RecepientName)
end;
lpRecepient.lpszAddress := PChar('SMTP:'+RecepientEMail);
lpRecepient.ulReserved := 0;
lpRecepient.ulEIDSize := 0;
lpRecepient.lpEntryID := nil;
nRecipCount := 1;
lpRecips := @lpRecepient;
end
else
begin
lpRecips := nil
end;
if (FileName='') then
begin
nFileCount := 0;
lpFiles := nil;
end
else
begin
FillChar(FileAttach, SizeOf(FileAttach), 0);
FileAttach.nPosition := Cardinal($FFFFFFFF);
FileAttach.lpszPathName := PChar(FileName);
nFileCount := 1;
lpFiles := @FileAttach;
end;
end;
MAPIModule := LoadLibrary(PChar(MAPIDLL));
if MAPIModule=0 then
begin
Result := -1
end
else
begin
try
@SM := GetProcAddress(MAPIModule, 'MAPISendMail');
if @SM<>nil then
begin
Result := SM(0, Application.Handle, message, MAPI_DIALOG or
MAPI_LOGON_UI, 0);
end
else
begin
Result := 1
end;
finally
FreeLibrary(MAPIModule);
end;
end;
if Result<>0 then
begin
MessageDlg('Error sending mail ('+IntToStr(Result)+').', mtError, [mbOk],
0)
end;
end;
Hi forum,
i have this file myfirst.txt located on a cluster of computers down the hall, i.e.:
myname@login1:~> ls
myfirst.txt
which i want to download to the home directory:
scp [email protected]:myfirst.txt .
to which i get:
myfirst.txt 100% 1828 1.8KB/s 00:00
now where (on my home computer) is this myfirst.txt file ? i can't find it. It's not visible when i click 'show hidden files' either.
Tia,
Hi,
Once I connect my iPhone to my computer, is there anyway I can look at the directory structure on the phone?
Would it work like a USB device for example and let me copy files without using iTunes but just drag and drop through the Finder on a Mac?
Thanks,
Tee
I am trying:
saveArr = do
outh <- openFile "test.txt" WriteMode
hPutStrLn outh [1,2,3]
hClose outh
but it doesn't works... output:
No instance for (Num Char) arising from the literal `1'
I writing a webapp which uploads images to imgur directly. Since all older version of their APIs have been deprecated i am forced to use v3 of their APIs. Unfortunately I am unable to get the API to work. I am using curl to access the API.
$pvars = array('image' => base64_encode($data));
$timeout = 30;
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://api.imgur.com/3/upload');
curl_setopt($curl, CURLOPT_TIMEOUT, $timeout);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $pvars);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Client-ID xxxxxxa61xxxxxx'));
$xml = curl_exec($curl);
$xmlsimple = new SimpleXMLElement($xml);
print gettype($xml)."<hr>";
echo '<img height="180" src="';
echo $xmlsimple->links->original;
echo '">';
curl_close ($curl);
The "Xml" variable always return as "false", no server error is displayed. Can someone guide me to what I am doing wrong ? Unfortunately I am also unable to find any proper example in the documentation nor around to guide me.
I have a custom control and I want to dynamically insert a link to a stylesheet.
Might not be the best solution of the year but it needs to be done. Any idea how to do it?
Everytime I try, Page.Header is null.
Hello,
In samplexml.svg there is a node
<image width="744" height="1052" xlink:href="image1.png"/>
I need to replace "image1.png" with another value like "image2.png". Please guide me with sample code how to to that.
I could get the attribute value "image1.png". Here is the code:
> <?php $xdoc = new DomDocument;
> $xdoc->Load('samplexml.svg'); $tagName
> = $xdoc->getElementsByTagName('image')->item(0);
> $attribNode =
> $tagName->getAttributeNode('xlink:href');
>
> echo "Attribute Name :
> ".$attribNode->name; echo "<br
> />Attribute Value :
> ".$attribNode->value; ?>
Here is samplexml.svg:
> <svg> <g> <title>Test title</title>
> <image x="0" y="0" width="744"
> height="1052"
> xlink:href="image1.png"/> </g> </svg>
Please help me, how to change this attribute value.
Regards,
rafiq7s