#import <Foundation/Foundation.h>
#import "Fixtures.h"
#import "SpecHelper.h"

extern BOOL gEagerSingletonHook;

@protocol MetaCar<NSObject>
- (id)manufacture;
@end

@protocol GearBox<NSObject>
- (void)shiftUp;
- (void)shiftDown;
@optional
- (void)engageClutch;
@end

@interface Car(Meta)
+ (id)manufacture;
@end

@interface AfterMarketGearBox : NSObject<GearBox>
@end

@interface EagerSingleton : NSObject
@end

@interface MyModule : JSObjectionModule
{
  BOOL _instrumentInvalidEagerSingleton;
  BOOL _instrumentInvalidMetaClass;
}

@property(weak, nonatomic, readonly) Engine *engine;
@property(weak, nonatomic, readonly) id<GearBox> gearBox;
@property(nonatomic, assign) BOOL instrumentInvalidEagerSingleton;
@property (nonatomic, assign) BOOL instrumentInvalidMetaClass;

- (id)initWithEngine:(Engine *)engine andGearBox:(id<GearBox>)gearBox;
@end

@interface CarProvider : NSObject<JSObjectionProvider>
@end

@interface GearBoxProvider : NSObject<JSObjectionProvider>
@end

@interface ProviderModule : JSObjectionModule
@end

@interface BlockModule : JSObjectionModule

@property (nonatomic, assign) BOOL instrumentNilBlock;

@end

@interface CreditCardValidator : NSObject
@end

@protocol CreditCardProcessor <NSObject>
- (void)processNumber:(NSString *)number;
@end

@interface BaseCreditCardProcessor : NSObject<CreditCardProcessor>
@end

@interface VisaCCProcessor : BaseCreditCardProcessor<CreditCardProcessor> {
  CreditCardValidator *_validator;
}
- (id)initWithCreditCardNumber:(NSString *)aCCNumber;
@property (nonatomic, strong) NSString *CCNumber;
@property (nonatomic, strong) CreditCardValidator *validator;
@end

@interface FirstModule : JSObjectionModule
@end

@interface SecondModule : JSObjectionModule
@end

@interface ScopeModule : JSObjectionModule

@end

@interface BlockScopeModule : JSObjectionModule

@end

@interface ProviderScopeModule : JSObjectionModule

@end

@interface BlinkerProvider : NSObject<JSObjectionProvider>
@end

@interface NamedModule : JSObjectionModule
- (id)initWithRightHeadlight:(Headlight*)rightHeadlight;
@end


You are given an array $$$[p_1, p_2, \dots, p_n]$$$, where all elements are distinct.

You can perform several (possibly zero) operations with it. In one operation, you can choose a contiguous subsegment of $$$p$$$ and remove all elements from that subsegment, except for the minimum element on that subsegment. For example, if $$$p = [3, 1, 4, 7, 5, 2, 6]$$$ and you choose the subsegment from the $$$3$$$-rd element to the $$$6$$$-th element, the resulting array is $$$[3, 1, 2, 6]$$$.

An array $$$a$$$ is called reachable if it can be obtained from $$$p$$$ using several (maybe zero) aforementioned operations. Calculate the number of reachable arrays, and print it modulo $$$998244353$$$.


A Snake in the hole? Who cares?
Sometimes a story is just a story—except when it is not. This story was just a story at the time. Over the years, upon reflection, it has taken on more meaning. To me, today, the story about there maybe being a snake in the hole in the tree is more than a story about there maybe being a snake in the hole in the tree.
When I tell it, I sense the cool damp of the Alabama woods in the late fall. I see the fallen leaves, the moss on the bare trees, the oak, the hickory, the sweet gum. I see the squirrel running around the tree, dropping to the ground when Dad shot him. I catch the subdued smell of Dad's ever present cigar and the smell of the wood chips as the tree is cut into firewood. That day in the woods with my Dad is a very good memory.
I see it now also as a caution against being obsessed with the what ifs of life. I am reasonably sure that if there had been a snake in the hole, my Dad would have dealt with it. I suppose one could make a case for investigating a situation before getting involved but I am very much aware that there are all sorts of possible threats out there that can paralyze me if I choose to make that my main focus.
This is just a story—unless you choose to make something more out of it.


Job ID: MI-601606 (99990722)
.Net Architect with C#, Oracle, SQL, MVC, Entity, Razor, jQuery, TFS, agile, scrum and State Elections experience
Location:Lansing , MI(MDOS)
Duration: 2 months
experience working in web development with .Net and C# Required 5 Years
experience in web development with Oracle backend database Required 5 Years
experience as a software architect- developing solution architecture from business requirements, information architecture and technical architecture Required 7 Years
experience working with data analysis including basic SQL skills using a relational database management system (Oracle, SQL Server or DB2) Required 5 Years
experience with object oriented design and development Required 10 Years
experience with MVC, the Entity framework, Razor, JQuery and related .NET technologies and frameworks Required 3 Years
experience working on software development projects as a business analyst where the project was focused on public facing or large enterprise web devel Required 5 Years
experience writing functional designs which include high level requirements, user stories, process overviews and documenting screen mockups using TFS. Required 5 Years
experience producing design documents on a software development project where the methodology was agile, scrum or a more formal method Required 5 Years
experience working in a government agency Required 5 Years
experience working with State elections Required 5 Years
The Infrastructure Solutions Architect will perform a combination of both Infrastructure and Application Architect responsibilities related to MDOS Elections, Financial, and Legal departments. The Infrastructure Solutions Architect will also lead the efforts of those performing Business Analyst duties and executing tasks as defined in the State of Michigan’s Project Management Methodology (PMM) as well as the Systems Engineering Methodology (SEM).
Specific tasks may include but are not limited to:
• Analyze and recommend architecture solutions
• Lead developers in development of system in accordance with defined architecture.
• Ensure compliance with standards (defacto and dejure)
• Analyze and recommend solutions for Web and mobile applications
• Analyze business practices and processes to determine best practice strategies to ensure maximum effectiveness and efficiency
• Assist with Strategic planning, including applications integration and legacy application strategy
• Analyze hardware and software to assist in the standards determination and setting of processes
• Perform Cost analysis and modeling to assist in the assessment of the return on investment for projects and computer operations.
• Analyze application development processes and tools
• Recommend changes in hardware, storage, network systems, operating systems, COTS software, security and software design to meet future growth and improve system performance
• Assist with the development of Business Process Models
• Assist with architecting the integration of various vendor technologies including COTS
• Support technical teams with implementations
• Assist with the coordination of architectural change in both technical and business environments
• Assist with architecting diverse solutions into a cohesive and manageable environment
• Recommend solutions for technical architectures of web content management applications
• Assist in the development of solution architectures from business requirements, information architecture, and technical architecture
• Analyze market trends so as to relate business needs with technical opportunities
• Participate in technology test plan development and execution
• Create and modify appropriate documentation deliverables that exist within the Systems Engineering Methodology and are required for the State of Michigan standards.
• Lead and review BA efforts and gathering for completeness.
Serves as the communication bridge between non-technical business users and technical solution developers. The Solutions Architect has a depth of knowledge in business analysis and design processes including knowledge of methodology, tools, and techniques. This individual is an active participant in aspects of department assessment, visioning, and reengineering.


Appleman and Toastman play a game. Initially Appleman gives one group of n numbers to the Toastman, then they start to complete the following tasks:

- Each time Toastman gets a group of numbers, he sums up all the numbers and adds this sum to the score. Then he gives the group to the Appleman.
- Each time Appleman gets a group consisting of a single number, he throws this group out. Each time Appleman gets a group consisting of more than one number, he splits the group into two non-empty groups (he can do it in any way) and gives each of them to Toastman.

After guys complete all the tasks they look at the score value. What is the maximum possible value of score they can get?


3.1 - Add/Remove Beneficiary
Click the ‘Manage’ icon in the bottom left of the app. Click on ‘Add beneficiary’. Enter the beneficiary address (the beneficiary address is their Account No. from Valora).
In order to be able to be added as a beneficiary, the user needs to have impactMarket app connected to Valora with the Account No. being used to add as a beneficiary. If the user is not registered, an error "Not registered" will be shown.
Also note that when a beneficiary is added, $0.05 will be sent from the community contract to the beneficiary being added (to cover the transaction fees). This means that the community needs to have at least $0.05 to add a new beneficiary.
After removing a beneficiary, it could not be added again.


This is the hard version of the problem. The difference between the versions is that in this version, you need to count the number of good arrays. You can hack only if you solved all versions of this problem.

Kevin is visiting the Red Church, and he found a puzzle on the wall.

For an array $$$ a $$$, let $$$ c(l,r) $$$ indicate how many distinct numbers are among $$$ a_l, a_{l+1}, \ldots, a_r $$$. In particular, if $$$ l > r $$$, define $$$ c(l,r) = 0 $$$.

You are given a string $$$ s $$$ of length $$$ n $$$ consisting of letters $$$ \texttt{L} $$$ and $$$ \texttt{R} $$$ only. Let a non-negative array $$$ a $$$ be called good, if the following conditions hold for $$$ 1 \leq i \leq n $$$:

- if $$$s_i=\verb!L!$$$, then $$$c(1,i-1)=a_i$$$;
- if $$$s_i=\verb!R!$$$, then $$$c(i+1,n)=a_i$$$.

You need to count the number of good arrays $$$a$$$. Since the answer may be large, you only need to output the answer modulo $$$998\,244\,353$$$.


E-wallet Mobile App
CUT isan e-wallet mobile application that available in China and Myanmar. It works well with both RMB and MMK currencies.
The Technology Stack
As a leading web/mobile app development company, Nimble AppGenie uses the latest technologies and tools to ensure high-quality development solutions.


