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.
The listing of all deployed Services can be disabled by setting 'disableServiceList' to true in Axis; which is used in AxisServlet.java - reportAvailableServices() .
However, is there a way to disable access to the wsdls ?
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
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)?
HI everyone i am new to this css i am developing a website for that site i am using kannada fonts but i wnat to embed the fonts in css how to embed that can any one please give sugessions and solutions .. thanks in advance
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();
}
}
Forgive me if this is nor the place to ask these questions, I am new to batch and scripts and a bit new to these kind of posts...
I have a folder that will receive files and folders, I want to run a script that looks at the directory and renames all files in each subfolder numerically, and moves them if possible.
For example I have something that looks like the following
Recieved_File_Folder
|_folder1
| |_file1.txt
| |_file2.bmp
|_folder2
| |_file4.exe
| |_file5.bmp
|__file9.txt
|__file10.jpg
I would like to be able to look in every directory and move it to something like this, keeping in mind the names of the files will be random and I want to keep the extension intact also.
Renamed_Folder
|_folder1
| |_1.txt
| |_2.bmp
|_folder2
| |_1.exe
| |_2.bmp
|__1.txt
|__2.jpg
I have spent alot of time on this and am not doing too well with it, any help would be very greatly appreciated!! Thank you in advance!
There is a specific file on a customers server which I require to connect to one of their services. The contents of the file are confidential and the file is not intended for the public.
Thus, the file is not "commonly downloaded", and every time I need to download it, I get this warning:
I have to download that files sometimes multiple times a day (the contents of the file change periodically) and, every time, I have to click through this little annoyance.
The Phishing and malware detection page only explains how to disable the feature completely, which is not what I want at all.
Can I disable this feature for a single given URL?
Say I want to use a proxy auto-config file that is stored at C:\proxy.pac. To make Internet Explorer use this configuration I have to specify the pac-file in the LAN settings in the following way:
file://C:/proxy.pac
But Safari, that uses the same proxy settings, will ignore it in this case. To make Safari use the pac-file I have to reference it as
file:///C:/proxy.pac
(3 slashes at the beginning) which, according to Wikipedia is the correct format. But this way Internet Explorer will ignore it. Opera and Chrome, that also use the same proxy settings, are fine with both ways but is there another option that will work with Safari and Internet Explorer at the same time?
For a PHP application I'm developing, I need to read the current git revision SHA which of course I can get easily by using shell_exec or backticks to execute the git command line client.
I have obviously put this call into a method of its very own, so that I can easily isolate and mock this for the rest of my unit tests. So my class looks a bit like this:
class Task_Bundle
{
public function execute()
{
// Do things
$revision = $this->git_sha();
// Do more things
}
protected function git_sha()
{
return `git rev-parse --short HEAD`;
}
}
Of course, although I can test most of the class by mocking git_sha, I'm struggling to see how to test the actual git_sha() method because I don't see a way to create a known state for it. I don't think there's any real value in a unit test that also calls git rev-parse to compare the results? I was wondering about at least asserting that the command had been run, but I can't see any way to get a history of shell commands executed by PHP - even if I specify that PHP should use BASH rather than SH the history list comes up empty, I presume because the separate backticks executions are separate terminal sessions.
I'd love to hear any suggestions for how I might test this, or is it OK to just leave that method untested and be careful with it when the app is being maintained in future?
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.
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
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#.
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 try to check the permission granted to a directory in linux, i mean i have a directory with permission 755
berty@berty-laptop:~$ ls -l / |grep directory
drwxr-xr-x 3 root root 4096 2011-01-10 12:33 directory
how can i read that permission with java? I've tried using FilePermission but though i have a directory with all the permissions (777) the FilePermission class always returns an exception
java.security.AccessControlException: Access denied (java.io.FilePermission /home/directory read)
at java.security.AccessController.checkPermission(AccessController.java:103)
at com.snippets.Check4DirectoryPermission.checker(Check4DirectoryPermission.java:50)
at com.snippets.Check4DirectoryPermission.main(Check4DirectoryPermission.java:70)
is there another way to do this?
Hi,
I want to make it possible for the administrator to log in as a fontend user from the backend. Right now I'm using two sessions (sessions with different names), one for the admin and one for the frontend.
Is it possible to write in the first session, close it and then open a new session?
This is a simplified version of what I attempted but failed:
session_name('admin_session');
session_start();
// use first session without generatring any output
session_close();
session_name('frontend_session');
session_start();
// use the second session
Thanks.
I want to write a program to recover recently deleted files on windows 7..
Is there a function in windows API that recover files? If not, how can I begin in that?
EDIT:
Or an open source project for that?
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
So there are a lot of questions regarding this method on SO, but none seem to answer my question. I firstly had an issue with the connectionstring (although it seems to work in other areas of my code correctly). This was resolved easily.
Now the issue is with a simple SELECT query via a OLEDBCommand (Text) that keeps popping up the following error?
"SELECT [Opportunity#],[BidManager],[Prob %],[Opportunity_Stage].[Opportunity_Status],[Term],[Sign Date] FROM [Sheet1$];"
No value given for one or more required parameters.
but their are no parameters????
Checked and double checked the columns names, but to no avail. Also tried removing the special characters from the column names, but still the same exception.
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,