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"
I want to use wget to DL some files. I want to DL only files whose name that fit a certain pattern, e.g. ???.txt and not any other *.txt files.
Can this be done with wget?
I could only find a way to --accept/--reject files based on the extension.
Thanks!
When reading a Windows PE file directly, I can't seem to find the strong name signature of a delay signed assembly. I can get to the CLR Header and read all those entries. Is the information in the MetaData directory specified within the CLR header? If so does anyone have an example of how to read this table?
I am not interested in calling SN.exe or loading the assembly.
I am new to the world of VB.NET and have been tasked to put together a little program to search a directory of about 2000 Excel spreadsheets and put together a list to display based on the value of a Custom Document Property within that spreadsheet file. Given that I am far from a computer programmer by education or trade, this has been an adventure.
I've gotten it to work, the results are fine. The problem is, it takes well over a minute to run. It is being run over a LAN connection. When I run it locally (using a 'test' directory of about 300 files) it executes in about 4 seconds.
I'm not sure even what to expect as a reasonable execution speed, so I thought I would ask here.
The code is below, if anyone thinks changes there might be of use in speeding things up.
Thank you in advance!
Private Sub listByPt()
Dim di As New IO.DirectoryInfo(dir_loc)
Dim aryFiles As IO.FileInfo() = di.GetFiles("*" & ext_to_check)
Dim fi As IO.FileInfo
Dim dso As DSOFile.OleDocumentProperties
Dim sfilename As String
Dim sheetInfo As Object
Dim sfileCount As String
Dim ifilesDone As Integer
Dim errorList As New ArrayList()
Dim ErrorFile As Object
Dim ErrorMessage As String
'Initialize progress bar values
ifilesDone = 0
sfileCount = di.GetFiles("*" & ext_to_check).Length
Me.lblHighProgress.Text = sfileCount
Me.lblLowProgress.Text = 0
With Me.progressMain
.Maximum = di.GetFiles("*" & ext_to_check).Length
.Minimum = 0
.Value = 0
End With
'Loop through all files in the search directory
For Each fi In aryFiles
dso = New DSOFile.OleDocumentProperties
sfilename = fi.FullName
Try
dso.Open(sfilename, True)
'grab the PT Initials off of the logsheet
Catch excep As Runtime.InteropServices.COMException
errorList.Add(sfilename)
End Try
Try
sheetInfo = dso.CustomProperties("PTNameChecker").Value
Catch ex As Runtime.InteropServices.COMException
sheetInfo = "NONE"
End Try
'Check to see if the initials on the log sheet
'match those we are searching for
If sheetInfo = lstInitials.SelectedValue Then
Dim logsheet As New LogSheet
logsheet.PTInitials = sheetInfo
logsheet.FileName = sfilename
PTFiles.Add(logsheet)
End If
'update progress bar
Me.progressMain.Increment(1)
ifilesDone = ifilesDone + 1
lblLowProgress.Text = ifilesDone
dso.Close()
Next
lstResults.Items.Clear()
'loop through results in the PTFiles list
'add results to the listbox, removing the path info
For Each showsheet As LogSheet In PTFiles
lstResults.Items.Add(Path.GetFileNameWithoutExtension(showsheet.FileName))
Next
'build error message to display to user
ErrorMessage = ""
For Each ErrorFile In errorList
ErrorMessage += ErrorFile & vbCrLf
Next
MsgBox("The following Log Sheets were unable to be checked" _
& vbCrLf & ErrorMessage)
PTFiles.Clear() 'empty PTFiles for next use
End Sub
Hi,
I have a native app that has an .OCX file that needs to be registered for it to be used in a .NET application.
Now currently there's different versions of this .OCX on the machine. Can someone please explain how this can affect the registration of this new (updated) .OCX file registration?
And how does my .NET app know which object to create from which .OCX file?
Is there a way to find the name (and path) of the current application's config file from inside a class library?
E.g. in a web app this would be web.config, in a windows app or service this would be myapp.exe.config.
Could someone please give me a link on how to create a query in JDBC that gets a variable name in the WHERE statement, or write an example, to be more specific, my code looks something like this:
private String getLastModified(String url) {
String lastModified = null;
ResultSet resultSet;
String query = "select LastModified from CacheTable where " +
" URL.equals(url)";
try {
resultSet = sqlStatement.executeQuery(query);
}
Now I need the syntax that enables me to return a ResultSet object where URL in the cacheTable equals url from the method's argument.
thanks
I have a c# winform application that when used spy++, gives "WindowsForms10.Window.8.app.0.33c0d9d" as class name.
Is there a way to change that to something more friendly?
I need to copy and paste the data from one Excel spreadsheet to another based on column name.
For example, one shreadsheet has columns named like Asset, Asset owner.
Another spreadsheet has column named like Application, Application Owner.
Now I want "Asset" column data to copy and paste into the "Application" column in another spreadsheet. The same way "Asset owner" column data should copy and paste into the "Application Owner" column in the other spreadsheet.
Hi devs!
I have seen urls like website.com/admin/ that don't actually show the "index.html" or file name after the last slash. How is this achieved?
Thank you!
Hello friend
I have code name and surname put into same string with coma in the middle ,as "JohnSmith"
I need to insert into database to separate
Can you show me how to code that please.
Thanks
vijay
Here is a snippet of my code
$fp = fsockopen($s['url'], 80, $errno, $errstr, 5);
if($fp){
fwrite($fp, $out);
fclose($fp);
When I run it, it outputs:
unable to connect to www.mydomain.net/1/file.php:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known
I can't figure out why. Any help would be greatly appreciated.
EDIT: I forgot to mention that I'm using this to submit GET data to the $s['url']
Duplicate: http://stackoverflow.com/questions/1034350/dynamic-class-creation-in-objective-c/1034368#1034368
Is it possible to create an instance of a class by name? Something like:
NSString* className = @"Car";
id* p = [Magic createClassByName:className];
[p turnOnEngine];
I don't know if this is possible in objective-c but seems like it would be,
Thanks
I have implemented a web service with server and client authentication using keytool. The problem is that this authentication doesn't work if I don't include the name of the host in it. For example:
keytool -genkey -alias myAlias -keyalg RSA -keypass myPassword -storepass myPassword -keystore my.keystore -dname "CN=myhost"
But I don't need and I don't like validation by host or by IP. Is there any way of avoiding it?
Thanks.
Hy everyone
I'm using a TextField where the user is typing in a phonenumber. When the TextField has changed it should check if this number is allready in the phonebook and display the name.
So far, my only way is to parse all names and number in a Dict and read it from there.
Is there a simpler more efficient and sophisticated way to do that.
cheers simon
How can I fetch a domain name from a URL String?
Examples:
+----------------------+------------+
| input | output |
+----------------------+------------+
| www.google.com | google |
| www.mail.yahoo.com | mail.yahoo |
| www.mail.yahoo.co.in | mail.yahoo |
| www.abc.au.uk | abc |
+----------------------+------------+
Related:
Matching a web address through regex
Should a Software Publisher Certificate granted by a third-part Certification Authority be used to generate a Strong Name Key for use with .NET assemblies?
If I have two interfaces , both quite different in their purposes , but with same method signature , how do I make a class implement both without being forced to write a single method that serves for the both the interfaces and writing some convoluted logic in the method implementation that checks for which type of object the call is being made and invoke proper code ?
In C# , this is overcome by what is called as explicit interface implementation. Is there any equivalent way in Java ?
Hi There,
I have downloaded Storefront asp.net mvc application. When I try to run the application, I get following exception:
ArgumentNullException - Value cannot be null. Parameter name: httpContext
I just don't understand it. How do I fix this error?
Thanks
-Hitesh
Hello friend
I have code name and surname put into same string with coma in the middle ,as "JohnSmith"
I need to insert into database to separate
Can you give me code for that.
Thanks
vijay
Hi,
I'm currently obtaining a handle to a Excel worksheet by using the below C# code:
*Excel.Worksheet worksheet = (Excel.Worksheet)sheets.get_Item(15);//Get the worksheet "SubSignOff" number*
Is there any way that I can obtain the same by using the worksheet name -- "SubSignOff" ?
Many thanks for your help.
--Chapax
Hey guys
Just wondering how do I mimic the following using attributes...
<%= Html.EditorFor(x => x.SportProgramIdList, "FormMultiSelectDropDownList", "SportProgramIds")%>
I know I can specify the template by using [UIHint("FormMultiSelectDropDownList")] but I am left with the problem with how to set the name...
Cheers
Anthony