Create folder in Apps exe. is - visual-studio-2010

Not sure what I am doing wrong. I want to create a folder to store images in my app.
This is code I am trying to use.
If (Not System.IO.Directory.Exists(Application.StartupPath \ "quilt_images")) Then
System.IO.Directory.CreateDirectory(Application.StartupPath \ "quilt_images")
End If
I am getting error
System.InvalidCastException was unhandled
HResult=-2147467262
Message=Conversion from string "C:\Users\DaD\Documents\Visual St" to type 'Long' is not valid.

In this line:
If (Not System.IO.Directory.Exists(Application.StartupPath \ "quilt_images")) Then
you're dividing, not concatenating the string.

Related

Apache 403 on windows using AliasMatch and -D

After i packaged apache to be portable (used any where), I had the surprise to get 403 error on AliasMatch but not on regular Location resources.
Update: I found the fix. Check answer.
And so, here is my own response.
I check the error.log and saw the path of the aliasmatch was wrong ( what a scoop). But note this path is made using a variable. Actually, all the character / that we can expect have been removed.
I look to the origin of the variable but not at the beginning, because all URI based on Location was working. Amazing ! But , the fact is, Location directive seems to convert the ugly \ windows in / to work, but not the AliasMatch directive. I forget to tell that i launched Apache using command line httpd with option -D and ... an ugly windows path with \ and not /. So, i convert the path in a pretty unix path and all is back in order.
In dos command : SET APACHE_ROOT="%THE_WINDOWS_PATH:\=/%"

Localization failed to read a strings file (Xcode 6.3.2)

I can't export for localization, I just get a "Localization failed to read a strings file" error.
The system log says:
2015-06-07 01:41:48,305 Xcode[1914]: [MT] DVTAssertions: Warning in /SourceCache/IDEFrameworks/IDEFrameworks-7718/IDEFoundation/Localization/IDELocalizationWork.m:434
Details: Failed to read strings file "/var/folders/vh/z7jrdtc16mv_ml4rdf3c_yf40000gn/T/Xcode3SourceStringsAdaptor-8B1BF14F-E8BF-4354-9FB6-BFF843BD6623/Localizable.strings", underlying error:
The data couldn’t be read because it isn’t in the correct format.
Object: <IDELocalizationWork>
Method: +readStringsWorkForContext:
Thread: <NSThread: 0x7fa8a250a200>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
But I have no idea what file "Localizable.strings" is.
These steps didn't work:
Found "Localizable.strings" in Base.lproj and deleted it. It was completely empty.
Deleted the whole folder specified in the log message.
Clean and Clean build folder.
Running genstrings first to generate missing .strings-files. genstrings complained and said my strings weren't literals in the calls to NSLocalizedString. Uhh... they all look like this: private let ALERT_REMINDER_FIRED_TITLE = NSLocalizedString("ALERT_REMINDER_FIRED_TITLE", tableName:"ReminderHandler", comment:"my comment")
I figure that Localizable.strings is supposed to contain someting, like /** no localizable strings **/ or something. The problem with that is that my project doesn't even contain the file, it's being generated as completely empty.
Seems that unfinished and commented out calls to NSLocalizedString interfere with export for localization.
For me it was like key = "your string"; that worked in swift 3.
No quotes for key. Semicolons at the end.
I had the same problem when tried to use NSLocalizedString with own NSBundle specified. Seems Xcode won't work if you use localization macros with different form than NSLocalizedString("Some key", comment: "Some comment"). I have fixed this by just redefining the NSLocalizedString function like that:
public func NSLocalizedString(key: String, tableName: String? = nil, bundle: NSBundle = NSBundle.mainBundle(), value: String = "", comment: String) -> String
{
return yourBundleHere.localizedStringForKey(key, value: value, table: tableName)
}
Replace yourBundleHere with NSBundle.mainBundle() or what ever you want.
Check if there are redundant double quotation marks in your Localizable.strings file, then remove them.
The problem for me was that I had completely empty xx.strings files - I'd manually cleared them out.
Add this line at the top of any empty xx.strings files, and the export works again:
/* No Localized Strings */
Had the same issue.
In my case it was caused by an NSLocalizedString that used a variable passed from the server as the key instead of actual strings. The system still scans commented code so anything short of deleting the lines of code will not work.

Team Explorer Everywhere CLC mapping error: "First free argument must be a server path"

I am trying to create a working folder mapping from a server path and local path.
Create Workspace
./tf workspace -new -collection:http://tfs.wtqa.int.thomson.com:8080/tfs//WTQA -login:usrName#domain,password WORKSPACE_SCM_32
Workspace successfully created.
Map Workspace
./tf workfold -map -workspace:WORKSPACE_SCM_32 -login:userName#doamin,password "$/POC-MSFAgile6.2Project/POC Source Code" /blackduck/project/Protex_SCM_Test_32
but it says "An argument error occurred: First free argument must be a server path"
I was having the same problem. What solved to me was using single quotes instead of double quotes:
./tf workfold -map -workspace:WORKSPACE_SCM_32 -login:userName#doamin,password '$/POC-MSFAgile6.2Project/POC Source Code' '/blackduck/project/Protex_SCM_Test_32'

How to find line that is causing the error

I have just started using Laravel and cannot get my head around how it throws errors. It doesn't show the line where the error is so I don't know how to locate it. Can anyone help?
htmlentities() expects parameter 1 to be string, array given (View:
M:\webserver\www\app\views\products\admin\create.blade.php)
This file is incredibly long and I cannot see where this array is being sent.
It's obviously coming from a Form::text() but I am passing a null as the second param in all that I can see. Why doesn't Laravel simply tell me the line that is erroring. The error it puts out is no use to me.
check the error file:
app/storage/logs/laravel.log
you can watch changes in the file (on Mac and *NIX) using command line:
tail -f app/storage/logs/laravel.log
remember that the storage directory must be writable by the webserver/PHP process because it's used as scratch space (for blade views, logs, etc.)

mkdir on windows - CAKEPHP

Hi I am searching for a good solution since a while and I found nothing to help me on google.
I got an error on my website with the function mkdir, but only when I set the debug at 2.
Here is the error
Warning (2): mkdir() [function.mkdir]: Invalid argument
[CORE\cake\libs\folder.php, line 498]
Im on windows server 2003 and every permission are given to all my folder.
The path that is given to the function is
C:\Inetpub\vhosts[DOMAIN NAME]\subdomains[SUBDOMAIN
NAME]\httpdocs\app\webroot\C:
I notice the last C: at the end of the path but don't know where it come from nor does I know what the function is trying to create.
mkdir() should ideally take the path to directory and should not include the file name. The invalid argument warning seems to suggest the same. Try passing the argument without filename.
/Thanks.

Resources