Rectangle 27 4

The .exe is buried in the .app file. It's all in the .app folder because it mimics the structure of an OS X program. Open the .app folder and look in Contents/Windows. If your project was built correctly, the .exe file will be there.

Don't bother trying to run it from Xcode or in any other fashion under OS X, it's a Windows program.

And, yes, Cocotron's documentation leaves much to be desired. In spite of its difficulties and limitations there's no better way I've found to compile a Cocoa program to run under Windows. But be prepared for quite a bit of conditional compiling. It's been a number of months since I worked with it. I'm sure it's improving all the time.

I've got the Cocotron target in my existing project working under Xcode 4.4. Here are some settings to make sure you have:

A Build Rule for C files to be processed with the Cocotron compiler:

retargetBundle

After compiling with all that in place, you should see a build-Windows folder in your project folder that contains a Release folder which contains a .app bundle. Inside that bundle, you should see a Contents folder which contains a Windows folder which contains AppKit.1.0.dll, AppKit.framework, Foundation.1.0.dll, Foundation.framework, and yourApp.exe.

If it's not working, let us know which parts of the app you see and which you don't.

Helpful Answer, but I'm not getting the Windows folder inside of the Contents folder. Obviously I'm doing something wrong. Could this have to do with the Build Locations Settings? Or the Cocotron Settings? My EXECUTABLE_FOLDER_PATH setting looks fine, it seems like it just won't build the EXE file.

Did you set all of these build settings? What version of Xcode are you using? I think I've only used Cocotron under version 3. It doesn't look like these instructions have changed since then. I don't know if that means the build settings are still the same or just that the documentation hasn't been updated.

Everything looks fine, however there are a few settings not shown in my project. I've built the project a few times and although the build succeeds, there are only two folders within the App Bundle/Contents/ folder. I am using Xcode 4.4.1. It seems odd that it won't work...

Could you check the edits. I've been working on this, and I was wondering if you could help out ( +50 bounty reward ;) )

objective c - Generating an EXE with Cocotron - Stack Overflow

objective-c compiler-errors cross-compiling cocotron
Rectangle 27 7

Those items in the Build Info are not available to your built app. They are placeholders that you could possibly pull into your app. What is in your app is anything that you place in, say, the Resources folder of your app, like any text files, or plists, or a nice picture of your versioning engineer.

Now, you could pull some of the items in the Build Info window into a info.plist, using special identifiers, such as ${VERSION_INFO_PREFIX} or other token. The tokens are available if you click on any of the items on the left hand side in the window you have included above. For example, click on the word "Current Project Version" and copy the token that you see at the bottom, "CURRENT_PROJECT_VERSION". Then go to your plist file, and add an entry. Give it any name you want or "Current Project Version". Paste in ${CURRENT_PROJECT_VERSION} on the right hand side. Now that value is available to you from your app, programmatically. Of course, someone now has to enter that value into the appropriate place either in the Build Info window or elsewhere. It might just be easier just to manage this and fields like this in the info.plist file. It's up to you how you'd like to handle these things.

Here is how I get version info out of my info.plist:

+ (NSString *) getAppVersionNumber;
{
    NSString    *myVersion,
                *buildNum,
                *versText;

    myVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
    buildNum = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
    if (myVersion) {
        if (buildNum)
            versText = [NSString stringWithFormat:@"Version: %@ (%@)", myVersion, buildNum];
        else
            versText = [NSString stringWithFormat:@"Version: %@", myVersion];
    }
    else if (buildNum)
        versText = [NSString stringWithFormat:@"Version: %@", buildNum];
    NSLog(versText);
    return versText;
}

"Undefined or garbage value returned to caller"! Delete versText and put a return statement on it's position. At the end return nil.

Don't NSLog like this. It should be NSLog(@"%@",versText);. If versText remains undefined, which is possible from the code, this will result in a crash.

iphone - How to display the current project version of my App to the u...

iphone cocoa cocoa-touch xcode
Rectangle 27 5

