Live Tile Notification Not Showing - gml

Hi I've been working at this for a while without success. I'm trying to send a simple notification to the live tile for my Native Windows 8 game. To get used to it I tried to use the example mentioned in the docs:
var expiryTime;
expiryTime = date_current_datetime();
expiryTime = date_inc_minute(expiryTime, 5);
win8_livetile_notification_begin("TileSquarePeekImageAndText01");
win8_livetile_notification_expiry(expiryTime);
win8_livetile_notification_tag("tag0");
win8_livetile_notification_text_add("Current Score = " + score);
win8_livetile_notification_image_add("ms-appx:///" + working_directory + "ScoreTile.png");
win8_livetile_notification_end();
Now this code crashes my app. Can someone tell me how to post a tile notification and where we should put the images. Right now I have the images inside of the Included Files folder.

score is a real value, not a string, so you must write:
win8_livetile_notification_text_add("Current Score = " + string(score));
There's no typecasting in GameMaker and never was.

Related

What can make a functionality run a simulator and not on the device?

I'm building an app using React Native.
I'm fetching an array of values fetched from a database in order to provide users a line chart which refresh every X seconds ( 3s atm ).
This works fine on iOS simulator but when it comes to deploy to TestFlight, and run the app on a device, the curves are not displayed, nothing happens.
Since I can use some other feature that requires to fetch data from the DB, I figured out that the issue was not from the API requests.
I currently use react-native-chart-kit, but I tried with react-native-svg-charts as well, the issue remains the same.
Any hint ?
The issue is the same when I display the array of the fetched values, a new value appears on the simulator every 3 seconds but it does not show anything on the device.
I finally found the issue.
The issue were spotted at the API request.
My request takes 2 timestamp params : start time / end time
I always debug the app using the browser and launch ios sim from the RN project.
This time I tried to Run a the project from Xcode and edit the Scheme as release instead of debug .
When I checked the console from Xcode I noticed that my Start time timestamp when considered as 'NaN'.. Not the End time timestamp.
Back to the RN project and to the browser console, the timestamp is alright.
I made some random changes and now it works fine .
Here's what I had before solving the issue:
function formatDate(rawStamp) {
const now = new Date(rawStamp);
var convertToStr =
now.getFullYear() +
"-" +
("00" + (now.getMonth() + 1)).slice(-2) +
"-" +
("00" + now.getDate()).slice(-2) +
" " +
("00" + now.getHours()).slice(-2) +
":" +
("00" + now.getMinutes()).slice(-2) +
":" +
("00" + now.getSeconds()).slice(-2);
return convertToStr
}
const nowStr = formatDate(Date.now() - 7200000)
const gameStampMinusX = Date.parse(nowStr) - (300000)
const gameStampMinusXToStr = formatDate(gameStampMinusX)
Here's what solved the issue:
const nowStr = formatDate(Date.now() - 7200000)
const gameStampMinusX = Date.now() - 7200000 - 300000
const gameStampMinusXToStr = formatDate(gameStampMinusX)
I'm a newbie so I cannot explain this behavior, but seems that this little change makes Xcode recognize the timestamp, and proceed the the API request correctly.
If anyone can explain, feel free !

Youtrack Workflow - Notify a group in a workflow

I am trying to create a workflow for my project in Youtrack that will notify all members of a UserGroup when the state is set to an appropriate value - for example notify all members of the QA group when a task is set to Ready For QA.
Here is the code I have, taken from a larger state machine workflow:
on Approve do {
{group: Quality Assurance}.notifyAllUsers("Task Ready for QA", "A task has been marked as Ready For QA: " + getId());
Alpha Tested By = loggedInUser;
} transit to Ready For QA
Setting the Alpha Tested By values works, everything else works but the group notify. In the editor, the group notify line is highlighted in red, but there is no information about what the problem is. The group name is correct. I copied the syntax directly from the documentation here: https://www.jetbrains.com/help/youtrack/incloud/7.0/Workflow-Language-Grammar.html#literals
I am using the v7.0 InCloud hosted version of YouTrack.
I guess you use the "YouTrack Workflow Editor". Inserting is a bit nasty, copy-paste usually won't work.
Just navigate your mouse to the position you want to insert and hit ctrl + space (autocomplete). Start typing "{group" and you'll get the suggestion for {group: }.
Use again ctrl + space to get the right group-name. After group add the dot "." and once again ctrl + space to add the notifyAllUsers function.
This is my workflow which added issues moved to state "QA" onto a agile board for QA and sends notification to all users in group QA:
whenState.becomes({QA}) {
sprints.add({QA Board.First sprint});
{group:QA}.notifyAllUsers("New Task in QA: " + getId( ) + " " + summary, "Please check your QA board or open this task: " + getUrl( ));
}