Fixing memory issues
One of the most common issues encountered when installing Pixelmon is the user's system running out of memory (RAM). Pixelmon has many large assets, such as models, textures, and music, that require significantly more memory to load compared to vanilla Minecraft and most other mods, and not having enough memory will cause Minecraft to either crash or freeze while loading.
Identifying the issue
Memory issues are not the only cause of Minecraft not loading. Before attempting to fix a memory issue, it must first be confirmed that a memory issue is causing the problem.
If Minecraft crashes when attempting to start up, it is possible that the crash is caused by running out of memory. To check whether this is the case, you will need to look at the crash report that is displayed after Minecraft crashes. The first line of the crash report after "Description" is the start of the actual crash. Look for any of the following lines.
- "java.lang.OutOfMemoryError: Java heap space"
- "net.minecraftforge.fml.common.LoaderException: java.lang.OutOfMemoryError: Java heap space"
- "net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: com/pixelmonmod/pixelmon/..."
- "SplashProgress has detected a error loading Minecraft."
- "Caused by: java.lang.IllegalAccessError: tried to access field net.minecraft.client.renderer.entity.RenderManager.field_178636_l from class com.pixelmonmod.pixelmon.client.ClientProxy"
- "at net.minecraft.world.World.getSkyColorBody(World.java:1477)"
If the crash begins with any of these lines, then Minecraft is crashing because it ran out of memory.
- If Minecraft freezes on the loading screen, it is very likely that Minecraft has run out of memory. In particular, memory issues commonly cause the Forge loading screen to freeze while loading models and textures ("Reloading — ModelManager").
- If Minecraft lags severely during gameplay, it is possible that Minecraft doesn't have enough memory to run smoothly.
The Pixelmon launcher will not allow you start up Minecraft until at least 2G of memory is allocated. While this restriction usually prevents memory issues from occurring, there are certain situations that may still cause memory issues.
- If you have already allocated at least 2G of memory through the Pixelmon launcher and Minecraft still crashes or freezes due to memory issues (as detailed above), see this section.
- If the Pixelmon launcher does not allow you to allocate more than 1200M of memory, see this section.
Allocating more memory
To fix an issue with running out of memory, more memory must be allocated to Minecraft (at least 2G).
- On the Minecraft launcher, select the "Launch options" tab. Make sure that the switch labeled "Advanced settings" is turned on.
- Find and edit the profile that you are using to play Pixelmon.
- Find the "JVM Arguments" text box. Inside this text box, find the text that reads "-Xmx". After this text, there will be a number and a letter; e.g., "-Xmx1G" or "-Xmx512M". Change this to "-Xmx2G".
- Start Minecraft. If it completes start-up successfully, you have allocated enough memory.
- On the main screen of the Pixelmon launcher, locate the gear icon in the top-right corner of the launcher and click on it.
- Find the slider labeled "Maximum memory (MB)", and increase its value to at least 2G.
- If you cannot increase this value more than 1200M, see this section.
- Locate the command that you use to start your server. Depending on how you set up your server, this command may inside an executable file (e.g., a ".bat" or ".command" file), or the command may be directly entered into the command line.
- Within this command, find the text that reads "-Xmx". After this text, there will be a number and a letter; e.g., "-Xmx1G" or "-Xmx512M". Change this to "-Xmx2G".
- If you don't see any text that reads "-Xmx", add "-Xmx2G" directly after "java", separated on both sides by spaces. For example:
java -Xmx2G -jar minecraft_server.jar nogui
- Start the server.
If Minecraft does not successfully start up after changing the JVM arguments, there are several possible causes.
If you are using Windows, you may be using a 32-bit Java version, which cannot allocate the needed 2G of memory needed to run Pixelmon. One way to check this is to examine the Minecraft game output when Minecraft fails to start. If you have a 32-bit Java version, the following message will be displayed:
Error occurred during initialization of VM Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0 Could not reserve enough space for <number>KB object heap
You can download the installer for a 64-bit version of Java here. Make sure to choose the version of Java that is labeled "Windows x64".
After running the Java installer and installing the 64-bit Java version, find the file path to the Java executable file that was just installed.
- On Windows, the default file path where Java is installed is "C:\Program Files\Java\jdk1.8.0_<version>\bin\java.exe".
- On Mac OS X, the default file path where Java is installed is "/Library/Java/JavaVirtualMachines/jdk1.8.0_<version>.jdk/Contents/Home/bin/java".
Once you have found the file path to the Java executable file, you will need to configure Minecraft to use this file. This will allow Minecraft to use the new Java version you have installed.
- On the Minecraft launcher, edit your profile, find the text box labeled "Java executable", and enable it if it is not already enabled. Then, replace the contents of the text box with the file path to the Java executable file. Save your profile after doing this.
- On the Pixelmon launcher, click the gear in the top-right corner of the launcher to open the launcher settings. Click on Select Java Install and browse your file system to find the Java executable file. Then, click "Continue" to save your settings changes.
32-bit operating system
If you are using Windows and are unable to install a 64-bit Java version, it is possible that your operating system is 32-bit and cannot run 64-bit programs. You can also check the initial crash report before you attempted to change the JVM arguments. In the "System Details" section at the bottom of the crash report, look for a line starting with "Operating System". If it contains "(x86)", your operating system is 32-bit; you will need to upgrade to a 64-bit operating system in order to play Pixelmon. Below is an example of a 32-bit operating system:
Operating System: Windows 10 (x86) version 10.0
Be warned that upgrading Windows from 32-bit to 64-bit is not a trivial task. If you are willing to upgrade, see one of the following links depending on the version of Windows you are using:
If you cannot upgrade to a 64-bit operating system, it is possible that your computer's CPU hardware is 32-bit. In this case, you will need to get a new computer with a 64-bit CPU.
If you have already installed a 64-bit Java version and you're still getting the same error as before, then your computer may not have enough RAM to run Pixelmon. Check the amount of RAM on your system by right-clicking on "Computer" (Windows 7/8) or "This PC" (Windows 10) and choosing "Properties". Look for the "Installed memory (RAM)" entry under "System". If you have 2.00 GB RAM or less installed, you will need to install more RAM on your system in order to run Pixelmon. This will require you to physically buy more RAM and insert it into your computer; details about this process can be found here.
Global Java options
Windows systems have a feature that limits the amount of memory that can be allocated to a Java program. Frequently, this limit is less than 2G of memory and will override any manually defined JVM arguments, causing too little memory to be allocated to Minecraft. To check if this limit is affecting you, look at the "System Details" section of the Minecraft crash report, and find the line that starts with "JVM Flags", and look for "-Xmx" in this line. If you see multiple "-Xmx" arguments, including one that is not in the "JVM Arguments" text box in your Minecraft profile, the global Java limit is preventing you from allocating enough memory.
The following snippet is an example of the JVM flags that are displayed in a crash report when the global Java limit problem occurs. Notice that there is a user-defined "-Xmx2G" and an additional "-Xmx512M" that the user did not manually add.
JVM Flags: 5 total; ... -XX:MaxPermSize=128m -Xmx2G -Xms256M -Xmx512M
To remove this global limit, follow these steps:
- In File Explorer, right-click on "Computer" (Windows 7/8) or "This PC" (Windows 10) and choose "Properties".
- A window will open. In the sidebar on the left of this window, select "Advanced system settings".
- A "System Properties" window will open. Select the "Environment Variables" button at the bottom of this window.
- In the "Environment Variables" window, scroll through the list labeled "System variables" until you find a variable labeled "_JAVA_OPTIONS".
- Select the "_JAVA_OPTIONS" entry and click "Delete" to remove it.
- Restart your computer.
- After Windows restarts, start up Minecraft to verify that it is now able to start successfully.


Alice and Bob play a game. They have a binary string $$$s$$$ (a string such that each character in it is either $$$0$$$ or $$$1$$$). Alice moves first, then Bob, then Alice again, and so on.

During their move, the player can choose any number (not less than one) of consecutive equal characters in $$$s$$$ and delete them.

For example, if the string is $$$10110$$$, there are $$$6$$$ possible moves (deleted characters are bold):

1. $$$\textbf{1}0110 \to 0110$$$;
2. $$$1\textbf{0}110 \to 1110$$$;
3. $$$10\textbf{1}10 \to 1010$$$;
4. $$$101\textbf{1}0 \to 1010$$$;
5. $$$10\textbf{11}0 \to 100$$$;
6. $$$1011\textbf{0} \to 1011$$$.

After the characters are removed, the characters to the left and to the right of the removed block become adjacent. I. e. the following sequence of moves is valid: $$$10\textbf{11}0 \to 1\textbf{00} \to 1$$$.

The game ends when the string becomes empty, and the score of each player is the number of $$$1$$$-characters deleted by them.

Each player wants to maximize their score. Calculate the resulting score of Alice.


int FontAdd(char *foldername);
Load a custom bitmap font. Font folders must be placed in the Debug/Assets folder of your project.
Returns an int handle to the loaded font.
Folder in which font images are stored. This path is relative to the Assets folder in your Application's folder.
NOTE: The file system used by iOS is case sensitive, so be sure to match the case of the file name in your code to that of the file on your computer.
The FontAdd() function loads images specified by foldername to memory. Use TextAdd() to add text using a specific font. You may create your own font images using the DragonFireSDK Font Generator utility that ships with DragonFireSDK, and is located in the folder where you installed DragonFireSDK.
Available in DragonFireSDK 1.0 and later.
Description: This program will load text images from a folder named FontMedium, add "Hello" at 0, 0 using FontMedium and "Bye" at 100, 0 using FontMedium.
FontMedium = FontAdd("FontMedium");
TextAdd( 0, 0, "Hello", FontMedium);
TextAdd(100, 0, "Bye", FontMedium);