If I remember well, I had the same kind of issue when loading stuff from the asset folder but with a database. It seems that the stuff in your asset folder can have 2 stats : compressed or not. If it is compressed, then you are allowed 1 Mo of memory to uncompress it, otherwise you will get this kind of exception. There are several bug reports about that because the documentation is not clear. So if you still want to to use your format, you have to either use an uncompressed version, or give an extension like .mp3 or .png to your file. I know it's a bit crazy but I load a database with a .mp3 extension and it works perfectly fine. This other solution is to package your application with a special option to tell it not to compress certain extension. But then you need to build your app manually and add "zip -0" option. The advantage of an uncompressed assest is that the phase of zip-align before publication of an application will align the data correctly so that when loaded in memory it can be directly mapped.

  • change the extension of the file to .mp3 or .png and see if it works
  • build your app manually and use the zip-0 option

How to play videos in android from assets folder or raw folder? - Stac...

android video assets
Rectangle 27 3

this code will help you to play music in background: the sound file of the music should be only 30 sec notification support 30 sec sound file and it should be in the bundle folder if it is in the document folder then you have to put the path of the sound file

NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
NSString *dateValueRemaining =[NSString stringWithFormat:@"23/08/2012 11:30:33"];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"dd/MM/yyyy HH:mm:ss"];
NSDate *dateRemaining = [dateFormat dateFromString:dateValueRemaining];
NSDate *pickerDate = dateRemaining;
NSDateComponents *dateComponents = [calendar components:(NSYearCalendarUnit
                                                         | NSMonthCalendarUnit
                                                         | NSDayCalendarUnit)
                                               fromDate:pickerDate];
NSDateComponents *timeComponents = [calendar components:(NSHourCalendarUnit
                                                         | NSMinuteCalendarUnit
                                                         | NSSecondCalendarUnit)
                                               fromDate:pickerDate];
// Set up the fire time
NSDateComponents *dateComps = [[NSDateComponents alloc] init];
[dateComps setDay:[dateComponents day]];
[dateComps setMonth:[dateComponents month]];
[dateComps setYear:[dateComponents year]];
[dateComps setHour:[timeComponents hour]];
[dateComps setMinute:[timeComponents minute]];
[dateComps setSecond:[timeComponents second]];
NSDate *itemDate = [calendar dateFromComponents:dateComps];
NSLog(@"itemDate: %@", itemDate);
if (localNotif) {
    [[UIApplication sharedApplication] cancelLocalNotification:localNotif];
}
localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil) {
    return;
}
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate = itemDate;
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody = @"Your Time is Over";
localNotif.alertAction = @"View";
//---THIS SONG FILE IN THE NSBUNDLE FOLDER---------//
localNotif.soundName = @"s1.mp3";
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:@"someValue" forKey:@"someKey"];
localNotif.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];

objective c - iPhone - play alarm sound while the app in background - ...

iphone objective-c background alarm
Rectangle 27 3

this code will help you to play music in background: the sound file of the music should be only 30 sec notification support 30 sec sound file and it should be in the bundle folder if it is in the document folder then you have to put the path of the sound file

NSCalendar *calendar = [NSCalendar autoupdatingCurrentCalendar];
NSString *dateValueRemaining =[NSString stringWithFormat:@"23/08/2012 11:30:33"];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"dd/MM/yyyy HH:mm:ss"];
NSDate *dateRemaining = [dateFormat dateFromString:dateValueRemaining];
NSDate *pickerDate = dateRemaining;
NSDateComponents *dateComponents = [calendar components:(NSYearCalendarUnit
                                                         | NSMonthCalendarUnit
                                                         | NSDayCalendarUnit)
                                               fromDate:pickerDate];
NSDateComponents *timeComponents = [calendar components:(NSHourCalendarUnit
                                                         | NSMinuteCalendarUnit
                                                         | NSSecondCalendarUnit)
                                               fromDate:pickerDate];
// Set up the fire time
NSDateComponents *dateComps = [[NSDateComponents alloc] init];
[dateComps setDay:[dateComponents day]];
[dateComps setMonth:[dateComponents month]];
[dateComps setYear:[dateComponents year]];
[dateComps setHour:[timeComponents hour]];
[dateComps setMinute:[timeComponents minute]];
[dateComps setSecond:[timeComponents second]];
NSDate *itemDate = [calendar dateFromComponents:dateComps];
NSLog(@"itemDate: %@", itemDate);
if (localNotif) {
    [[UIApplication sharedApplication] cancelLocalNotification:localNotif];
}
localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil) {
    return;
}
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate = itemDate;
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody = @"Your Time is Over";
localNotif.alertAction = @"View";
//---THIS SONG FILE IN THE NSBUNDLE FOLDER---------//
localNotif.soundName = @"s1.mp3";
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:@"someValue" forKey:@"someKey"];
localNotif.userInfo = infoDict;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];