Automatic download of created file in Sencha Touch 2

My Sencha Touch 2 application has an 'Export' button, which creates an Excel file with the data of the selected offer.
After the user clicks the button, i want the (server side) export process to be started, and, once completed, the user to be prompted to select a filename and location, OR that the file is automatically downloaded. How do i do that? Does anyone have an example?
For Excel specifically I'm not 100% sure, but this might help you get started or if a CSV is acceptable...
I'm sure you could pass the file reference to a var instead of the string but I have yet to try it.
If you paste the js below into the console you can see how this works. Pretty basic. Maybe try the returned value from the server to see if that works then if it does you can build a function around it to happen when needed.
csvHeading = 'HA, HB, HC, HD \n';
csvData = 'r3a, r3b, r3c, r3d \n' +
'r2a, r2b, r2c, r2d';
CSVFile = csvHeading + csvData;
window.location = 'data:text/csv;charset=utf8,' + encodeURIComponent(CSVFile);

Detecting Front and Back camera in windows 8 tabs

I am developing a metro style app using c# and xaml. For a particular task i need to detect which cam(front or back) is currently capturing. Is there any way to detect front cam or back cam in winrt. Please help me.
Using indexes on the DeviceInformationCollection won't be a reliable solution:
Sometimes front camera will be index 0 and sometimes 1, after testing on the surface 2 a few times it seems to be kind of random.
User could use the USB port to connect an other webcam so you could end up with more than 2 items in your collection without any clue which camera is which index.
Having the same problem as you this is how I solved it:
// Still need to find all webcams
DeviceInformationCollection webcamList = await eviceInformation.FindAllAsync(DeviceClass.VideoCapture)
// Then I do a query to find the front webcam
DeviceInformation frontWebcam = (from webcam in webcamList
where webcam.EnclosureLocation != null
&& webcam.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front
select webcam).FirstOrDefault();
// Same for the back webcam
DeviceInformation backWebcam = (from webcam in webcamList
where webcam.EnclosureLocation != null
&& webcam.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Back
select webcam).FirstOrDefault();
In this exemple I used Linq queries but it works the same with a foreach on "webcamList".
Just look on each DeviceInformation the .EnclosureLocation.Panel property, which is a Windows.Devices.Enumeration.Panel enum. The rest is obvius, Front for the front camera, Back for the back one.
Be also carefull to check if .EnclosureLocation is null or not, using an USB webcam it seems to be null most of the time.
You can use this code.
DeviceInformationCollection videoCaptureDevices = await eviceInformation.FindAllAsync(DeviceClass.VideoCapture);
If the videoCaptureDevices count is zero ,there is no camera attached.
And if camera count is 2 , then there will be both Front & back cameras.
If you initializing camera operation with videoCaptureDevices [0], that will be using Front Camera, and will be Back Camera if it is using videoCaptureDevices [1] .

Multiple Flv Component playback - through a for loop - rewind issues AS3 Flash CS4

I am building a "video wall" app in flash AS3. I am importing a movie clip with a flvPlayback component nested within, then Adding it to the display list 12 times in a for loop (which is based on the length of an xml file.) The xml file aslo points to the .source of the flv instance.
This method is working, for displaying video content on all screens BUT, it only loops the last flvPlayback component. The rest just go back to the first frame of the video.
var vidURL = vidXML.video_item[i].#url
SS.video.source = vidURL;
SS.video.autoRewind = true;
SS.video.autoPlay = true;
SS.video.addEventListener(VideoEvent.COMPLETE, Loop);
function Loop(event:VideoEvent):void
{
SS.video.play();
}
I have tried refering to the SS + [i] to call the event to rewind as soon as it happens (as the videos are different lengths) but have had no luck.
Any help would be appreciated.
Thanks
Jono
Don't worry chaps...
using the "event.target.play()" is triggered when each video finishes, and rewinds them all nicely.
Sorry.
Jono