c++ – Making 100 different named variables(but same class type)+ declaring many variables

I have a class named ‘Movies’ and I have hundred different movie name(in array) I want to make these Movies into ‘Movies’ type. How can I do that? I don’t want to declare 100 times by typing in expression.
I tried to Make Movie name as ‘Movies’ type variable by using ‘for statement’ but it doesn’t work.

I will explain more about this.

I made an changing variable(I would call this movie_name). It changes in for loop into movie name.
And I wrote My expression like this.

for( int i=0;i<array_size;i++)

Movies movie_name=array(i)

///it doesn't work

How can I change this? Or do you have any other way to do this task??

What kind of technique when declaring many variables??

can u please help me with this lab test ( Create a folder named FinalTest under the root of the Linux file system:)


Your privacy


By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.




java – required a bean named ‘entityManagerFactory’ that could not be found

. ____ _ __ _ insira o código aqui
/ / __ _ () __ __ _
( ( )_
| ‘_ | ‘| | ‘ / ` |
/ __)| |)| | | | | || (
| | ) ) ) )
‘ || .__|| ||| |_, | / / / /
=========|
|==============|
/=////
:: Spring Boot :: (v2.1.12.RELEASE)

2021-04-05 14:07:12.362 INFO 19212 — ( restartedMain) c.t.s.DesafioSupply.Application : Starting Application on spon190100264 with PID 19212 (C:Usersjose.leocadioDesktopDesafioSupplyAgroTOTVSDesafioSupplytargetclasses started by jose.leocadio in C:Usersjose.leocadioDesktopDesafioSupplyAgroTOTVSDesafioSupply)
2021-04-05 14:07:12.368 INFO 19212 — ( restartedMain) c.t.s.DesafioSupply.Application : No active profile set, falling back to default profiles: default
2021-04-05 14:07:12.688 INFO 19212 — ( restartedMain) .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set ‘spring.devtools.add-properties’ to ‘false’ to disable
2021-04-05 14:07:12.689 INFO 19212 — ( restartedMain) .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the ‘logging.level.web’ property to ‘DEBUG’
2021-04-05 14:07:17.693 INFO 19212 — ( restartedMain) .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-04-05 14:07:18.103 INFO 19212 — ( restartedMain) .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 395ms. Found 3 JPA repository interfaces.
2021-04-05 14:07:20.148 INFO 19212 — ( restartedMain) faultConfiguringBeanFactoryPostProcessor : No bean named ‘errorChannel’ has been explicitly defined. Therefore, a default PublishSubscribeChannel will be created.
2021-04-05 14:07:20.167 INFO 19212 — ( restartedMain) faultConfiguringBeanFactoryPostProcessor : No bean named ‘integrationHeaderChannelRegistry’ has been explicitly defined. Therefore, a default DefaultHeaderChannelRegistry will be created.
2021-04-05 14:07:20.781 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration’ of type (org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$633c801a) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.210 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘integrationDisposableAutoCreatedBeans’ of type (org.springframework.integration.config.annotation.Disposables) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.365 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.integration.config.IntegrationManagementConfiguration’ of type (org.springframework.integration.config.IntegrationManagementConfiguration$$EnhancerBySpringCGLIB$$ce2e3b49) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.446 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration’ of type (org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration$IntegrationJmxConfiguration$$EnhancerBySpringCGLIB$$a9c04669) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.485 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration’ of type (org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration$$EnhancerBySpringCGLIB$$e2a7ef36) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:21.543 INFO 19212 — ( restartedMain) trationDelegate$BeanPostProcessorChecker : Bean ‘mbeanServer’ of type (com.sun.jmx.mbeanserver.JmxMBeanServer) is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-04-05 14:07:25.746 INFO 19212 — ( restartedMain) o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-04-05 14:07:25.834 INFO 19212 — ( restartedMain) o.apache.catalina.core.StandardService : Starting service (Tomcat)
2021-04-05 14:07:25.835 INFO 19212 — ( restartedMain) org.apache.catalina.core.StandardEngine : Starting Servlet engine: (Apache Tomcat/9.0.30)
2021-04-05 14:07:26.874 INFO 19212 — ( restartedMain) o.a.c.c.C.(Tomcat).(localhost).(/) : Initializing Spring embedded WebApplicationContext
2021-04-05 14:07:26.874 INFO 19212 — ( restartedMain) o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 14185 ms
2021-04-05 14:07:27.942 INFO 19212 — ( restartedMain) o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService ‘taskScheduler’
2021-04-05 14:07:32.596 WARN 19212 — ( restartedMain) ConfigServletWebServerApplicationContext : Exception encountered during context initialization – cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘enderecoController’: Unsatisfied dependency expressed through field ‘service’; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘enderecoService’: Unsatisfied dependency expressed through field ‘repository’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘enderecoRepository’: Cannot create inner bean ‘(inner bean)#3ed12fb9’ of type (org.springframework.orm.jpa.SharedEntityManagerCreator) while setting bean property ‘entityManager’; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘(inner bean)#3ed12fb9’: Cannot resolve reference to bean ‘entityManagerFactory’ while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘entityManagerFactory’ available
2021-04-05 14:07:32.608 INFO 19212 — ( restartedMain) o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService ‘taskScheduler’
2021-04-05 14:07:32.640 INFO 19212 — ( restartedMain) o.apache.catalina.core.StandardService : Stopping service (Tomcat)
2021-04-05 14:07:32.763 INFO 19212 — ( restartedMain) ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2021-04-05 14:07:33.228 ERROR 19212 — ( restartedMain) o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Field repository in com.totvs.supplyagro.DesafioSupply.Cadastros.Endereco.domain.EnderecoService required a bean named ‘entityManagerFactory’ that could not be found.

The injection point has the following annotations:
– @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean named ‘entityManagerFactory’ in your configuration.

Process finished with exit code 1

edge – how to remove vertical scrollbars from named ranges displayed using the excel web part

please see image;
This issue does not occur when displaying embedded charts but manifests when referencing named ranges. A scrollbar appears to the right hand side of the zone that appears unrelated to the size of the webpart or the zone.

enter image description here

This issue is evident in Edge however it does not manifest in IE. But as IE is depreciated this is now a problem for us and creates a mess on many of our site pages.

Can anyone help ?

formulas – I want to cut paste specific row cells into a sheet named LOG after the task has been completed. I am usin Data Validation to indicate task completion

https://docs.google.com/spreadsheets/d/1bWxZfhlBiKfSZ9Wpx3rdW0nyEEio6xZACRuAzNU0Eyw/edit#gid=1664631814

I am tracking daily activities and tasks of two employees Hillol and Dhritiman.
There are different types of tasks such as normal, priority and Background.

I want it to be such that when the employee changes the “Status” row value to “Done” from drop down menu, the details of the activity (only that specific type of activity and only the details of that activity WITHOUT the deadline, date and time stamp, or status) gets copied to the first row of the LOG sheet.

For example: In the following example, Normal Task, A, and C are marked completed in Column J.
Normal Activity A and C are marked Done
Therefore Normal Task A and C need to be deleted from Dhritiman Sheet automatically and updated in LOG sheet as shown below.
While it is deleted, the cells need to be shifted up automatically.

Now, ONLY the task detail i.e data in Cell K7 from Dhritiman sheet needs to be pasted in Cell E4 of sheet named LOG. The Completion Date needs to be filled automatically as the date on which the operation is executed.
For Late, we need to check whether the Completion date is after or before the deadline date in the Dhritiman Sheet and then Fill whether YES or EARLY in the “Late?” column of the respective tasks.
enter image description here

Please note that Deadline, Status, and time and date is not copied to the LOG sheet. They will just be deleted from original data.

Also, the most recently completed tasks need to be added in the first row of LOG sheet IF POSSIBLE and previous data is shifted 1 cell down.

P.S. There are scripts to delete and copy data for whole rows, but as you can see, I only want to cut paste certain cells if the task is completed in the LOG sheet.
Copy pasting whole row doesnt work for me as there are different types of tasks with different deadlines and completion date.

If anyone could help me, it would be great.

google sheets – Find given time and date in named range

I have a google sheet with my wife where we both enter our upcoming events. They are included in named ranges and passed to the main sheet where the information is displayed. For example, I enter in the Event Scheduler: 01/01/2000 | 06:00 | Take the dog for a walk, where each | is a new cell. I then generate a datetime with say A1&A2, this usually comes out to be some number with a decimal like 442770.25 is 22/03/21 & 06:00:00. I’ve now tried the following commands:
=MATCH(TODAY()&E14,INDEX(MolliesEvents,A13:A1000,6),0),
where MolliesEvents is a list of Mollies Events organised as follows:
date | time | | description | unique ID | datetime so the TODAY()&E14 = 442770.479166666666666, and INDEX(MolliesEvents,A13:A1000,6) = (…,442770.479166666666667,…) where the …’s are just other date&time combinations. Clearly, these two are the same, they subtract to zero, and checking their equality gives a TRUE. However, the command is not finding the given index and matching it. In fact the error given is that “Did not find value ‘442770.47916666666666’ in MATCH evalulation. The second command is =vlookup(TODAY()&E14,MolliesEvents,6,0) with similar definitions and it is still unable to find the given locale. Any help?

Here: https://docs.google.com/spreadsheets/d/1JINVcTPlfjPK1SPoTDC9eKhpYzmG6daq3umrBn_8TP0/edit?usp=sharing is the link to a copy of the same google sheet so that you can work directly with the source.

c++ – “tuple with named fields” implementation

I’d like to show you a type I made while experimenting with literal, non-type template parameters in C++20.

The idea is to provide a type that wraps up tuple-like types (std::tuple, std::pair, even std::variant) and provides access to its fields using a string literal. Also, it has to respect the constexpr-ness of the underlying types.

The intended usage is the following:

constexpr auto foo = with_names<std::tuple, named<int, "ciao">, named<float, "hola">>{ 1, 2.0f };
constexpr auto bar = with_names<std::variant, named<int, "ciao">, named<float, "hola">>{ 2.0f };

constexpr auto hola = get<"hola">(foo);
constexpr auto ciao = get<"ciao">(bar); // Fails because "ciao" is not the active member.
constexpr auto var_hola = get<"hola">(bar); // Succeeds.

After battling with a few compiler bugs, this is the solution I came up with:

#include <algorithm>

// First and foremost, the literal type, that will capture the name string.
template<size_t N>
struct StringLiteral {
    constexpr StringLiteral(const char (&str)(N)) {
        std::copy_n(str, N, value);
    }

    char value(N);
};

// This is the type that associates the underlying value type with a given name
template <typename T, StringLiteral Name>
struct named {
    using value_type = T;
    static constexpr auto value_name = Name;
};

// A trait to check for named<> types
template <typename T>
struct is_named: std::false_type{};

template <typename T, StringLiteral Name>
struct is_named<named<T, Name>>: std::true_type{};

// A trait to detect whether all types in a pack are unique.
// The algorithm's complexity is O(n²), therefore this is one of the parts that could certainly be improved.
template <typename T, typename... Ts>
struct are_distinct: std::conjunction<
    std::negation<std::is_same<T, Ts>>...,
    are_distinct<Ts...>
>{};

template <typename T>
struct are_distinct<T>: std::true_type{};

// Introducing the with_names<Seq, ...> type
template <template <typename...> typename Seq, typename ...Ts>
struct with_names;

// And its related trait
template <typename T>
struct is_with_names: std::false_type{};

template <template <typename...> typename Seq, typename ...Ts, StringLiteral... Names>
struct is_with_names<with_names<Seq, named<Ts, Names>...>>: std::true_type{};

// The real meat
template <template <typename...> typename Seq, typename ...Ts, StringLiteral... Names>
class with_names<Seq, named<Ts, Names>...>: public Seq<Ts...>
{    
    // This type is only used to trigger SFINAE within the below functions, so to ensure WithNames is the correct type.
    // Couldn't directly deal with with_names<> because then perfect forwarding wouldn't be possible (or would it?).
    struct sfinae{};

    // I would have liked this to be a templated lambda within the get() friend function below, alas 
    // MSVC would ICE out about it (see: https://godbolt.org/z/fW4q6Es8h )
    template <StringLiteral Name, typename WithNames, size_t... Is>
    friend constexpr auto impl(WithNames &&wn, const std::index_sequence<Is...> &, std::enable_if_t<is_with_names<std::decay_t<WithNames>>::value, sfinae> = {}) {
        auto constexpr idx = ((std::is_same_v<named<void, Names>, named<void, Name>>*(Is+1)) + ...);

        if constexpr (idx > 0)
            return get<idx-1>(std::forward<WithNames>(wn));
        else
            static_assert(idx > 0, "Name not found");        
    }

public:
    static_assert((are_distinct<named<void, Names>>::value && ...), "Names must be unique");

    using Seq<Ts...>::Seq;

    template <StringLiteral Name, typename WithNames>
    friend constexpr auto get(WithNames &&wn, std::enable_if_t<is_with_names<std::decay_t<WithNames>>::value, sfinae> = {}) {
        return impl<Name>(std::forward<WithNames>(wn), std::index_sequence_for<Ts...>());
    }
};

See it working on godbolt: https://godbolt.org/z/Phc9r984G

As mentioned in the code itself, the are_distinct<> algorithm complexity is O(n²), but boost:mpl::unique<> shows it could be linear.

Anything else that could be improved? Would you ever use such a type?

dnd 5e – Does resistance to a damage type prevent similarly named conditions from applying?

Damage resistance does not interact with status conditions.

The rules for damage resistance state:

If a creature or an object has resistance to a damage type, damage of that type is halved against it. If a creature or an object has vulnerability to a damage type, damage of that type is doubled against it.

No mention of status effects. Status effect immunity is an entirely separate feature from damage resistance and immunity.

Poison can be especially confusing, as resistance to poison damage does not a priori offer immunity or advantage against the poison condition, but features which offer one often also offer the other.

How to reference named range as sheet name in query function?

=QUERY(ActiveMonth!A7:L,"select A,D where K matches 'Admission|Pending'",0)

I am using sheets name/tabs (January, February.. December).
ActiveMonth is a namedRange of a cell containing the Month Name (A1). I want to query the tab with the activeMonth name. If the ActiveMonth (A1) is January then the formula will run as =QUERY(January!A7:L,"select A,D where K matches 'Admission|Pending'",0).

dnd 5e – Where can I find information about the characters named in official D&D 5e books?

There is some information in their respective books, but it’s not much, I’m afraid.

Introduction in Tasha’s Cauldron to Everything:

Tasha’s Cauldron of Everything offers a host of new options for DUNGEONS & DRAGONS, and our journey through those options is accompanied by the notes of the wizard Tasha. Creator of the spell Tasha’s hideous laughter, Tasha’s life is one of the most storied in the D&D multiverse. Raised by Baba Yaga, the Mother of Witches herself, Tasha adventured across the world of Greyhawk and became the friend and sometimes enemy of other famous adventurers, like Mordenkainen. In time, she ruled as the Witch Queen and later changed her name to Iggwilv – a
figure of legend who is whispered about, feared, and admired.

There are also notes from Tasha spread among the book, from which we learn that her aliases are Natasha the Dark, Hura of Ket, Baba Yaga’s Daughter or witch by excellence, and that she loves insects, for example.

Introduction in Xanathar’s Guide To Everything

Beneath the bustling city of Waterdeep, a beholder crime lord keeps tabs on everyone and everything—or so the beholder thinks. Known as Xanathar, this bizarre being believes it can gather information on everything in the DUNGEONS & DRAGONS multiverse. The beholder desires to know it all! But no matter what the beholder learns and what treasures it acquires, its most prized possession in all the multiverse remains its goldfish, Sylgar.

Again, we can learn some things from his notes throughout the book, like he’s glad to live underground because there is no weather, or that he’s not sure whether he likes music or not.

No short introduction here, but we can learn some things from the notes at the beginning of the book:

Mordenkainen is an Oeridian wizard from the world of Greyhawk who travelled the multiverse with his apprentice Bigby to observe conflicts of all sorts.

Sprinkled throughout the book are observations and musings from two denizens of the Forgotten Realms: the legendary explorer Volothamp Geddarm (Volo to his friends) and the Archmage of Shadowdale himself, Elminster Aumar.

Here again, some notes throughout the book give hints about the personality of Volo.