objective c - iPhone - play alarm sound while the app in background - ...

iphone objective-c background alarm
Rectangle 27 2

You can't get this path with Swift from your app: the "Derived Data" folder is only useful for Xcode, not for your app, which doesn't "see" it at all.

Xcode is the IDE and uses the folder when building your app - but your app is not aware of Xcode or its folders, your app is independent from the IDE.

this .xcode project inside derived data consists a info.plist file where workspace information is given. so in that case, this info can not be accessible or is there any way to know the .xcode project location? thanks

This info is only available to Xcode, not to your app. Let's say you distribute your app. When the final user uses it, there may not even be an Xcode installed on this machine... and anyway there won't be your Derived Data folder with your building data - this is only on your machine, only for your Xcode - unrelated to your app.

swift - find project path in derived data folder in xcode 8 - Stack Ov...

swift xcode xcode8
Rectangle 27 1

It is a bug but a superficial one - it happens when you clean your project. If the file is under the Products folder, those items are only for the purpose of displaying the output of the build process. If you build and run again it should not be red anymore but if it is red, it isn't affecting your app.

xcode4 - .app file appears in red (missing) in new projects with Xcode...

xcode4
Rectangle 27 3

My designer doesn't want to go hunting everywhere (all over the python path) for template files. My template layout follows yours in that there is one template folder and all the apps go below that. Each app has its own base.html that extends basebase.html.

Here lately I've started following the pinax model of an apps folder, and all apps go in there. The reason for this is purely aesthetic since Wing shows me a tree, all my apps are clustered together in that part of the tree. What I didn't like was an app that sorted out alphabetically after templates or media or site_media. Scrolling up and down the tree slowed me down. By putting all the apps into one place in the tree, git commit -m "feature notes" apps checkins in the code changes too which is another plus.

webapps/
  myvirtenv/
    bin/
    lib/
    myproject/        <- Source control starts here
      site_media/
        collected_static/
          js/
          css/
          img/
        uploaded_media/
      deploy/
          myproject.wsgi
          procmail scripts
          apache site files  # linked from /etc/apache2/sites-endabled
      apps/
        app1/
          templates/       <- This should be here, but in practice I just leave in templates below
            app1/
        app2/
      templates/ # lib template overrides and site wide templates
        basebase.html      <- I changed the name to help my designer
        app1/
        app2/
      settings.py
      gethostname()_local_settings.py # keep machine specific settings here
      urls.py
      manage.py
      requirements
        base.txt
        project.txt

There were too many base.html files and talking about it was difficult, so basebase.html was born and we've been happy with that ever since.

I haven't had any static files that didn't work with the staticfiles app. I was using that app with 1.2. I haven't gone back and done the 1.3 static folders yet but I probably will in the next few months as things get worked on.

I got the requirements folder trick from pinax.

  • manage syncdb (if using sqlite, otherwise you have to do db creation tasks first)

This looks like I can grow into from what I'm doing, but I will keep shoving myvirtenv (I just type venv) inside myproject. Great for clones, but using startproject requires me to create the project using a different (similar) virtualenv, then go into the project and set up my virtualenv. I just ignore venv from source control.

Django project hierarchy/organization - Stack Overflow

django hierarchy
Rectangle 27 0

By design, the local appdata folder on Windows is accessible only to that app, or to full-trust desktop applications (and this is probably true of similar sandboxed locations on other platforms). As a result, a Windows Store app that gets launched with Launcher.launchFileAsync won't be able access that location (nor can a webview process, which is also sandboxed). If a desktop application gets launched, on the other hand, it probably can access the file, but you can't tell ahead of time if that's the case. Bottom line is that local appdata isn't a good location for letting other apps get at the file.

You'll need to save the file in another location that is accessible to other apps. There are two approaches here, both of which will require a little user interaction to select a location, so they can place the PDFs anywhere they want:

There might be Cordova plugins that work with these APIs too, but I haven't checked. Either way, once the file is in an accessible location, launching the file should work just fine.