/*
 *  Copyright 2014-2015 The University of Queensland
 *  http://www.uq.edu.au
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

#pragma once

#include <thrust/functional.h>
#include <cusp/detail/functional.h>

#ifndef DIA_CHUNKSIZE
#define DIA_CHUNKSIZE 1024
#endif

namespace cusp
{
namespace detail
{
namespace host
{

/////////////////////////
// DIA transposed SpMV //
/////////////////////////
template <typename Matrix,
          typename Vector1,
          typename Vector2,
          typename UnaryFunction,
          typename BinaryFunction1,
          typename BinaryFunction2>
void transposed_spmv_dia(const Matrix&  A,
                         const Vector1& x,
                               Vector2& y,
                         UnaryFunction   initialize,
                         BinaryFunction1 combine,
                         BinaryFunction2 reduce)
{
    typedef typename Matrix::index_type  IndexType;
    //typedef typename Vector2::value_type ValueType;

    const size_t num_diagonals = A.values.num_cols;

#pragma omp parallel for
    for (size_t ch = 0; ch < A.num_cols; ch += DIA_CHUNKSIZE) {
        // initialize chunk
        for (size_t row = ch; row < std::min(ch+DIA_CHUNKSIZE,A.num_cols); row++)
        {
            y[row] = initialize(y[row]);
        }
        // for each diagonal
        for (size_t d = 0; d < num_diagonals; d++)
        {
            for (IndexType row=ch; row<std::min(ch+DIA_CHUNKSIZE,A.num_cols); row++)
            {
                const IndexType col = row - A.diagonal_offsets[d];
                if (col >= 0 && col < A.num_rows)
                {
                    y[row] = reduce(y[row], combine(A.values(col, d), x[col]));
                }
            }
        }
    }
}

template <typename Matrix,
          typename Vector1,
          typename Vector2>
void transposed_spmv_dia(const Matrix&  A,
                         const Vector1& x,
                               Vector2& y)
{
    typedef typename Vector2::value_type ValueType;

    transposed_spmv_dia(A, x, y,
             cusp::detail::zero_function<ValueType>(),
             thrust::multiplies<ValueType>(),
             thrust::plus<ValueType>());
}

template <typename Matrix,
          typename Vector1,
          typename Vector2,
          typename UnaryFunction,
          typename BinaryFunction1,
          typename BinaryFunction2>
void transposed_spmv_cds(const Matrix&  A,
                         const Vector1& x,
                               Vector2& y,
                         UnaryFunction   initialize,
                         BinaryFunction1 combine,
                         BinaryFunction2 reduce)
{
    typedef typename Matrix::index_type  IndexType;
    typedef typename Vector2::value_type ValueType;

    const IndexType num_diagonals = A.diagonal_offsets.size();
    const IndexType block_size = (IndexType)A.block_size;
    const IndexType num_cols = (IndexType)A.num_cols;
    // make chunksize a multiple of block_size
    const IndexType chunksize = block_size*(DIA_CHUNKSIZE/block_size);

    // optimisation for special case
    if (block_size == 2) {
#pragma omp parallel for
        for (IndexType ch = 0; ch < num_cols; ch += chunksize) {
            for (IndexType row = ch; row < std::min(ch+chunksize,num_cols); row+=2)
            {
                ValueType sum1 = initialize(y[row]);
                ValueType sum2 = initialize(y[row+1]);
                // for each diagonal block
                for (IndexType d = 0; d < num_diagonals; d++)
                {
                    const IndexType col = row - A.diagonal_offsets[d]*2;
                    if (col >= 0 && col < A.num_rows)
                    {
                        sum1 = reduce(sum1, combine(A.values(col,   2*d),  x[col]));
                        sum2 = reduce(sum2, combine(A.values(col,   2*d+1),x[col]));
                        sum1 = reduce(sum1, combine(A.values(col+1, 2*d),  x[col+1]));
                        sum2 = reduce(sum2, combine(A.values(col+1, 2*d+1),x[col+1]));
                    }
                }
                y[row] = sum1;
                y[row+1] = sum2;
            }
        }
    } else { // block_size!=2
#pragma omp parallel for
        for (IndexType ch = 0; ch < num_cols; ch += chunksize) {
            for (IndexType row = ch; row < std::min(ch+chunksize,num_cols); row++)
            {
                y[row] = initialize(y[row]);

                // for each diagonal block
                for (IndexType d = 0; d < num_diagonals; d++)
                {
                    const IndexType k = A.diagonal_offsets[d]*block_size;
                    const IndexType col = block_size*(row/block_size) - k;
                    if (col >= 0 && col <= A.num_rows-block_size)
                    {
                        // for each column in block
                        for (IndexType i = 0; i < block_size; i++)
                        {
                            const ValueType& Aij = A.values(col+i, d*block_size+row%block_size);
                            const ValueType& xj = x[col + i];
                            y[row] = reduce(y[row], combine(Aij, xj));
                        }
                    }
                } // diagonals
            } // rows
        } // chunks
    } // block_size
}

template <typename Matrix,
          typename Vector1,
          typename Vector2>
void transposed_spmv_cds(const Matrix&  A,
                         const Vector1& x,
                               Vector2& y)
{
    typedef typename Vector2::value_type ValueType;

    if (A.block_size == 1) {
        transposed_spmv_dia(A, x, y,
                 cusp::detail::zero_function<ValueType>(),
                 thrust::multiplies<ValueType>(),
                 thrust::plus<ValueType>());
    } else {
        transposed_spmv_cds(A, x, y,
                  cusp::detail::zero_function<ValueType>(),
                  thrust::multiplies<ValueType>(),
                  thrust::plus<ValueType>());
    }
}

} // end namespace host
} // end namespace detail
} // end namespace cusp


I'm getting this error when I try to upgrade Flash Player for Firefox and IE:
Only a single instance of this application can run..
Any idea how to update Flash player then?
I think this problem is somewhat recent. I had a similar issue. My solution was:
It's a bit annoying because between steps 1 and 2 you need to reboot. But it worked for me.
The upgrade for Flash player for IE and Firefox is two different programs. For IE, it is an ActiveX control, for Firefox (and the other browsers), it is a plugin. It looks like you were somehow running both simultaneously.
Go to this site with BOTH browsers and check your plugins:
http://www.mozilla.com/en-US/plugincheck/ (it says Mozilla, think Firefox, but works for any browser)
I suspect you may have actually already updated one (the first one that was running), and that only the second failed. Any plugins not updated will be reported to you, and will link you to the download. I might also suggest that you reboot and try this. Do one browser at a time. Give this a try, and if you actually have more serious problems, post back.
I have been fighting this problem for over a week now. Just figured things out today. I had installed Microsoft Silverlight a bit ago. I think that is the "other instance" that the computer was trying to tell me was interfering with installing Adobe Flash. I think it is a version of Flash Player. I uninstalled it and then installed the 64 bit version of Adobe Flash for other browsers (other than Iinternet Explorer). The Flash player now works with Safari and Firefox. There was a suggestion to download Google Chrome since it has an integrated Flash player and I did that. It worked great from the start, but I still wanted to use my other browsers. There was a version of Flash Player just for Internet Explorer, but I did not install that since I am uncertain whether or not I am going to use Explorer going forward. It has been acting up. I really hopes this helps some of the rest of you.


Leave a review
Manage and document software development.
Added on May 17
Paid plans start from $10/mo
DocumentationLab is an AI-powered software documentation tool designed to simplify and streamline the documentation process for developers.
• Simplify and streamline the software documentation process for development teams.
• Enhance documentation management by linking documentation to code files for automatic updates.
• Improve user experience by providing accurate and relevant answers through AI-powered search.
Experience the convenience and efficiency of DocumentationLab, an AI-powered software documentation tool designed to simplify the documentation process for developers and streamline team workflows.
What do you think about DocumentationLab ?
Leave a review for the community
This tool does not have any reviews yet. Be the first to review it.
Improves team knowledge sharing with fast Q&A solution.
Build beautiful, easy-to-maintain docs optimized for user engagement.
Open-source AI-powered search engine for your documentation
AI-powered programming assistant for JetBrains IDEs!
Team collaboration chat.
AI-powered code generation tool for unit tests, refactoring, and documentation
Copyright © 2023 - Futurepedia™


#include <stdio.h>
#include <stdlib.h>
#include "NetCDFReader.h"

typedef union ecldouble
{
    double value;
    unsigned long lvalue;
    unsigned char byte[8];
} ecldouble;

typedef union eclfloat
{
    float value;
    unsigned int ivalue;
    unsigned char byte[4];
} eclfloat;

void writeByteData(unsigned char *bytes, size_t byteLength, const char *tgtFilePath)
{
	FILE *pFile = fopen(tgtFilePath, "wb");
    if (pFile == NULL)
    {
        printf("Failed to open input file. 3\n");
		exit(0);
    }

    fwrite(bytes, 1, byteLength, pFile); //write outSize bytes
    fclose(pFile);
}

void writeFloatData_inBytes(float *data, size_t nbEle, const char* tgtFilePath)
{
	size_t i = 0;
	eclfloat buf;
	unsigned char* bytes = (unsigned char*)malloc(nbEle*sizeof(float));
	for(i=0;i<nbEle;i++)
	{
		buf.value = data[i];
		bytes[i*4+0] = buf.byte[0];
		bytes[i*4+1] = buf.byte[1];
		bytes[i*4+2] = buf.byte[2];
		bytes[i*4+3] = buf.byte[3];
	}

	size_t byteLength = nbEle*sizeof(float);
	writeByteData(bytes, byteLength, tgtFilePath);
	free(bytes);
}

void writeDoubleData_inBytes(double *data, size_t nbEle, const char* tgtFilePath)
{
	size_t i = 0, index = 0;
	ecldouble buf;
	unsigned char* bytes = (unsigned char*)malloc(nbEle*sizeof(double));
	for(i=0;i<nbEle;i++)
	{
		index = i*8;
		buf.value = data[i];
		bytes[index+0] = buf.byte[0];
		bytes[index+1] = buf.byte[1];
		bytes[index+2] = buf.byte[2];
		bytes[index+3] = buf.byte[3];
		bytes[index+4] = buf.byte[4];
		bytes[index+5] = buf.byte[5];
		bytes[index+6] = buf.byte[6];
		bytes[index+7] = buf.byte[7];
	}

	size_t byteLength = nbEle*sizeof(double);
	writeByteData(bytes, byteLength, tgtFilePath);
	free(bytes);
}

void usage()
{
	printf("Options:\n");
	printf("* data type:\n");
	printf("	-f: single precision (float type)\n");
	printf("	-d: double precision (double type)\n");
	printf("* input data file:\n");
	printf("	-i <NetCDF data file> : NetCDF data file\n");
	printf("	-n <dataset path> : dataset path in NetCDF file\n");
	printf("* output data file:\n");
	printf("	-o <output file path>: output file path\n");
	printf("* dimensions: \n");
	printf("	-1 <nx> : dimension for 1D data such as data[nx]\n");
	printf("	-2 <nx> <ny> : dimensions for 2D data such as data[ny][nx]\n");
	printf("	-3 <nx> <ny> <nz> : dimensions for 3D data such as data[nz][ny][nx] \n");
	printf("	-4 <nx> <ny> <nz> <np>: dimensions for 4D data such as data[np][nz][ny][nx] \n");
	printf("* examples: \n");
	printf("	extractNetCDFData -f -i testdata/testdata.nc -n data -2 6 12 -o test.dat\n");
	exit(0);
}

int main(int argc, char* argv[])
{
	int dataType;
	char* inPath = NULL;
	char *dataset = NULL;
	char* outPath = NULL;

	size_t i = 0;
	size_t nbEle;

	size_t r5 = 0;
	size_t r4 = 0;
	size_t r3 = 0;
	size_t r2 = 0;
	size_t r1 = 0;

	if(argc==1)
	  usage();

	for(i=1;i<argc;i++)
	{
		if (argv[i][0] != '-' || argv[i][2])
		  usage();
		switch (argv[i][1])
		{
			case 'f':
				dataType = 0;
				break;
			case 'd':
				dataType = 1;
				break;
			case 'i':
				if (++i == argc)
				  usage();
				inPath = argv[i];
				break;
			case '1':
				if (++i == argc || sscanf(argv[i], "%zu", &r1) != 1)
				  usage();
				break;
			case '2':
				if (++i == argc || sscanf(argv[i], "%zu", &r1) != 1 ||
							++i == argc || sscanf(argv[i], "%zu", &r2) != 1)
				  usage();
				break;
			case '3':
				if (++i == argc || sscanf(argv[i], "%zu", &r1) != 1 ||
							++i == argc || sscanf(argv[i], "%zu", &r2) != 1 ||
							++i == argc || sscanf(argv[i], "%zu", &r3) != 1)
				  usage();
				break;
			case '4':
				if (++i == argc || sscanf(argv[i], "%zu", &r1) != 1 ||
							++i == argc || sscanf(argv[i], "%zu", &r2) != 1 ||
							++i == argc || sscanf(argv[i], "%zu", &r3) != 1 ||
							++i == argc || sscanf(argv[i], "%zu", &r4) != 1)
				  usage();
				break;
			case 'n':
				if (++i == argc)
				  usage();
				dataset = argv[i];
				break;
			case 'o':
				if (++i == argc)
				  usage();
				outPath = argv[i];
				break;
			default:
				usage();
				break;
		}
	}

	if ((r1==0) && (r2==0) && (r3==0) && (r4==0) && (r5==0))
	{
		printf ("Error: please specify dimensions.\n");
		printf("-1 <nx> : dimension for 1D data such as data[nx]\n");
		printf("-2 <nx> <ny> : dimensions for 2D data such as data[ny][nx]\n");
		printf("-3 <nx> <ny> <nz> : dimensions for 3D data such as data[nz][ny][nx] \n");
		printf("-4 <nx> <ny> <nz> <np>: dimensions for 4D data such as data[np][nz][ny][nx] \n");
		exit(0);
	}

	if(r2==0)
	  nbEle = r1;
	else if(r3==0)
	  nbEle = r1*r2;
	else if(r4==0)
	  nbEle = r1*r2*r3;
	else if(r5==0)
	  nbEle = r1*r2*r3*r4;
	else
	  nbEle = r1*r2*r3*r4*r5;

	if (dataType == 0)
	{
		float *data = (float*)malloc(nbEle*sizeof(float));
		netcdfReader((void*)data, inPath, dataset, dataType);

		for (i = 0; i < 10; i++)
		  printf ("%f\n", ((float*)data)[i]);

		 writeFloatData_inBytes(data, nbEle, outPath);
	}
	else
	if (dataType == 1)
	{
	  double *data = (double*)malloc(nbEle*sizeof(double));
	  netcdfReader((void*)data, inPath, dataset, dataType);

	  for (i = 0; i < 10; i++)
		printf ("%lf\n", ((double*)data)[i]);

	  writeDoubleData_inBytes(data, nbEle, outPath);
	}
	printf("output data file: %s\n", outPath);

	return 0;
}


You are given a permutation $$$a_1,a_2,\ldots,a_n$$$ of the first $$$n$$$ positive integers. A subarray $$$[l,r]$$$ is called copium if we can rearrange it so that it becomes a sequence of consecutive integers, or more formally, if $$$$$$\max(a_l,a_{l+1},\ldots,a_r)-\min(a_l,a_{l+1},\ldots,a_r)=r-l$$$$$$ For each $$$k$$$ in the range $$$[0,n]$$$, print out the maximum number of copium subarrays of $$$a$$$ over all ways of rearranging the last $$$n-k$$$ elements of $$$a$$$.


It is never too late to play the fancy "Binary Cards" game!

There is an infinite amount of cards of positive and negative ranks that are used in the game. The absolute value of any card rank is a power of two, i.e. each card has a rank of either 2k or  - 2k for some integer k ≥ 0. There is an infinite amount of cards of any valid rank.

At the beginning of the game player forms his deck that is some multiset (possibly empty) of cards. It is allowed to pick any number of cards of any rank but the small deck is considered to be a skill indicator. Game consists of n rounds. In the i-th round jury tells the player an integer ai. After that the player is obligated to draw such a subset of his deck that the sum of ranks of the chosen cards is equal to ai (it is allowed to not draw any cards, in which case the sum is considered to be equal to zero). If player fails to do so, he loses and the game is over. Otherwise, player takes back all of his cards into his deck and the game proceeds to the next round. Player is considered a winner if he is able to draw the suitable set of cards in each of the rounds.

Somebody told you which numbers ai the jury is going to tell you in each round. Now you want to pick a deck consisting of the minimum number of cards that allows you to win the "Binary Cards" game.


Confirmed to work!! Please download in the File section of PSPUpdates or the following uploaded files.Welcome to 1.50, PSP firmware 2.0 users! MPH has created a WORKING downgrader from PSP firmware 2.0 to firmware 1.50. This takes advantage of the toc2rta exploit and allows for the full downgrade of firmware 2.0 to firmware 1.50. I have tried this myself and have successfully downgraded.
Although this has been tried and found working, this does not mean there is no risk involved so use at your own risk.
Steps to use the MPH downgrader:
- Create an UPDATE folder in PSP/GAME/ folder of your memory stick
- Copy EBOOT.PBP (update 1.50) in /PSP/GAME/UPDATE folder
- Unpack MPHDowngrader.zip
- Copy overflow.tif in your PSP/PHOTO/ folder of your memory stick
(make sure you have changed your background to frame_buffer.png as explained in the toc2rta exploit.)
- Copy h.bin in root of your memory stick
- Copy index.dat in root of your memory stick
- Plug the AC adaptor
What you do next is go into the Photo Menu on the PSP and it will show some jumbled text, which is normal. Wait about 30 seconds and then restart your PSP.
From there you will now have a new file in your PSP’s root directory called ms0:/index.dat.bak. In the next step you will go to you Game Menu, Then Memory Stick, and then Launch “PSP Update ver 1.50.”
It will then ask you to downgrade and lead you along to installing. Here is where I got scared. It installed to 99% then errored. This is OK. Restart your PSP and reboot it. It will come up with another error which is OK as well. Restart it again and you will have PSP firmware version 1.50. Enjoy, and welcome to the world of legal homebrew, not piracy.
You can get the MPH Downgrader in our PSP Download section [here] .
You can get the 1.50 Update Eboot in our PSP Download section [here] .


I have an array of audio data I am passing to a reader:
The instantiation is as follows:
AudioRecord recorder; short audioData; int bufferSize; int samplerate = 8000; //get the buffer size to use with this audio record bufferSize = AudioRecord.getMinBufferSize(samplerate, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT)*3; //instantiate the AudioRecorder recorder = new AudioRecord(AudioSource.MIC,samplerate, AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT,bufferSize); recording = true; //variable to use start or stop recording audioData = new short [bufferSize]; //short array that pcm data is put into.
I have a FFT class I have found online and a complex class to go with it.
I have tried for two days looking online everywhere but cant work out how to loop through the values stored in
audioData and pass it to the FFT.
This is the FFT class I am using: http://www.cs.princeton.edu/introcs/97data/FFT.java and this is the complex class to go with it: http://introcs.cs.princeton.edu/java/97data/Complex.java.html


Bertown is under siege! The attackers have blocked all the ways out and their cannon is bombarding the city. Fortunately, Berland intelligence managed to intercept the enemies' shooting plan. Let's introduce the Cartesian system of coordinates, the origin of which coincides with the cannon's position, the Ox axis is directed rightwards in the city's direction, the Oy axis is directed upwards (to the sky). The cannon will make n more shots. The cannon balls' initial speeds are the same in all the shots and are equal to V, so that every shot is characterized by only one number alphai which represents the angle at which the cannon fires. Due to the cannon's technical peculiarities this angle does not exceed 45 angles (π / 4). We disregard the cannon sizes and consider the firing made from the point (0, 0).

The balls fly according to the known physical laws of a body thrown towards the horizon at an angle:

vx(t) = V·cos(alpha)

vy(t) = V·sin(alpha)  –  g·t

x(t) = V·cos(alpha)·t

y(t) = V·sin(alpha)·t  –  g·t2 / 2

Think of the acceleration of gravity g as equal to 9.8.

Bertown defends m walls. The i-th wall is represented as a vertical segment (xi, 0) - (xi, yi). When a ball hits a wall, it gets stuck in it and doesn't fly on. If a ball doesn't hit any wall it falls on the ground (y = 0) and stops. If the ball exactly hits the point (xi, yi), it is considered stuck.

Your task is to find for each ball the coordinates of the point where it will be located in the end.


/* This file has been autogenerated by Ivory
 * Compiler version  0.1.0.5
 */