As an alternate solution, you could consider rendering the PDFs directly in your app. Windows has an API for this in Windows.Data.Pdf, with an associated sample. There might be a plugin or other JS libraries that could also work for this.

Display PDF file in LocalState folder in Windows 8 app in Cordova - St...

windows cordova pdf winjs
Rectangle 27 0

My way of doing this is to create a new folder in the /app directory in the root of your Laravel 4 project. Then add this folder to the first array of the /app/start/global.php file like so:

<?php

ClassLoader::addDirectories(array(

app_path().'/commands',
app_path().'/controllers',
app_path().'/models',
app_path().'/database/seeds',
app_path().'/classes', // This line is the one I've added.

));

As long as the folder structure within the new /app/classes folder follows your namespacing convention. Laravel 4 will autoload all the classes/files within this folder. This way there's no need to dig into any composer files or run composer command.

Not sure if this is best practice but it certainly works.

/app/classes/Helpers/Helper.php
<?php namespace Helpers;

class Helper {

    public static function helloWorld()
    {
        return 'Hello World';
    }
}
Helpers\Helper::helloWorld();

You could also alias this helper class in your /app/config/app.php file. Just add something like this to the end of the aliases array:

'Helper'          => 'Helpers\Helper'

I like this way because you dont have to mingle with anything composer-ish, a clean and classy solution. +1

If you were to add your helper class to your app.php file you can now access the class directly like this: Helper::hellowWorld();

should the helper be a class? can I define a simple function here?

This doesn't work if you don't edit the composer.json and don't run composer dumpautoload

What are the best practices and best places for laravel 4 helpers or b...

laravel laravel-4 blade
Rectangle 27 0

based off the questions you posted Writing a web app like what you want is no simple task. What I would recommend is use some other library (this is one i found with a quick google) to get a web console on your server and give the user it is running under execute deny permissions on every folder except the folder you have your app installed.

This is still is a risky method if you don't set up the security correctly but it is the easiest solution without digging around too much on existing libraries to just have the application interactive.

EDIT -- The "Best" solution is learn AJAX and have your program post its own pages with it but like I said, it will not be easy.

I'm not trying to write a webpage in C++. I'm trying to display output of a C++ program.

Do you want the output to be live or just every time they refresh they get the current buffer?

I want the output to be live. Essentially, what I am aiming on doing is someone writes some code in C++ and it displays the output of the program that person wrote on the website so users can interact with just as if it were in Terminal or Command Prompt.

The problem with HTTP is that it is a request/response model. You will need to wrap your main program into a web request handler. You can stream the current output out, but standard input is going to have to be handled via AJAX calls back to your program.

Any way to display C++ on a webpage? - Stack Overflow

c++
Rectangle 27 0

I also added the app in the repository, so you can run it straight from your folder. If you download the project, you should be able to open it in xcode, compile it and run it. You should get the same result as the app I uploaded.

objective c - Xcode single window, display custom view from xib file -...

objective-c xcode osx cocoa view
Rectangle 27 0

  • Are you sure that images folder is on your app root?

I would recommend you to use a static folder to store your static contents organized in subfolders:

Root  
  static  
     images
     stylesheets
     javascripts
  app.yaml

and Mapping a url /images like this.

- url: /images
  static_dir: static/images
  mime_type: image/png

mime_type: image/png is optional; if not specified, the MIME type for a file will be derived from the file's filename extension.

No he doesn't. If he has a directory called 'images' off his app's root dir, what he's listed should work just fine.

Unable to Display image in Google App Engine (Python) - Stack Overflow

python google-app-engine
Rectangle 27 0

Create a folder script in the root of the app and place rails file from the bin folder to the script folder then it will work. You might need to change the web-server options in the aptana setting also.

I was having the same problem but this fix fixed it

if it solves the problem please mark it as accepted

for future reference... instead of copying the rails binary, just make a softlink (if in unix): cd project/script; ln -s /usr/bin/rails

if /usr/bin does not exist (it depends in the way you installed rails), try executing ln -s bin script from your project folder

To ensure that you are using the correct version of rails (e.g., if you are using RVM gemsets), make a symlink like this: mkdir script; ln -s `which rails` script/rails

Rails 4.0 project not starting through aptana studio 3 - Stack Overflo...

ruby-on-rails-4 aptana aptana3
Rectangle 27 0

It looks like you might have some caching at play here. Check how the files are referenced. Embedded content, just files in the bin folder etc. Does it update the file if you do a full rebuild of your code? If so it could be that your files are refreshed when rebuilding and cached after you reference them in the app.

Hi, I have just tried your suggestion. I've cleared all Debug folders, cleaned soln, rebuilt it and run the app again. Still the same result. but Thanks for taking the time to answer my question. :)

c# - In windows form, why are some text in .resx file not displayed co...

c# asp.net winforms resources resx
Rectangle 27 0

Thanks for the suggestions! I'm writing a framework which has its own localizations and turns out the app which was integrating my framework had its own localizations too, where traditional Chinese was set to zh-hant therefore even thought Xcode placed the framework's .strings file and app's .strings file in the same folder (framework's is called FrameworkLocalizable.strings while app uses default Localizable.strings), I guess Xcode has to decide which .lproj folder name to use when creating the folder for the bundle and the app's name wins.

ios - zh-Hant.lproj folder in project changes to zh-hant.lproj in .app...

ios localization internationalization
Rectangle 27 0

You should be able to simply display the text in a TextView. If it does not display correctly, it's probably a font problem. You can package a custom font with your app and use it in a TextView very simply. Just put a .ttf font file (it needs to support Unicode encoding of your text) in your project's ./assets folder and include code similar to this in your activity's onCreate method:

TextView tv = (TextView) findViewById(R.id.view_for_hindi_text);
Typeface font = Typeface.createFromAsset(getAssets(), "MyHindiFont.ttf");
tv.setTypeface(font);

Its not working, it show boxes.

@RobinHood - It's either a font problem or an encoding problem with the text. "It shows boxes" is, in my experience, always caused by one (or both) of these problems.

Non-English words in android application - Stack Overflow

android
Rectangle 27 0

You just have to create a folder, or place a class wherever already is listed for autoload. Me, for exemple, have this class PDFMaker, that uses a DomPDF Laravel implementation. I created a folder named libraries and put the path to it (under the app folder) in the autoload:classmap key on composer.json

"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/libraries",
        "app/models",
        "app/helpers",
        "app/database/migrations"
    ]

I did the same with commands for artisan commands! When you do that, you only have to declare a new object for any class under that folder, or call it in a static way, if the class has defined static methods. Something like Class::method.

Hope it helps you, have a nice day! :D

EDIT: After that, don't forget the dump-autoload for placing the new class in autoload scope.

EDIT 2: Remember that once you've put the class on autoload, it will be in same scope the others, so you won't have to import it to other, neither others to it!

what I meant is that when you put some code for example in a controller "HomeController.php" , you just call Config:: , if I delete the use Illuminate\Support\Facades\Config; on my class i can't call it. I'm just asking if there is any way to call Config without importing "use" it

You want to call the class without importing the namespace? Is that correct?

Yup but i want to call laravel classes from my custom class located in app/CustomFolder/Class.php. Sry i'm really a beginner in laravel and frameworks. Thx for you time btw =)

Look, in EVERY programming language (OO) I ever worked with, you need to import the namespace to work with the class. BUT, Laravel let you create a Facede for it. It's the only two ways I think that might be possible.

Nice =D , thx for your idea it was so simple why i didn't think about that : ( thx so much =D so resuming in the parent class i do all the importing use blablabla and on the child classes i can use the imports of the parent class =D ?

Laravel 4 Aliases in custom classes - Stack Overflow

laravel laravel-4
Rectangle 27 0

I place them in a app/libs folder.

Then in the build.gradle (Module: app) looks like this:

dependencies {

    compile project(':protobuf')
    compile files('libs/android-support-v13.jar')

}

Where "android-support-v13.jar" is the jar file i previously placed in libs folder.

java - How do I include a local jar dependency in Gradle? - Stack Over...

java gradle build.gradle
Rectangle 27 0

I had the same issue and in my case the app showed up again when, after manually deleting it from my device, I clicked the Add button under Organizer->Devices->My Device->Applications (where the app should have been displaying already) and dragged my app from under the Products folder in to the Finder dialog; a process described in this question. After a pause with no indication of any progress the app was again displayed in the Organizer window.

Actually just deleting the app and install it again solved the problem for me.

ios - Xcode Organizer doesn't show my app bundle on the connected iPho...

ios xcode code-signing organizer