#ifndef __INPUT_TB_SERVER2SELF_DEQUEUE_MONITOR_H__
#define __INPUT_TB_SERVER2SELF_DEQUEUE_MONITOR_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "ivory.h"
#include "smaccm_can_module.h"
#include "ivory_serialize.h"
#include "canDriverTypes.h"
#include "fragment_drop_monitor.h"
void callback_input_tb_server2self_dequeue_handler(const uint8_t n_var0[80U]);

#ifdef __cplusplus
}
#endif
#endif /* __INPUT_TB_SERVER2SELF_DEQUEUE_MONITOR_H__ */


It seems strange to me that with so many sufferers there is no decent forum for hypertensives. Those that are active seem frequented by advertisers and weirdo’s! I was hoping that this area might become one but it seems a bit quiet. a shame as to my mind the my blood pressure s/ware could legitimately be described as ‘best of breed’!
Does anyone know of a good forum? Or can we try harder to make this the centre of all things hypertensive!


Puzzles4Family es una colección de juegos de puzzles para iPhone e iPad. Estos puzzles son para toda la familia, tanto para niños como para adultos, hombres y mujeres. Los disfrutarás mientras esperas al autobús, viajas en metro o ves la televisión.
Puzzles4family ("us", "we", or "our") operates the Puzzles4family mobile application (the "Service").
We do not collect any data from you.
Puzzles4family does not collect data for any purposes
We do not transfer any data.
Puzzles4family do not disclose your Personal Data.
The security of your data is important to us, but remember that no method of transmission over the Internet, or method of electronic storage is 100% secure. While we strive to use commercially acceptable means to protect your Personal Data, we cannot guarantee its absolute security.
We have no control over and assume no responsibility for the content, privacy policies or practices of any third party sites or services.
Our Service does not address anyone under the age of 18 ("Children").
We do not knowingly collect personally identifiable information from anyone under the age of 18. If you are a parent or guardian and you are aware that your Children has provided us with Personal Data, please contact us. If we become aware that we have collected Personal Data from children without verification of parental consent, we take steps to remove that information from our servers.


I'd be lying if I were to suggest the slightest hint of positive experience in the time I spent logged into Realms of Despair.
I went through their creation process, as limited as it is, and got into the thick of things. You'd think with the couple of hundred players logged on, someone'd be willing to answer a question or in some way communicate with a new player. Attempts both in character and out of character to initiate communications were ignored. And as for the game itself, for as much as I was able to see in the hour or so I spent bumping around on the 'number 1' mud on this site.... I cannot pose so much as a single reason they sit in the number 1 spot. This mud is truley among the more mindless game I've ever logged into.
And this is coming from someone who used to work, writing reviews for various muds for another site. Big-time thumbs down.


Researchers have interestingly found the hottest planet-hosting star system and caught a picture of a planet orbiting b Centauri, a binary star noticeable with the unaided eye. Situated at multiple times the distance between the Sun and Jupiter, the star system goes against the prevalent view that planets couldn’t exist around stars this gigantic and this warm — as of recently.
“Getting to see a planet around b Centauri was extremely invigorating since it totally changes the image about gigantic stars hosting planets,” clarifies Markus Janson, a cosmologist at Stockholm University, Sweden. Found 325 light-years away in the Centaurus heavenly body, space experts have identified a monster planet in orbit around a youthful monstrous binary star called b Centauri. Researchers said that the b Centauri binary star is only 15 million years of age and has something like multiple times the mass of the Sun. This property makes it by a wide margin the most enormous heavenly system around which cosmologists have tracked down a planet. Its essential star is a purported B-type star that is north of three times more blazing than the Sun.
Because of its high temperature, it produces a lot of UV and X-beam radiation. Up to this point, past examinations had neglected to distinguish any such item around a star multiple occasions as gigantic as the Sun. “B-type stars are by and large viewed as very damaging and hazardous environments. It was accepted that it ought to be incredibly hard to shape enormous planets around them,” Janson clarifies. “We have consistently had an extremely nearby planet group driven perspective on what planetary systems ‘should’ resemble,” MPIA researcher and co-author Matthias Samland calls attention to.
“In the course of the most recent ten years, the revelation of numerous planetary systems in amazing and novel designs has caused us to extend our generally limited view. This revelation adds one more thrilling section involved, this time for monstrous stars,” he said in an assertion delivered by the Max Planck Institute for Astronomy. Researchers said that the planet, b Centauri (AB)b or b Centauri b is an outsider world encountering conditions totally unique in relation to what we face in our planetary group. t is multiple times more huge than Jupiter, making it quite possibly the most gigantic planet at any point found.
Besides, it spins around the binary star at an amazing multiple times more prominent distance than Jupiter does from the Sun, perhaps the vastest orbit found at this point. The exceptional system was identified by a Spectro-Polarimetric High-contrast Exoplanet Research instrument (SPHERE) mounted on the Very Large Telescope (VLT) at the European Southern Observatory (ESO) in Chile. The group investigated past information on b Centauri and found that the planet had really been imaged over 20 years prior by the ESO 3.6-meter telescope, in spite of the fact that it was not perceived as a planet at that point.


ValeriaSalvatore (22 Y/O female) XXX hot live cam sex show - Chat and webcam sex with ValeriaSalvatore
Yeah I know I look like an angel but are you sure I am? Well, you'll find out. Nice to meet you, you can call me Vale, it will be a pleasure to meet you and make you happier. I'm online monday to saturday (7am - 5pm GTM 5).


/// \file
/// \brief Internal header file that describes the utility functions for Windows
/// IO.
/// \author Lyberta
/// \copyright BSLv1.

#pragma once

#include <ios>
#include <span>
#include <filesystem>

#include "../position.h"
#include "../file_options.h"

#include <windows.h>

#include "Platform.h"

namespace std::io::Windows
{

using NativeHandle = HANDLE; ///< Native Windows file handle.

/// \brief Invalid Windows file handle.
const NativeHandle InvalidNativeHandle = INVALID_HANDLE_VALUE;

/// \brief Opens or creates a file and returns the handle to it.
/// \param[in] file_name Name of the file to open.
/// \param[in] m TODO
/// \param[in] c TODO
/// \return Handle to the file.
/// \throw TODO
NativeHandle OpenFile(const filesystem::path& file_name, mode m, creation c);

/// \brief Closes the file handle if it is valid.
/// \param[in] handle File handle to close.
void CloseFile(NativeHandle handle) noexcept;

/// \brief Returns current position in the file.
/// \param[in] handle Native handle to inspect.
/// \return Current position in the file.
/// \throw TODO
position GetPosition(NativeHandle handle);

/// \brief Sets the position in the file to the given one.
/// \param[in] handle Native handle to work with.
/// \param[in] pos Position to set.
/// \throw std::io::io_error In case of documented error.
/// \throw std::system_error In case of undocumented error.
void SeekPosition(NativeHandle handle, position pos);

/// \brief Sets the position in the file to the given offset relative to the
/// current position in the file.
/// \param[in] handle Native handle to work with.
/// \param[in] off Offset to seek by.
/// \throw std::io::io_error In case of documented error.
/// \throw std::system_error In case of undocumented error.
void SeekPosition(NativeHandle handle, offset off);

/// \brief Sets the position in the file to the given base position.
/// \param[in] handle Native handle to work with.
/// \param[in] base Base position to set.
/// \throw std::io::io_error In case of documented error.
/// \throw std::system_error In case of undocumented error.
void SeekPosition(NativeHandle handle, base_position base);

/// \brief Sets the position in the file specified by the given base position
/// and offset.
/// \param[in] handle Native handle to work with.
/// \param[in] base Base position to use for seeking.
/// \param[in] off Offset to apply to the given base position.
/// \throw std::io::io_error In case of documented error.
/// \throw std::system_error In case of undocumented error.
void SeekPosition(NativeHandle handle, base_position base, offset off);

/// \brief Reads zero or more bytes from the file to the given buffer and
/// advances file position by the amount of bytes read.
/// \param
/// \param[in,out] buffer Buffer to write to.
/// \return Amount of bytes read.
/// \throw std::io::io_error In case of documented error.
/// \throw std::system_error In case of undocumented error.
streamsize ReadSome(NativeHandle handle, span<byte> buffer);

/// \brief Writes zero or more bytes to the file from the given buffer and
/// advances file position by the amount of bytes written.
/// \param[in] buffer Buffer to read from.
/// \return Amount of bytes written.
/// \throw std::io::io_error In case of documented error.
/// \throw std::system_error In case of undocumented error.
streamsize WriteSome(NativeHandle handle, span<const byte> buffer);

/// \brief Returns the optimal buffer size for the given native handle.
/// \param[in] handle Handle to inspect.
/// \return Optimal buffer size.
/// \throw TODO
size_t GetBufferSize(NativeHandle handle);

}


There are $$$n$$$ shovels in the nearby shop. The $$$i$$$-th shovel costs $$$a_i$$$ bourles.

Misha has to buy exactly $$$k$$$ shovels. Each shovel can be bought no more than once.

Misha can buy shovels by several purchases. During one purchase he can choose any subset of remaining (non-bought) shovels and buy this subset.

There are also $$$m$$$ special offers in the shop. The $$$j$$$-th of them is given as a pair $$$(x_j, y_j)$$$, and it means that if Misha buys exactly $$$x_j$$$ shovels during one purchase then $$$y_j$$$ most cheapest of them are for free (i.e. he will not pay for $$$y_j$$$ most cheapest shovels during the current purchase).

Misha can use any offer any (possibly, zero) number of times, but he cannot use more than one offer during one purchase (but he can buy shovels without using any offers).

Your task is to calculate the minimum cost of buying $$$k$$$ shovels, if Misha buys them optimally.


I'm having an issue with Microsoft Power BI Desktop. I'm unable to connect to my ArcGIS account. I was able to log in last week but am unable to do so now. I've done my research and attempted to uninstall, redownload (tried an earlier version), install, and clear cache, among other things. Nothing I attempt appears to work. The login text field is frozen, preventing me from entering my credentials. However, the text field unfreezes if I select the ArcGIS Enterprise login option (see attached image).


On a cold winter evening our hero Vasya stood in a railway queue to buy a ticket for Codeforces championship final. As it usually happens, the cashier said he was going to be away for 5 minutes and left for an hour. Then Vasya, not to get bored, started to analyze such a mechanism as a queue. The findings astonished Vasya.

Every man is characterized by two numbers: ai, which is the importance of his current task (the greater the number is, the more important the task is) and number ci, which is a picture of his conscience. Numbers ai form the permutation of numbers from 1 to n.

Let the queue consist of n - 1 people at the moment. Let's look at the way the person who came number n behaves. First, he stands at the end of the queue and the does the following: if importance of the task ai of the man in front of him is less than an, they swap their places (it looks like this: the man number n asks the one before him: "Erm... Excuse me please but it's very important for me... could you please let me move up the queue?"), then he again poses the question to the man in front of him and so on. But in case when ai is greater than an, moving up the queue stops. However, the man number n can perform the operation no more than cn times.

In our task let us suppose that by the moment when the man number n joins the queue, the process of swaps between n - 1 will have stopped. If the swap is possible it necessarily takes place.

Your task is to help Vasya model the described process and find the order in which the people will stand in queue when all the swaps stops.


Scales? What kind of scales is this website talking about? Is it digital scales, that balance scale, the scale one weighs their self and other objects with. What kind of scale is this? Oh, it's Escali digital scales. And what are those? ScalesEtc. has a new line of fashionable scales. Now that's interesting. These scales seem to be the kind that weigh items in fractions of a gram to hundreds of pounds. Does that mean this scale can weigh flour and spinach in kilos? Is that how I have heard of these kinds of scales? I guess they can make a handy item in the kitchen when one is cooking and measuring something a lot. And they sell bathroom and other kinds of scales also. So if you happen to be looking for one of those digital scales or some other kind of scale for whatever reason, ScalesEtc. is there for you. They are all scales, all the time.


OV7251 vs. OV9782 sensor
The camera config page mentions both the OV7251 and the OV9282 as compatible sensors for tracking/stereo.
But the link to the OV9782 (https://docs.modalai.com/M0113/) is dead - I wonder if you have any comments on the sensor.
Is the OV7251 the preferred / better supported solution?
You can find M0113 here: https://www.modalai.com/products/msu-m0113
@Chad-Sweet thanks. Is there also a datasheet doc for M0113?


Is the OE Authentication Gateway product available in the 11.7 OEDK? I can't find it in the list when I create an activation file.
Gateway is part of PAS Prod which not included into OEDK.
Thanks Valeriy. I see from the price list that OEAG is a part of both PASOE Prod (which, presumably, developers shouldn't be using) and as a stand-alone product. I guess we have to buy the latter. It's odd to me that OEAG isn't also a part of the OEDK.


The ping is the reaction time of your connection–how fast you get a response after you’ve sent out a request. A fast ping means a more responsive connection, especially in applications where timing is everything (like video games).
Ping is more appropriate to test whether or not a connection can be made, not how fast the connection is. How Ping Tests Work Ping uses the Internet Control Message Protocol (ICMP) to generate requests and handle responses.
Ping is a basic Internet program that allows a user to verify that a particular IP address exists and can accept requests. The verb «ping» means the act of using the ping utility or command.
Ping, the disguised identity of Hua Mulan in the animated film Mulan Ping the Elastic Man , a comic strip character introduced in The Beano in 1938 «The machine that goes Ping! «, a fictitious obstetric medical device featured in the film Monty Python’s The Meaning of Life
Ping is a utility first developed by Michael Muss in 1983 that is used to verify whether or not a network data packet is capable of being distributed to an address without errors. The ping utility is commonly used to check for network errors.
Jul 31, 2009 · The time it takes for a device to respond to a ping request is determined by a number of factors. Network traffic, the type of cables you use, and even location. Typically speaking, if you lived in Columbus Ohio, you will get a better ping speed pinging a computer in Cleveland than if you were pinging, say, Sacramento, California.


Young Adult Librarian
New York Public Library
Crystal Chen (she/her/hers) is the Young Adult Librarian at the Woodstock branch of The New York Public Library. She earned a BA in fine arts from Amherst College, a MFA in printmaking from SUNY New Paltz, and a MSLIS from Pratt Institute. She is interested in the intersection of art, activism, and social justice and how libraries can create inclusive, responsive programming for youth communities.


Househelp booking app
Betalt ved levering
app to book live in maid or driver.
Projekt ID: #36726005
19 freelancere byder i gennemsnit ₹34395 timen for dette job
Hi, We are team of professional developers wit more than 8 years of experience. We can make app for maid or diver booking. Please inbox so that we can discuss the features and pricing in detail. Thanks.
I am a professional software engineer having experience of 3 + years in developing applications. Along with developing your application I will give free support service to the software developed for 1 years.


"Best player on their team"
Erm You see when you're at the comparison section, and it says best player on their team, they usually say the best player is the one that's the highest rated. Tbh, there are a lot of teams where the highest rated player isn't doing the most work. The game should use the same coefficient to work out who's putting in the most work. Besides, you can see who's the highest rated anyway... Thank you guys for coming to my talk, the floor is open for questions and help yourself to the bar on the left hand side *gestures*
2022-02-03 · 回复数 0 · 赞数 1


Google launched Carbon programming language with a goal to being a successor to C++. Tried it indepth and looks like a great language for beginners. If you are not sure about it,
You can get started with this Google Carbon language tutorial
Although I use C++ very rarely, Getting started with Carbon language was breeze. If you are interested in exploring new language, definitely give it a try. If you tried it,
I have tried all the Carbon language examples using IntelliJ. But curious to know if any one tried it in VSCode ?


A few months ago on this blog I described PowerLoader functionality including an interesting way for privilege escalation into the explorer.exe system process. The leaked PowerLoader code is also used in other malware families. For example the Win32/Gapz dropper is based on leaked PowerLoader code. In August 2013 we have tracked a new modification of PowerLoader for 64-bit operating systems (detected by ESET products as Win64/Vabushky.A). This modification uses three exploits for local privilege escalation (LPE): MS13-053 (CVE-2013-3660), MS12-041 (CVE-2012-1864), and MS12-042 (CVE-2012-0217). Use of this set of LPE exploits was not previously observed in PowerLoader samples or by related malware families.
Win64/Vabushky is a good example of how cybercriminals update their projects with code based on leaked Carberp sources. Two 64-bit exploits (CVE-2012-1864 and CVE-2012-0217) from the updated PowerLoader update are based on the leaked code. Before this leak into the public domain, 64-bit exploitation code for these vulnerabilities was not available. It’s also worth noting that the PowerLoader code was leaked in April 2013 and initiated the wave of distribution of droppers based on PowerLoader leaked code.
The dropper for Win64/Vabushky is packed by MPRESS because this packer is one of the few free products that support x64 PE32+ files. After unpacking, the dropper extracted the original PE32+ header with the time of compilation:
All binaries include a payload compiled at the beginning of August, according to time stamp data. PowerLoader’s export table also shows a few changes after unpacking when compared to the older version:
The most interesting part of latest changes provided concern the exploitation code for local privilege escalation.
LPE exploits update
After code injection into explorer.exe the modified version of PowerLoader tried to execute following local privilege escalation exploits into trusted process address space:
This set of LPE exploits can bypass some types of sandbox technologies used by security products. This is because direct manipulation of some kernel-mode structures is possible from user-mode using legitimate WinAPI calls.
Google researcher Tavis Ormandy discovered the MS31-053 vulnerability in March and exploitation details were disclosed in May. The patch only became available with July’s patch Tuesday. Before this modified version of PowerLoader, I hadn’t seen a 64-bit version of MS13-053 exploit in-the-wild. Only an x86 version of proof of concept code has been seen made available publicly, but PowerLoader uses 64-bit exploitation code. There is a good description of the way in which this vulnerability is exploited in the VUPEN blog.
Before the start of the exploitation process a second desktop is created for hiding visible artifacts by manipulating GDI objects.
The main exploitation code for CVE-2013-3660 is presented in the following figure:
This exploitation code does not work for the 64-bit MS Windows 8 platform because it cannot bypass the Intel SMEP (Supervisor Mode Execution Protection) technology in modern CPU’s (for which support has been provided since the Ivy Bridge line of processors). Microsoft only started to support SMEP with Windows 8 and upwards. This technology blocks attempts to execute code from user-mode memory pages into kernel-mode. A good description of Intel SMEP as exploit protection technology can be found here. The SMEP technology in Windows 8 for x64 can be bypassed using a ROP (Return-Oriented Programming) technique. However, Intel announced the new protection technology SMAP (Supervisor Mode Access Prevention). Intel’s SMAP blocks attempts to read memory pages from user-mode into kernel-mode. SMAP and SMEP were developed to prevent exploitation of NULL pointer dereferences in kernel-mode but SMAP is not supported in Microsoft operating systems yet.
CVE-2012-0217 and CVE-2012-1864
The CVE-2012-0217 and CVE-2012-1864 exploitation code is based on leaked Carberp sources. The 64-bit versions of CVE-2012-1864 had never been made public before the source code leakage. The exploitation code for CVE-2012-0217 released on public doesn’t work reliably on 64-bit versions of operating systems. Neither exploit will work on Microsoft Windows 8 because of the restricted vulnerability of the platform. After observing the similarity to leaked Carberp source code I checked compiled exploit binaries found in the leaked archive. In both compiled exploits I found the same path to the build directory.
This finding points to the same developer and seller for these exploits. The exploitation code for CVE-2012-0217 is different in many respects to the publicly available Proof of Concept exploits. The leaked exploit works more reliably and supports 64-bits operating systems.
I’m going to check similarities in the code from the PowerLoader modification and the leaked exploit for CVE-2012-0217. The following flow graph shows the similarity of basic structural blocks (PowerLoader code on the left side):
It looks to be pretty much the same structure. All the differences are found only in additional debugging code which is not included in PowerLoader modification. Also there are some specific techniques for making the exploitation more stable that look exactly the same.
This code provides modifications in nt!HalDispatchTable for avoiding 100% CPU activity with multiple threads in exploitation process.
The same thing was found with exploitation code for CVE-2012-1864 vulnerability. This exploit has never before been publicly available either. CVE-2012-1864 was discovered by Tarjei Mandt from Azimuth Security. The vulnerability details were disclosed on the slides “Smashing the Atom” at the Recon conference in June 2012 but exploitation code was not released to the public. The exploit code from PowerLoader looks more optimized and doesn’t have debugging code with console output. For example, as seen in this code (disassembly code from PowerLoader is the second image):
CVE-2012-0217 and CVE-2012-1864 are good examples of exploits that make it possible to bypass sandboxes in security software. Both of these exploits can manipulate kernel-mode structures from user-mode using standard WinAPI functions. A nice description of vectors for bypassing sandboxes using these types of vulnerabilities is presented in the research report “Application Sandboxes: A Pen-Tester’s Perspective” by Bromium Labs.
After successful PowerLoader execution and privilege escalation, the ransomware (Win64/Vabushky.A) was downloaded in order to infect the system. Earlier this week my colleague Jean-Ian Boutin discussed another example of ransomware in the blog post “Nymaim – Obfuscation Chronicles“. The downloaded file was executed once escalated privileges were achieved to SYSTEM. The Win64/Vabushky installer uses the trick with a self-generated legitimate certificate and the following installation to the local trust store as a ROOT CA and TrustedPublisher. The following code shows this technique:
This trick is not new and was mentioned in the blog post “The “Hikit” Rootkit: Advanced and Persistent Attack” by Mandiant. Also, during the installation process modifications are made to Boot Configuration Data (BCD) so as to activate test-signing policy for loading the unsigned driver module. The next figure presents registry keys with system configuration to allow the malicious driver to load (safeboot with various options is covered too):
After successful infection the locked desktop screen looks like this:
The user-mode part of Win64/Vabushky also encrypts the user’s files using the Microsoft CryptoAPI and uses the .crypted file extension for encrypted files. The driver code uses standard tricks for locking that don’t merit further discussion in this blog.
The Win64/Vabushky dropper uses an interesting modification to the PowerLoader code. However the PowerLoader modifications are based on leaked LPE exploits for 64-bit operating systems from Carberp code. All modules and components dropped by Win64/Vabushky target x64 versions of Microsoft Windows. Only one exploit, CVE-2013-3660, can attack MS Windows 8. However the exploitation code does not work for the 64-bit version of Windows 8 because it can’t bypass Intel SMEP technology. Microsoft is implementing better kernel-mode protection on Windows 8, making x64 exploits for this operating system more expensive. These security mechanisms can be bypassed in such cases with targeted attacks but this adds up to an expensive exploitation technique for run-of-the-mill cybercriminals.
Special thanks to R136a1 who reported the new modification of PowerLoader.
Aleksandr Matrosov, Security Intelligence Team Lead
SHA1 hashes for analyzed samples:
Win64/Vabushky.A (dropper) – 110e23ce497d6cd1fd3dc570e50cd701c612b7ba
Win64/Vabushky.A (driver installer) – 62a53ff68d1c862c9c68fb577b06fa261ef573e4
Win64/Vabushky.A (driver) – 9434792df305f59a7b9deb99dd8b2617942513b0
Author Aleksandr Matrosov, We Live Security
Leave a reply


#include <stdio.h>
#include <string.h>
#include <sys/xattr.h>
#include "shared.h"

void print_usage(void) {
    printf("Usage:\n"
           "\tHide: ./xattr hide <path> ...\n"
           "\tHide: ./xattr unhide <path> ...\n\n");
}

int main(int argc, char *argv[]) {
    if (argc < 3) {
        printf("[-] xattr: missing arguments\n");
        print_usage();
        return -1;
    }

    if (!strcmp(argv[1], "hide")) {
        // hide all given paths
        for (int i = 2; i < argc; i++) {
            if (0 > setxattr(argv[i], HIDDEN_XATTR, NULL, 0, 0)) {
                printf("[-] xattr: Cannot set attribute '%s' for path '%s'\n", HIDDEN_XATTR, argv[i]);
            }
        }
    } else if (!strcmp(argv[1], "unhide")) {
        // unhide all given paths
        for (int i = 2; i < argc; i++) {
            if (0 > removexattr(argv[i], HIDDEN_XATTR)) {
                printf("[-] xattr: Cannot remove attribute '%s' for path '%s'\n", HIDDEN_XATTR, argv[i]);
            }
        }
    } else {
        printf("[-] xattr: invalid command\n");
        print_usage();
        return -1;
    }

    printf("[+] xattr: Done\n");
    return 0;
}


#ifndef LEARNING_ENTITIES_NN_GA_TARGET_H
#define LEARNING_ENTITIES_NN_GA_TARGET_H

#include "Point.h"

class Food {
private:
    Point pos;
public:
    Food(Point);

    void draw(sf::RenderWindow *);

    const Point getPos() const;
    void setPos(const Point pos);
};

#endif


Monocarp is planning on opening a chemistry lab. During the first month, he's going to distribute solutions of a certain acid.

First, he will sign some contracts with a local chemistry factory. Each contract provides Monocarp with an unlimited supply of some solution of the same acid. The factory provides $$$n$$$ contract options, numbered from $$$1$$$ to $$$n$$$. The $$$i$$$-th solution has a concentration of $$$x_i\%$$$, the contract costs $$$w_i$$$ burles, and Monocarp will be able to sell it for $$$c_i$$$ burles per liter.

Monocarp is expecting $$$k$$$ customers during the first month. Each customer will buy a liter of a $$$y\%$$$-solution, where $$$y$$$ is a real number chosen uniformly at random from $$$0$$$ to $$$100$$$ independently for each customer. More formally, the probability of number $$$y$$$ being less than or equal to some $$$t$$$ is $$$P(y \le t) = \frac{t}{100}$$$.

Monocarp can mix the solution that he signed the contracts with the factory for, at any ratio. More formally, if he has contracts for $$$m$$$ solutions with concentrations $$$x_1, x_2, \dots, x_m$$$, then, for these solutions, he picks their volumes $$$a_1, a_2, \dots, a_m$$$ so that $$$\sum \limits_{i=1}^{m} a_i = 1$$$ (exactly $$$1$$$ since each customer wants exactly one liter of a certain solution).

The concentration of the resulting solution is $$$\sum \limits_{i=1}^{m} x_i \cdot a_i$$$. The price of the resulting solution is $$$\sum \limits_{i=1}^{m} c_i \cdot a_i$$$.

If Monocarp can obtain a solution of concentration $$$y\%$$$, then he will do it while maximizing its price (the cost for the customer). Otherwise, the customer leaves without buying anything, and the price is considered equal to $$$0$$$.

Monocarp wants to sign some contracts with a factory (possibly, none or all of them) so that the expected profit is maximized — the expected total price of the sold solutions for all $$$k$$$ customers minus the total cost of signing the contracts from the factory.

Print the maximum expected profit Monocarp can achieve.


- 01 Sep 2022
- 14 Minutes to read
Map tools tab
- Updated on 01 Sep 2022
- 14 Minutes to read
The Map Tools tab is available from the main ribbon of Flood Modeller's interface. The buttons found here are grouped into 7 tool groups which allow you to perform various functions, such as:
- Adding GIS data to your project
- Generating new GIS data to assist with model building
- Loading / processing results from 1D and 2D models
- Adding bookmarks to highlight parts of the map view
- Adding notes to provide further information in your model
- Geo-processing of GIS data
Each of the 7 tool groups are described in turn below.
GIS Data Tool Group
The buttons in the GIS Data section allow you to either add existing GIS files to the Map View or create a range of new files which can be added and saved to the project.
If you would like to add GIS data to your map, this can be done by clicking the ‘Add GIS Data’ button. This will open a new window prompting you to browse to, and select, the file (or files) that you wish to add. Note the drop-down menu on the bottom right of this window which lists all supported file types that can be selected. Once you have selected your file (or files), click ‘Open’ and the new layer (layers) will be added to the map view as well as be listed in the ‘Layers’ window of the interface (lower left corner).
If you would like to create a new GIS layer, this can be done by navigating to the ‘New’ button of the GIS Data Tool Group. Clicking this will activate a drop down menu with the following layer options to choose from: Shapefile or WMS Layer.
If you select the Shapefile option, the following window will appear:
The above window allows you to select the type of shapefile you would like to create, depending on the purpose it is going to serve. Once you have chosen the type of shapefile that you would like to create, you need to specify a name and location for saving it.
If you select to Create a WMS Layer, the create WMS layer tool will then be displayed in a new window as shown below:
A WMS layer is a layer of maps located on a WMS server. A WMS, or Web Map Service, is a protocol for providing georeferenced map images via the Internet. These map images are generated by a map server using data from a GIS database.
If this is the first time you are accessing this function, it will have no servers specified initially. If a WMS server link has already been established, it will be listed.
The command buttons available on this window are defined as follows:
- Validate – Flood Modeller checks it can successfully connect to the selected WMS Server and reports back the available layers for you to review prior to adding them to your view
- Add - Prompts you to define a new link to a WMS Server
- Edit - Enables an existing WMS Server link to be edited
- Delete - Removes an existing WMS Server link
- Save - Saves your defined list of WMS Server links as an XML file to be recalled in a subsequent Flood Modeller session. Note that if the file is named 'WMSservers.xml' it will be automatically loaded into the WMS server links table.
- Load - Enables you to load a previously defined list of WMS server links for you to then select one to load as a new layer in your view.
- OK - After validating a selected WMS Server link this button proceeds to load the associated data as a new layer in your view. You will be prompted to provide a filename for your new layer (which is given a '.wms' file extension)
- Close - Closes the WMS server window without adding any data to your view.
Generators Tool Group
The Generators Tool Group allows you to add features such as spill, reservoir or cross sections into your project.
Spill Units provide pathways for flow to traverse from in-bank onto the floodplain. These are effectively modelled as weirs running parallel to a river, and are defined by a set of ground levels and corresponding chainages (between adjacent river nodes). Flood Modeller provides the facility to automatically extract this information from a specified ground grid. This requires the following to be defined:
- Ground grid data – this will be interrogated to obtain the vertical elevations along each specified spill line. The grid should be an ASCII format grid (.asc).
- One or more spill lines – this is a line alongside the modelled watercourse across which an overflow will be modelled. It may be represented by an existing polyline shapefile defined elsewhere or it can be a new polyline shapefile that you 'draw' yourself.
Once you have specified your ground grid and spill line shapefile, click on the Spill Generator tool – a new window will then displayed, as shown below:
You can review the spill data calculated by this tool either in long section chart format or in IED format within a text viewer. You can then decide whether to proceed to save the spill data to an IED file.
The reservoir generator tool converts shapefile polygons into reservoir units by defining a series of constant height 'contours' within each polygon. By calculating the area confined by each contour, Flood Modeller can build a set of depth against surface area data pairs that a reservoir unit requires.
In order for this to be carried out, the following must be defined:
- Ground data.
- Reservoir polygons. If a shapefile of reservoir polygons already exists then this can be loaded into the viewport. Alternatively, a new shapefile can be defined.
After creating or loading a reservoir outline shapefile, click on the Reservoir button from the Map Tools tab. The Reservoir Generator window will then be displayed, as shown below:
The Cross Section Generator button opens the river section builder, within which you must specify the necessary information to define your cross sections. These are as follows:
- Polyline shapefile loaded into Layers window that represents your river centre line - this must be selected in the Layers window before the cross section tool is run.
- Cross section separation along the river centre line, which can be defined either by a specified number of equidistant sections or by a maximum distance between sections. Alternatively, you can request a cross section at every point along the centre line.
- Length of cross section – you must specify the distances from the centre to the left and right banks individually.
- 1D node label for each cross section. This can be taken from an existing field in the centre line dbf file or you can specify a common name and Flood Modeller will automatically increment each cross section by assigning a number (starting at '001')
- Common roughness value to be assigned to each cross section. This can be edited in individual sections later if required.
Toolbox Tool Group
The Toolbox tool group contains range of commands which relate to modelling. The buttons here allow you to carry out functions such as creating TIN surfaces, exporting shapefiles to KML, plotting cross-sections and a number of other options relating to grid data processing. You can also access the Modelling Toolbox and Flood Viewer tool from this section.
The Modelling Toolbox groups together all key functions which relate to modelling, providing an easy to use, single point of access to all of these tools. The toolbox can be accessed by clicking on the Modelling Toolbox button in the Map Tools tab, or by selecting the ‘Toolbox’ button from the group of buttons at the bottom right corner of your user interface. The toolbox will open as a new window on the right side of your map viewport.
The TIN Creator tool is designed to generate and edit interpolated triangular network surfaces. These are then used to transform 1D hydraulic model results into 2D flood extent surfaces.
The TIN Creator triangulates any complex surface containing ESRI shapefiles (polygons, polylines (curves) and points). In addition some shapes within the input data can be specified as 'holes'. The triangulation process will then go around these areas leaving them blank. Holes are useful to define areas in a model that you want to keep 'dry' when creating a flood water surface from model results.
The Export to Google Earth button converts a shapefile to kml format and provides the option to upload the file to Google Earth after the conversion is complete. Selected attributes data can also be assigned to the kml file to provide a colour scale, e.g. water depth data.
Flood Viewer is an interactive flood visualisation tool which aims to provide rapid access to historic/predictive flood extent mapping in an emergency situation (e.g. control room). The tool allows you to relate maps of different flood extents to a single gauge level, and you can control the extent output by selecting the desired gauge level. The Flood Viewer tool runs within your web browser and can be used from a USB stick or over the web, and therefore there is no requirement for expensive GIS software and no issues with IT compatibility. In addition to basic GIS viewing functions it incorporates a slider, allowing you to move seamlessly between different flooding scenarios (e.g. return period events, time)
The Plot Section button allows you to view an animated sequence in a cross section plot. To do this, you must first load your 2D results into Flood Modeller. In addition, load the ground level data used to define your model.
If you are using a shapefile to define your cross section then a window will be displayed listing all polyline type shapefiles in your map view. Select the required file and click the OK button.
A new window will be displayed containing an empty x-y chart, as shown below. To the left of the chart the compatible datasets available for plotting are listed.
Flood Modeller can be used to manipulate raster datasets (either loaded into the viewport or external files).
The following functions are available for affecting grid data:
- Grid Calculator - Flood Modeller provides the Grid Calculator tool to perform basic arithmetic on grid data. This can be the manipulation of data within a single grid or the combining of multiple grid datasets to create a new grid output. This feature can be utilised to:
- Convert the units within a grid
- Find the difference between two grids, e.g. differences in flood extent
- Add grids together, e.g. add ground grid data to water depths to create a water level grid
- Surface Calculator - this is compatible with binary (flt), ASCII (asc) and ESRI grid formats. However, it is not compatible with TUFLOW 2D modelling grid outputs. This will be addressed in future to enable calculation of flood hazard grids, i.e. cross products of vector and scalar time series data.
- Resize - Enables you to resize a grid, i.e. create a new grid that is a subset of the source grid. This is useful to improve performance if only a small part of a large grid is being used. The cell size must remain the same as the original so the only user settings are either revised numbers of rows and columns or revised grid coordinates (for lower left corner). These are set in the new window that is displayed when this option is selected. Note the grid to be resized must be first selected in the Layers window before this tool is accessed.
- Resample - This function enables the generation of a grid with a different cell size to the source grid. The source grid can be one already loaded in the Layers window or an external grid that you select. The tool is displayed in a new window. You must select an output filename and location as well as the cell size for the new grid. The cell size of the specified source grid is displayed as a guide. If a larger cell size is selected, than Flood Modeller will calculate an average value based on the source cells contained within each output cell. If a smaller cell size is selected then all output cells within a source cell will take the same value (i.e. that of the source cell).
- Superimpose - Enables you to superimpose elevations from one grid onto another, e.g. change levels over part of a grid by superimposing more recent data. The two grids specified for this operation (base grid and additional layer) can be different extents and resolutions. Either a new grid can be generated as an output or the base grid data can be overwritten. The extent of the output grid can be the same as the base grid or can be the combined extent of both input grids. The required input data are defined in a new window.
- Stamps SHP features - This functionality enables you to superimpose the attributes of a shapefile onto a grid e.g. the z values or other data stored in the shapefile. A new panel is displayed on selecting this tool which prompts you to select an appropriate grid and shapefile, and select the attribute to be displayed on the new grid.
Bookmarks Tool Group
To help you in navigating around a large model, the bookmark facility allows you to mark units of reference or particular importance. The bookmarks can be given two priorities (high or normal), are colour-coded and can be easily navigated using the F9 key.
The Quick Add button allows you to quickly add current extent to the bookmark.
The Quick Add button allows you to quickly delete the last bookmark.
Save/Load Bookmarks buttons allow to save bookmarks in a new file or load bookmarks from an existing file respectively.
Notes Tool Group
Flood Modeller provides the option to add labels or images to a grid, map, or any other suitable layer. There are three types of labels that you can add:
- The text label editor can be launched by selecting the Add Text Label button, . This then launches the map label editor, which can be seen in the figure below.
- An image can be added to the viewport using the image label editor. When selecting the button Add Image Label, , from the Map Tools tab, you will be prompted to find the location of an appropriate image.
- The final type of label which can be created is a link label, . This provides a text label in the viewport, which when clicked offers further details in a text box, and a link to an external file.
The final three buttons within the Notes Tool Group are ‘Clear All’ – which allows you to remove all labels; ‘Save’ – which saves the labels to the disk; and ‘Load’ – which loads labels that have been saved to the disk.
Map View Tool Group
This group of options provides range of tools for viewing the data.
The Flood Modeller 3D Viewer is a separate application linked to the main Flood Modeller interface which enables you to view your data in a three dimensional viewport.
The 3D Viewer is accessed from the main toolbar by clicking on the 3D Viewer icon, shown above. This will prompt you to select which files currently loaded in the Layers window should be also loaded into the 3D Viewer. In addition to preselecting layers in the main Flood Modeller interface to load into the 3D Viewer, the 3D Viewer toolbar includes an Add Layer menu. This enables additional layers to be added after you have accessed the separate 3D Viewer interface.
If you wish to navigate to a specific location on a map or grid, then the Go To X,Y button can be used. This allows you to enter the coordinates of an exact location, and the viewport will move to centre on that location. The level of zoom will remain the same.
If the exact location of a grid or map is known in x and y coordinates, the Set Extent tool can be used to manually set the position of the viewport. The Set Extent tool can be found under the View tab in the top right of the MAPPER window. On launching the set extent tool, the panel as shown below will be launched. You can then enter the extreme value of the top, bottom, left and right of the extent required to be launched in the viewport.
In addition to the layer properties window, if you right click on the Flood Modeller map view the displayed menu includes a map properties item. If this is selected a new window is displayed that contains overall map properties, i.e. properties that are independent of all loaded layers. An example of this window is shown in the figure below:
The map properties window provides the following functions:
- Change shapefile drawing properties, e.g. line and shape colours (as you are drawing - the finished shape colours are set in individual layer properties).
- Zoom and pan sensitivity to mouse movements
- Viewport rotation - map is rotated, e.g. to obtain optimum orientation when creating a display for a report.
After settings have been defined, click the Apply button to implement them. Note that shapefile drawing functions will apply to the next new shapefile created / edited in the viewport (current files may not display the changes).
Geoprocessing Tool Group
The Geoprocessing tool group contains options for performing basic GIS tasks for analysis and/or management of the geographic data within your project. The following buttons are available:
- Buffer: creates a buffer shapefile around a specified shapefile layer.
- Clip: uses the outside polygon boundary of the clip coverage to cookie-cut features and attributes from the input coverage.
- Merge: combines selected features of the same layer into one feature. The features must be from either a line or a polygon layer.
- Intersect: creates a new shapefile from the common areas or edges of any two selected layers of the same geometry type. The new intersected feature is created using the settings specified in the chosen feature template.
- Union: computes the geometric union of two shapefile layers.
- Dissolve: Creates a new shapefile by merging adjacent polygons, lines, or regions that have the same value for a specified field.


Paul is at the orchestra. The string section is arranged in an r × c rectangular grid and is filled with violinists with the exception of n violists. Paul really likes violas, so he would like to take a picture including at least k of them. Paul can take a picture of any axis-parallel rectangle in the orchestra. Count the number of possible pictures that Paul can take.

Two pictures are considered to be different if the coordinates of corresponding rectangles are different.


/*
firehorse
by Roee Hay & Noam Hadad, Aleph Research
*/

#include "fh.h"

void null_snprintf(char *buf, int size, char *fmt, ...)
{
}

void null_uartB(char *buf)
{
}

void null_dprintf(char *fmt, ...)
{
}


Oleg the bank client and Igor the analyst are arguing again. This time, they want to pick a gift as a present for their friend, ZS the coder. After a long thought, they decided that their friend loves to eat carrots the most and thus they want to pick the best carrot as their present.

There are n carrots arranged in a line. The i-th carrot from the left has juiciness ai. Oleg thinks ZS loves juicy carrots whereas Igor thinks that he hates juicy carrots. Thus, Oleg would like to maximize the juiciness of the carrot they choose while Igor would like to minimize the juiciness of the carrot they choose.

To settle this issue, they decided to play a game again. Oleg and Igor take turns to play the game. In each turn, a player can choose a carrot from either end of the line, and eat it. The game ends when only one carrot remains. Oleg moves first. The last remaining carrot will be the carrot that they will give their friend, ZS.

Oleg is a sneaky bank client. When Igor goes to a restroom, he performs k moves before the start of the game. Each move is the same as above (eat a carrot from either end of the line). After Igor returns, they start the game with Oleg still going first.

Oleg wonders: for each k such that 0 ≤ k ≤ n - 1, what is the juiciness of the carrot they will give to ZS if he makes k extra moves beforehand and both players play optimally?


Calvin the robot lies in an infinite rectangular grid. Calvin's source code contains a list of n commands, each either 'U', 'R', 'D', or 'L' — instructions to move a single square up, right, down, or left, respectively. How many ways can Calvin execute a non-empty contiguous substrings of commands and return to the same square he starts in? Two substrings are considered different if they have different starting or ending indices.


You are given a weighed undirected connected graph, consisting of $$$n$$$ vertices and $$$m$$$ edges.

You should answer $$$q$$$ queries, the $$$i$$$-th query is to find the shortest distance between vertices $$$u_i$$$ and $$$v_i$$$.


Recently, Polycarp completed $$$n$$$ successive tasks.

For each completed task, the time $$$s_i$$$ is known when it was given, no two tasks were given at the same time. Also given is the time $$$f_i$$$ when the task was completed. For each task, there is an unknown value $$$d_i$$$ ($$$d_i>0$$$) — duration of task execution.

It is known that the tasks were completed in the order in which they came. Polycarp performed the tasks as follows:

- As soon as the very first task came, Polycarp immediately began to carry it out.
- If a new task arrived before Polycarp finished the previous one, he put the new task at the end of the queue.
- When Polycarp finished executing the next task and the queue was not empty, he immediately took a new task from the head of the queue (if the queue is empty — he just waited for the next task).

Find $$$d_i$$$ (duration) of each task.


The chef has cooked $$$n$$$ dishes yet again: the $$$i$$$-th dish consists of $$$a_i$$$ grams of fish and $$$b_i$$$ grams of meat.

Banquet organizers consider two dishes $$$i$$$ and $$$j$$$ equal if $$$a_i=a_j$$$ and $$$b_i=b_j$$$ at the same time.

The banquet organizers estimate the variety of $$$n$$$ dishes as follows. The variety of a set of dishes is equal to the number of different dishes in it. The less variety is, the better.

In order to reduce the variety, a taster was invited. He will eat exactly $$$m_i$$$ grams of food from each dish. For each dish, the taster determines separately how much fish and how much meat he will eat. The only condition is that he will eat exactly $$$m_i$$$ grams of the $$$i$$$-th dish in total.

Determine how much of what type of food the taster should eat from each dish so that the value of variety is the minimum possible. If there are several correct answers, you may output any of them.